resources_js_pages_user_Index_vue.js 692KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264
  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. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: String,
  21. label: String,
  22. classButton: String
  23. },
  24. setup: function setup(__props, _ref) {
  25. var expose = _ref.expose;
  26. expose();
  27. var __returned__ = {
  28. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  29. };
  30. Object.defineProperty(__returned__, '__isScriptSetup', {
  31. enumerable: false,
  32. value: true
  33. });
  34. return __returned__;
  35. }
  36. });
  37. /***/ }),
  38. /***/ "./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":
  39. /*!***************************************************************************************************************************************************************************************************************!*\
  40. !*** ./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 ***!
  41. \***************************************************************************************************************************************************************************************************************/
  42. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  43. "use strict";
  44. __webpack_require__.r(__webpack_exports__);
  45. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  46. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  47. /* harmony export */ });
  48. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  49. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  50. __name: 'AppMessage',
  51. setup: function setup(__props, _ref) {
  52. var expose = _ref.expose;
  53. expose();
  54. var onClose = function onClose() {
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  56. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  58. };
  59. var __returned__ = {
  60. onClose: onClose,
  61. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  62. };
  63. Object.defineProperty(__returned__, '__isScriptSetup', {
  64. enumerable: false,
  65. value: true
  66. });
  67. return __returned__;
  68. }
  69. });
  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. !*** ./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 ***!
  74. \******************************************************************************************************************************************************************************************************************/
  75. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  76. "use strict";
  77. __webpack_require__.r(__webpack_exports__);
  78. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  79. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  80. /* harmony export */ });
  81. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  82. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  83. __name: 'AppPagination',
  84. props: {
  85. links: Array
  86. },
  87. setup: function setup(__props, _ref) {
  88. var expose = _ref.expose;
  89. expose();
  90. var __returned__ = {
  91. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  92. };
  93. Object.defineProperty(__returned__, '__isScriptSetup', {
  94. enumerable: false,
  95. value: true
  96. });
  97. return __returned__;
  98. }
  99. });
  100. /***/ }),
  101. /***/ "./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":
  102. /*!***************************************************************************************************************************************************************************************************************!*\
  103. !*** ./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 ***!
  104. \***************************************************************************************************************************************************************************************************************/
  105. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  106. "use strict";
  107. __webpack_require__.r(__webpack_exports__);
  108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  110. /* harmony export */ });
  111. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  112. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  113. __name: 'AppSidebar',
  114. props: {
  115. menu: Array
  116. },
  117. setup: function setup(__props, _ref) {
  118. var expose = _ref.expose;
  119. expose();
  120. var __returned__ = {
  121. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  122. };
  123. Object.defineProperty(__returned__, '__isScriptSetup', {
  124. enumerable: false,
  125. value: true
  126. });
  127. return __returned__;
  128. }
  129. });
  130. /***/ }),
  131. /***/ "./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":
  132. /*!******************************************************************************************************************************************************************************************************************!*\
  133. !*** ./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 ***!
  134. \******************************************************************************************************************************************************************************************************************/
  135. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  136. "use strict";
  137. __webpack_require__.r(__webpack_exports__);
  138. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  139. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  140. /* harmony export */ });
  141. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  142. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  143. __name: 'AppSubSidebar',
  144. props: {
  145. items: Array,
  146. root: {
  147. type: Boolean,
  148. "default": false
  149. }
  150. },
  151. setup: function setup(__props, _ref) {
  152. var expose = _ref.expose;
  153. expose();
  154. var __returned__ = {
  155. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  156. };
  157. Object.defineProperty(__returned__, '__isScriptSetup', {
  158. enumerable: false,
  159. value: true
  160. });
  161. return __returned__;
  162. }
  163. });
  164. /***/ }),
  165. /***/ "./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":
  166. /*!**************************************************************************************************************************************************************************************************************!*\
  167. !*** ./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 ***!
  168. \**************************************************************************************************************************************************************************************************************/
  169. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  170. "use strict";
  171. __webpack_require__.r(__webpack_exports__);
  172. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  173. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  174. /* harmony export */ });
  175. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  177. __name: 'AppTopBar',
  178. emits: ['menu-toggle'],
  179. setup: function setup(__props, _ref) {
  180. var expose = _ref.expose;
  181. expose();
  182. var __returned__ = {
  183. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  184. };
  185. Object.defineProperty(__returned__, '__isScriptSetup', {
  186. enumerable: false,
  187. value: true
  188. });
  189. return __returned__;
  190. }
  191. });
  192. /***/ }),
  193. /***/ "./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":
  194. /*!*****************************************************************************************************************************************************************************************************************!*\
  195. !*** ./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 ***!
  196. \*****************************************************************************************************************************************************************************************************************/
  197. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  198. "use strict";
  199. __webpack_require__.r(__webpack_exports__);
  200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  202. /* harmony export */ });
  203. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  204. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  205. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  206. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  207. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  208. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  209. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  210. __name: 'DashboardLayout',
  211. setup: function setup(__props, _ref) {
  212. var expose = _ref.expose;
  213. expose();
  214. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  215. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var isDesktop = function isDesktop() {
  218. return window.innerWidth >= 992;
  219. };
  220. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  221. return ['layout-wrapper', {
  222. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  223. 'layout-mobile-sidebar-active': mobileMenuActive.value
  224. }];
  225. });
  226. var onWrapperClick = function onWrapperClick() {
  227. if (!menuClick.value) {
  228. mobileMenuActive.value = false;
  229. }
  230. menuClick.value = false;
  231. };
  232. var onMenuToggle = function onMenuToggle(event) {
  233. menuClick.value = true;
  234. if (isDesktop()) {
  235. staticMenuInactive.value = !staticMenuInactive.value;
  236. } else {
  237. mobileMenuActive.value = !mobileMenuActive.value;
  238. }
  239. event.preventDefault();
  240. };
  241. var __returned__ = {
  242. mobileMenuActive: mobileMenuActive,
  243. staticMenuInactive: staticMenuInactive,
  244. menuClick: menuClick,
  245. isDesktop: isDesktop,
  246. containerClass: containerClass,
  247. onWrapperClick: onWrapperClick,
  248. onMenuToggle: onMenuToggle,
  249. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  250. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  251. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  252. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  253. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./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":
  266. /*!**********************************************************************************************************************************************************************************************************!*\
  267. !*** ./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 ***!
  268. \**********************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/user/tableHeader.js");
  281. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  282. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  283. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  284. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  286. __name: 'Index',
  287. props: {
  288. users: Object,
  289. initialSearch: String
  290. },
  291. setup: function setup(__props, _ref) {
  292. var expose = _ref.expose;
  293. expose();
  294. var props = __props;
  295. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  296. search = _useSearchText.search;
  297. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  298. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var __returned__ = {
  305. props: props,
  306. search: search,
  307. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  310. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  311. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  312. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  313. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  314. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  316. };
  317. Object.defineProperty(__returned__, '__isScriptSetup', {
  318. enumerable: false,
  319. value: true
  320. });
  321. return __returned__;
  322. }
  323. });
  324. /***/ }),
  325. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  326. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  327. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  328. \***********************************************************************************************************************************************************************************************************************************************************************************/
  329. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  330. "use strict";
  331. __webpack_require__.r(__webpack_exports__);
  332. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  333. /* harmony export */ "render": () => (/* binding */ render)
  334. /* harmony export */ });
  335. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  336. var _hoisted_1 = {
  337. key: 1,
  338. "class": "p-button-label"
  339. };
  340. var _hoisted_2 = {
  341. key: 1,
  342. "class": "p-button-label"
  343. };
  344. function render(_ctx, _cache, $props, $setup, $data, $options) {
  345. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  346. key: 0,
  347. "class": "p-button p-component",
  348. as: "button",
  349. type: "button"
  350. }, {
  351. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  352. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  353. key: 0,
  354. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  355. }, null, 2
  356. /* CLASS */
  357. )) : (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
  358. /* TEXT */
  359. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  360. }),
  361. _: 1
  362. /* STABLE */
  363. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  364. key: 1,
  365. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  366. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  367. key: 0,
  368. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  369. }, null, 2
  370. /* CLASS */
  371. )) : (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
  372. /* TEXT */
  373. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  374. /* CLASS */
  375. ));
  376. }
  377. /***/ }),
  378. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  379. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  380. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  381. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  382. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  383. "use strict";
  384. __webpack_require__.r(__webpack_exports__);
  385. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  386. /* harmony export */ "render": () => (/* binding */ render)
  387. /* harmony export */ });
  388. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  389. var _withScopeId = function _withScopeId(n) {
  390. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  391. };
  392. var _hoisted_1 = {
  393. "class": "layout-footer"
  394. };
  395. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  396. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  397. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  398. href: "https://dijitalcode.com",
  399. target: "_blank",
  400. "class": "font-medium ml-2"
  401. }, "DijitalCODE", -1
  402. /* HOISTED */
  403. );
  404. });
  405. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  406. function render(_ctx, _cache) {
  407. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  408. }
  409. /***/ }),
  410. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  411. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  412. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  413. \********************************************************************************************************************************************************************************************************************************************************************************/
  414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  415. "use strict";
  416. __webpack_require__.r(__webpack_exports__);
  417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  418. /* harmony export */ "render": () => (/* binding */ render)
  419. /* harmony export */ });
  420. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  421. var _hoisted_1 = {
  422. key: 0
  423. };
  424. var _hoisted_2 = {
  425. key: 1
  426. };
  427. function render(_ctx, _cache, $props, $setup, $data, $options) {
  428. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  429. 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, {
  430. key: 0,
  431. severity: "success",
  432. onClose: $setup.onClose
  433. }, {
  434. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  435. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  436. /* TEXT */
  437. )];
  438. }),
  439. _: 1
  440. /* STABLE */
  441. })) : (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, {
  442. key: 1,
  443. severity: "error",
  444. onClose: $setup.onClose
  445. }, {
  446. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  447. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  448. /* TEXT */
  449. )];
  450. }),
  451. _: 1
  452. /* STABLE */
  453. })) : (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, {
  454. key: 2,
  455. severity: "error",
  456. onClose: $setup.onClose
  457. }, {
  458. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  459. 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
  460. /* TEXT */
  461. ))];
  462. }),
  463. _: 1
  464. /* STABLE */
  465. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  466. /* STABLE_FRAGMENT */
  467. );
  468. }
  469. /***/ }),
  470. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  471. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  472. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  473. \***********************************************************************************************************************************************************************************************************************************************************************************/
  474. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  475. "use strict";
  476. __webpack_require__.r(__webpack_exports__);
  477. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  478. /* harmony export */ "render": () => (/* binding */ render)
  479. /* harmony export */ });
  480. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  481. var _hoisted_1 = {
  482. key: 0,
  483. "class": "p-paginator p-component flex justify-content-start"
  484. };
  485. var _hoisted_2 = {
  486. "class": "p-paginator-pages"
  487. };
  488. var _hoisted_3 = ["innerHTML"];
  489. function render(_ctx, _cache, $props, $setup, $data, $options) {
  490. 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) {
  491. 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", {
  492. key: "link-".concat(key),
  493. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  494. 'p-disabled': link
  495. }]),
  496. innerHTML: link.label
  497. }, null, 10
  498. /* CLASS, PROPS */
  499. , _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"], {
  500. key: "link-".concat(key),
  501. href: link.url,
  502. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  503. 'p-highlight': link.active
  504. }, "p-paginator-page p-paginator-element p-link"]),
  505. innerHTML: link.label
  506. }, null, 8
  507. /* PROPS */
  508. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  509. /* STABLE_FRAGMENT */
  510. );
  511. }), 256
  512. /* UNKEYED_FRAGMENT */
  513. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  514. }
  515. /***/ }),
  516. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  517. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  518. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  519. \********************************************************************************************************************************************************************************************************************************************************************************************/
  520. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  521. "use strict";
  522. __webpack_require__.r(__webpack_exports__);
  523. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  524. /* harmony export */ "render": () => (/* binding */ render)
  525. /* harmony export */ });
  526. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  527. function render(_ctx, _cache, $props, $setup, $data, $options) {
  528. 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"], {
  529. "class": "layout-menu",
  530. items: $props.menu,
  531. root: true
  532. }, null, 8
  533. /* PROPS */
  534. , ["items"])]);
  535. }
  536. /***/ }),
  537. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  538. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  539. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  540. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  542. "use strict";
  543. __webpack_require__.r(__webpack_exports__);
  544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  545. /* harmony export */ "render": () => (/* binding */ render)
  546. /* harmony export */ });
  547. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  548. var _withScopeId = function _withScopeId(n) {
  549. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  550. };
  551. var _hoisted_1 = {
  552. key: 0
  553. };
  554. var _hoisted_2 = ["aria-label"];
  555. var _hoisted_3 = ["aria-label"];
  556. function render(_ctx, _cache, $props, $setup, $data, $options) {
  557. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  558. 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) {
  559. 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", {
  560. key: i,
  561. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  562. 'layout-menuitem-category': $props.root
  563. }]),
  564. role: "none"
  565. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  566. key: 0
  567. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  568. "class": "layout-menuitem-root-text",
  569. "aria-label": item.label
  570. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  571. /* TEXT, PROPS */
  572. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  573. items: item.items
  574. }, null, 8
  575. /* PROPS */
  576. , ["items"])], 64
  577. /* STABLE_FRAGMENT */
  578. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  579. key: 1
  580. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  581. key: 0,
  582. role: "menuitem",
  583. href: item.to,
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  585. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  586. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  587. }]),
  588. "aria-label": item.label
  589. }, {
  590. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  591. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  593. }, null, 2
  594. /* CLASS */
  595. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  596. /* TEXT */
  597. )];
  598. }),
  599. _: 2
  600. /* DYNAMIC */
  601. }, 1032
  602. /* PROPS, DYNAMIC_SLOTS */
  603. , ["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", {
  604. key: 1,
  605. href: "#",
  606. role: "menuitem",
  607. "aria-label": item.label
  608. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  609. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  610. }, null, 2
  611. /* CLASS */
  612. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  613. /* TEXT */
  614. )], 8
  615. /* PROPS */
  616. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  617. items: item.items
  618. }, null, 8
  619. /* PROPS */
  620. , ["items"])], 64
  621. /* STABLE_FRAGMENT */
  622. ))], 2
  623. /* CLASS */
  624. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  625. /* STABLE_FRAGMENT */
  626. );
  627. }), 256
  628. /* UNKEYED_FRAGMENT */
  629. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  630. }
  631. /***/ }),
  632. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  633. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  634. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  635. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  637. "use strict";
  638. __webpack_require__.r(__webpack_exports__);
  639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  640. /* harmony export */ "render": () => (/* binding */ render)
  641. /* harmony export */ });
  642. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  643. var _withScopeId = function _withScopeId(n) {
  644. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  645. };
  646. var _hoisted_1 = {
  647. "class": "layout-topbar"
  648. };
  649. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  650. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  651. alt: "Logo",
  652. src: "/images/logo.svg",
  653. "class": "md:mr-3"
  654. }, null, -1
  655. /* HOISTED */
  656. );
  657. });
  658. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  659. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  660. /* HOISTED */
  661. );
  662. });
  663. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  664. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  665. "class": "pi pi-bars"
  666. }, null, -1
  667. /* HOISTED */
  668. );
  669. });
  670. var _hoisted_5 = [_hoisted_4];
  671. var _hoisted_6 = {
  672. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  673. };
  674. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  675. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  676. "class": "pi pi-ellipsis-v"
  677. }, null, -1
  678. /* HOISTED */
  679. );
  680. });
  681. var _hoisted_8 = [_hoisted_7];
  682. var _hoisted_9 = {
  683. "class": "layout-topbar-menu hidden lg:flex origin-top"
  684. };
  685. var _hoisted_10 = {
  686. "class": "align-self-center"
  687. };
  688. var _hoisted_11 = {
  689. "class": "hidden lg:inline"
  690. };
  691. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  692. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  693. "class": "pi pi-user"
  694. }, null, -1
  695. /* HOISTED */
  696. );
  697. });
  698. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  699. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  700. /* HOISTED */
  701. );
  702. });
  703. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  704. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  705. "class": "pi pi-sign-out"
  706. }, null, -1
  707. /* HOISTED */
  708. );
  709. });
  710. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  711. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  712. /* HOISTED */
  713. );
  714. });
  715. function render(_ctx, _cache, $props, $setup, $data, $options) {
  716. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  717. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  718. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  719. href: "/",
  720. "class": "layout-topbar-logo"
  721. }, {
  722. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  723. return [_hoisted_2, _hoisted_3];
  724. }),
  725. _: 1
  726. /* STABLE */
  727. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  728. "class": "p-link layout-menu-button layout-topbar-button",
  729. onClick: _cache[0] || (_cache[0] = function ($event) {
  730. return _ctx.$emit('menu-toggle', $event);
  731. })
  732. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  733. selector: '@next',
  734. enterClass: 'hidden',
  735. enterActiveClass: 'scalein',
  736. leaveToClass: 'hidden',
  737. leaveActiveClass: 'fadeout',
  738. hideOnOutsideClick: true
  739. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  740. /* TEXT */
  741. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  742. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  743. "class": "p-link layout-topbar-button"
  744. }, {
  745. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  746. return [_hoisted_12, _hoisted_13];
  747. }),
  748. _: 1
  749. /* STABLE */
  750. }, 8
  751. /* PROPS */
  752. , ["href"])), [[_directive_tooltip, {
  753. value: 'Ubah Profil',
  754. "class": 'layout-topbar-menu-tooltip'
  755. }, void 0, {
  756. bottom: true
  757. }]])]), (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"], {
  758. href: _ctx.route('logout'),
  759. as: "button",
  760. method: "post",
  761. "class": "p-link layout-topbar-button"
  762. }, {
  763. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  764. return [_hoisted_14, _hoisted_15];
  765. }),
  766. _: 1
  767. /* STABLE */
  768. }, 8
  769. /* PROPS */
  770. , ["href"])), [[_directive_tooltip, {
  771. value: 'Keluar',
  772. "class": 'layout-topbar-menu-tooltip'
  773. }, void 0, {
  774. bottom: true
  775. }]])])])]);
  776. }
  777. /***/ }),
  778. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  779. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  780. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  781. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  783. "use strict";
  784. __webpack_require__.r(__webpack_exports__);
  785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  786. /* harmony export */ "render": () => (/* binding */ render)
  787. /* harmony export */ });
  788. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  789. var _withScopeId = function _withScopeId(n) {
  790. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  791. };
  792. var _hoisted_1 = {
  793. "class": "layout-sidebar"
  794. };
  795. var _hoisted_2 = {
  796. "class": "layout-main-container"
  797. };
  798. var _hoisted_3 = {
  799. "class": "layout-main"
  800. };
  801. var _hoisted_4 = {
  802. key: 0,
  803. "class": "layout-mask p-component-overlay"
  804. };
  805. function render(_ctx, _cache, $props, $setup, $data, $options) {
  806. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  807. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  808. onClick: $setup.onWrapperClick
  809. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  810. onMenuToggle: $setup.onMenuToggle
  811. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  812. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  813. }, null, 8
  814. /* PROPS */
  815. , ["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, {
  816. name: "layout-mask"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. 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)];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. })], 2
  824. /* CLASS */
  825. );
  826. }
  827. /***/ }),
  828. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  829. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  830. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  831. \***************************************************************************************************************************************************************************************************************************************************************************/
  832. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  833. "use strict";
  834. __webpack_require__.r(__webpack_exports__);
  835. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  836. /* harmony export */ "render": () => (/* binding */ render)
  837. /* harmony export */ });
  838. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  839. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  840. /* HOISTED */
  841. );
  842. var _hoisted_2 = {
  843. "class": "grid"
  844. };
  845. var _hoisted_3 = {
  846. "class": "col-12 md:col-8"
  847. };
  848. var _hoisted_4 = {
  849. "class": "flex align-items-center"
  850. };
  851. var _hoisted_5 = {
  852. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  853. };
  854. function render(_ctx, _cache, $props, $setup, $data, $options) {
  855. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  856. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  857. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  858. 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"], {
  859. title: "Daftar User"
  860. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  861. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  862. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  863. responsiveLayout: "scroll",
  864. columnResizeMode: "expand",
  865. value: $props.users.data,
  866. rowHover: true,
  867. stripedRows: true
  868. }, {
  869. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. 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, {
  871. "class": "w-full md:w-27rem",
  872. placeholder: "cari, contoh: tina, tina@xx.com",
  873. modelValue: $setup.search,
  874. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  875. return $setup.search = $event;
  876. })
  877. }, null, 8
  878. /* PROPS */
  879. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  880. label: "Tambah User",
  881. icon: "pi pi-pencil",
  882. "class": "p-button-outlined",
  883. href: _ctx.route('users.create')
  884. }, null, 8
  885. /* PROPS */
  886. , ["href"])])])];
  887. }),
  888. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  889. 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) {
  890. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  891. field: value.field,
  892. header: value.header,
  893. key: value.field
  894. }, null, 8
  895. /* PROPS */
  896. , ["field", "header"]);
  897. }), 128
  898. /* KEYED_FRAGMENT */
  899. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  900. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  901. var data = _ref.data;
  902. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  903. icon: "pi pi-pencil",
  904. "class": "p-button-icon-only p-button-rounded p-button-text",
  905. href: _ctx.route('users.edit', data.id)
  906. }, null, 8
  907. /* PROPS */
  908. , ["href"])];
  909. }),
  910. _: 1
  911. /* STABLE */
  912. })];
  913. }),
  914. _: 1
  915. /* STABLE */
  916. }, 8
  917. /* PROPS */
  918. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  919. links: $props.users.links
  920. }, null, 8
  921. /* PROPS */
  922. , ["links"])];
  923. }),
  924. _: 1
  925. /* STABLE */
  926. })], 64
  927. /* STABLE_FRAGMENT */
  928. );
  929. }
  930. /***/ }),
  931. /***/ "./resources/js/components/useSearchText.js":
  932. /*!**************************************************!*\
  933. !*** ./resources/js/components/useSearchText.js ***!
  934. \**************************************************/
  935. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  936. "use strict";
  937. __webpack_require__.r(__webpack_exports__);
  938. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  939. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  940. /* harmony export */ });
  941. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  942. function useSearchText(props) {
  943. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  944. return {
  945. search: search
  946. };
  947. }
  948. /***/ }),
  949. /***/ "./resources/js/pages/user/tableHeader.js":
  950. /*!************************************************!*\
  951. !*** ./resources/js/pages/user/tableHeader.js ***!
  952. \************************************************/
  953. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  954. "use strict";
  955. __webpack_require__.r(__webpack_exports__);
  956. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  957. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  958. /* harmony export */ });
  959. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  960. field: 'name',
  961. header: 'Nama'
  962. }, {
  963. field: 'username',
  964. header: 'Nama Pengguna'
  965. }, {
  966. field: 'role',
  967. header: 'Hak Akses'
  968. }, {
  969. field: 'status',
  970. header: 'Status'
  971. }]);
  972. /***/ }),
  973. /***/ "./resources/js/utils/menu.js":
  974. /*!************************************!*\
  975. !*** ./resources/js/utils/menu.js ***!
  976. \************************************/
  977. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  978. "use strict";
  979. __webpack_require__.r(__webpack_exports__);
  980. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  981. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  982. /* harmony export */ });
  983. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  984. // Admin
  985. 1: [{
  986. label: 'Home',
  987. items: [{
  988. label: 'Dashboard',
  989. icon: 'pi pi-home',
  990. to: '/dashboards',
  991. component: 'home/Index'
  992. }]
  993. }, {
  994. label: 'Laporan',
  995. items: []
  996. }, {
  997. label: 'Master',
  998. items: [{
  999. label: 'User',
  1000. icon: 'pi pi-user',
  1001. to: '/users',
  1002. component: 'user/Index'
  1003. }]
  1004. }],
  1005. // Supervisor
  1006. 2: [],
  1007. // Operator
  1008. 3: []
  1009. });
  1010. /***/ }),
  1011. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1012. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1013. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1014. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1015. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1016. "use strict";
  1017. __webpack_require__.r(__webpack_exports__);
  1018. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1019. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1020. /* harmony export */ });
  1021. /* 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");
  1022. /* 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__);
  1023. // Imports
  1024. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1025. // Module
  1026. ___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}", ""]);
  1027. // Exports
  1028. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1029. /***/ }),
  1030. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1031. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1032. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1033. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1034. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1035. "use strict";
  1036. __webpack_require__.r(__webpack_exports__);
  1037. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1038. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1039. /* harmony export */ });
  1040. /* 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");
  1041. /* 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__);
  1042. // Imports
  1043. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1044. // Module
  1045. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1046. // Exports
  1047. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1048. /***/ }),
  1049. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1050. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1051. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1052. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1053. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1054. "use strict";
  1055. __webpack_require__.r(__webpack_exports__);
  1056. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1057. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1058. /* harmony export */ });
  1059. /* 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");
  1060. /* 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__);
  1061. // Imports
  1062. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1063. // Module
  1064. ___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}", ""]);
  1065. // Exports
  1066. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1067. /***/ }),
  1068. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1069. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1070. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1071. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1072. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1073. "use strict";
  1074. __webpack_require__.r(__webpack_exports__);
  1075. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1076. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1077. /* harmony export */ });
  1078. /* 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");
  1079. /* 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__);
  1080. // Imports
  1081. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1082. // Module
  1083. ___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}", ""]);
  1084. // Exports
  1085. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1086. /***/ }),
  1087. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1088. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1089. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1090. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1091. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1092. "use strict";
  1093. __webpack_require__.r(__webpack_exports__);
  1094. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1095. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1096. /* harmony export */ });
  1097. /* 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");
  1098. /* 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__);
  1099. // Imports
  1100. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1101. // Module
  1102. ___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}", ""]);
  1103. // Exports
  1104. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1105. /***/ }),
  1106. /***/ "./node_modules/lodash/lodash.js":
  1107. /*!***************************************!*\
  1108. !*** ./node_modules/lodash/lodash.js ***!
  1109. \***************************************/
  1110. /***/ (function(module, exports, __webpack_require__) {
  1111. /* module decorator */ module = __webpack_require__.nmd(module);
  1112. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1113. * @license
  1114. * Lodash <https://lodash.com/>
  1115. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1116. * Released under MIT license <https://lodash.com/license>
  1117. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1118. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1119. */
  1120. ;(function() {
  1121. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1122. var undefined;
  1123. /** Used as the semantic version number. */
  1124. var VERSION = '4.17.21';
  1125. /** Used as the size to enable large array optimizations. */
  1126. var LARGE_ARRAY_SIZE = 200;
  1127. /** Error message constants. */
  1128. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1129. FUNC_ERROR_TEXT = 'Expected a function',
  1130. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1131. /** Used to stand-in for `undefined` hash values. */
  1132. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1133. /** Used as the maximum memoize cache size. */
  1134. var MAX_MEMOIZE_SIZE = 500;
  1135. /** Used as the internal argument placeholder. */
  1136. var PLACEHOLDER = '__lodash_placeholder__';
  1137. /** Used to compose bitmasks for cloning. */
  1138. var CLONE_DEEP_FLAG = 1,
  1139. CLONE_FLAT_FLAG = 2,
  1140. CLONE_SYMBOLS_FLAG = 4;
  1141. /** Used to compose bitmasks for value comparisons. */
  1142. var COMPARE_PARTIAL_FLAG = 1,
  1143. COMPARE_UNORDERED_FLAG = 2;
  1144. /** Used to compose bitmasks for function metadata. */
  1145. var WRAP_BIND_FLAG = 1,
  1146. WRAP_BIND_KEY_FLAG = 2,
  1147. WRAP_CURRY_BOUND_FLAG = 4,
  1148. WRAP_CURRY_FLAG = 8,
  1149. WRAP_CURRY_RIGHT_FLAG = 16,
  1150. WRAP_PARTIAL_FLAG = 32,
  1151. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1152. WRAP_ARY_FLAG = 128,
  1153. WRAP_REARG_FLAG = 256,
  1154. WRAP_FLIP_FLAG = 512;
  1155. /** Used as default options for `_.truncate`. */
  1156. var DEFAULT_TRUNC_LENGTH = 30,
  1157. DEFAULT_TRUNC_OMISSION = '...';
  1158. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1159. var HOT_COUNT = 800,
  1160. HOT_SPAN = 16;
  1161. /** Used to indicate the type of lazy iteratees. */
  1162. var LAZY_FILTER_FLAG = 1,
  1163. LAZY_MAP_FLAG = 2,
  1164. LAZY_WHILE_FLAG = 3;
  1165. /** Used as references for various `Number` constants. */
  1166. var INFINITY = 1 / 0,
  1167. MAX_SAFE_INTEGER = 9007199254740991,
  1168. MAX_INTEGER = 1.7976931348623157e+308,
  1169. NAN = 0 / 0;
  1170. /** Used as references for the maximum length and index of an array. */
  1171. var MAX_ARRAY_LENGTH = 4294967295,
  1172. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1173. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1174. /** Used to associate wrap methods with their bit flags. */
  1175. var wrapFlags = [
  1176. ['ary', WRAP_ARY_FLAG],
  1177. ['bind', WRAP_BIND_FLAG],
  1178. ['bindKey', WRAP_BIND_KEY_FLAG],
  1179. ['curry', WRAP_CURRY_FLAG],
  1180. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1181. ['flip', WRAP_FLIP_FLAG],
  1182. ['partial', WRAP_PARTIAL_FLAG],
  1183. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1184. ['rearg', WRAP_REARG_FLAG]
  1185. ];
  1186. /** `Object#toString` result references. */
  1187. var argsTag = '[object Arguments]',
  1188. arrayTag = '[object Array]',
  1189. asyncTag = '[object AsyncFunction]',
  1190. boolTag = '[object Boolean]',
  1191. dateTag = '[object Date]',
  1192. domExcTag = '[object DOMException]',
  1193. errorTag = '[object Error]',
  1194. funcTag = '[object Function]',
  1195. genTag = '[object GeneratorFunction]',
  1196. mapTag = '[object Map]',
  1197. numberTag = '[object Number]',
  1198. nullTag = '[object Null]',
  1199. objectTag = '[object Object]',
  1200. promiseTag = '[object Promise]',
  1201. proxyTag = '[object Proxy]',
  1202. regexpTag = '[object RegExp]',
  1203. setTag = '[object Set]',
  1204. stringTag = '[object String]',
  1205. symbolTag = '[object Symbol]',
  1206. undefinedTag = '[object Undefined]',
  1207. weakMapTag = '[object WeakMap]',
  1208. weakSetTag = '[object WeakSet]';
  1209. var arrayBufferTag = '[object ArrayBuffer]',
  1210. dataViewTag = '[object DataView]',
  1211. float32Tag = '[object Float32Array]',
  1212. float64Tag = '[object Float64Array]',
  1213. int8Tag = '[object Int8Array]',
  1214. int16Tag = '[object Int16Array]',
  1215. int32Tag = '[object Int32Array]',
  1216. uint8Tag = '[object Uint8Array]',
  1217. uint8ClampedTag = '[object Uint8ClampedArray]',
  1218. uint16Tag = '[object Uint16Array]',
  1219. uint32Tag = '[object Uint32Array]';
  1220. /** Used to match empty string literals in compiled template source. */
  1221. var reEmptyStringLeading = /\b__p \+= '';/g,
  1222. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1223. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1224. /** Used to match HTML entities and HTML characters. */
  1225. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1226. reUnescapedHtml = /[&<>"']/g,
  1227. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1228. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1229. /** Used to match template delimiters. */
  1230. var reEscape = /<%-([\s\S]+?)%>/g,
  1231. reEvaluate = /<%([\s\S]+?)%>/g,
  1232. reInterpolate = /<%=([\s\S]+?)%>/g;
  1233. /** Used to match property names within property paths. */
  1234. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1235. reIsPlainProp = /^\w*$/,
  1236. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1237. /**
  1238. * Used to match `RegExp`
  1239. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1240. */
  1241. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1242. reHasRegExpChar = RegExp(reRegExpChar.source);
  1243. /** Used to match leading whitespace. */
  1244. var reTrimStart = /^\s+/;
  1245. /** Used to match a single whitespace character. */
  1246. var reWhitespace = /\s/;
  1247. /** Used to match wrap detail comments. */
  1248. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1249. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1250. reSplitDetails = /,? & /;
  1251. /** Used to match words composed of alphanumeric characters. */
  1252. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1253. /**
  1254. * Used to validate the `validate` option in `_.template` variable.
  1255. *
  1256. * Forbids characters which could potentially change the meaning of the function argument definition:
  1257. * - "()," (modification of function parameters)
  1258. * - "=" (default value)
  1259. * - "[]{}" (destructuring of function parameters)
  1260. * - "/" (beginning of a comment)
  1261. * - whitespace
  1262. */
  1263. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1264. /** Used to match backslashes in property paths. */
  1265. var reEscapeChar = /\\(\\)?/g;
  1266. /**
  1267. * Used to match
  1268. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1269. */
  1270. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1271. /** Used to match `RegExp` flags from their coerced string values. */
  1272. var reFlags = /\w*$/;
  1273. /** Used to detect bad signed hexadecimal string values. */
  1274. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1275. /** Used to detect binary string values. */
  1276. var reIsBinary = /^0b[01]+$/i;
  1277. /** Used to detect host constructors (Safari). */
  1278. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1279. /** Used to detect octal string values. */
  1280. var reIsOctal = /^0o[0-7]+$/i;
  1281. /** Used to detect unsigned integer values. */
  1282. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1283. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1284. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1285. /** Used to ensure capturing order of template delimiters. */
  1286. var reNoMatch = /($^)/;
  1287. /** Used to match unescaped characters in compiled string literals. */
  1288. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1289. /** Used to compose unicode character classes. */
  1290. var rsAstralRange = '\\ud800-\\udfff',
  1291. rsComboMarksRange = '\\u0300-\\u036f',
  1292. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1293. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1294. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1295. rsDingbatRange = '\\u2700-\\u27bf',
  1296. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1297. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1298. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1299. rsPunctuationRange = '\\u2000-\\u206f',
  1300. 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',
  1301. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1302. rsVarRange = '\\ufe0e\\ufe0f',
  1303. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1304. /** Used to compose unicode capture groups. */
  1305. var rsApos = "['\u2019]",
  1306. rsAstral = '[' + rsAstralRange + ']',
  1307. rsBreak = '[' + rsBreakRange + ']',
  1308. rsCombo = '[' + rsComboRange + ']',
  1309. rsDigits = '\\d+',
  1310. rsDingbat = '[' + rsDingbatRange + ']',
  1311. rsLower = '[' + rsLowerRange + ']',
  1312. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1313. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1314. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1315. rsNonAstral = '[^' + rsAstralRange + ']',
  1316. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1317. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1318. rsUpper = '[' + rsUpperRange + ']',
  1319. rsZWJ = '\\u200d';
  1320. /** Used to compose unicode regexes. */
  1321. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1322. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1323. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1324. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1325. reOptMod = rsModifier + '?',
  1326. rsOptVar = '[' + rsVarRange + ']?',
  1327. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1328. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1329. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1330. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1331. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1332. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1333. /** Used to match apostrophes. */
  1334. var reApos = RegExp(rsApos, 'g');
  1335. /**
  1336. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1337. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1338. */
  1339. var reComboMark = RegExp(rsCombo, 'g');
  1340. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1341. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1342. /** Used to match complex or compound words. */
  1343. var reUnicodeWord = RegExp([
  1344. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1345. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1346. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1347. rsUpper + '+' + rsOptContrUpper,
  1348. rsOrdUpper,
  1349. rsOrdLower,
  1350. rsDigits,
  1351. rsEmoji
  1352. ].join('|'), 'g');
  1353. /** 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/). */
  1354. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1355. /** Used to detect strings that need a more robust regexp to match words. */
  1356. 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 ]/;
  1357. /** Used to assign default `context` object properties. */
  1358. var contextProps = [
  1359. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1360. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1361. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1362. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1363. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1364. ];
  1365. /** Used to make template sourceURLs easier to identify. */
  1366. var templateCounter = -1;
  1367. /** Used to identify `toStringTag` values of typed arrays. */
  1368. var typedArrayTags = {};
  1369. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1370. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1371. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1372. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1373. typedArrayTags[uint32Tag] = true;
  1374. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1375. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1376. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1377. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1378. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1379. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1380. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1381. typedArrayTags[weakMapTag] = false;
  1382. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1383. var cloneableTags = {};
  1384. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1385. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1386. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1387. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1388. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1389. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1390. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1391. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1392. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1393. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1394. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1395. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1396. cloneableTags[weakMapTag] = false;
  1397. /** Used to map Latin Unicode letters to basic Latin letters. */
  1398. var deburredLetters = {
  1399. // Latin-1 Supplement block.
  1400. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1401. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1402. '\xc7': 'C', '\xe7': 'c',
  1403. '\xd0': 'D', '\xf0': 'd',
  1404. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1405. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1406. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1407. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1408. '\xd1': 'N', '\xf1': 'n',
  1409. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1410. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1411. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1412. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1413. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1414. '\xc6': 'Ae', '\xe6': 'ae',
  1415. '\xde': 'Th', '\xfe': 'th',
  1416. '\xdf': 'ss',
  1417. // Latin Extended-A block.
  1418. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1419. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1420. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1421. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1422. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1423. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1424. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1425. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1426. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1427. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1428. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1429. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1430. '\u0134': 'J', '\u0135': 'j',
  1431. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1432. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1433. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1434. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1435. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1436. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1437. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1438. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1439. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1440. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1441. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1442. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1443. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1444. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1445. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1446. '\u0174': 'W', '\u0175': 'w',
  1447. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1448. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1449. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1450. '\u0132': 'IJ', '\u0133': 'ij',
  1451. '\u0152': 'Oe', '\u0153': 'oe',
  1452. '\u0149': "'n", '\u017f': 's'
  1453. };
  1454. /** Used to map characters to HTML entities. */
  1455. var htmlEscapes = {
  1456. '&': '&amp;',
  1457. '<': '&lt;',
  1458. '>': '&gt;',
  1459. '"': '&quot;',
  1460. "'": '&#39;'
  1461. };
  1462. /** Used to map HTML entities to characters. */
  1463. var htmlUnescapes = {
  1464. '&amp;': '&',
  1465. '&lt;': '<',
  1466. '&gt;': '>',
  1467. '&quot;': '"',
  1468. '&#39;': "'"
  1469. };
  1470. /** Used to escape characters for inclusion in compiled string literals. */
  1471. var stringEscapes = {
  1472. '\\': '\\',
  1473. "'": "'",
  1474. '\n': 'n',
  1475. '\r': 'r',
  1476. '\u2028': 'u2028',
  1477. '\u2029': 'u2029'
  1478. };
  1479. /** Built-in method references without a dependency on `root`. */
  1480. var freeParseFloat = parseFloat,
  1481. freeParseInt = parseInt;
  1482. /** Detect free variable `global` from Node.js. */
  1483. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1484. /** Detect free variable `self`. */
  1485. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1486. /** Used as a reference to the global object. */
  1487. var root = freeGlobal || freeSelf || Function('return this')();
  1488. /** Detect free variable `exports`. */
  1489. var freeExports = true && exports && !exports.nodeType && exports;
  1490. /** Detect free variable `module`. */
  1491. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1492. /** Detect the popular CommonJS extension `module.exports`. */
  1493. var moduleExports = freeModule && freeModule.exports === freeExports;
  1494. /** Detect free variable `process` from Node.js. */
  1495. var freeProcess = moduleExports && freeGlobal.process;
  1496. /** Used to access faster Node.js helpers. */
  1497. var nodeUtil = (function() {
  1498. try {
  1499. // Use `util.types` for Node.js 10+.
  1500. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1501. if (types) {
  1502. return types;
  1503. }
  1504. // Legacy `process.binding('util')` for Node.js < 10.
  1505. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1506. } catch (e) {}
  1507. }());
  1508. /* Node.js helper references. */
  1509. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1510. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1511. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1512. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1513. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1514. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1515. /*--------------------------------------------------------------------------*/
  1516. /**
  1517. * A faster alternative to `Function#apply`, this function invokes `func`
  1518. * with the `this` binding of `thisArg` and the arguments of `args`.
  1519. *
  1520. * @private
  1521. * @param {Function} func The function to invoke.
  1522. * @param {*} thisArg The `this` binding of `func`.
  1523. * @param {Array} args The arguments to invoke `func` with.
  1524. * @returns {*} Returns the result of `func`.
  1525. */
  1526. function apply(func, thisArg, args) {
  1527. switch (args.length) {
  1528. case 0: return func.call(thisArg);
  1529. case 1: return func.call(thisArg, args[0]);
  1530. case 2: return func.call(thisArg, args[0], args[1]);
  1531. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1532. }
  1533. return func.apply(thisArg, args);
  1534. }
  1535. /**
  1536. * A specialized version of `baseAggregator` for arrays.
  1537. *
  1538. * @private
  1539. * @param {Array} [array] The array to iterate over.
  1540. * @param {Function} setter The function to set `accumulator` values.
  1541. * @param {Function} iteratee The iteratee to transform keys.
  1542. * @param {Object} accumulator The initial aggregated object.
  1543. * @returns {Function} Returns `accumulator`.
  1544. */
  1545. function arrayAggregator(array, setter, iteratee, accumulator) {
  1546. var index = -1,
  1547. length = array == null ? 0 : array.length;
  1548. while (++index < length) {
  1549. var value = array[index];
  1550. setter(accumulator, value, iteratee(value), array);
  1551. }
  1552. return accumulator;
  1553. }
  1554. /**
  1555. * A specialized version of `_.forEach` for arrays without support for
  1556. * iteratee shorthands.
  1557. *
  1558. * @private
  1559. * @param {Array} [array] The array to iterate over.
  1560. * @param {Function} iteratee The function invoked per iteration.
  1561. * @returns {Array} Returns `array`.
  1562. */
  1563. function arrayEach(array, iteratee) {
  1564. var index = -1,
  1565. length = array == null ? 0 : array.length;
  1566. while (++index < length) {
  1567. if (iteratee(array[index], index, array) === false) {
  1568. break;
  1569. }
  1570. }
  1571. return array;
  1572. }
  1573. /**
  1574. * A specialized version of `_.forEachRight` for arrays without support for
  1575. * iteratee shorthands.
  1576. *
  1577. * @private
  1578. * @param {Array} [array] The array to iterate over.
  1579. * @param {Function} iteratee The function invoked per iteration.
  1580. * @returns {Array} Returns `array`.
  1581. */
  1582. function arrayEachRight(array, iteratee) {
  1583. var length = array == null ? 0 : array.length;
  1584. while (length--) {
  1585. if (iteratee(array[length], length, array) === false) {
  1586. break;
  1587. }
  1588. }
  1589. return array;
  1590. }
  1591. /**
  1592. * A specialized version of `_.every` for arrays without support for
  1593. * iteratee shorthands.
  1594. *
  1595. * @private
  1596. * @param {Array} [array] The array to iterate over.
  1597. * @param {Function} predicate The function invoked per iteration.
  1598. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1599. * else `false`.
  1600. */
  1601. function arrayEvery(array, predicate) {
  1602. var index = -1,
  1603. length = array == null ? 0 : array.length;
  1604. while (++index < length) {
  1605. if (!predicate(array[index], index, array)) {
  1606. return false;
  1607. }
  1608. }
  1609. return true;
  1610. }
  1611. /**
  1612. * A specialized version of `_.filter` for arrays without support for
  1613. * iteratee shorthands.
  1614. *
  1615. * @private
  1616. * @param {Array} [array] The array to iterate over.
  1617. * @param {Function} predicate The function invoked per iteration.
  1618. * @returns {Array} Returns the new filtered array.
  1619. */
  1620. function arrayFilter(array, predicate) {
  1621. var index = -1,
  1622. length = array == null ? 0 : array.length,
  1623. resIndex = 0,
  1624. result = [];
  1625. while (++index < length) {
  1626. var value = array[index];
  1627. if (predicate(value, index, array)) {
  1628. result[resIndex++] = value;
  1629. }
  1630. }
  1631. return result;
  1632. }
  1633. /**
  1634. * A specialized version of `_.includes` for arrays without support for
  1635. * specifying an index to search from.
  1636. *
  1637. * @private
  1638. * @param {Array} [array] The array to inspect.
  1639. * @param {*} target The value to search for.
  1640. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1641. */
  1642. function arrayIncludes(array, value) {
  1643. var length = array == null ? 0 : array.length;
  1644. return !!length && baseIndexOf(array, value, 0) > -1;
  1645. }
  1646. /**
  1647. * This function is like `arrayIncludes` except that it accepts a comparator.
  1648. *
  1649. * @private
  1650. * @param {Array} [array] The array to inspect.
  1651. * @param {*} target The value to search for.
  1652. * @param {Function} comparator The comparator invoked per element.
  1653. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1654. */
  1655. function arrayIncludesWith(array, value, comparator) {
  1656. var index = -1,
  1657. length = array == null ? 0 : array.length;
  1658. while (++index < length) {
  1659. if (comparator(value, array[index])) {
  1660. return true;
  1661. }
  1662. }
  1663. return false;
  1664. }
  1665. /**
  1666. * A specialized version of `_.map` for arrays without support for iteratee
  1667. * shorthands.
  1668. *
  1669. * @private
  1670. * @param {Array} [array] The array to iterate over.
  1671. * @param {Function} iteratee The function invoked per iteration.
  1672. * @returns {Array} Returns the new mapped array.
  1673. */
  1674. function arrayMap(array, iteratee) {
  1675. var index = -1,
  1676. length = array == null ? 0 : array.length,
  1677. result = Array(length);
  1678. while (++index < length) {
  1679. result[index] = iteratee(array[index], index, array);
  1680. }
  1681. return result;
  1682. }
  1683. /**
  1684. * Appends the elements of `values` to `array`.
  1685. *
  1686. * @private
  1687. * @param {Array} array The array to modify.
  1688. * @param {Array} values The values to append.
  1689. * @returns {Array} Returns `array`.
  1690. */
  1691. function arrayPush(array, values) {
  1692. var index = -1,
  1693. length = values.length,
  1694. offset = array.length;
  1695. while (++index < length) {
  1696. array[offset + index] = values[index];
  1697. }
  1698. return array;
  1699. }
  1700. /**
  1701. * A specialized version of `_.reduce` for arrays without support for
  1702. * iteratee shorthands.
  1703. *
  1704. * @private
  1705. * @param {Array} [array] The array to iterate over.
  1706. * @param {Function} iteratee The function invoked per iteration.
  1707. * @param {*} [accumulator] The initial value.
  1708. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1709. * the initial value.
  1710. * @returns {*} Returns the accumulated value.
  1711. */
  1712. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1713. var index = -1,
  1714. length = array == null ? 0 : array.length;
  1715. if (initAccum && length) {
  1716. accumulator = array[++index];
  1717. }
  1718. while (++index < length) {
  1719. accumulator = iteratee(accumulator, array[index], index, array);
  1720. }
  1721. return accumulator;
  1722. }
  1723. /**
  1724. * A specialized version of `_.reduceRight` for arrays without support for
  1725. * iteratee shorthands.
  1726. *
  1727. * @private
  1728. * @param {Array} [array] The array to iterate over.
  1729. * @param {Function} iteratee The function invoked per iteration.
  1730. * @param {*} [accumulator] The initial value.
  1731. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1732. * the initial value.
  1733. * @returns {*} Returns the accumulated value.
  1734. */
  1735. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1736. var length = array == null ? 0 : array.length;
  1737. if (initAccum && length) {
  1738. accumulator = array[--length];
  1739. }
  1740. while (length--) {
  1741. accumulator = iteratee(accumulator, array[length], length, array);
  1742. }
  1743. return accumulator;
  1744. }
  1745. /**
  1746. * A specialized version of `_.some` for arrays without support for iteratee
  1747. * shorthands.
  1748. *
  1749. * @private
  1750. * @param {Array} [array] The array to iterate over.
  1751. * @param {Function} predicate The function invoked per iteration.
  1752. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1753. * else `false`.
  1754. */
  1755. function arraySome(array, predicate) {
  1756. var index = -1,
  1757. length = array == null ? 0 : array.length;
  1758. while (++index < length) {
  1759. if (predicate(array[index], index, array)) {
  1760. return true;
  1761. }
  1762. }
  1763. return false;
  1764. }
  1765. /**
  1766. * Gets the size of an ASCII `string`.
  1767. *
  1768. * @private
  1769. * @param {string} string The string inspect.
  1770. * @returns {number} Returns the string size.
  1771. */
  1772. var asciiSize = baseProperty('length');
  1773. /**
  1774. * Converts an ASCII `string` to an array.
  1775. *
  1776. * @private
  1777. * @param {string} string The string to convert.
  1778. * @returns {Array} Returns the converted array.
  1779. */
  1780. function asciiToArray(string) {
  1781. return string.split('');
  1782. }
  1783. /**
  1784. * Splits an ASCII `string` into an array of its words.
  1785. *
  1786. * @private
  1787. * @param {string} The string to inspect.
  1788. * @returns {Array} Returns the words of `string`.
  1789. */
  1790. function asciiWords(string) {
  1791. return string.match(reAsciiWord) || [];
  1792. }
  1793. /**
  1794. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1795. * without support for iteratee shorthands, which iterates over `collection`
  1796. * using `eachFunc`.
  1797. *
  1798. * @private
  1799. * @param {Array|Object} collection The collection to inspect.
  1800. * @param {Function} predicate The function invoked per iteration.
  1801. * @param {Function} eachFunc The function to iterate over `collection`.
  1802. * @returns {*} Returns the found element or its key, else `undefined`.
  1803. */
  1804. function baseFindKey(collection, predicate, eachFunc) {
  1805. var result;
  1806. eachFunc(collection, function(value, key, collection) {
  1807. if (predicate(value, key, collection)) {
  1808. result = key;
  1809. return false;
  1810. }
  1811. });
  1812. return result;
  1813. }
  1814. /**
  1815. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1816. * support for iteratee shorthands.
  1817. *
  1818. * @private
  1819. * @param {Array} array The array to inspect.
  1820. * @param {Function} predicate The function invoked per iteration.
  1821. * @param {number} fromIndex The index to search from.
  1822. * @param {boolean} [fromRight] Specify iterating from right to left.
  1823. * @returns {number} Returns the index of the matched value, else `-1`.
  1824. */
  1825. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1826. var length = array.length,
  1827. index = fromIndex + (fromRight ? 1 : -1);
  1828. while ((fromRight ? index-- : ++index < length)) {
  1829. if (predicate(array[index], index, array)) {
  1830. return index;
  1831. }
  1832. }
  1833. return -1;
  1834. }
  1835. /**
  1836. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1837. *
  1838. * @private
  1839. * @param {Array} array The array to inspect.
  1840. * @param {*} value The value to search for.
  1841. * @param {number} fromIndex The index to search from.
  1842. * @returns {number} Returns the index of the matched value, else `-1`.
  1843. */
  1844. function baseIndexOf(array, value, fromIndex) {
  1845. return value === value
  1846. ? strictIndexOf(array, value, fromIndex)
  1847. : baseFindIndex(array, baseIsNaN, fromIndex);
  1848. }
  1849. /**
  1850. * This function is like `baseIndexOf` except that it accepts a comparator.
  1851. *
  1852. * @private
  1853. * @param {Array} array The array to inspect.
  1854. * @param {*} value The value to search for.
  1855. * @param {number} fromIndex The index to search from.
  1856. * @param {Function} comparator The comparator invoked per element.
  1857. * @returns {number} Returns the index of the matched value, else `-1`.
  1858. */
  1859. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1860. var index = fromIndex - 1,
  1861. length = array.length;
  1862. while (++index < length) {
  1863. if (comparator(array[index], value)) {
  1864. return index;
  1865. }
  1866. }
  1867. return -1;
  1868. }
  1869. /**
  1870. * The base implementation of `_.isNaN` without support for number objects.
  1871. *
  1872. * @private
  1873. * @param {*} value The value to check.
  1874. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1875. */
  1876. function baseIsNaN(value) {
  1877. return value !== value;
  1878. }
  1879. /**
  1880. * The base implementation of `_.mean` and `_.meanBy` without support for
  1881. * iteratee shorthands.
  1882. *
  1883. * @private
  1884. * @param {Array} array The array to iterate over.
  1885. * @param {Function} iteratee The function invoked per iteration.
  1886. * @returns {number} Returns the mean.
  1887. */
  1888. function baseMean(array, iteratee) {
  1889. var length = array == null ? 0 : array.length;
  1890. return length ? (baseSum(array, iteratee) / length) : NAN;
  1891. }
  1892. /**
  1893. * The base implementation of `_.property` without support for deep paths.
  1894. *
  1895. * @private
  1896. * @param {string} key The key of the property to get.
  1897. * @returns {Function} Returns the new accessor function.
  1898. */
  1899. function baseProperty(key) {
  1900. return function(object) {
  1901. return object == null ? undefined : object[key];
  1902. };
  1903. }
  1904. /**
  1905. * The base implementation of `_.propertyOf` without support for deep paths.
  1906. *
  1907. * @private
  1908. * @param {Object} object The object to query.
  1909. * @returns {Function} Returns the new accessor function.
  1910. */
  1911. function basePropertyOf(object) {
  1912. return function(key) {
  1913. return object == null ? undefined : object[key];
  1914. };
  1915. }
  1916. /**
  1917. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1918. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1919. *
  1920. * @private
  1921. * @param {Array|Object} collection The collection to iterate over.
  1922. * @param {Function} iteratee The function invoked per iteration.
  1923. * @param {*} accumulator The initial value.
  1924. * @param {boolean} initAccum Specify using the first or last element of
  1925. * `collection` as the initial value.
  1926. * @param {Function} eachFunc The function to iterate over `collection`.
  1927. * @returns {*} Returns the accumulated value.
  1928. */
  1929. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1930. eachFunc(collection, function(value, index, collection) {
  1931. accumulator = initAccum
  1932. ? (initAccum = false, value)
  1933. : iteratee(accumulator, value, index, collection);
  1934. });
  1935. return accumulator;
  1936. }
  1937. /**
  1938. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1939. * sort order of `array` and replaces criteria objects with their corresponding
  1940. * values.
  1941. *
  1942. * @private
  1943. * @param {Array} array The array to sort.
  1944. * @param {Function} comparer The function to define sort order.
  1945. * @returns {Array} Returns `array`.
  1946. */
  1947. function baseSortBy(array, comparer) {
  1948. var length = array.length;
  1949. array.sort(comparer);
  1950. while (length--) {
  1951. array[length] = array[length].value;
  1952. }
  1953. return array;
  1954. }
  1955. /**
  1956. * The base implementation of `_.sum` and `_.sumBy` without support for
  1957. * iteratee shorthands.
  1958. *
  1959. * @private
  1960. * @param {Array} array The array to iterate over.
  1961. * @param {Function} iteratee The function invoked per iteration.
  1962. * @returns {number} Returns the sum.
  1963. */
  1964. function baseSum(array, iteratee) {
  1965. var result,
  1966. index = -1,
  1967. length = array.length;
  1968. while (++index < length) {
  1969. var current = iteratee(array[index]);
  1970. if (current !== undefined) {
  1971. result = result === undefined ? current : (result + current);
  1972. }
  1973. }
  1974. return result;
  1975. }
  1976. /**
  1977. * The base implementation of `_.times` without support for iteratee shorthands
  1978. * or max array length checks.
  1979. *
  1980. * @private
  1981. * @param {number} n The number of times to invoke `iteratee`.
  1982. * @param {Function} iteratee The function invoked per iteration.
  1983. * @returns {Array} Returns the array of results.
  1984. */
  1985. function baseTimes(n, iteratee) {
  1986. var index = -1,
  1987. result = Array(n);
  1988. while (++index < n) {
  1989. result[index] = iteratee(index);
  1990. }
  1991. return result;
  1992. }
  1993. /**
  1994. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  1995. * of key-value pairs for `object` corresponding to the property names of `props`.
  1996. *
  1997. * @private
  1998. * @param {Object} object The object to query.
  1999. * @param {Array} props The property names to get values for.
  2000. * @returns {Object} Returns the key-value pairs.
  2001. */
  2002. function baseToPairs(object, props) {
  2003. return arrayMap(props, function(key) {
  2004. return [key, object[key]];
  2005. });
  2006. }
  2007. /**
  2008. * The base implementation of `_.trim`.
  2009. *
  2010. * @private
  2011. * @param {string} string The string to trim.
  2012. * @returns {string} Returns the trimmed string.
  2013. */
  2014. function baseTrim(string) {
  2015. return string
  2016. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2017. : string;
  2018. }
  2019. /**
  2020. * The base implementation of `_.unary` without support for storing metadata.
  2021. *
  2022. * @private
  2023. * @param {Function} func The function to cap arguments for.
  2024. * @returns {Function} Returns the new capped function.
  2025. */
  2026. function baseUnary(func) {
  2027. return function(value) {
  2028. return func(value);
  2029. };
  2030. }
  2031. /**
  2032. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2033. * array of `object` property values corresponding to the property names
  2034. * of `props`.
  2035. *
  2036. * @private
  2037. * @param {Object} object The object to query.
  2038. * @param {Array} props The property names to get values for.
  2039. * @returns {Object} Returns the array of property values.
  2040. */
  2041. function baseValues(object, props) {
  2042. return arrayMap(props, function(key) {
  2043. return object[key];
  2044. });
  2045. }
  2046. /**
  2047. * Checks if a `cache` value for `key` exists.
  2048. *
  2049. * @private
  2050. * @param {Object} cache The cache to query.
  2051. * @param {string} key The key of the entry to check.
  2052. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2053. */
  2054. function cacheHas(cache, key) {
  2055. return cache.has(key);
  2056. }
  2057. /**
  2058. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2059. * that is not found in the character symbols.
  2060. *
  2061. * @private
  2062. * @param {Array} strSymbols The string symbols to inspect.
  2063. * @param {Array} chrSymbols The character symbols to find.
  2064. * @returns {number} Returns the index of the first unmatched string symbol.
  2065. */
  2066. function charsStartIndex(strSymbols, chrSymbols) {
  2067. var index = -1,
  2068. length = strSymbols.length;
  2069. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2070. return index;
  2071. }
  2072. /**
  2073. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2074. * that is not found in the character symbols.
  2075. *
  2076. * @private
  2077. * @param {Array} strSymbols The string symbols to inspect.
  2078. * @param {Array} chrSymbols The character symbols to find.
  2079. * @returns {number} Returns the index of the last unmatched string symbol.
  2080. */
  2081. function charsEndIndex(strSymbols, chrSymbols) {
  2082. var index = strSymbols.length;
  2083. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2084. return index;
  2085. }
  2086. /**
  2087. * Gets the number of `placeholder` occurrences in `array`.
  2088. *
  2089. * @private
  2090. * @param {Array} array The array to inspect.
  2091. * @param {*} placeholder The placeholder to search for.
  2092. * @returns {number} Returns the placeholder count.
  2093. */
  2094. function countHolders(array, placeholder) {
  2095. var length = array.length,
  2096. result = 0;
  2097. while (length--) {
  2098. if (array[length] === placeholder) {
  2099. ++result;
  2100. }
  2101. }
  2102. return result;
  2103. }
  2104. /**
  2105. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2106. * letters to basic Latin letters.
  2107. *
  2108. * @private
  2109. * @param {string} letter The matched letter to deburr.
  2110. * @returns {string} Returns the deburred letter.
  2111. */
  2112. var deburrLetter = basePropertyOf(deburredLetters);
  2113. /**
  2114. * Used by `_.escape` to convert characters to HTML entities.
  2115. *
  2116. * @private
  2117. * @param {string} chr The matched character to escape.
  2118. * @returns {string} Returns the escaped character.
  2119. */
  2120. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2121. /**
  2122. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2123. *
  2124. * @private
  2125. * @param {string} chr The matched character to escape.
  2126. * @returns {string} Returns the escaped character.
  2127. */
  2128. function escapeStringChar(chr) {
  2129. return '\\' + stringEscapes[chr];
  2130. }
  2131. /**
  2132. * Gets the value at `key` of `object`.
  2133. *
  2134. * @private
  2135. * @param {Object} [object] The object to query.
  2136. * @param {string} key The key of the property to get.
  2137. * @returns {*} Returns the property value.
  2138. */
  2139. function getValue(object, key) {
  2140. return object == null ? undefined : object[key];
  2141. }
  2142. /**
  2143. * Checks if `string` contains Unicode symbols.
  2144. *
  2145. * @private
  2146. * @param {string} string The string to inspect.
  2147. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2148. */
  2149. function hasUnicode(string) {
  2150. return reHasUnicode.test(string);
  2151. }
  2152. /**
  2153. * Checks if `string` contains a word composed of Unicode symbols.
  2154. *
  2155. * @private
  2156. * @param {string} string The string to inspect.
  2157. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2158. */
  2159. function hasUnicodeWord(string) {
  2160. return reHasUnicodeWord.test(string);
  2161. }
  2162. /**
  2163. * Converts `iterator` to an array.
  2164. *
  2165. * @private
  2166. * @param {Object} iterator The iterator to convert.
  2167. * @returns {Array} Returns the converted array.
  2168. */
  2169. function iteratorToArray(iterator) {
  2170. var data,
  2171. result = [];
  2172. while (!(data = iterator.next()).done) {
  2173. result.push(data.value);
  2174. }
  2175. return result;
  2176. }
  2177. /**
  2178. * Converts `map` to its key-value pairs.
  2179. *
  2180. * @private
  2181. * @param {Object} map The map to convert.
  2182. * @returns {Array} Returns the key-value pairs.
  2183. */
  2184. function mapToArray(map) {
  2185. var index = -1,
  2186. result = Array(map.size);
  2187. map.forEach(function(value, key) {
  2188. result[++index] = [key, value];
  2189. });
  2190. return result;
  2191. }
  2192. /**
  2193. * Creates a unary function that invokes `func` with its argument transformed.
  2194. *
  2195. * @private
  2196. * @param {Function} func The function to wrap.
  2197. * @param {Function} transform The argument transform.
  2198. * @returns {Function} Returns the new function.
  2199. */
  2200. function overArg(func, transform) {
  2201. return function(arg) {
  2202. return func(transform(arg));
  2203. };
  2204. }
  2205. /**
  2206. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2207. * and returns an array of their indexes.
  2208. *
  2209. * @private
  2210. * @param {Array} array The array to modify.
  2211. * @param {*} placeholder The placeholder to replace.
  2212. * @returns {Array} Returns the new array of placeholder indexes.
  2213. */
  2214. function replaceHolders(array, placeholder) {
  2215. var index = -1,
  2216. length = array.length,
  2217. resIndex = 0,
  2218. result = [];
  2219. while (++index < length) {
  2220. var value = array[index];
  2221. if (value === placeholder || value === PLACEHOLDER) {
  2222. array[index] = PLACEHOLDER;
  2223. result[resIndex++] = index;
  2224. }
  2225. }
  2226. return result;
  2227. }
  2228. /**
  2229. * Converts `set` to an array of its values.
  2230. *
  2231. * @private
  2232. * @param {Object} set The set to convert.
  2233. * @returns {Array} Returns the values.
  2234. */
  2235. function setToArray(set) {
  2236. var index = -1,
  2237. result = Array(set.size);
  2238. set.forEach(function(value) {
  2239. result[++index] = value;
  2240. });
  2241. return result;
  2242. }
  2243. /**
  2244. * Converts `set` to its value-value pairs.
  2245. *
  2246. * @private
  2247. * @param {Object} set The set to convert.
  2248. * @returns {Array} Returns the value-value pairs.
  2249. */
  2250. function setToPairs(set) {
  2251. var index = -1,
  2252. result = Array(set.size);
  2253. set.forEach(function(value) {
  2254. result[++index] = [value, value];
  2255. });
  2256. return result;
  2257. }
  2258. /**
  2259. * A specialized version of `_.indexOf` which performs strict equality
  2260. * comparisons of values, i.e. `===`.
  2261. *
  2262. * @private
  2263. * @param {Array} array The array to inspect.
  2264. * @param {*} value The value to search for.
  2265. * @param {number} fromIndex The index to search from.
  2266. * @returns {number} Returns the index of the matched value, else `-1`.
  2267. */
  2268. function strictIndexOf(array, value, fromIndex) {
  2269. var index = fromIndex - 1,
  2270. length = array.length;
  2271. while (++index < length) {
  2272. if (array[index] === value) {
  2273. return index;
  2274. }
  2275. }
  2276. return -1;
  2277. }
  2278. /**
  2279. * A specialized version of `_.lastIndexOf` which performs strict equality
  2280. * comparisons of values, i.e. `===`.
  2281. *
  2282. * @private
  2283. * @param {Array} array The array to inspect.
  2284. * @param {*} value The value to search for.
  2285. * @param {number} fromIndex The index to search from.
  2286. * @returns {number} Returns the index of the matched value, else `-1`.
  2287. */
  2288. function strictLastIndexOf(array, value, fromIndex) {
  2289. var index = fromIndex + 1;
  2290. while (index--) {
  2291. if (array[index] === value) {
  2292. return index;
  2293. }
  2294. }
  2295. return index;
  2296. }
  2297. /**
  2298. * Gets the number of symbols in `string`.
  2299. *
  2300. * @private
  2301. * @param {string} string The string to inspect.
  2302. * @returns {number} Returns the string size.
  2303. */
  2304. function stringSize(string) {
  2305. return hasUnicode(string)
  2306. ? unicodeSize(string)
  2307. : asciiSize(string);
  2308. }
  2309. /**
  2310. * Converts `string` to an array.
  2311. *
  2312. * @private
  2313. * @param {string} string The string to convert.
  2314. * @returns {Array} Returns the converted array.
  2315. */
  2316. function stringToArray(string) {
  2317. return hasUnicode(string)
  2318. ? unicodeToArray(string)
  2319. : asciiToArray(string);
  2320. }
  2321. /**
  2322. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2323. * character of `string`.
  2324. *
  2325. * @private
  2326. * @param {string} string The string to inspect.
  2327. * @returns {number} Returns the index of the last non-whitespace character.
  2328. */
  2329. function trimmedEndIndex(string) {
  2330. var index = string.length;
  2331. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2332. return index;
  2333. }
  2334. /**
  2335. * Used by `_.unescape` to convert HTML entities to characters.
  2336. *
  2337. * @private
  2338. * @param {string} chr The matched character to unescape.
  2339. * @returns {string} Returns the unescaped character.
  2340. */
  2341. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2342. /**
  2343. * Gets the size of a Unicode `string`.
  2344. *
  2345. * @private
  2346. * @param {string} string The string inspect.
  2347. * @returns {number} Returns the string size.
  2348. */
  2349. function unicodeSize(string) {
  2350. var result = reUnicode.lastIndex = 0;
  2351. while (reUnicode.test(string)) {
  2352. ++result;
  2353. }
  2354. return result;
  2355. }
  2356. /**
  2357. * Converts a Unicode `string` to an array.
  2358. *
  2359. * @private
  2360. * @param {string} string The string to convert.
  2361. * @returns {Array} Returns the converted array.
  2362. */
  2363. function unicodeToArray(string) {
  2364. return string.match(reUnicode) || [];
  2365. }
  2366. /**
  2367. * Splits a Unicode `string` into an array of its words.
  2368. *
  2369. * @private
  2370. * @param {string} The string to inspect.
  2371. * @returns {Array} Returns the words of `string`.
  2372. */
  2373. function unicodeWords(string) {
  2374. return string.match(reUnicodeWord) || [];
  2375. }
  2376. /*--------------------------------------------------------------------------*/
  2377. /**
  2378. * Create a new pristine `lodash` function using the `context` object.
  2379. *
  2380. * @static
  2381. * @memberOf _
  2382. * @since 1.1.0
  2383. * @category Util
  2384. * @param {Object} [context=root] The context object.
  2385. * @returns {Function} Returns a new `lodash` function.
  2386. * @example
  2387. *
  2388. * _.mixin({ 'foo': _.constant('foo') });
  2389. *
  2390. * var lodash = _.runInContext();
  2391. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2392. *
  2393. * _.isFunction(_.foo);
  2394. * // => true
  2395. * _.isFunction(_.bar);
  2396. * // => false
  2397. *
  2398. * lodash.isFunction(lodash.foo);
  2399. * // => false
  2400. * lodash.isFunction(lodash.bar);
  2401. * // => true
  2402. *
  2403. * // Create a suped-up `defer` in Node.js.
  2404. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2405. */
  2406. var runInContext = (function runInContext(context) {
  2407. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2408. /** Built-in constructor references. */
  2409. var Array = context.Array,
  2410. Date = context.Date,
  2411. Error = context.Error,
  2412. Function = context.Function,
  2413. Math = context.Math,
  2414. Object = context.Object,
  2415. RegExp = context.RegExp,
  2416. String = context.String,
  2417. TypeError = context.TypeError;
  2418. /** Used for built-in method references. */
  2419. var arrayProto = Array.prototype,
  2420. funcProto = Function.prototype,
  2421. objectProto = Object.prototype;
  2422. /** Used to detect overreaching core-js shims. */
  2423. var coreJsData = context['__core-js_shared__'];
  2424. /** Used to resolve the decompiled source of functions. */
  2425. var funcToString = funcProto.toString;
  2426. /** Used to check objects for own properties. */
  2427. var hasOwnProperty = objectProto.hasOwnProperty;
  2428. /** Used to generate unique IDs. */
  2429. var idCounter = 0;
  2430. /** Used to detect methods masquerading as native. */
  2431. var maskSrcKey = (function() {
  2432. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2433. return uid ? ('Symbol(src)_1.' + uid) : '';
  2434. }());
  2435. /**
  2436. * Used to resolve the
  2437. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2438. * of values.
  2439. */
  2440. var nativeObjectToString = objectProto.toString;
  2441. /** Used to infer the `Object` constructor. */
  2442. var objectCtorString = funcToString.call(Object);
  2443. /** Used to restore the original `_` reference in `_.noConflict`. */
  2444. var oldDash = root._;
  2445. /** Used to detect if a method is native. */
  2446. var reIsNative = RegExp('^' +
  2447. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2448. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2449. );
  2450. /** Built-in value references. */
  2451. var Buffer = moduleExports ? context.Buffer : undefined,
  2452. Symbol = context.Symbol,
  2453. Uint8Array = context.Uint8Array,
  2454. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2455. getPrototype = overArg(Object.getPrototypeOf, Object),
  2456. objectCreate = Object.create,
  2457. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2458. splice = arrayProto.splice,
  2459. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2460. symIterator = Symbol ? Symbol.iterator : undefined,
  2461. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2462. var defineProperty = (function() {
  2463. try {
  2464. var func = getNative(Object, 'defineProperty');
  2465. func({}, '', {});
  2466. return func;
  2467. } catch (e) {}
  2468. }());
  2469. /** Mocked built-ins. */
  2470. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2471. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2472. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2473. /* Built-in method references for those with the same name as other `lodash` methods. */
  2474. var nativeCeil = Math.ceil,
  2475. nativeFloor = Math.floor,
  2476. nativeGetSymbols = Object.getOwnPropertySymbols,
  2477. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2478. nativeIsFinite = context.isFinite,
  2479. nativeJoin = arrayProto.join,
  2480. nativeKeys = overArg(Object.keys, Object),
  2481. nativeMax = Math.max,
  2482. nativeMin = Math.min,
  2483. nativeNow = Date.now,
  2484. nativeParseInt = context.parseInt,
  2485. nativeRandom = Math.random,
  2486. nativeReverse = arrayProto.reverse;
  2487. /* Built-in method references that are verified to be native. */
  2488. var DataView = getNative(context, 'DataView'),
  2489. Map = getNative(context, 'Map'),
  2490. Promise = getNative(context, 'Promise'),
  2491. Set = getNative(context, 'Set'),
  2492. WeakMap = getNative(context, 'WeakMap'),
  2493. nativeCreate = getNative(Object, 'create');
  2494. /** Used to store function metadata. */
  2495. var metaMap = WeakMap && new WeakMap;
  2496. /** Used to lookup unminified function names. */
  2497. var realNames = {};
  2498. /** Used to detect maps, sets, and weakmaps. */
  2499. var dataViewCtorString = toSource(DataView),
  2500. mapCtorString = toSource(Map),
  2501. promiseCtorString = toSource(Promise),
  2502. setCtorString = toSource(Set),
  2503. weakMapCtorString = toSource(WeakMap);
  2504. /** Used to convert symbols to primitives and strings. */
  2505. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2506. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2507. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2508. /*------------------------------------------------------------------------*/
  2509. /**
  2510. * Creates a `lodash` object which wraps `value` to enable implicit method
  2511. * chain sequences. Methods that operate on and return arrays, collections,
  2512. * and functions can be chained together. Methods that retrieve a single value
  2513. * or may return a primitive value will automatically end the chain sequence
  2514. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2515. * with `_#value`.
  2516. *
  2517. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2518. * enabled using `_.chain`.
  2519. *
  2520. * The execution of chained methods is lazy, that is, it's deferred until
  2521. * `_#value` is implicitly or explicitly called.
  2522. *
  2523. * Lazy evaluation allows several methods to support shortcut fusion.
  2524. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2525. * the creation of intermediate arrays and can greatly reduce the number of
  2526. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2527. * fusion if the section is applied to an array and iteratees accept only
  2528. * one argument. The heuristic for whether a section qualifies for shortcut
  2529. * fusion is subject to change.
  2530. *
  2531. * Chaining is supported in custom builds as long as the `_#value` method is
  2532. * directly or indirectly included in the build.
  2533. *
  2534. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2535. *
  2536. * The wrapper `Array` methods are:
  2537. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2538. *
  2539. * The wrapper `String` methods are:
  2540. * `replace` and `split`
  2541. *
  2542. * The wrapper methods that support shortcut fusion are:
  2543. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2544. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2545. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2546. *
  2547. * The chainable wrapper methods are:
  2548. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2549. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2550. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2551. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2552. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2553. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2554. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2555. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2556. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2557. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2558. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2559. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2560. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2561. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2562. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2563. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2564. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2565. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2566. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2567. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2568. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2569. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2570. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2571. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2572. *
  2573. * The wrapper methods that are **not** chainable by default are:
  2574. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2575. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2576. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2577. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2578. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2579. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2580. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2581. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2582. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2583. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2584. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2585. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2586. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2587. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2588. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2589. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2590. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2591. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2592. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2593. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2594. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2595. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2596. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2597. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2598. * `upperFirst`, `value`, and `words`
  2599. *
  2600. * @name _
  2601. * @constructor
  2602. * @category Seq
  2603. * @param {*} value The value to wrap in a `lodash` instance.
  2604. * @returns {Object} Returns the new `lodash` wrapper instance.
  2605. * @example
  2606. *
  2607. * function square(n) {
  2608. * return n * n;
  2609. * }
  2610. *
  2611. * var wrapped = _([1, 2, 3]);
  2612. *
  2613. * // Returns an unwrapped value.
  2614. * wrapped.reduce(_.add);
  2615. * // => 6
  2616. *
  2617. * // Returns a wrapped value.
  2618. * var squares = wrapped.map(square);
  2619. *
  2620. * _.isArray(squares);
  2621. * // => false
  2622. *
  2623. * _.isArray(squares.value());
  2624. * // => true
  2625. */
  2626. function lodash(value) {
  2627. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2628. if (value instanceof LodashWrapper) {
  2629. return value;
  2630. }
  2631. if (hasOwnProperty.call(value, '__wrapped__')) {
  2632. return wrapperClone(value);
  2633. }
  2634. }
  2635. return new LodashWrapper(value);
  2636. }
  2637. /**
  2638. * The base implementation of `_.create` without support for assigning
  2639. * properties to the created object.
  2640. *
  2641. * @private
  2642. * @param {Object} proto The object to inherit from.
  2643. * @returns {Object} Returns the new object.
  2644. */
  2645. var baseCreate = (function() {
  2646. function object() {}
  2647. return function(proto) {
  2648. if (!isObject(proto)) {
  2649. return {};
  2650. }
  2651. if (objectCreate) {
  2652. return objectCreate(proto);
  2653. }
  2654. object.prototype = proto;
  2655. var result = new object;
  2656. object.prototype = undefined;
  2657. return result;
  2658. };
  2659. }());
  2660. /**
  2661. * The function whose prototype chain sequence wrappers inherit from.
  2662. *
  2663. * @private
  2664. */
  2665. function baseLodash() {
  2666. // No operation performed.
  2667. }
  2668. /**
  2669. * The base constructor for creating `lodash` wrapper objects.
  2670. *
  2671. * @private
  2672. * @param {*} value The value to wrap.
  2673. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2674. */
  2675. function LodashWrapper(value, chainAll) {
  2676. this.__wrapped__ = value;
  2677. this.__actions__ = [];
  2678. this.__chain__ = !!chainAll;
  2679. this.__index__ = 0;
  2680. this.__values__ = undefined;
  2681. }
  2682. /**
  2683. * By default, the template delimiters used by lodash are like those in
  2684. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2685. * following template settings to use alternative delimiters.
  2686. *
  2687. * @static
  2688. * @memberOf _
  2689. * @type {Object}
  2690. */
  2691. lodash.templateSettings = {
  2692. /**
  2693. * Used to detect `data` property values to be HTML-escaped.
  2694. *
  2695. * @memberOf _.templateSettings
  2696. * @type {RegExp}
  2697. */
  2698. 'escape': reEscape,
  2699. /**
  2700. * Used to detect code to be evaluated.
  2701. *
  2702. * @memberOf _.templateSettings
  2703. * @type {RegExp}
  2704. */
  2705. 'evaluate': reEvaluate,
  2706. /**
  2707. * Used to detect `data` property values to inject.
  2708. *
  2709. * @memberOf _.templateSettings
  2710. * @type {RegExp}
  2711. */
  2712. 'interpolate': reInterpolate,
  2713. /**
  2714. * Used to reference the data object in the template text.
  2715. *
  2716. * @memberOf _.templateSettings
  2717. * @type {string}
  2718. */
  2719. 'variable': '',
  2720. /**
  2721. * Used to import variables into the compiled template.
  2722. *
  2723. * @memberOf _.templateSettings
  2724. * @type {Object}
  2725. */
  2726. 'imports': {
  2727. /**
  2728. * A reference to the `lodash` function.
  2729. *
  2730. * @memberOf _.templateSettings.imports
  2731. * @type {Function}
  2732. */
  2733. '_': lodash
  2734. }
  2735. };
  2736. // Ensure wrappers are instances of `baseLodash`.
  2737. lodash.prototype = baseLodash.prototype;
  2738. lodash.prototype.constructor = lodash;
  2739. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2740. LodashWrapper.prototype.constructor = LodashWrapper;
  2741. /*------------------------------------------------------------------------*/
  2742. /**
  2743. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2744. *
  2745. * @private
  2746. * @constructor
  2747. * @param {*} value The value to wrap.
  2748. */
  2749. function LazyWrapper(value) {
  2750. this.__wrapped__ = value;
  2751. this.__actions__ = [];
  2752. this.__dir__ = 1;
  2753. this.__filtered__ = false;
  2754. this.__iteratees__ = [];
  2755. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2756. this.__views__ = [];
  2757. }
  2758. /**
  2759. * Creates a clone of the lazy wrapper object.
  2760. *
  2761. * @private
  2762. * @name clone
  2763. * @memberOf LazyWrapper
  2764. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2765. */
  2766. function lazyClone() {
  2767. var result = new LazyWrapper(this.__wrapped__);
  2768. result.__actions__ = copyArray(this.__actions__);
  2769. result.__dir__ = this.__dir__;
  2770. result.__filtered__ = this.__filtered__;
  2771. result.__iteratees__ = copyArray(this.__iteratees__);
  2772. result.__takeCount__ = this.__takeCount__;
  2773. result.__views__ = copyArray(this.__views__);
  2774. return result;
  2775. }
  2776. /**
  2777. * Reverses the direction of lazy iteration.
  2778. *
  2779. * @private
  2780. * @name reverse
  2781. * @memberOf LazyWrapper
  2782. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2783. */
  2784. function lazyReverse() {
  2785. if (this.__filtered__) {
  2786. var result = new LazyWrapper(this);
  2787. result.__dir__ = -1;
  2788. result.__filtered__ = true;
  2789. } else {
  2790. result = this.clone();
  2791. result.__dir__ *= -1;
  2792. }
  2793. return result;
  2794. }
  2795. /**
  2796. * Extracts the unwrapped value from its lazy wrapper.
  2797. *
  2798. * @private
  2799. * @name value
  2800. * @memberOf LazyWrapper
  2801. * @returns {*} Returns the unwrapped value.
  2802. */
  2803. function lazyValue() {
  2804. var array = this.__wrapped__.value(),
  2805. dir = this.__dir__,
  2806. isArr = isArray(array),
  2807. isRight = dir < 0,
  2808. arrLength = isArr ? array.length : 0,
  2809. view = getView(0, arrLength, this.__views__),
  2810. start = view.start,
  2811. end = view.end,
  2812. length = end - start,
  2813. index = isRight ? end : (start - 1),
  2814. iteratees = this.__iteratees__,
  2815. iterLength = iteratees.length,
  2816. resIndex = 0,
  2817. takeCount = nativeMin(length, this.__takeCount__);
  2818. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2819. return baseWrapperValue(array, this.__actions__);
  2820. }
  2821. var result = [];
  2822. outer:
  2823. while (length-- && resIndex < takeCount) {
  2824. index += dir;
  2825. var iterIndex = -1,
  2826. value = array[index];
  2827. while (++iterIndex < iterLength) {
  2828. var data = iteratees[iterIndex],
  2829. iteratee = data.iteratee,
  2830. type = data.type,
  2831. computed = iteratee(value);
  2832. if (type == LAZY_MAP_FLAG) {
  2833. value = computed;
  2834. } else if (!computed) {
  2835. if (type == LAZY_FILTER_FLAG) {
  2836. continue outer;
  2837. } else {
  2838. break outer;
  2839. }
  2840. }
  2841. }
  2842. result[resIndex++] = value;
  2843. }
  2844. return result;
  2845. }
  2846. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2847. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2848. LazyWrapper.prototype.constructor = LazyWrapper;
  2849. /*------------------------------------------------------------------------*/
  2850. /**
  2851. * Creates a hash object.
  2852. *
  2853. * @private
  2854. * @constructor
  2855. * @param {Array} [entries] The key-value pairs to cache.
  2856. */
  2857. function Hash(entries) {
  2858. var index = -1,
  2859. length = entries == null ? 0 : entries.length;
  2860. this.clear();
  2861. while (++index < length) {
  2862. var entry = entries[index];
  2863. this.set(entry[0], entry[1]);
  2864. }
  2865. }
  2866. /**
  2867. * Removes all key-value entries from the hash.
  2868. *
  2869. * @private
  2870. * @name clear
  2871. * @memberOf Hash
  2872. */
  2873. function hashClear() {
  2874. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2875. this.size = 0;
  2876. }
  2877. /**
  2878. * Removes `key` and its value from the hash.
  2879. *
  2880. * @private
  2881. * @name delete
  2882. * @memberOf Hash
  2883. * @param {Object} hash The hash to modify.
  2884. * @param {string} key The key of the value to remove.
  2885. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2886. */
  2887. function hashDelete(key) {
  2888. var result = this.has(key) && delete this.__data__[key];
  2889. this.size -= result ? 1 : 0;
  2890. return result;
  2891. }
  2892. /**
  2893. * Gets the hash value for `key`.
  2894. *
  2895. * @private
  2896. * @name get
  2897. * @memberOf Hash
  2898. * @param {string} key The key of the value to get.
  2899. * @returns {*} Returns the entry value.
  2900. */
  2901. function hashGet(key) {
  2902. var data = this.__data__;
  2903. if (nativeCreate) {
  2904. var result = data[key];
  2905. return result === HASH_UNDEFINED ? undefined : result;
  2906. }
  2907. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2908. }
  2909. /**
  2910. * Checks if a hash value for `key` exists.
  2911. *
  2912. * @private
  2913. * @name has
  2914. * @memberOf Hash
  2915. * @param {string} key The key of the entry to check.
  2916. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2917. */
  2918. function hashHas(key) {
  2919. var data = this.__data__;
  2920. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2921. }
  2922. /**
  2923. * Sets the hash `key` to `value`.
  2924. *
  2925. * @private
  2926. * @name set
  2927. * @memberOf Hash
  2928. * @param {string} key The key of the value to set.
  2929. * @param {*} value The value to set.
  2930. * @returns {Object} Returns the hash instance.
  2931. */
  2932. function hashSet(key, value) {
  2933. var data = this.__data__;
  2934. this.size += this.has(key) ? 0 : 1;
  2935. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2936. return this;
  2937. }
  2938. // Add methods to `Hash`.
  2939. Hash.prototype.clear = hashClear;
  2940. Hash.prototype['delete'] = hashDelete;
  2941. Hash.prototype.get = hashGet;
  2942. Hash.prototype.has = hashHas;
  2943. Hash.prototype.set = hashSet;
  2944. /*------------------------------------------------------------------------*/
  2945. /**
  2946. * Creates an list cache object.
  2947. *
  2948. * @private
  2949. * @constructor
  2950. * @param {Array} [entries] The key-value pairs to cache.
  2951. */
  2952. function ListCache(entries) {
  2953. var index = -1,
  2954. length = entries == null ? 0 : entries.length;
  2955. this.clear();
  2956. while (++index < length) {
  2957. var entry = entries[index];
  2958. this.set(entry[0], entry[1]);
  2959. }
  2960. }
  2961. /**
  2962. * Removes all key-value entries from the list cache.
  2963. *
  2964. * @private
  2965. * @name clear
  2966. * @memberOf ListCache
  2967. */
  2968. function listCacheClear() {
  2969. this.__data__ = [];
  2970. this.size = 0;
  2971. }
  2972. /**
  2973. * Removes `key` and its value from the list cache.
  2974. *
  2975. * @private
  2976. * @name delete
  2977. * @memberOf ListCache
  2978. * @param {string} key The key of the value to remove.
  2979. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2980. */
  2981. function listCacheDelete(key) {
  2982. var data = this.__data__,
  2983. index = assocIndexOf(data, key);
  2984. if (index < 0) {
  2985. return false;
  2986. }
  2987. var lastIndex = data.length - 1;
  2988. if (index == lastIndex) {
  2989. data.pop();
  2990. } else {
  2991. splice.call(data, index, 1);
  2992. }
  2993. --this.size;
  2994. return true;
  2995. }
  2996. /**
  2997. * Gets the list cache value for `key`.
  2998. *
  2999. * @private
  3000. * @name get
  3001. * @memberOf ListCache
  3002. * @param {string} key The key of the value to get.
  3003. * @returns {*} Returns the entry value.
  3004. */
  3005. function listCacheGet(key) {
  3006. var data = this.__data__,
  3007. index = assocIndexOf(data, key);
  3008. return index < 0 ? undefined : data[index][1];
  3009. }
  3010. /**
  3011. * Checks if a list cache value for `key` exists.
  3012. *
  3013. * @private
  3014. * @name has
  3015. * @memberOf ListCache
  3016. * @param {string} key The key of the entry to check.
  3017. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3018. */
  3019. function listCacheHas(key) {
  3020. return assocIndexOf(this.__data__, key) > -1;
  3021. }
  3022. /**
  3023. * Sets the list cache `key` to `value`.
  3024. *
  3025. * @private
  3026. * @name set
  3027. * @memberOf ListCache
  3028. * @param {string} key The key of the value to set.
  3029. * @param {*} value The value to set.
  3030. * @returns {Object} Returns the list cache instance.
  3031. */
  3032. function listCacheSet(key, value) {
  3033. var data = this.__data__,
  3034. index = assocIndexOf(data, key);
  3035. if (index < 0) {
  3036. ++this.size;
  3037. data.push([key, value]);
  3038. } else {
  3039. data[index][1] = value;
  3040. }
  3041. return this;
  3042. }
  3043. // Add methods to `ListCache`.
  3044. ListCache.prototype.clear = listCacheClear;
  3045. ListCache.prototype['delete'] = listCacheDelete;
  3046. ListCache.prototype.get = listCacheGet;
  3047. ListCache.prototype.has = listCacheHas;
  3048. ListCache.prototype.set = listCacheSet;
  3049. /*------------------------------------------------------------------------*/
  3050. /**
  3051. * Creates a map cache object to store key-value pairs.
  3052. *
  3053. * @private
  3054. * @constructor
  3055. * @param {Array} [entries] The key-value pairs to cache.
  3056. */
  3057. function MapCache(entries) {
  3058. var index = -1,
  3059. length = entries == null ? 0 : entries.length;
  3060. this.clear();
  3061. while (++index < length) {
  3062. var entry = entries[index];
  3063. this.set(entry[0], entry[1]);
  3064. }
  3065. }
  3066. /**
  3067. * Removes all key-value entries from the map.
  3068. *
  3069. * @private
  3070. * @name clear
  3071. * @memberOf MapCache
  3072. */
  3073. function mapCacheClear() {
  3074. this.size = 0;
  3075. this.__data__ = {
  3076. 'hash': new Hash,
  3077. 'map': new (Map || ListCache),
  3078. 'string': new Hash
  3079. };
  3080. }
  3081. /**
  3082. * Removes `key` and its value from the map.
  3083. *
  3084. * @private
  3085. * @name delete
  3086. * @memberOf MapCache
  3087. * @param {string} key The key of the value to remove.
  3088. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3089. */
  3090. function mapCacheDelete(key) {
  3091. var result = getMapData(this, key)['delete'](key);
  3092. this.size -= result ? 1 : 0;
  3093. return result;
  3094. }
  3095. /**
  3096. * Gets the map value for `key`.
  3097. *
  3098. * @private
  3099. * @name get
  3100. * @memberOf MapCache
  3101. * @param {string} key The key of the value to get.
  3102. * @returns {*} Returns the entry value.
  3103. */
  3104. function mapCacheGet(key) {
  3105. return getMapData(this, key).get(key);
  3106. }
  3107. /**
  3108. * Checks if a map value for `key` exists.
  3109. *
  3110. * @private
  3111. * @name has
  3112. * @memberOf MapCache
  3113. * @param {string} key The key of the entry to check.
  3114. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3115. */
  3116. function mapCacheHas(key) {
  3117. return getMapData(this, key).has(key);
  3118. }
  3119. /**
  3120. * Sets the map `key` to `value`.
  3121. *
  3122. * @private
  3123. * @name set
  3124. * @memberOf MapCache
  3125. * @param {string} key The key of the value to set.
  3126. * @param {*} value The value to set.
  3127. * @returns {Object} Returns the map cache instance.
  3128. */
  3129. function mapCacheSet(key, value) {
  3130. var data = getMapData(this, key),
  3131. size = data.size;
  3132. data.set(key, value);
  3133. this.size += data.size == size ? 0 : 1;
  3134. return this;
  3135. }
  3136. // Add methods to `MapCache`.
  3137. MapCache.prototype.clear = mapCacheClear;
  3138. MapCache.prototype['delete'] = mapCacheDelete;
  3139. MapCache.prototype.get = mapCacheGet;
  3140. MapCache.prototype.has = mapCacheHas;
  3141. MapCache.prototype.set = mapCacheSet;
  3142. /*------------------------------------------------------------------------*/
  3143. /**
  3144. *
  3145. * Creates an array cache object to store unique values.
  3146. *
  3147. * @private
  3148. * @constructor
  3149. * @param {Array} [values] The values to cache.
  3150. */
  3151. function SetCache(values) {
  3152. var index = -1,
  3153. length = values == null ? 0 : values.length;
  3154. this.__data__ = new MapCache;
  3155. while (++index < length) {
  3156. this.add(values[index]);
  3157. }
  3158. }
  3159. /**
  3160. * Adds `value` to the array cache.
  3161. *
  3162. * @private
  3163. * @name add
  3164. * @memberOf SetCache
  3165. * @alias push
  3166. * @param {*} value The value to cache.
  3167. * @returns {Object} Returns the cache instance.
  3168. */
  3169. function setCacheAdd(value) {
  3170. this.__data__.set(value, HASH_UNDEFINED);
  3171. return this;
  3172. }
  3173. /**
  3174. * Checks if `value` is in the array cache.
  3175. *
  3176. * @private
  3177. * @name has
  3178. * @memberOf SetCache
  3179. * @param {*} value The value to search for.
  3180. * @returns {number} Returns `true` if `value` is found, else `false`.
  3181. */
  3182. function setCacheHas(value) {
  3183. return this.__data__.has(value);
  3184. }
  3185. // Add methods to `SetCache`.
  3186. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3187. SetCache.prototype.has = setCacheHas;
  3188. /*------------------------------------------------------------------------*/
  3189. /**
  3190. * Creates a stack cache object to store key-value pairs.
  3191. *
  3192. * @private
  3193. * @constructor
  3194. * @param {Array} [entries] The key-value pairs to cache.
  3195. */
  3196. function Stack(entries) {
  3197. var data = this.__data__ = new ListCache(entries);
  3198. this.size = data.size;
  3199. }
  3200. /**
  3201. * Removes all key-value entries from the stack.
  3202. *
  3203. * @private
  3204. * @name clear
  3205. * @memberOf Stack
  3206. */
  3207. function stackClear() {
  3208. this.__data__ = new ListCache;
  3209. this.size = 0;
  3210. }
  3211. /**
  3212. * Removes `key` and its value from the stack.
  3213. *
  3214. * @private
  3215. * @name delete
  3216. * @memberOf Stack
  3217. * @param {string} key The key of the value to remove.
  3218. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3219. */
  3220. function stackDelete(key) {
  3221. var data = this.__data__,
  3222. result = data['delete'](key);
  3223. this.size = data.size;
  3224. return result;
  3225. }
  3226. /**
  3227. * Gets the stack value for `key`.
  3228. *
  3229. * @private
  3230. * @name get
  3231. * @memberOf Stack
  3232. * @param {string} key The key of the value to get.
  3233. * @returns {*} Returns the entry value.
  3234. */
  3235. function stackGet(key) {
  3236. return this.__data__.get(key);
  3237. }
  3238. /**
  3239. * Checks if a stack value for `key` exists.
  3240. *
  3241. * @private
  3242. * @name has
  3243. * @memberOf Stack
  3244. * @param {string} key The key of the entry to check.
  3245. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3246. */
  3247. function stackHas(key) {
  3248. return this.__data__.has(key);
  3249. }
  3250. /**
  3251. * Sets the stack `key` to `value`.
  3252. *
  3253. * @private
  3254. * @name set
  3255. * @memberOf Stack
  3256. * @param {string} key The key of the value to set.
  3257. * @param {*} value The value to set.
  3258. * @returns {Object} Returns the stack cache instance.
  3259. */
  3260. function stackSet(key, value) {
  3261. var data = this.__data__;
  3262. if (data instanceof ListCache) {
  3263. var pairs = data.__data__;
  3264. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3265. pairs.push([key, value]);
  3266. this.size = ++data.size;
  3267. return this;
  3268. }
  3269. data = this.__data__ = new MapCache(pairs);
  3270. }
  3271. data.set(key, value);
  3272. this.size = data.size;
  3273. return this;
  3274. }
  3275. // Add methods to `Stack`.
  3276. Stack.prototype.clear = stackClear;
  3277. Stack.prototype['delete'] = stackDelete;
  3278. Stack.prototype.get = stackGet;
  3279. Stack.prototype.has = stackHas;
  3280. Stack.prototype.set = stackSet;
  3281. /*------------------------------------------------------------------------*/
  3282. /**
  3283. * Creates an array of the enumerable property names of the array-like `value`.
  3284. *
  3285. * @private
  3286. * @param {*} value The value to query.
  3287. * @param {boolean} inherited Specify returning inherited property names.
  3288. * @returns {Array} Returns the array of property names.
  3289. */
  3290. function arrayLikeKeys(value, inherited) {
  3291. var isArr = isArray(value),
  3292. isArg = !isArr && isArguments(value),
  3293. isBuff = !isArr && !isArg && isBuffer(value),
  3294. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3295. skipIndexes = isArr || isArg || isBuff || isType,
  3296. result = skipIndexes ? baseTimes(value.length, String) : [],
  3297. length = result.length;
  3298. for (var key in value) {
  3299. if ((inherited || hasOwnProperty.call(value, key)) &&
  3300. !(skipIndexes && (
  3301. // Safari 9 has enumerable `arguments.length` in strict mode.
  3302. key == 'length' ||
  3303. // Node.js 0.10 has enumerable non-index properties on buffers.
  3304. (isBuff && (key == 'offset' || key == 'parent')) ||
  3305. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3306. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3307. // Skip index properties.
  3308. isIndex(key, length)
  3309. ))) {
  3310. result.push(key);
  3311. }
  3312. }
  3313. return result;
  3314. }
  3315. /**
  3316. * A specialized version of `_.sample` for arrays.
  3317. *
  3318. * @private
  3319. * @param {Array} array The array to sample.
  3320. * @returns {*} Returns the random element.
  3321. */
  3322. function arraySample(array) {
  3323. var length = array.length;
  3324. return length ? array[baseRandom(0, length - 1)] : undefined;
  3325. }
  3326. /**
  3327. * A specialized version of `_.sampleSize` for arrays.
  3328. *
  3329. * @private
  3330. * @param {Array} array The array to sample.
  3331. * @param {number} n The number of elements to sample.
  3332. * @returns {Array} Returns the random elements.
  3333. */
  3334. function arraySampleSize(array, n) {
  3335. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3336. }
  3337. /**
  3338. * A specialized version of `_.shuffle` for arrays.
  3339. *
  3340. * @private
  3341. * @param {Array} array The array to shuffle.
  3342. * @returns {Array} Returns the new shuffled array.
  3343. */
  3344. function arrayShuffle(array) {
  3345. return shuffleSelf(copyArray(array));
  3346. }
  3347. /**
  3348. * This function is like `assignValue` except that it doesn't assign
  3349. * `undefined` values.
  3350. *
  3351. * @private
  3352. * @param {Object} object The object to modify.
  3353. * @param {string} key The key of the property to assign.
  3354. * @param {*} value The value to assign.
  3355. */
  3356. function assignMergeValue(object, key, value) {
  3357. if ((value !== undefined && !eq(object[key], value)) ||
  3358. (value === undefined && !(key in object))) {
  3359. baseAssignValue(object, key, value);
  3360. }
  3361. }
  3362. /**
  3363. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3364. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3365. * for equality comparisons.
  3366. *
  3367. * @private
  3368. * @param {Object} object The object to modify.
  3369. * @param {string} key The key of the property to assign.
  3370. * @param {*} value The value to assign.
  3371. */
  3372. function assignValue(object, key, value) {
  3373. var objValue = object[key];
  3374. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3375. (value === undefined && !(key in object))) {
  3376. baseAssignValue(object, key, value);
  3377. }
  3378. }
  3379. /**
  3380. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3381. *
  3382. * @private
  3383. * @param {Array} array The array to inspect.
  3384. * @param {*} key The key to search for.
  3385. * @returns {number} Returns the index of the matched value, else `-1`.
  3386. */
  3387. function assocIndexOf(array, key) {
  3388. var length = array.length;
  3389. while (length--) {
  3390. if (eq(array[length][0], key)) {
  3391. return length;
  3392. }
  3393. }
  3394. return -1;
  3395. }
  3396. /**
  3397. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3398. * by `iteratee` and values set by `setter`.
  3399. *
  3400. * @private
  3401. * @param {Array|Object} collection The collection to iterate over.
  3402. * @param {Function} setter The function to set `accumulator` values.
  3403. * @param {Function} iteratee The iteratee to transform keys.
  3404. * @param {Object} accumulator The initial aggregated object.
  3405. * @returns {Function} Returns `accumulator`.
  3406. */
  3407. function baseAggregator(collection, setter, iteratee, accumulator) {
  3408. baseEach(collection, function(value, key, collection) {
  3409. setter(accumulator, value, iteratee(value), collection);
  3410. });
  3411. return accumulator;
  3412. }
  3413. /**
  3414. * The base implementation of `_.assign` without support for multiple sources
  3415. * or `customizer` functions.
  3416. *
  3417. * @private
  3418. * @param {Object} object The destination object.
  3419. * @param {Object} source The source object.
  3420. * @returns {Object} Returns `object`.
  3421. */
  3422. function baseAssign(object, source) {
  3423. return object && copyObject(source, keys(source), object);
  3424. }
  3425. /**
  3426. * The base implementation of `_.assignIn` without support for multiple sources
  3427. * or `customizer` functions.
  3428. *
  3429. * @private
  3430. * @param {Object} object The destination object.
  3431. * @param {Object} source The source object.
  3432. * @returns {Object} Returns `object`.
  3433. */
  3434. function baseAssignIn(object, source) {
  3435. return object && copyObject(source, keysIn(source), object);
  3436. }
  3437. /**
  3438. * The base implementation of `assignValue` and `assignMergeValue` without
  3439. * value checks.
  3440. *
  3441. * @private
  3442. * @param {Object} object The object to modify.
  3443. * @param {string} key The key of the property to assign.
  3444. * @param {*} value The value to assign.
  3445. */
  3446. function baseAssignValue(object, key, value) {
  3447. if (key == '__proto__' && defineProperty) {
  3448. defineProperty(object, key, {
  3449. 'configurable': true,
  3450. 'enumerable': true,
  3451. 'value': value,
  3452. 'writable': true
  3453. });
  3454. } else {
  3455. object[key] = value;
  3456. }
  3457. }
  3458. /**
  3459. * The base implementation of `_.at` without support for individual paths.
  3460. *
  3461. * @private
  3462. * @param {Object} object The object to iterate over.
  3463. * @param {string[]} paths The property paths to pick.
  3464. * @returns {Array} Returns the picked elements.
  3465. */
  3466. function baseAt(object, paths) {
  3467. var index = -1,
  3468. length = paths.length,
  3469. result = Array(length),
  3470. skip = object == null;
  3471. while (++index < length) {
  3472. result[index] = skip ? undefined : get(object, paths[index]);
  3473. }
  3474. return result;
  3475. }
  3476. /**
  3477. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3478. *
  3479. * @private
  3480. * @param {number} number The number to clamp.
  3481. * @param {number} [lower] The lower bound.
  3482. * @param {number} upper The upper bound.
  3483. * @returns {number} Returns the clamped number.
  3484. */
  3485. function baseClamp(number, lower, upper) {
  3486. if (number === number) {
  3487. if (upper !== undefined) {
  3488. number = number <= upper ? number : upper;
  3489. }
  3490. if (lower !== undefined) {
  3491. number = number >= lower ? number : lower;
  3492. }
  3493. }
  3494. return number;
  3495. }
  3496. /**
  3497. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3498. * traversed objects.
  3499. *
  3500. * @private
  3501. * @param {*} value The value to clone.
  3502. * @param {boolean} bitmask The bitmask flags.
  3503. * 1 - Deep clone
  3504. * 2 - Flatten inherited properties
  3505. * 4 - Clone symbols
  3506. * @param {Function} [customizer] The function to customize cloning.
  3507. * @param {string} [key] The key of `value`.
  3508. * @param {Object} [object] The parent object of `value`.
  3509. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3510. * @returns {*} Returns the cloned value.
  3511. */
  3512. function baseClone(value, bitmask, customizer, key, object, stack) {
  3513. var result,
  3514. isDeep = bitmask & CLONE_DEEP_FLAG,
  3515. isFlat = bitmask & CLONE_FLAT_FLAG,
  3516. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3517. if (customizer) {
  3518. result = object ? customizer(value, key, object, stack) : customizer(value);
  3519. }
  3520. if (result !== undefined) {
  3521. return result;
  3522. }
  3523. if (!isObject(value)) {
  3524. return value;
  3525. }
  3526. var isArr = isArray(value);
  3527. if (isArr) {
  3528. result = initCloneArray(value);
  3529. if (!isDeep) {
  3530. return copyArray(value, result);
  3531. }
  3532. } else {
  3533. var tag = getTag(value),
  3534. isFunc = tag == funcTag || tag == genTag;
  3535. if (isBuffer(value)) {
  3536. return cloneBuffer(value, isDeep);
  3537. }
  3538. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3539. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3540. if (!isDeep) {
  3541. return isFlat
  3542. ? copySymbolsIn(value, baseAssignIn(result, value))
  3543. : copySymbols(value, baseAssign(result, value));
  3544. }
  3545. } else {
  3546. if (!cloneableTags[tag]) {
  3547. return object ? value : {};
  3548. }
  3549. result = initCloneByTag(value, tag, isDeep);
  3550. }
  3551. }
  3552. // Check for circular references and return its corresponding clone.
  3553. stack || (stack = new Stack);
  3554. var stacked = stack.get(value);
  3555. if (stacked) {
  3556. return stacked;
  3557. }
  3558. stack.set(value, result);
  3559. if (isSet(value)) {
  3560. value.forEach(function(subValue) {
  3561. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3562. });
  3563. } else if (isMap(value)) {
  3564. value.forEach(function(subValue, key) {
  3565. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3566. });
  3567. }
  3568. var keysFunc = isFull
  3569. ? (isFlat ? getAllKeysIn : getAllKeys)
  3570. : (isFlat ? keysIn : keys);
  3571. var props = isArr ? undefined : keysFunc(value);
  3572. arrayEach(props || value, function(subValue, key) {
  3573. if (props) {
  3574. key = subValue;
  3575. subValue = value[key];
  3576. }
  3577. // Recursively populate clone (susceptible to call stack limits).
  3578. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3579. });
  3580. return result;
  3581. }
  3582. /**
  3583. * The base implementation of `_.conforms` which doesn't clone `source`.
  3584. *
  3585. * @private
  3586. * @param {Object} source The object of property predicates to conform to.
  3587. * @returns {Function} Returns the new spec function.
  3588. */
  3589. function baseConforms(source) {
  3590. var props = keys(source);
  3591. return function(object) {
  3592. return baseConformsTo(object, source, props);
  3593. };
  3594. }
  3595. /**
  3596. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3597. *
  3598. * @private
  3599. * @param {Object} object The object to inspect.
  3600. * @param {Object} source The object of property predicates to conform to.
  3601. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3602. */
  3603. function baseConformsTo(object, source, props) {
  3604. var length = props.length;
  3605. if (object == null) {
  3606. return !length;
  3607. }
  3608. object = Object(object);
  3609. while (length--) {
  3610. var key = props[length],
  3611. predicate = source[key],
  3612. value = object[key];
  3613. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3614. return false;
  3615. }
  3616. }
  3617. return true;
  3618. }
  3619. /**
  3620. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3621. * to provide to `func`.
  3622. *
  3623. * @private
  3624. * @param {Function} func The function to delay.
  3625. * @param {number} wait The number of milliseconds to delay invocation.
  3626. * @param {Array} args The arguments to provide to `func`.
  3627. * @returns {number|Object} Returns the timer id or timeout object.
  3628. */
  3629. function baseDelay(func, wait, args) {
  3630. if (typeof func != 'function') {
  3631. throw new TypeError(FUNC_ERROR_TEXT);
  3632. }
  3633. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3634. }
  3635. /**
  3636. * The base implementation of methods like `_.difference` without support
  3637. * for excluding multiple arrays or iteratee shorthands.
  3638. *
  3639. * @private
  3640. * @param {Array} array The array to inspect.
  3641. * @param {Array} values The values to exclude.
  3642. * @param {Function} [iteratee] The iteratee invoked per element.
  3643. * @param {Function} [comparator] The comparator invoked per element.
  3644. * @returns {Array} Returns the new array of filtered values.
  3645. */
  3646. function baseDifference(array, values, iteratee, comparator) {
  3647. var index = -1,
  3648. includes = arrayIncludes,
  3649. isCommon = true,
  3650. length = array.length,
  3651. result = [],
  3652. valuesLength = values.length;
  3653. if (!length) {
  3654. return result;
  3655. }
  3656. if (iteratee) {
  3657. values = arrayMap(values, baseUnary(iteratee));
  3658. }
  3659. if (comparator) {
  3660. includes = arrayIncludesWith;
  3661. isCommon = false;
  3662. }
  3663. else if (values.length >= LARGE_ARRAY_SIZE) {
  3664. includes = cacheHas;
  3665. isCommon = false;
  3666. values = new SetCache(values);
  3667. }
  3668. outer:
  3669. while (++index < length) {
  3670. var value = array[index],
  3671. computed = iteratee == null ? value : iteratee(value);
  3672. value = (comparator || value !== 0) ? value : 0;
  3673. if (isCommon && computed === computed) {
  3674. var valuesIndex = valuesLength;
  3675. while (valuesIndex--) {
  3676. if (values[valuesIndex] === computed) {
  3677. continue outer;
  3678. }
  3679. }
  3680. result.push(value);
  3681. }
  3682. else if (!includes(values, computed, comparator)) {
  3683. result.push(value);
  3684. }
  3685. }
  3686. return result;
  3687. }
  3688. /**
  3689. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3690. *
  3691. * @private
  3692. * @param {Array|Object} collection The collection to iterate over.
  3693. * @param {Function} iteratee The function invoked per iteration.
  3694. * @returns {Array|Object} Returns `collection`.
  3695. */
  3696. var baseEach = createBaseEach(baseForOwn);
  3697. /**
  3698. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3699. *
  3700. * @private
  3701. * @param {Array|Object} collection The collection to iterate over.
  3702. * @param {Function} iteratee The function invoked per iteration.
  3703. * @returns {Array|Object} Returns `collection`.
  3704. */
  3705. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3706. /**
  3707. * The base implementation of `_.every` without support for iteratee shorthands.
  3708. *
  3709. * @private
  3710. * @param {Array|Object} collection The collection to iterate over.
  3711. * @param {Function} predicate The function invoked per iteration.
  3712. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3713. * else `false`
  3714. */
  3715. function baseEvery(collection, predicate) {
  3716. var result = true;
  3717. baseEach(collection, function(value, index, collection) {
  3718. result = !!predicate(value, index, collection);
  3719. return result;
  3720. });
  3721. return result;
  3722. }
  3723. /**
  3724. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3725. * `comparator` to determine the extremum value.
  3726. *
  3727. * @private
  3728. * @param {Array} array The array to iterate over.
  3729. * @param {Function} iteratee The iteratee invoked per iteration.
  3730. * @param {Function} comparator The comparator used to compare values.
  3731. * @returns {*} Returns the extremum value.
  3732. */
  3733. function baseExtremum(array, iteratee, comparator) {
  3734. var index = -1,
  3735. length = array.length;
  3736. while (++index < length) {
  3737. var value = array[index],
  3738. current = iteratee(value);
  3739. if (current != null && (computed === undefined
  3740. ? (current === current && !isSymbol(current))
  3741. : comparator(current, computed)
  3742. )) {
  3743. var computed = current,
  3744. result = value;
  3745. }
  3746. }
  3747. return result;
  3748. }
  3749. /**
  3750. * The base implementation of `_.fill` without an iteratee call guard.
  3751. *
  3752. * @private
  3753. * @param {Array} array The array to fill.
  3754. * @param {*} value The value to fill `array` with.
  3755. * @param {number} [start=0] The start position.
  3756. * @param {number} [end=array.length] The end position.
  3757. * @returns {Array} Returns `array`.
  3758. */
  3759. function baseFill(array, value, start, end) {
  3760. var length = array.length;
  3761. start = toInteger(start);
  3762. if (start < 0) {
  3763. start = -start > length ? 0 : (length + start);
  3764. }
  3765. end = (end === undefined || end > length) ? length : toInteger(end);
  3766. if (end < 0) {
  3767. end += length;
  3768. }
  3769. end = start > end ? 0 : toLength(end);
  3770. while (start < end) {
  3771. array[start++] = value;
  3772. }
  3773. return array;
  3774. }
  3775. /**
  3776. * The base implementation of `_.filter` 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 {Array} Returns the new filtered array.
  3782. */
  3783. function baseFilter(collection, predicate) {
  3784. var result = [];
  3785. baseEach(collection, function(value, index, collection) {
  3786. if (predicate(value, index, collection)) {
  3787. result.push(value);
  3788. }
  3789. });
  3790. return result;
  3791. }
  3792. /**
  3793. * The base implementation of `_.flatten` with support for restricting flattening.
  3794. *
  3795. * @private
  3796. * @param {Array} array The array to flatten.
  3797. * @param {number} depth The maximum recursion depth.
  3798. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3799. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3800. * @param {Array} [result=[]] The initial result value.
  3801. * @returns {Array} Returns the new flattened array.
  3802. */
  3803. function baseFlatten(array, depth, predicate, isStrict, result) {
  3804. var index = -1,
  3805. length = array.length;
  3806. predicate || (predicate = isFlattenable);
  3807. result || (result = []);
  3808. while (++index < length) {
  3809. var value = array[index];
  3810. if (depth > 0 && predicate(value)) {
  3811. if (depth > 1) {
  3812. // Recursively flatten arrays (susceptible to call stack limits).
  3813. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3814. } else {
  3815. arrayPush(result, value);
  3816. }
  3817. } else if (!isStrict) {
  3818. result[result.length] = value;
  3819. }
  3820. }
  3821. return result;
  3822. }
  3823. /**
  3824. * The base implementation of `baseForOwn` which iterates over `object`
  3825. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3826. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3827. *
  3828. * @private
  3829. * @param {Object} object The object to iterate over.
  3830. * @param {Function} iteratee The function invoked per iteration.
  3831. * @param {Function} keysFunc The function to get the keys of `object`.
  3832. * @returns {Object} Returns `object`.
  3833. */
  3834. var baseFor = createBaseFor();
  3835. /**
  3836. * This function is like `baseFor` except that it iterates over properties
  3837. * in the opposite order.
  3838. *
  3839. * @private
  3840. * @param {Object} object The object to iterate over.
  3841. * @param {Function} iteratee The function invoked per iteration.
  3842. * @param {Function} keysFunc The function to get the keys of `object`.
  3843. * @returns {Object} Returns `object`.
  3844. */
  3845. var baseForRight = createBaseFor(true);
  3846. /**
  3847. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3848. *
  3849. * @private
  3850. * @param {Object} object The object to iterate over.
  3851. * @param {Function} iteratee The function invoked per iteration.
  3852. * @returns {Object} Returns `object`.
  3853. */
  3854. function baseForOwn(object, iteratee) {
  3855. return object && baseFor(object, iteratee, keys);
  3856. }
  3857. /**
  3858. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3859. *
  3860. * @private
  3861. * @param {Object} object The object to iterate over.
  3862. * @param {Function} iteratee The function invoked per iteration.
  3863. * @returns {Object} Returns `object`.
  3864. */
  3865. function baseForOwnRight(object, iteratee) {
  3866. return object && baseForRight(object, iteratee, keys);
  3867. }
  3868. /**
  3869. * The base implementation of `_.functions` which creates an array of
  3870. * `object` function property names filtered from `props`.
  3871. *
  3872. * @private
  3873. * @param {Object} object The object to inspect.
  3874. * @param {Array} props The property names to filter.
  3875. * @returns {Array} Returns the function names.
  3876. */
  3877. function baseFunctions(object, props) {
  3878. return arrayFilter(props, function(key) {
  3879. return isFunction(object[key]);
  3880. });
  3881. }
  3882. /**
  3883. * The base implementation of `_.get` without support for default values.
  3884. *
  3885. * @private
  3886. * @param {Object} object The object to query.
  3887. * @param {Array|string} path The path of the property to get.
  3888. * @returns {*} Returns the resolved value.
  3889. */
  3890. function baseGet(object, path) {
  3891. path = castPath(path, object);
  3892. var index = 0,
  3893. length = path.length;
  3894. while (object != null && index < length) {
  3895. object = object[toKey(path[index++])];
  3896. }
  3897. return (index && index == length) ? object : undefined;
  3898. }
  3899. /**
  3900. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3901. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3902. * symbols of `object`.
  3903. *
  3904. * @private
  3905. * @param {Object} object The object to query.
  3906. * @param {Function} keysFunc The function to get the keys of `object`.
  3907. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3908. * @returns {Array} Returns the array of property names and symbols.
  3909. */
  3910. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3911. var result = keysFunc(object);
  3912. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3913. }
  3914. /**
  3915. * The base implementation of `getTag` without fallbacks for buggy environments.
  3916. *
  3917. * @private
  3918. * @param {*} value The value to query.
  3919. * @returns {string} Returns the `toStringTag`.
  3920. */
  3921. function baseGetTag(value) {
  3922. if (value == null) {
  3923. return value === undefined ? undefinedTag : nullTag;
  3924. }
  3925. return (symToStringTag && symToStringTag in Object(value))
  3926. ? getRawTag(value)
  3927. : objectToString(value);
  3928. }
  3929. /**
  3930. * The base implementation of `_.gt` which doesn't coerce arguments.
  3931. *
  3932. * @private
  3933. * @param {*} value The value to compare.
  3934. * @param {*} other The other value to compare.
  3935. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3936. * else `false`.
  3937. */
  3938. function baseGt(value, other) {
  3939. return value > other;
  3940. }
  3941. /**
  3942. * The base implementation of `_.has` without support for deep paths.
  3943. *
  3944. * @private
  3945. * @param {Object} [object] The object to query.
  3946. * @param {Array|string} key The key to check.
  3947. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3948. */
  3949. function baseHas(object, key) {
  3950. return object != null && hasOwnProperty.call(object, key);
  3951. }
  3952. /**
  3953. * The base implementation of `_.hasIn` without support for deep paths.
  3954. *
  3955. * @private
  3956. * @param {Object} [object] The object to query.
  3957. * @param {Array|string} key The key to check.
  3958. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3959. */
  3960. function baseHasIn(object, key) {
  3961. return object != null && key in Object(object);
  3962. }
  3963. /**
  3964. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3965. *
  3966. * @private
  3967. * @param {number} number The number to check.
  3968. * @param {number} start The start of the range.
  3969. * @param {number} end The end of the range.
  3970. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  3971. */
  3972. function baseInRange(number, start, end) {
  3973. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  3974. }
  3975. /**
  3976. * The base implementation of methods like `_.intersection`, without support
  3977. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3978. *
  3979. * @private
  3980. * @param {Array} arrays The arrays to inspect.
  3981. * @param {Function} [iteratee] The iteratee invoked per element.
  3982. * @param {Function} [comparator] The comparator invoked per element.
  3983. * @returns {Array} Returns the new array of shared values.
  3984. */
  3985. function baseIntersection(arrays, iteratee, comparator) {
  3986. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  3987. length = arrays[0].length,
  3988. othLength = arrays.length,
  3989. othIndex = othLength,
  3990. caches = Array(othLength),
  3991. maxLength = Infinity,
  3992. result = [];
  3993. while (othIndex--) {
  3994. var array = arrays[othIndex];
  3995. if (othIndex && iteratee) {
  3996. array = arrayMap(array, baseUnary(iteratee));
  3997. }
  3998. maxLength = nativeMin(array.length, maxLength);
  3999. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4000. ? new SetCache(othIndex && array)
  4001. : undefined;
  4002. }
  4003. array = arrays[0];
  4004. var index = -1,
  4005. seen = caches[0];
  4006. outer:
  4007. while (++index < length && result.length < maxLength) {
  4008. var value = array[index],
  4009. computed = iteratee ? iteratee(value) : value;
  4010. value = (comparator || value !== 0) ? value : 0;
  4011. if (!(seen
  4012. ? cacheHas(seen, computed)
  4013. : includes(result, computed, comparator)
  4014. )) {
  4015. othIndex = othLength;
  4016. while (--othIndex) {
  4017. var cache = caches[othIndex];
  4018. if (!(cache
  4019. ? cacheHas(cache, computed)
  4020. : includes(arrays[othIndex], computed, comparator))
  4021. ) {
  4022. continue outer;
  4023. }
  4024. }
  4025. if (seen) {
  4026. seen.push(computed);
  4027. }
  4028. result.push(value);
  4029. }
  4030. }
  4031. return result;
  4032. }
  4033. /**
  4034. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4035. * `object` with values transformed by `iteratee` and set by `setter`.
  4036. *
  4037. * @private
  4038. * @param {Object} object The object to iterate over.
  4039. * @param {Function} setter The function to set `accumulator` values.
  4040. * @param {Function} iteratee The iteratee to transform values.
  4041. * @param {Object} accumulator The initial inverted object.
  4042. * @returns {Function} Returns `accumulator`.
  4043. */
  4044. function baseInverter(object, setter, iteratee, accumulator) {
  4045. baseForOwn(object, function(value, key, object) {
  4046. setter(accumulator, iteratee(value), key, object);
  4047. });
  4048. return accumulator;
  4049. }
  4050. /**
  4051. * The base implementation of `_.invoke` without support for individual
  4052. * method arguments.
  4053. *
  4054. * @private
  4055. * @param {Object} object The object to query.
  4056. * @param {Array|string} path The path of the method to invoke.
  4057. * @param {Array} args The arguments to invoke the method with.
  4058. * @returns {*} Returns the result of the invoked method.
  4059. */
  4060. function baseInvoke(object, path, args) {
  4061. path = castPath(path, object);
  4062. object = parent(object, path);
  4063. var func = object == null ? object : object[toKey(last(path))];
  4064. return func == null ? undefined : apply(func, object, args);
  4065. }
  4066. /**
  4067. * The base implementation of `_.isArguments`.
  4068. *
  4069. * @private
  4070. * @param {*} value The value to check.
  4071. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4072. */
  4073. function baseIsArguments(value) {
  4074. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4075. }
  4076. /**
  4077. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4078. *
  4079. * @private
  4080. * @param {*} value The value to check.
  4081. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4082. */
  4083. function baseIsArrayBuffer(value) {
  4084. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4085. }
  4086. /**
  4087. * The base implementation of `_.isDate` without Node.js optimizations.
  4088. *
  4089. * @private
  4090. * @param {*} value The value to check.
  4091. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4092. */
  4093. function baseIsDate(value) {
  4094. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4095. }
  4096. /**
  4097. * The base implementation of `_.isEqual` which supports partial comparisons
  4098. * and tracks traversed objects.
  4099. *
  4100. * @private
  4101. * @param {*} value The value to compare.
  4102. * @param {*} other The other value to compare.
  4103. * @param {boolean} bitmask The bitmask flags.
  4104. * 1 - Unordered comparison
  4105. * 2 - Partial comparison
  4106. * @param {Function} [customizer] The function to customize comparisons.
  4107. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4108. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4109. */
  4110. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4111. if (value === other) {
  4112. return true;
  4113. }
  4114. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4115. return value !== value && other !== other;
  4116. }
  4117. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4118. }
  4119. /**
  4120. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4121. * deep comparisons and tracks traversed objects enabling objects with circular
  4122. * references to be compared.
  4123. *
  4124. * @private
  4125. * @param {Object} object The object to compare.
  4126. * @param {Object} other The other object to compare.
  4127. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4128. * @param {Function} customizer The function to customize comparisons.
  4129. * @param {Function} equalFunc The function to determine equivalents of values.
  4130. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4131. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4132. */
  4133. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4134. var objIsArr = isArray(object),
  4135. othIsArr = isArray(other),
  4136. objTag = objIsArr ? arrayTag : getTag(object),
  4137. othTag = othIsArr ? arrayTag : getTag(other);
  4138. objTag = objTag == argsTag ? objectTag : objTag;
  4139. othTag = othTag == argsTag ? objectTag : othTag;
  4140. var objIsObj = objTag == objectTag,
  4141. othIsObj = othTag == objectTag,
  4142. isSameTag = objTag == othTag;
  4143. if (isSameTag && isBuffer(object)) {
  4144. if (!isBuffer(other)) {
  4145. return false;
  4146. }
  4147. objIsArr = true;
  4148. objIsObj = false;
  4149. }
  4150. if (isSameTag && !objIsObj) {
  4151. stack || (stack = new Stack);
  4152. return (objIsArr || isTypedArray(object))
  4153. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4154. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4155. }
  4156. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4157. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4158. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4159. if (objIsWrapped || othIsWrapped) {
  4160. var objUnwrapped = objIsWrapped ? object.value() : object,
  4161. othUnwrapped = othIsWrapped ? other.value() : other;
  4162. stack || (stack = new Stack);
  4163. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4164. }
  4165. }
  4166. if (!isSameTag) {
  4167. return false;
  4168. }
  4169. stack || (stack = new Stack);
  4170. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4171. }
  4172. /**
  4173. * The base implementation of `_.isMap` without Node.js optimizations.
  4174. *
  4175. * @private
  4176. * @param {*} value The value to check.
  4177. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4178. */
  4179. function baseIsMap(value) {
  4180. return isObjectLike(value) && getTag(value) == mapTag;
  4181. }
  4182. /**
  4183. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4184. *
  4185. * @private
  4186. * @param {Object} object The object to inspect.
  4187. * @param {Object} source The object of property values to match.
  4188. * @param {Array} matchData The property names, values, and compare flags to match.
  4189. * @param {Function} [customizer] The function to customize comparisons.
  4190. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4191. */
  4192. function baseIsMatch(object, source, matchData, customizer) {
  4193. var index = matchData.length,
  4194. length = index,
  4195. noCustomizer = !customizer;
  4196. if (object == null) {
  4197. return !length;
  4198. }
  4199. object = Object(object);
  4200. while (index--) {
  4201. var data = matchData[index];
  4202. if ((noCustomizer && data[2])
  4203. ? data[1] !== object[data[0]]
  4204. : !(data[0] in object)
  4205. ) {
  4206. return false;
  4207. }
  4208. }
  4209. while (++index < length) {
  4210. data = matchData[index];
  4211. var key = data[0],
  4212. objValue = object[key],
  4213. srcValue = data[1];
  4214. if (noCustomizer && data[2]) {
  4215. if (objValue === undefined && !(key in object)) {
  4216. return false;
  4217. }
  4218. } else {
  4219. var stack = new Stack;
  4220. if (customizer) {
  4221. var result = customizer(objValue, srcValue, key, object, source, stack);
  4222. }
  4223. if (!(result === undefined
  4224. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4225. : result
  4226. )) {
  4227. return false;
  4228. }
  4229. }
  4230. }
  4231. return true;
  4232. }
  4233. /**
  4234. * The base implementation of `_.isNative` without bad shim checks.
  4235. *
  4236. * @private
  4237. * @param {*} value The value to check.
  4238. * @returns {boolean} Returns `true` if `value` is a native function,
  4239. * else `false`.
  4240. */
  4241. function baseIsNative(value) {
  4242. if (!isObject(value) || isMasked(value)) {
  4243. return false;
  4244. }
  4245. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4246. return pattern.test(toSource(value));
  4247. }
  4248. /**
  4249. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4250. *
  4251. * @private
  4252. * @param {*} value The value to check.
  4253. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4254. */
  4255. function baseIsRegExp(value) {
  4256. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4257. }
  4258. /**
  4259. * The base implementation of `_.isSet` without Node.js optimizations.
  4260. *
  4261. * @private
  4262. * @param {*} value The value to check.
  4263. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4264. */
  4265. function baseIsSet(value) {
  4266. return isObjectLike(value) && getTag(value) == setTag;
  4267. }
  4268. /**
  4269. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4270. *
  4271. * @private
  4272. * @param {*} value The value to check.
  4273. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4274. */
  4275. function baseIsTypedArray(value) {
  4276. return isObjectLike(value) &&
  4277. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4278. }
  4279. /**
  4280. * The base implementation of `_.iteratee`.
  4281. *
  4282. * @private
  4283. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4284. * @returns {Function} Returns the iteratee.
  4285. */
  4286. function baseIteratee(value) {
  4287. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4288. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4289. if (typeof value == 'function') {
  4290. return value;
  4291. }
  4292. if (value == null) {
  4293. return identity;
  4294. }
  4295. if (typeof value == 'object') {
  4296. return isArray(value)
  4297. ? baseMatchesProperty(value[0], value[1])
  4298. : baseMatches(value);
  4299. }
  4300. return property(value);
  4301. }
  4302. /**
  4303. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4304. *
  4305. * @private
  4306. * @param {Object} object The object to query.
  4307. * @returns {Array} Returns the array of property names.
  4308. */
  4309. function baseKeys(object) {
  4310. if (!isPrototype(object)) {
  4311. return nativeKeys(object);
  4312. }
  4313. var result = [];
  4314. for (var key in Object(object)) {
  4315. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4316. result.push(key);
  4317. }
  4318. }
  4319. return result;
  4320. }
  4321. /**
  4322. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4323. *
  4324. * @private
  4325. * @param {Object} object The object to query.
  4326. * @returns {Array} Returns the array of property names.
  4327. */
  4328. function baseKeysIn(object) {
  4329. if (!isObject(object)) {
  4330. return nativeKeysIn(object);
  4331. }
  4332. var isProto = isPrototype(object),
  4333. result = [];
  4334. for (var key in object) {
  4335. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4336. result.push(key);
  4337. }
  4338. }
  4339. return result;
  4340. }
  4341. /**
  4342. * The base implementation of `_.lt` which doesn't coerce arguments.
  4343. *
  4344. * @private
  4345. * @param {*} value The value to compare.
  4346. * @param {*} other The other value to compare.
  4347. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4348. * else `false`.
  4349. */
  4350. function baseLt(value, other) {
  4351. return value < other;
  4352. }
  4353. /**
  4354. * The base implementation of `_.map` without support for iteratee shorthands.
  4355. *
  4356. * @private
  4357. * @param {Array|Object} collection The collection to iterate over.
  4358. * @param {Function} iteratee The function invoked per iteration.
  4359. * @returns {Array} Returns the new mapped array.
  4360. */
  4361. function baseMap(collection, iteratee) {
  4362. var index = -1,
  4363. result = isArrayLike(collection) ? Array(collection.length) : [];
  4364. baseEach(collection, function(value, key, collection) {
  4365. result[++index] = iteratee(value, key, collection);
  4366. });
  4367. return result;
  4368. }
  4369. /**
  4370. * The base implementation of `_.matches` which doesn't clone `source`.
  4371. *
  4372. * @private
  4373. * @param {Object} source The object of property values to match.
  4374. * @returns {Function} Returns the new spec function.
  4375. */
  4376. function baseMatches(source) {
  4377. var matchData = getMatchData(source);
  4378. if (matchData.length == 1 && matchData[0][2]) {
  4379. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4380. }
  4381. return function(object) {
  4382. return object === source || baseIsMatch(object, source, matchData);
  4383. };
  4384. }
  4385. /**
  4386. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4387. *
  4388. * @private
  4389. * @param {string} path The path of the property to get.
  4390. * @param {*} srcValue The value to match.
  4391. * @returns {Function} Returns the new spec function.
  4392. */
  4393. function baseMatchesProperty(path, srcValue) {
  4394. if (isKey(path) && isStrictComparable(srcValue)) {
  4395. return matchesStrictComparable(toKey(path), srcValue);
  4396. }
  4397. return function(object) {
  4398. var objValue = get(object, path);
  4399. return (objValue === undefined && objValue === srcValue)
  4400. ? hasIn(object, path)
  4401. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4402. };
  4403. }
  4404. /**
  4405. * The base implementation of `_.merge` without support for multiple sources.
  4406. *
  4407. * @private
  4408. * @param {Object} object The destination object.
  4409. * @param {Object} source The source object.
  4410. * @param {number} srcIndex The index of `source`.
  4411. * @param {Function} [customizer] The function to customize merged values.
  4412. * @param {Object} [stack] Tracks traversed source values and their merged
  4413. * counterparts.
  4414. */
  4415. function baseMerge(object, source, srcIndex, customizer, stack) {
  4416. if (object === source) {
  4417. return;
  4418. }
  4419. baseFor(source, function(srcValue, key) {
  4420. stack || (stack = new Stack);
  4421. if (isObject(srcValue)) {
  4422. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4423. }
  4424. else {
  4425. var newValue = customizer
  4426. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4427. : undefined;
  4428. if (newValue === undefined) {
  4429. newValue = srcValue;
  4430. }
  4431. assignMergeValue(object, key, newValue);
  4432. }
  4433. }, keysIn);
  4434. }
  4435. /**
  4436. * A specialized version of `baseMerge` for arrays and objects which performs
  4437. * deep merges and tracks traversed objects enabling objects with circular
  4438. * references to be merged.
  4439. *
  4440. * @private
  4441. * @param {Object} object The destination object.
  4442. * @param {Object} source The source object.
  4443. * @param {string} key The key of the value to merge.
  4444. * @param {number} srcIndex The index of `source`.
  4445. * @param {Function} mergeFunc The function to merge values.
  4446. * @param {Function} [customizer] The function to customize assigned values.
  4447. * @param {Object} [stack] Tracks traversed source values and their merged
  4448. * counterparts.
  4449. */
  4450. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4451. var objValue = safeGet(object, key),
  4452. srcValue = safeGet(source, key),
  4453. stacked = stack.get(srcValue);
  4454. if (stacked) {
  4455. assignMergeValue(object, key, stacked);
  4456. return;
  4457. }
  4458. var newValue = customizer
  4459. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4460. : undefined;
  4461. var isCommon = newValue === undefined;
  4462. if (isCommon) {
  4463. var isArr = isArray(srcValue),
  4464. isBuff = !isArr && isBuffer(srcValue),
  4465. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4466. newValue = srcValue;
  4467. if (isArr || isBuff || isTyped) {
  4468. if (isArray(objValue)) {
  4469. newValue = objValue;
  4470. }
  4471. else if (isArrayLikeObject(objValue)) {
  4472. newValue = copyArray(objValue);
  4473. }
  4474. else if (isBuff) {
  4475. isCommon = false;
  4476. newValue = cloneBuffer(srcValue, true);
  4477. }
  4478. else if (isTyped) {
  4479. isCommon = false;
  4480. newValue = cloneTypedArray(srcValue, true);
  4481. }
  4482. else {
  4483. newValue = [];
  4484. }
  4485. }
  4486. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4487. newValue = objValue;
  4488. if (isArguments(objValue)) {
  4489. newValue = toPlainObject(objValue);
  4490. }
  4491. else if (!isObject(objValue) || isFunction(objValue)) {
  4492. newValue = initCloneObject(srcValue);
  4493. }
  4494. }
  4495. else {
  4496. isCommon = false;
  4497. }
  4498. }
  4499. if (isCommon) {
  4500. // Recursively merge objects and arrays (susceptible to call stack limits).
  4501. stack.set(srcValue, newValue);
  4502. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4503. stack['delete'](srcValue);
  4504. }
  4505. assignMergeValue(object, key, newValue);
  4506. }
  4507. /**
  4508. * The base implementation of `_.nth` which doesn't coerce arguments.
  4509. *
  4510. * @private
  4511. * @param {Array} array The array to query.
  4512. * @param {number} n The index of the element to return.
  4513. * @returns {*} Returns the nth element of `array`.
  4514. */
  4515. function baseNth(array, n) {
  4516. var length = array.length;
  4517. if (!length) {
  4518. return;
  4519. }
  4520. n += n < 0 ? length : 0;
  4521. return isIndex(n, length) ? array[n] : undefined;
  4522. }
  4523. /**
  4524. * The base implementation of `_.orderBy` without param guards.
  4525. *
  4526. * @private
  4527. * @param {Array|Object} collection The collection to iterate over.
  4528. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4529. * @param {string[]} orders The sort orders of `iteratees`.
  4530. * @returns {Array} Returns the new sorted array.
  4531. */
  4532. function baseOrderBy(collection, iteratees, orders) {
  4533. if (iteratees.length) {
  4534. iteratees = arrayMap(iteratees, function(iteratee) {
  4535. if (isArray(iteratee)) {
  4536. return function(value) {
  4537. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4538. }
  4539. }
  4540. return iteratee;
  4541. });
  4542. } else {
  4543. iteratees = [identity];
  4544. }
  4545. var index = -1;
  4546. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4547. var result = baseMap(collection, function(value, key, collection) {
  4548. var criteria = arrayMap(iteratees, function(iteratee) {
  4549. return iteratee(value);
  4550. });
  4551. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4552. });
  4553. return baseSortBy(result, function(object, other) {
  4554. return compareMultiple(object, other, orders);
  4555. });
  4556. }
  4557. /**
  4558. * The base implementation of `_.pick` without support for individual
  4559. * property identifiers.
  4560. *
  4561. * @private
  4562. * @param {Object} object The source object.
  4563. * @param {string[]} paths The property paths to pick.
  4564. * @returns {Object} Returns the new object.
  4565. */
  4566. function basePick(object, paths) {
  4567. return basePickBy(object, paths, function(value, path) {
  4568. return hasIn(object, path);
  4569. });
  4570. }
  4571. /**
  4572. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4573. *
  4574. * @private
  4575. * @param {Object} object The source object.
  4576. * @param {string[]} paths The property paths to pick.
  4577. * @param {Function} predicate The function invoked per property.
  4578. * @returns {Object} Returns the new object.
  4579. */
  4580. function basePickBy(object, paths, predicate) {
  4581. var index = -1,
  4582. length = paths.length,
  4583. result = {};
  4584. while (++index < length) {
  4585. var path = paths[index],
  4586. value = baseGet(object, path);
  4587. if (predicate(value, path)) {
  4588. baseSet(result, castPath(path, object), value);
  4589. }
  4590. }
  4591. return result;
  4592. }
  4593. /**
  4594. * A specialized version of `baseProperty` which supports deep paths.
  4595. *
  4596. * @private
  4597. * @param {Array|string} path The path of the property to get.
  4598. * @returns {Function} Returns the new accessor function.
  4599. */
  4600. function basePropertyDeep(path) {
  4601. return function(object) {
  4602. return baseGet(object, path);
  4603. };
  4604. }
  4605. /**
  4606. * The base implementation of `_.pullAllBy` without support for iteratee
  4607. * shorthands.
  4608. *
  4609. * @private
  4610. * @param {Array} array The array to modify.
  4611. * @param {Array} values The values to remove.
  4612. * @param {Function} [iteratee] The iteratee invoked per element.
  4613. * @param {Function} [comparator] The comparator invoked per element.
  4614. * @returns {Array} Returns `array`.
  4615. */
  4616. function basePullAll(array, values, iteratee, comparator) {
  4617. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4618. index = -1,
  4619. length = values.length,
  4620. seen = array;
  4621. if (array === values) {
  4622. values = copyArray(values);
  4623. }
  4624. if (iteratee) {
  4625. seen = arrayMap(array, baseUnary(iteratee));
  4626. }
  4627. while (++index < length) {
  4628. var fromIndex = 0,
  4629. value = values[index],
  4630. computed = iteratee ? iteratee(value) : value;
  4631. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4632. if (seen !== array) {
  4633. splice.call(seen, fromIndex, 1);
  4634. }
  4635. splice.call(array, fromIndex, 1);
  4636. }
  4637. }
  4638. return array;
  4639. }
  4640. /**
  4641. * The base implementation of `_.pullAt` without support for individual
  4642. * indexes or capturing the removed elements.
  4643. *
  4644. * @private
  4645. * @param {Array} array The array to modify.
  4646. * @param {number[]} indexes The indexes of elements to remove.
  4647. * @returns {Array} Returns `array`.
  4648. */
  4649. function basePullAt(array, indexes) {
  4650. var length = array ? indexes.length : 0,
  4651. lastIndex = length - 1;
  4652. while (length--) {
  4653. var index = indexes[length];
  4654. if (length == lastIndex || index !== previous) {
  4655. var previous = index;
  4656. if (isIndex(index)) {
  4657. splice.call(array, index, 1);
  4658. } else {
  4659. baseUnset(array, index);
  4660. }
  4661. }
  4662. }
  4663. return array;
  4664. }
  4665. /**
  4666. * The base implementation of `_.random` without support for returning
  4667. * floating-point numbers.
  4668. *
  4669. * @private
  4670. * @param {number} lower The lower bound.
  4671. * @param {number} upper The upper bound.
  4672. * @returns {number} Returns the random number.
  4673. */
  4674. function baseRandom(lower, upper) {
  4675. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4676. }
  4677. /**
  4678. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4679. * coerce arguments.
  4680. *
  4681. * @private
  4682. * @param {number} start The start of the range.
  4683. * @param {number} end The end of the range.
  4684. * @param {number} step The value to increment or decrement by.
  4685. * @param {boolean} [fromRight] Specify iterating from right to left.
  4686. * @returns {Array} Returns the range of numbers.
  4687. */
  4688. function baseRange(start, end, step, fromRight) {
  4689. var index = -1,
  4690. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4691. result = Array(length);
  4692. while (length--) {
  4693. result[fromRight ? length : ++index] = start;
  4694. start += step;
  4695. }
  4696. return result;
  4697. }
  4698. /**
  4699. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4700. *
  4701. * @private
  4702. * @param {string} string The string to repeat.
  4703. * @param {number} n The number of times to repeat the string.
  4704. * @returns {string} Returns the repeated string.
  4705. */
  4706. function baseRepeat(string, n) {
  4707. var result = '';
  4708. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4709. return result;
  4710. }
  4711. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4712. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4713. do {
  4714. if (n % 2) {
  4715. result += string;
  4716. }
  4717. n = nativeFloor(n / 2);
  4718. if (n) {
  4719. string += string;
  4720. }
  4721. } while (n);
  4722. return result;
  4723. }
  4724. /**
  4725. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4726. *
  4727. * @private
  4728. * @param {Function} func The function to apply a rest parameter to.
  4729. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4730. * @returns {Function} Returns the new function.
  4731. */
  4732. function baseRest(func, start) {
  4733. return setToString(overRest(func, start, identity), func + '');
  4734. }
  4735. /**
  4736. * The base implementation of `_.sample`.
  4737. *
  4738. * @private
  4739. * @param {Array|Object} collection The collection to sample.
  4740. * @returns {*} Returns the random element.
  4741. */
  4742. function baseSample(collection) {
  4743. return arraySample(values(collection));
  4744. }
  4745. /**
  4746. * The base implementation of `_.sampleSize` without param guards.
  4747. *
  4748. * @private
  4749. * @param {Array|Object} collection The collection to sample.
  4750. * @param {number} n The number of elements to sample.
  4751. * @returns {Array} Returns the random elements.
  4752. */
  4753. function baseSampleSize(collection, n) {
  4754. var array = values(collection);
  4755. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4756. }
  4757. /**
  4758. * The base implementation of `_.set`.
  4759. *
  4760. * @private
  4761. * @param {Object} object The object to modify.
  4762. * @param {Array|string} path The path of the property to set.
  4763. * @param {*} value The value to set.
  4764. * @param {Function} [customizer] The function to customize path creation.
  4765. * @returns {Object} Returns `object`.
  4766. */
  4767. function baseSet(object, path, value, customizer) {
  4768. if (!isObject(object)) {
  4769. return object;
  4770. }
  4771. path = castPath(path, object);
  4772. var index = -1,
  4773. length = path.length,
  4774. lastIndex = length - 1,
  4775. nested = object;
  4776. while (nested != null && ++index < length) {
  4777. var key = toKey(path[index]),
  4778. newValue = value;
  4779. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4780. return object;
  4781. }
  4782. if (index != lastIndex) {
  4783. var objValue = nested[key];
  4784. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4785. if (newValue === undefined) {
  4786. newValue = isObject(objValue)
  4787. ? objValue
  4788. : (isIndex(path[index + 1]) ? [] : {});
  4789. }
  4790. }
  4791. assignValue(nested, key, newValue);
  4792. nested = nested[key];
  4793. }
  4794. return object;
  4795. }
  4796. /**
  4797. * The base implementation of `setData` without support for hot loop shorting.
  4798. *
  4799. * @private
  4800. * @param {Function} func The function to associate metadata with.
  4801. * @param {*} data The metadata.
  4802. * @returns {Function} Returns `func`.
  4803. */
  4804. var baseSetData = !metaMap ? identity : function(func, data) {
  4805. metaMap.set(func, data);
  4806. return func;
  4807. };
  4808. /**
  4809. * The base implementation of `setToString` without support for hot loop shorting.
  4810. *
  4811. * @private
  4812. * @param {Function} func The function to modify.
  4813. * @param {Function} string The `toString` result.
  4814. * @returns {Function} Returns `func`.
  4815. */
  4816. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4817. return defineProperty(func, 'toString', {
  4818. 'configurable': true,
  4819. 'enumerable': false,
  4820. 'value': constant(string),
  4821. 'writable': true
  4822. });
  4823. };
  4824. /**
  4825. * The base implementation of `_.shuffle`.
  4826. *
  4827. * @private
  4828. * @param {Array|Object} collection The collection to shuffle.
  4829. * @returns {Array} Returns the new shuffled array.
  4830. */
  4831. function baseShuffle(collection) {
  4832. return shuffleSelf(values(collection));
  4833. }
  4834. /**
  4835. * The base implementation of `_.slice` without an iteratee call guard.
  4836. *
  4837. * @private
  4838. * @param {Array} array The array to slice.
  4839. * @param {number} [start=0] The start position.
  4840. * @param {number} [end=array.length] The end position.
  4841. * @returns {Array} Returns the slice of `array`.
  4842. */
  4843. function baseSlice(array, start, end) {
  4844. var index = -1,
  4845. length = array.length;
  4846. if (start < 0) {
  4847. start = -start > length ? 0 : (length + start);
  4848. }
  4849. end = end > length ? length : end;
  4850. if (end < 0) {
  4851. end += length;
  4852. }
  4853. length = start > end ? 0 : ((end - start) >>> 0);
  4854. start >>>= 0;
  4855. var result = Array(length);
  4856. while (++index < length) {
  4857. result[index] = array[index + start];
  4858. }
  4859. return result;
  4860. }
  4861. /**
  4862. * The base implementation of `_.some` without support for iteratee shorthands.
  4863. *
  4864. * @private
  4865. * @param {Array|Object} collection The collection to iterate over.
  4866. * @param {Function} predicate The function invoked per iteration.
  4867. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4868. * else `false`.
  4869. */
  4870. function baseSome(collection, predicate) {
  4871. var result;
  4872. baseEach(collection, function(value, index, collection) {
  4873. result = predicate(value, index, collection);
  4874. return !result;
  4875. });
  4876. return !!result;
  4877. }
  4878. /**
  4879. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4880. * performs a binary search of `array` to determine the index at which `value`
  4881. * should be inserted into `array` in order to maintain its sort order.
  4882. *
  4883. * @private
  4884. * @param {Array} array The sorted array to inspect.
  4885. * @param {*} value The value to evaluate.
  4886. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4887. * @returns {number} Returns the index at which `value` should be inserted
  4888. * into `array`.
  4889. */
  4890. function baseSortedIndex(array, value, retHighest) {
  4891. var low = 0,
  4892. high = array == null ? low : array.length;
  4893. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4894. while (low < high) {
  4895. var mid = (low + high) >>> 1,
  4896. computed = array[mid];
  4897. if (computed !== null && !isSymbol(computed) &&
  4898. (retHighest ? (computed <= value) : (computed < value))) {
  4899. low = mid + 1;
  4900. } else {
  4901. high = mid;
  4902. }
  4903. }
  4904. return high;
  4905. }
  4906. return baseSortedIndexBy(array, value, identity, retHighest);
  4907. }
  4908. /**
  4909. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4910. * which invokes `iteratee` for `value` and each element of `array` to compute
  4911. * their sort ranking. The iteratee is invoked with one argument; (value).
  4912. *
  4913. * @private
  4914. * @param {Array} array The sorted array to inspect.
  4915. * @param {*} value The value to evaluate.
  4916. * @param {Function} iteratee The iteratee invoked per element.
  4917. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4918. * @returns {number} Returns the index at which `value` should be inserted
  4919. * into `array`.
  4920. */
  4921. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4922. var low = 0,
  4923. high = array == null ? 0 : array.length;
  4924. if (high === 0) {
  4925. return 0;
  4926. }
  4927. value = iteratee(value);
  4928. var valIsNaN = value !== value,
  4929. valIsNull = value === null,
  4930. valIsSymbol = isSymbol(value),
  4931. valIsUndefined = value === undefined;
  4932. while (low < high) {
  4933. var mid = nativeFloor((low + high) / 2),
  4934. computed = iteratee(array[mid]),
  4935. othIsDefined = computed !== undefined,
  4936. othIsNull = computed === null,
  4937. othIsReflexive = computed === computed,
  4938. othIsSymbol = isSymbol(computed);
  4939. if (valIsNaN) {
  4940. var setLow = retHighest || othIsReflexive;
  4941. } else if (valIsUndefined) {
  4942. setLow = othIsReflexive && (retHighest || othIsDefined);
  4943. } else if (valIsNull) {
  4944. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4945. } else if (valIsSymbol) {
  4946. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4947. } else if (othIsNull || othIsSymbol) {
  4948. setLow = false;
  4949. } else {
  4950. setLow = retHighest ? (computed <= value) : (computed < value);
  4951. }
  4952. if (setLow) {
  4953. low = mid + 1;
  4954. } else {
  4955. high = mid;
  4956. }
  4957. }
  4958. return nativeMin(high, MAX_ARRAY_INDEX);
  4959. }
  4960. /**
  4961. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4962. * support for iteratee shorthands.
  4963. *
  4964. * @private
  4965. * @param {Array} array The array to inspect.
  4966. * @param {Function} [iteratee] The iteratee invoked per element.
  4967. * @returns {Array} Returns the new duplicate free array.
  4968. */
  4969. function baseSortedUniq(array, iteratee) {
  4970. var index = -1,
  4971. length = array.length,
  4972. resIndex = 0,
  4973. result = [];
  4974. while (++index < length) {
  4975. var value = array[index],
  4976. computed = iteratee ? iteratee(value) : value;
  4977. if (!index || !eq(computed, seen)) {
  4978. var seen = computed;
  4979. result[resIndex++] = value === 0 ? 0 : value;
  4980. }
  4981. }
  4982. return result;
  4983. }
  4984. /**
  4985. * The base implementation of `_.toNumber` which doesn't ensure correct
  4986. * conversions of binary, hexadecimal, or octal string values.
  4987. *
  4988. * @private
  4989. * @param {*} value The value to process.
  4990. * @returns {number} Returns the number.
  4991. */
  4992. function baseToNumber(value) {
  4993. if (typeof value == 'number') {
  4994. return value;
  4995. }
  4996. if (isSymbol(value)) {
  4997. return NAN;
  4998. }
  4999. return +value;
  5000. }
  5001. /**
  5002. * The base implementation of `_.toString` which doesn't convert nullish
  5003. * values to empty strings.
  5004. *
  5005. * @private
  5006. * @param {*} value The value to process.
  5007. * @returns {string} Returns the string.
  5008. */
  5009. function baseToString(value) {
  5010. // Exit early for strings to avoid a performance hit in some environments.
  5011. if (typeof value == 'string') {
  5012. return value;
  5013. }
  5014. if (isArray(value)) {
  5015. // Recursively convert values (susceptible to call stack limits).
  5016. return arrayMap(value, baseToString) + '';
  5017. }
  5018. if (isSymbol(value)) {
  5019. return symbolToString ? symbolToString.call(value) : '';
  5020. }
  5021. var result = (value + '');
  5022. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5023. }
  5024. /**
  5025. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5026. *
  5027. * @private
  5028. * @param {Array} array The array to inspect.
  5029. * @param {Function} [iteratee] The iteratee invoked per element.
  5030. * @param {Function} [comparator] The comparator invoked per element.
  5031. * @returns {Array} Returns the new duplicate free array.
  5032. */
  5033. function baseUniq(array, iteratee, comparator) {
  5034. var index = -1,
  5035. includes = arrayIncludes,
  5036. length = array.length,
  5037. isCommon = true,
  5038. result = [],
  5039. seen = result;
  5040. if (comparator) {
  5041. isCommon = false;
  5042. includes = arrayIncludesWith;
  5043. }
  5044. else if (length >= LARGE_ARRAY_SIZE) {
  5045. var set = iteratee ? null : createSet(array);
  5046. if (set) {
  5047. return setToArray(set);
  5048. }
  5049. isCommon = false;
  5050. includes = cacheHas;
  5051. seen = new SetCache;
  5052. }
  5053. else {
  5054. seen = iteratee ? [] : result;
  5055. }
  5056. outer:
  5057. while (++index < length) {
  5058. var value = array[index],
  5059. computed = iteratee ? iteratee(value) : value;
  5060. value = (comparator || value !== 0) ? value : 0;
  5061. if (isCommon && computed === computed) {
  5062. var seenIndex = seen.length;
  5063. while (seenIndex--) {
  5064. if (seen[seenIndex] === computed) {
  5065. continue outer;
  5066. }
  5067. }
  5068. if (iteratee) {
  5069. seen.push(computed);
  5070. }
  5071. result.push(value);
  5072. }
  5073. else if (!includes(seen, computed, comparator)) {
  5074. if (seen !== result) {
  5075. seen.push(computed);
  5076. }
  5077. result.push(value);
  5078. }
  5079. }
  5080. return result;
  5081. }
  5082. /**
  5083. * The base implementation of `_.unset`.
  5084. *
  5085. * @private
  5086. * @param {Object} object The object to modify.
  5087. * @param {Array|string} path The property path to unset.
  5088. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5089. */
  5090. function baseUnset(object, path) {
  5091. path = castPath(path, object);
  5092. object = parent(object, path);
  5093. return object == null || delete object[toKey(last(path))];
  5094. }
  5095. /**
  5096. * The base implementation of `_.update`.
  5097. *
  5098. * @private
  5099. * @param {Object} object The object to modify.
  5100. * @param {Array|string} path The path of the property to update.
  5101. * @param {Function} updater The function to produce the updated value.
  5102. * @param {Function} [customizer] The function to customize path creation.
  5103. * @returns {Object} Returns `object`.
  5104. */
  5105. function baseUpdate(object, path, updater, customizer) {
  5106. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5107. }
  5108. /**
  5109. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5110. * without support for iteratee shorthands.
  5111. *
  5112. * @private
  5113. * @param {Array} array The array to query.
  5114. * @param {Function} predicate The function invoked per iteration.
  5115. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5116. * @param {boolean} [fromRight] Specify iterating from right to left.
  5117. * @returns {Array} Returns the slice of `array`.
  5118. */
  5119. function baseWhile(array, predicate, isDrop, fromRight) {
  5120. var length = array.length,
  5121. index = fromRight ? length : -1;
  5122. while ((fromRight ? index-- : ++index < length) &&
  5123. predicate(array[index], index, array)) {}
  5124. return isDrop
  5125. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5126. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5127. }
  5128. /**
  5129. * The base implementation of `wrapperValue` which returns the result of
  5130. * performing a sequence of actions on the unwrapped `value`, where each
  5131. * successive action is supplied the return value of the previous.
  5132. *
  5133. * @private
  5134. * @param {*} value The unwrapped value.
  5135. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5136. * @returns {*} Returns the resolved value.
  5137. */
  5138. function baseWrapperValue(value, actions) {
  5139. var result = value;
  5140. if (result instanceof LazyWrapper) {
  5141. result = result.value();
  5142. }
  5143. return arrayReduce(actions, function(result, action) {
  5144. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5145. }, result);
  5146. }
  5147. /**
  5148. * The base implementation of methods like `_.xor`, without support for
  5149. * iteratee shorthands, that accepts an array of arrays to inspect.
  5150. *
  5151. * @private
  5152. * @param {Array} arrays The arrays to inspect.
  5153. * @param {Function} [iteratee] The iteratee invoked per element.
  5154. * @param {Function} [comparator] The comparator invoked per element.
  5155. * @returns {Array} Returns the new array of values.
  5156. */
  5157. function baseXor(arrays, iteratee, comparator) {
  5158. var length = arrays.length;
  5159. if (length < 2) {
  5160. return length ? baseUniq(arrays[0]) : [];
  5161. }
  5162. var index = -1,
  5163. result = Array(length);
  5164. while (++index < length) {
  5165. var array = arrays[index],
  5166. othIndex = -1;
  5167. while (++othIndex < length) {
  5168. if (othIndex != index) {
  5169. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5170. }
  5171. }
  5172. }
  5173. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5174. }
  5175. /**
  5176. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5177. *
  5178. * @private
  5179. * @param {Array} props The property identifiers.
  5180. * @param {Array} values The property values.
  5181. * @param {Function} assignFunc The function to assign values.
  5182. * @returns {Object} Returns the new object.
  5183. */
  5184. function baseZipObject(props, values, assignFunc) {
  5185. var index = -1,
  5186. length = props.length,
  5187. valsLength = values.length,
  5188. result = {};
  5189. while (++index < length) {
  5190. var value = index < valsLength ? values[index] : undefined;
  5191. assignFunc(result, props[index], value);
  5192. }
  5193. return result;
  5194. }
  5195. /**
  5196. * Casts `value` to an empty array if it's not an array like object.
  5197. *
  5198. * @private
  5199. * @param {*} value The value to inspect.
  5200. * @returns {Array|Object} Returns the cast array-like object.
  5201. */
  5202. function castArrayLikeObject(value) {
  5203. return isArrayLikeObject(value) ? value : [];
  5204. }
  5205. /**
  5206. * Casts `value` to `identity` if it's not a function.
  5207. *
  5208. * @private
  5209. * @param {*} value The value to inspect.
  5210. * @returns {Function} Returns cast function.
  5211. */
  5212. function castFunction(value) {
  5213. return typeof value == 'function' ? value : identity;
  5214. }
  5215. /**
  5216. * Casts `value` to a path array if it's not one.
  5217. *
  5218. * @private
  5219. * @param {*} value The value to inspect.
  5220. * @param {Object} [object] The object to query keys on.
  5221. * @returns {Array} Returns the cast property path array.
  5222. */
  5223. function castPath(value, object) {
  5224. if (isArray(value)) {
  5225. return value;
  5226. }
  5227. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5228. }
  5229. /**
  5230. * A `baseRest` alias which can be replaced with `identity` by module
  5231. * replacement plugins.
  5232. *
  5233. * @private
  5234. * @type {Function}
  5235. * @param {Function} func The function to apply a rest parameter to.
  5236. * @returns {Function} Returns the new function.
  5237. */
  5238. var castRest = baseRest;
  5239. /**
  5240. * Casts `array` to a slice if it's needed.
  5241. *
  5242. * @private
  5243. * @param {Array} array The array to inspect.
  5244. * @param {number} start The start position.
  5245. * @param {number} [end=array.length] The end position.
  5246. * @returns {Array} Returns the cast slice.
  5247. */
  5248. function castSlice(array, start, end) {
  5249. var length = array.length;
  5250. end = end === undefined ? length : end;
  5251. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5252. }
  5253. /**
  5254. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5255. *
  5256. * @private
  5257. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5258. */
  5259. var clearTimeout = ctxClearTimeout || function(id) {
  5260. return root.clearTimeout(id);
  5261. };
  5262. /**
  5263. * Creates a clone of `buffer`.
  5264. *
  5265. * @private
  5266. * @param {Buffer} buffer The buffer to clone.
  5267. * @param {boolean} [isDeep] Specify a deep clone.
  5268. * @returns {Buffer} Returns the cloned buffer.
  5269. */
  5270. function cloneBuffer(buffer, isDeep) {
  5271. if (isDeep) {
  5272. return buffer.slice();
  5273. }
  5274. var length = buffer.length,
  5275. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5276. buffer.copy(result);
  5277. return result;
  5278. }
  5279. /**
  5280. * Creates a clone of `arrayBuffer`.
  5281. *
  5282. * @private
  5283. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5284. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5285. */
  5286. function cloneArrayBuffer(arrayBuffer) {
  5287. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5288. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5289. return result;
  5290. }
  5291. /**
  5292. * Creates a clone of `dataView`.
  5293. *
  5294. * @private
  5295. * @param {Object} dataView The data view to clone.
  5296. * @param {boolean} [isDeep] Specify a deep clone.
  5297. * @returns {Object} Returns the cloned data view.
  5298. */
  5299. function cloneDataView(dataView, isDeep) {
  5300. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5301. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5302. }
  5303. /**
  5304. * Creates a clone of `regexp`.
  5305. *
  5306. * @private
  5307. * @param {Object} regexp The regexp to clone.
  5308. * @returns {Object} Returns the cloned regexp.
  5309. */
  5310. function cloneRegExp(regexp) {
  5311. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5312. result.lastIndex = regexp.lastIndex;
  5313. return result;
  5314. }
  5315. /**
  5316. * Creates a clone of the `symbol` object.
  5317. *
  5318. * @private
  5319. * @param {Object} symbol The symbol object to clone.
  5320. * @returns {Object} Returns the cloned symbol object.
  5321. */
  5322. function cloneSymbol(symbol) {
  5323. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5324. }
  5325. /**
  5326. * Creates a clone of `typedArray`.
  5327. *
  5328. * @private
  5329. * @param {Object} typedArray The typed array to clone.
  5330. * @param {boolean} [isDeep] Specify a deep clone.
  5331. * @returns {Object} Returns the cloned typed array.
  5332. */
  5333. function cloneTypedArray(typedArray, isDeep) {
  5334. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5335. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5336. }
  5337. /**
  5338. * Compares values to sort them in ascending order.
  5339. *
  5340. * @private
  5341. * @param {*} value The value to compare.
  5342. * @param {*} other The other value to compare.
  5343. * @returns {number} Returns the sort order indicator for `value`.
  5344. */
  5345. function compareAscending(value, other) {
  5346. if (value !== other) {
  5347. var valIsDefined = value !== undefined,
  5348. valIsNull = value === null,
  5349. valIsReflexive = value === value,
  5350. valIsSymbol = isSymbol(value);
  5351. var othIsDefined = other !== undefined,
  5352. othIsNull = other === null,
  5353. othIsReflexive = other === other,
  5354. othIsSymbol = isSymbol(other);
  5355. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5356. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5357. (valIsNull && othIsDefined && othIsReflexive) ||
  5358. (!valIsDefined && othIsReflexive) ||
  5359. !valIsReflexive) {
  5360. return 1;
  5361. }
  5362. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5363. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5364. (othIsNull && valIsDefined && valIsReflexive) ||
  5365. (!othIsDefined && valIsReflexive) ||
  5366. !othIsReflexive) {
  5367. return -1;
  5368. }
  5369. }
  5370. return 0;
  5371. }
  5372. /**
  5373. * Used by `_.orderBy` to compare multiple properties of a value to another
  5374. * and stable sort them.
  5375. *
  5376. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5377. * specify an order of "desc" for descending or "asc" for ascending sort order
  5378. * of corresponding values.
  5379. *
  5380. * @private
  5381. * @param {Object} object The object to compare.
  5382. * @param {Object} other The other object to compare.
  5383. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5384. * @returns {number} Returns the sort order indicator for `object`.
  5385. */
  5386. function compareMultiple(object, other, orders) {
  5387. var index = -1,
  5388. objCriteria = object.criteria,
  5389. othCriteria = other.criteria,
  5390. length = objCriteria.length,
  5391. ordersLength = orders.length;
  5392. while (++index < length) {
  5393. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5394. if (result) {
  5395. if (index >= ordersLength) {
  5396. return result;
  5397. }
  5398. var order = orders[index];
  5399. return result * (order == 'desc' ? -1 : 1);
  5400. }
  5401. }
  5402. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5403. // that causes it, under certain circumstances, to provide the same value for
  5404. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5405. // for more details.
  5406. //
  5407. // This also ensures a stable sort in V8 and other engines.
  5408. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5409. return object.index - other.index;
  5410. }
  5411. /**
  5412. * Creates an array that is the composition of partially applied arguments,
  5413. * placeholders, and provided arguments into a single array of arguments.
  5414. *
  5415. * @private
  5416. * @param {Array} args The provided arguments.
  5417. * @param {Array} partials The arguments to prepend to those provided.
  5418. * @param {Array} holders The `partials` placeholder indexes.
  5419. * @params {boolean} [isCurried] Specify composing for a curried function.
  5420. * @returns {Array} Returns the new array of composed arguments.
  5421. */
  5422. function composeArgs(args, partials, holders, isCurried) {
  5423. var argsIndex = -1,
  5424. argsLength = args.length,
  5425. holdersLength = holders.length,
  5426. leftIndex = -1,
  5427. leftLength = partials.length,
  5428. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5429. result = Array(leftLength + rangeLength),
  5430. isUncurried = !isCurried;
  5431. while (++leftIndex < leftLength) {
  5432. result[leftIndex] = partials[leftIndex];
  5433. }
  5434. while (++argsIndex < holdersLength) {
  5435. if (isUncurried || argsIndex < argsLength) {
  5436. result[holders[argsIndex]] = args[argsIndex];
  5437. }
  5438. }
  5439. while (rangeLength--) {
  5440. result[leftIndex++] = args[argsIndex++];
  5441. }
  5442. return result;
  5443. }
  5444. /**
  5445. * This function is like `composeArgs` except that the arguments composition
  5446. * is tailored for `_.partialRight`.
  5447. *
  5448. * @private
  5449. * @param {Array} args The provided arguments.
  5450. * @param {Array} partials The arguments to append to those provided.
  5451. * @param {Array} holders The `partials` placeholder indexes.
  5452. * @params {boolean} [isCurried] Specify composing for a curried function.
  5453. * @returns {Array} Returns the new array of composed arguments.
  5454. */
  5455. function composeArgsRight(args, partials, holders, isCurried) {
  5456. var argsIndex = -1,
  5457. argsLength = args.length,
  5458. holdersIndex = -1,
  5459. holdersLength = holders.length,
  5460. rightIndex = -1,
  5461. rightLength = partials.length,
  5462. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5463. result = Array(rangeLength + rightLength),
  5464. isUncurried = !isCurried;
  5465. while (++argsIndex < rangeLength) {
  5466. result[argsIndex] = args[argsIndex];
  5467. }
  5468. var offset = argsIndex;
  5469. while (++rightIndex < rightLength) {
  5470. result[offset + rightIndex] = partials[rightIndex];
  5471. }
  5472. while (++holdersIndex < holdersLength) {
  5473. if (isUncurried || argsIndex < argsLength) {
  5474. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5475. }
  5476. }
  5477. return result;
  5478. }
  5479. /**
  5480. * Copies the values of `source` to `array`.
  5481. *
  5482. * @private
  5483. * @param {Array} source The array to copy values from.
  5484. * @param {Array} [array=[]] The array to copy values to.
  5485. * @returns {Array} Returns `array`.
  5486. */
  5487. function copyArray(source, array) {
  5488. var index = -1,
  5489. length = source.length;
  5490. array || (array = Array(length));
  5491. while (++index < length) {
  5492. array[index] = source[index];
  5493. }
  5494. return array;
  5495. }
  5496. /**
  5497. * Copies properties of `source` to `object`.
  5498. *
  5499. * @private
  5500. * @param {Object} source The object to copy properties from.
  5501. * @param {Array} props The property identifiers to copy.
  5502. * @param {Object} [object={}] The object to copy properties to.
  5503. * @param {Function} [customizer] The function to customize copied values.
  5504. * @returns {Object} Returns `object`.
  5505. */
  5506. function copyObject(source, props, object, customizer) {
  5507. var isNew = !object;
  5508. object || (object = {});
  5509. var index = -1,
  5510. length = props.length;
  5511. while (++index < length) {
  5512. var key = props[index];
  5513. var newValue = customizer
  5514. ? customizer(object[key], source[key], key, object, source)
  5515. : undefined;
  5516. if (newValue === undefined) {
  5517. newValue = source[key];
  5518. }
  5519. if (isNew) {
  5520. baseAssignValue(object, key, newValue);
  5521. } else {
  5522. assignValue(object, key, newValue);
  5523. }
  5524. }
  5525. return object;
  5526. }
  5527. /**
  5528. * Copies own symbols of `source` to `object`.
  5529. *
  5530. * @private
  5531. * @param {Object} source The object to copy symbols from.
  5532. * @param {Object} [object={}] The object to copy symbols to.
  5533. * @returns {Object} Returns `object`.
  5534. */
  5535. function copySymbols(source, object) {
  5536. return copyObject(source, getSymbols(source), object);
  5537. }
  5538. /**
  5539. * Copies own and inherited symbols of `source` to `object`.
  5540. *
  5541. * @private
  5542. * @param {Object} source The object to copy symbols from.
  5543. * @param {Object} [object={}] The object to copy symbols to.
  5544. * @returns {Object} Returns `object`.
  5545. */
  5546. function copySymbolsIn(source, object) {
  5547. return copyObject(source, getSymbolsIn(source), object);
  5548. }
  5549. /**
  5550. * Creates a function like `_.groupBy`.
  5551. *
  5552. * @private
  5553. * @param {Function} setter The function to set accumulator values.
  5554. * @param {Function} [initializer] The accumulator object initializer.
  5555. * @returns {Function} Returns the new aggregator function.
  5556. */
  5557. function createAggregator(setter, initializer) {
  5558. return function(collection, iteratee) {
  5559. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5560. accumulator = initializer ? initializer() : {};
  5561. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5562. };
  5563. }
  5564. /**
  5565. * Creates a function like `_.assign`.
  5566. *
  5567. * @private
  5568. * @param {Function} assigner The function to assign values.
  5569. * @returns {Function} Returns the new assigner function.
  5570. */
  5571. function createAssigner(assigner) {
  5572. return baseRest(function(object, sources) {
  5573. var index = -1,
  5574. length = sources.length,
  5575. customizer = length > 1 ? sources[length - 1] : undefined,
  5576. guard = length > 2 ? sources[2] : undefined;
  5577. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5578. ? (length--, customizer)
  5579. : undefined;
  5580. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5581. customizer = length < 3 ? undefined : customizer;
  5582. length = 1;
  5583. }
  5584. object = Object(object);
  5585. while (++index < length) {
  5586. var source = sources[index];
  5587. if (source) {
  5588. assigner(object, source, index, customizer);
  5589. }
  5590. }
  5591. return object;
  5592. });
  5593. }
  5594. /**
  5595. * Creates a `baseEach` or `baseEachRight` function.
  5596. *
  5597. * @private
  5598. * @param {Function} eachFunc The function to iterate over a collection.
  5599. * @param {boolean} [fromRight] Specify iterating from right to left.
  5600. * @returns {Function} Returns the new base function.
  5601. */
  5602. function createBaseEach(eachFunc, fromRight) {
  5603. return function(collection, iteratee) {
  5604. if (collection == null) {
  5605. return collection;
  5606. }
  5607. if (!isArrayLike(collection)) {
  5608. return eachFunc(collection, iteratee);
  5609. }
  5610. var length = collection.length,
  5611. index = fromRight ? length : -1,
  5612. iterable = Object(collection);
  5613. while ((fromRight ? index-- : ++index < length)) {
  5614. if (iteratee(iterable[index], index, iterable) === false) {
  5615. break;
  5616. }
  5617. }
  5618. return collection;
  5619. };
  5620. }
  5621. /**
  5622. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5623. *
  5624. * @private
  5625. * @param {boolean} [fromRight] Specify iterating from right to left.
  5626. * @returns {Function} Returns the new base function.
  5627. */
  5628. function createBaseFor(fromRight) {
  5629. return function(object, iteratee, keysFunc) {
  5630. var index = -1,
  5631. iterable = Object(object),
  5632. props = keysFunc(object),
  5633. length = props.length;
  5634. while (length--) {
  5635. var key = props[fromRight ? length : ++index];
  5636. if (iteratee(iterable[key], key, iterable) === false) {
  5637. break;
  5638. }
  5639. }
  5640. return object;
  5641. };
  5642. }
  5643. /**
  5644. * Creates a function that wraps `func` to invoke it with the optional `this`
  5645. * binding of `thisArg`.
  5646. *
  5647. * @private
  5648. * @param {Function} func The function to wrap.
  5649. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5650. * @param {*} [thisArg] The `this` binding of `func`.
  5651. * @returns {Function} Returns the new wrapped function.
  5652. */
  5653. function createBind(func, bitmask, thisArg) {
  5654. var isBind = bitmask & WRAP_BIND_FLAG,
  5655. Ctor = createCtor(func);
  5656. function wrapper() {
  5657. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5658. return fn.apply(isBind ? thisArg : this, arguments);
  5659. }
  5660. return wrapper;
  5661. }
  5662. /**
  5663. * Creates a function like `_.lowerFirst`.
  5664. *
  5665. * @private
  5666. * @param {string} methodName The name of the `String` case method to use.
  5667. * @returns {Function} Returns the new case function.
  5668. */
  5669. function createCaseFirst(methodName) {
  5670. return function(string) {
  5671. string = toString(string);
  5672. var strSymbols = hasUnicode(string)
  5673. ? stringToArray(string)
  5674. : undefined;
  5675. var chr = strSymbols
  5676. ? strSymbols[0]
  5677. : string.charAt(0);
  5678. var trailing = strSymbols
  5679. ? castSlice(strSymbols, 1).join('')
  5680. : string.slice(1);
  5681. return chr[methodName]() + trailing;
  5682. };
  5683. }
  5684. /**
  5685. * Creates a function like `_.camelCase`.
  5686. *
  5687. * @private
  5688. * @param {Function} callback The function to combine each word.
  5689. * @returns {Function} Returns the new compounder function.
  5690. */
  5691. function createCompounder(callback) {
  5692. return function(string) {
  5693. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5694. };
  5695. }
  5696. /**
  5697. * Creates a function that produces an instance of `Ctor` regardless of
  5698. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5699. *
  5700. * @private
  5701. * @param {Function} Ctor The constructor to wrap.
  5702. * @returns {Function} Returns the new wrapped function.
  5703. */
  5704. function createCtor(Ctor) {
  5705. return function() {
  5706. // Use a `switch` statement to work with class constructors. See
  5707. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5708. // for more details.
  5709. var args = arguments;
  5710. switch (args.length) {
  5711. case 0: return new Ctor;
  5712. case 1: return new Ctor(args[0]);
  5713. case 2: return new Ctor(args[0], args[1]);
  5714. case 3: return new Ctor(args[0], args[1], args[2]);
  5715. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5716. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5717. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5718. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5719. }
  5720. var thisBinding = baseCreate(Ctor.prototype),
  5721. result = Ctor.apply(thisBinding, args);
  5722. // Mimic the constructor's `return` behavior.
  5723. // See https://es5.github.io/#x13.2.2 for more details.
  5724. return isObject(result) ? result : thisBinding;
  5725. };
  5726. }
  5727. /**
  5728. * Creates a function that wraps `func` to enable currying.
  5729. *
  5730. * @private
  5731. * @param {Function} func The function to wrap.
  5732. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5733. * @param {number} arity The arity of `func`.
  5734. * @returns {Function} Returns the new wrapped function.
  5735. */
  5736. function createCurry(func, bitmask, arity) {
  5737. var Ctor = createCtor(func);
  5738. function wrapper() {
  5739. var length = arguments.length,
  5740. args = Array(length),
  5741. index = length,
  5742. placeholder = getHolder(wrapper);
  5743. while (index--) {
  5744. args[index] = arguments[index];
  5745. }
  5746. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5747. ? []
  5748. : replaceHolders(args, placeholder);
  5749. length -= holders.length;
  5750. if (length < arity) {
  5751. return createRecurry(
  5752. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5753. args, holders, undefined, undefined, arity - length);
  5754. }
  5755. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5756. return apply(fn, this, args);
  5757. }
  5758. return wrapper;
  5759. }
  5760. /**
  5761. * Creates a `_.find` or `_.findLast` function.
  5762. *
  5763. * @private
  5764. * @param {Function} findIndexFunc The function to find the collection index.
  5765. * @returns {Function} Returns the new find function.
  5766. */
  5767. function createFind(findIndexFunc) {
  5768. return function(collection, predicate, fromIndex) {
  5769. var iterable = Object(collection);
  5770. if (!isArrayLike(collection)) {
  5771. var iteratee = getIteratee(predicate, 3);
  5772. collection = keys(collection);
  5773. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5774. }
  5775. var index = findIndexFunc(collection, predicate, fromIndex);
  5776. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5777. };
  5778. }
  5779. /**
  5780. * Creates a `_.flow` or `_.flowRight` function.
  5781. *
  5782. * @private
  5783. * @param {boolean} [fromRight] Specify iterating from right to left.
  5784. * @returns {Function} Returns the new flow function.
  5785. */
  5786. function createFlow(fromRight) {
  5787. return flatRest(function(funcs) {
  5788. var length = funcs.length,
  5789. index = length,
  5790. prereq = LodashWrapper.prototype.thru;
  5791. if (fromRight) {
  5792. funcs.reverse();
  5793. }
  5794. while (index--) {
  5795. var func = funcs[index];
  5796. if (typeof func != 'function') {
  5797. throw new TypeError(FUNC_ERROR_TEXT);
  5798. }
  5799. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5800. var wrapper = new LodashWrapper([], true);
  5801. }
  5802. }
  5803. index = wrapper ? index : length;
  5804. while (++index < length) {
  5805. func = funcs[index];
  5806. var funcName = getFuncName(func),
  5807. data = funcName == 'wrapper' ? getData(func) : undefined;
  5808. if (data && isLaziable(data[0]) &&
  5809. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5810. !data[4].length && data[9] == 1
  5811. ) {
  5812. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5813. } else {
  5814. wrapper = (func.length == 1 && isLaziable(func))
  5815. ? wrapper[funcName]()
  5816. : wrapper.thru(func);
  5817. }
  5818. }
  5819. return function() {
  5820. var args = arguments,
  5821. value = args[0];
  5822. if (wrapper && args.length == 1 && isArray(value)) {
  5823. return wrapper.plant(value).value();
  5824. }
  5825. var index = 0,
  5826. result = length ? funcs[index].apply(this, args) : value;
  5827. while (++index < length) {
  5828. result = funcs[index].call(this, result);
  5829. }
  5830. return result;
  5831. };
  5832. });
  5833. }
  5834. /**
  5835. * Creates a function that wraps `func` to invoke it with optional `this`
  5836. * binding of `thisArg`, partial application, and currying.
  5837. *
  5838. * @private
  5839. * @param {Function|string} func The function or method name to wrap.
  5840. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5841. * @param {*} [thisArg] The `this` binding of `func`.
  5842. * @param {Array} [partials] The arguments to prepend to those provided to
  5843. * the new function.
  5844. * @param {Array} [holders] The `partials` placeholder indexes.
  5845. * @param {Array} [partialsRight] The arguments to append to those provided
  5846. * to the new function.
  5847. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5848. * @param {Array} [argPos] The argument positions of the new function.
  5849. * @param {number} [ary] The arity cap of `func`.
  5850. * @param {number} [arity] The arity of `func`.
  5851. * @returns {Function} Returns the new wrapped function.
  5852. */
  5853. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5854. var isAry = bitmask & WRAP_ARY_FLAG,
  5855. isBind = bitmask & WRAP_BIND_FLAG,
  5856. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5857. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5858. isFlip = bitmask & WRAP_FLIP_FLAG,
  5859. Ctor = isBindKey ? undefined : createCtor(func);
  5860. function wrapper() {
  5861. var length = arguments.length,
  5862. args = Array(length),
  5863. index = length;
  5864. while (index--) {
  5865. args[index] = arguments[index];
  5866. }
  5867. if (isCurried) {
  5868. var placeholder = getHolder(wrapper),
  5869. holdersCount = countHolders(args, placeholder);
  5870. }
  5871. if (partials) {
  5872. args = composeArgs(args, partials, holders, isCurried);
  5873. }
  5874. if (partialsRight) {
  5875. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5876. }
  5877. length -= holdersCount;
  5878. if (isCurried && length < arity) {
  5879. var newHolders = replaceHolders(args, placeholder);
  5880. return createRecurry(
  5881. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5882. args, newHolders, argPos, ary, arity - length
  5883. );
  5884. }
  5885. var thisBinding = isBind ? thisArg : this,
  5886. fn = isBindKey ? thisBinding[func] : func;
  5887. length = args.length;
  5888. if (argPos) {
  5889. args = reorder(args, argPos);
  5890. } else if (isFlip && length > 1) {
  5891. args.reverse();
  5892. }
  5893. if (isAry && ary < length) {
  5894. args.length = ary;
  5895. }
  5896. if (this && this !== root && this instanceof wrapper) {
  5897. fn = Ctor || createCtor(fn);
  5898. }
  5899. return fn.apply(thisBinding, args);
  5900. }
  5901. return wrapper;
  5902. }
  5903. /**
  5904. * Creates a function like `_.invertBy`.
  5905. *
  5906. * @private
  5907. * @param {Function} setter The function to set accumulator values.
  5908. * @param {Function} toIteratee The function to resolve iteratees.
  5909. * @returns {Function} Returns the new inverter function.
  5910. */
  5911. function createInverter(setter, toIteratee) {
  5912. return function(object, iteratee) {
  5913. return baseInverter(object, setter, toIteratee(iteratee), {});
  5914. };
  5915. }
  5916. /**
  5917. * Creates a function that performs a mathematical operation on two values.
  5918. *
  5919. * @private
  5920. * @param {Function} operator The function to perform the operation.
  5921. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5922. * @returns {Function} Returns the new mathematical operation function.
  5923. */
  5924. function createMathOperation(operator, defaultValue) {
  5925. return function(value, other) {
  5926. var result;
  5927. if (value === undefined && other === undefined) {
  5928. return defaultValue;
  5929. }
  5930. if (value !== undefined) {
  5931. result = value;
  5932. }
  5933. if (other !== undefined) {
  5934. if (result === undefined) {
  5935. return other;
  5936. }
  5937. if (typeof value == 'string' || typeof other == 'string') {
  5938. value = baseToString(value);
  5939. other = baseToString(other);
  5940. } else {
  5941. value = baseToNumber(value);
  5942. other = baseToNumber(other);
  5943. }
  5944. result = operator(value, other);
  5945. }
  5946. return result;
  5947. };
  5948. }
  5949. /**
  5950. * Creates a function like `_.over`.
  5951. *
  5952. * @private
  5953. * @param {Function} arrayFunc The function to iterate over iteratees.
  5954. * @returns {Function} Returns the new over function.
  5955. */
  5956. function createOver(arrayFunc) {
  5957. return flatRest(function(iteratees) {
  5958. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5959. return baseRest(function(args) {
  5960. var thisArg = this;
  5961. return arrayFunc(iteratees, function(iteratee) {
  5962. return apply(iteratee, thisArg, args);
  5963. });
  5964. });
  5965. });
  5966. }
  5967. /**
  5968. * Creates the padding for `string` based on `length`. The `chars` string
  5969. * is truncated if the number of characters exceeds `length`.
  5970. *
  5971. * @private
  5972. * @param {number} length The padding length.
  5973. * @param {string} [chars=' '] The string used as padding.
  5974. * @returns {string} Returns the padding for `string`.
  5975. */
  5976. function createPadding(length, chars) {
  5977. chars = chars === undefined ? ' ' : baseToString(chars);
  5978. var charsLength = chars.length;
  5979. if (charsLength < 2) {
  5980. return charsLength ? baseRepeat(chars, length) : chars;
  5981. }
  5982. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  5983. return hasUnicode(chars)
  5984. ? castSlice(stringToArray(result), 0, length).join('')
  5985. : result.slice(0, length);
  5986. }
  5987. /**
  5988. * Creates a function that wraps `func` to invoke it with the `this` binding
  5989. * of `thisArg` and `partials` prepended to the arguments it receives.
  5990. *
  5991. * @private
  5992. * @param {Function} func The function to wrap.
  5993. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5994. * @param {*} thisArg The `this` binding of `func`.
  5995. * @param {Array} partials The arguments to prepend to those provided to
  5996. * the new function.
  5997. * @returns {Function} Returns the new wrapped function.
  5998. */
  5999. function createPartial(func, bitmask, thisArg, partials) {
  6000. var isBind = bitmask & WRAP_BIND_FLAG,
  6001. Ctor = createCtor(func);
  6002. function wrapper() {
  6003. var argsIndex = -1,
  6004. argsLength = arguments.length,
  6005. leftIndex = -1,
  6006. leftLength = partials.length,
  6007. args = Array(leftLength + argsLength),
  6008. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6009. while (++leftIndex < leftLength) {
  6010. args[leftIndex] = partials[leftIndex];
  6011. }
  6012. while (argsLength--) {
  6013. args[leftIndex++] = arguments[++argsIndex];
  6014. }
  6015. return apply(fn, isBind ? thisArg : this, args);
  6016. }
  6017. return wrapper;
  6018. }
  6019. /**
  6020. * Creates a `_.range` or `_.rangeRight` function.
  6021. *
  6022. * @private
  6023. * @param {boolean} [fromRight] Specify iterating from right to left.
  6024. * @returns {Function} Returns the new range function.
  6025. */
  6026. function createRange(fromRight) {
  6027. return function(start, end, step) {
  6028. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6029. end = step = undefined;
  6030. }
  6031. // Ensure the sign of `-0` is preserved.
  6032. start = toFinite(start);
  6033. if (end === undefined) {
  6034. end = start;
  6035. start = 0;
  6036. } else {
  6037. end = toFinite(end);
  6038. }
  6039. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6040. return baseRange(start, end, step, fromRight);
  6041. };
  6042. }
  6043. /**
  6044. * Creates a function that performs a relational operation on two values.
  6045. *
  6046. * @private
  6047. * @param {Function} operator The function to perform the operation.
  6048. * @returns {Function} Returns the new relational operation function.
  6049. */
  6050. function createRelationalOperation(operator) {
  6051. return function(value, other) {
  6052. if (!(typeof value == 'string' && typeof other == 'string')) {
  6053. value = toNumber(value);
  6054. other = toNumber(other);
  6055. }
  6056. return operator(value, other);
  6057. };
  6058. }
  6059. /**
  6060. * Creates a function that wraps `func` to continue currying.
  6061. *
  6062. * @private
  6063. * @param {Function} func The function to wrap.
  6064. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6065. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6066. * @param {*} placeholder The placeholder value.
  6067. * @param {*} [thisArg] The `this` binding of `func`.
  6068. * @param {Array} [partials] The arguments to prepend to those provided to
  6069. * the new function.
  6070. * @param {Array} [holders] The `partials` placeholder indexes.
  6071. * @param {Array} [argPos] The argument positions of the new function.
  6072. * @param {number} [ary] The arity cap of `func`.
  6073. * @param {number} [arity] The arity of `func`.
  6074. * @returns {Function} Returns the new wrapped function.
  6075. */
  6076. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6077. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6078. newHolders = isCurry ? holders : undefined,
  6079. newHoldersRight = isCurry ? undefined : holders,
  6080. newPartials = isCurry ? partials : undefined,
  6081. newPartialsRight = isCurry ? undefined : partials;
  6082. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6083. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6084. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6085. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6086. }
  6087. var newData = [
  6088. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6089. newHoldersRight, argPos, ary, arity
  6090. ];
  6091. var result = wrapFunc.apply(undefined, newData);
  6092. if (isLaziable(func)) {
  6093. setData(result, newData);
  6094. }
  6095. result.placeholder = placeholder;
  6096. return setWrapToString(result, func, bitmask);
  6097. }
  6098. /**
  6099. * Creates a function like `_.round`.
  6100. *
  6101. * @private
  6102. * @param {string} methodName The name of the `Math` method to use when rounding.
  6103. * @returns {Function} Returns the new round function.
  6104. */
  6105. function createRound(methodName) {
  6106. var func = Math[methodName];
  6107. return function(number, precision) {
  6108. number = toNumber(number);
  6109. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6110. if (precision && nativeIsFinite(number)) {
  6111. // Shift with exponential notation to avoid floating-point issues.
  6112. // See [MDN](https://mdn.io/round#Examples) for more details.
  6113. var pair = (toString(number) + 'e').split('e'),
  6114. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6115. pair = (toString(value) + 'e').split('e');
  6116. return +(pair[0] + 'e' + (+pair[1] - precision));
  6117. }
  6118. return func(number);
  6119. };
  6120. }
  6121. /**
  6122. * Creates a set object of `values`.
  6123. *
  6124. * @private
  6125. * @param {Array} values The values to add to the set.
  6126. * @returns {Object} Returns the new set.
  6127. */
  6128. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6129. return new Set(values);
  6130. };
  6131. /**
  6132. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6133. *
  6134. * @private
  6135. * @param {Function} keysFunc The function to get the keys of a given object.
  6136. * @returns {Function} Returns the new pairs function.
  6137. */
  6138. function createToPairs(keysFunc) {
  6139. return function(object) {
  6140. var tag = getTag(object);
  6141. if (tag == mapTag) {
  6142. return mapToArray(object);
  6143. }
  6144. if (tag == setTag) {
  6145. return setToPairs(object);
  6146. }
  6147. return baseToPairs(object, keysFunc(object));
  6148. };
  6149. }
  6150. /**
  6151. * Creates a function that either curries or invokes `func` with optional
  6152. * `this` binding and partially applied arguments.
  6153. *
  6154. * @private
  6155. * @param {Function|string} func The function or method name to wrap.
  6156. * @param {number} bitmask The bitmask flags.
  6157. * 1 - `_.bind`
  6158. * 2 - `_.bindKey`
  6159. * 4 - `_.curry` or `_.curryRight` of a bound function
  6160. * 8 - `_.curry`
  6161. * 16 - `_.curryRight`
  6162. * 32 - `_.partial`
  6163. * 64 - `_.partialRight`
  6164. * 128 - `_.rearg`
  6165. * 256 - `_.ary`
  6166. * 512 - `_.flip`
  6167. * @param {*} [thisArg] The `this` binding of `func`.
  6168. * @param {Array} [partials] The arguments to be partially applied.
  6169. * @param {Array} [holders] The `partials` placeholder indexes.
  6170. * @param {Array} [argPos] The argument positions of the new function.
  6171. * @param {number} [ary] The arity cap of `func`.
  6172. * @param {number} [arity] The arity of `func`.
  6173. * @returns {Function} Returns the new wrapped function.
  6174. */
  6175. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6176. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6177. if (!isBindKey && typeof func != 'function') {
  6178. throw new TypeError(FUNC_ERROR_TEXT);
  6179. }
  6180. var length = partials ? partials.length : 0;
  6181. if (!length) {
  6182. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6183. partials = holders = undefined;
  6184. }
  6185. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6186. arity = arity === undefined ? arity : toInteger(arity);
  6187. length -= holders ? holders.length : 0;
  6188. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6189. var partialsRight = partials,
  6190. holdersRight = holders;
  6191. partials = holders = undefined;
  6192. }
  6193. var data = isBindKey ? undefined : getData(func);
  6194. var newData = [
  6195. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6196. argPos, ary, arity
  6197. ];
  6198. if (data) {
  6199. mergeData(newData, data);
  6200. }
  6201. func = newData[0];
  6202. bitmask = newData[1];
  6203. thisArg = newData[2];
  6204. partials = newData[3];
  6205. holders = newData[4];
  6206. arity = newData[9] = newData[9] === undefined
  6207. ? (isBindKey ? 0 : func.length)
  6208. : nativeMax(newData[9] - length, 0);
  6209. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6210. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6211. }
  6212. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6213. var result = createBind(func, bitmask, thisArg);
  6214. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6215. result = createCurry(func, bitmask, arity);
  6216. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6217. result = createPartial(func, bitmask, thisArg, partials);
  6218. } else {
  6219. result = createHybrid.apply(undefined, newData);
  6220. }
  6221. var setter = data ? baseSetData : setData;
  6222. return setWrapToString(setter(result, newData), func, bitmask);
  6223. }
  6224. /**
  6225. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6226. * of source objects to the destination object for all destination properties
  6227. * that resolve to `undefined`.
  6228. *
  6229. * @private
  6230. * @param {*} objValue The destination value.
  6231. * @param {*} srcValue The source value.
  6232. * @param {string} key The key of the property to assign.
  6233. * @param {Object} object The parent object of `objValue`.
  6234. * @returns {*} Returns the value to assign.
  6235. */
  6236. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6237. if (objValue === undefined ||
  6238. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6239. return srcValue;
  6240. }
  6241. return objValue;
  6242. }
  6243. /**
  6244. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6245. * objects into destination objects that are passed thru.
  6246. *
  6247. * @private
  6248. * @param {*} objValue The destination value.
  6249. * @param {*} srcValue The source value.
  6250. * @param {string} key The key of the property to merge.
  6251. * @param {Object} object The parent object of `objValue`.
  6252. * @param {Object} source The parent object of `srcValue`.
  6253. * @param {Object} [stack] Tracks traversed source values and their merged
  6254. * counterparts.
  6255. * @returns {*} Returns the value to assign.
  6256. */
  6257. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6258. if (isObject(objValue) && isObject(srcValue)) {
  6259. // Recursively merge objects and arrays (susceptible to call stack limits).
  6260. stack.set(srcValue, objValue);
  6261. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6262. stack['delete'](srcValue);
  6263. }
  6264. return objValue;
  6265. }
  6266. /**
  6267. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6268. * objects.
  6269. *
  6270. * @private
  6271. * @param {*} value The value to inspect.
  6272. * @param {string} key The key of the property to inspect.
  6273. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6274. */
  6275. function customOmitClone(value) {
  6276. return isPlainObject(value) ? undefined : value;
  6277. }
  6278. /**
  6279. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6280. * partial deep comparisons.
  6281. *
  6282. * @private
  6283. * @param {Array} array The array to compare.
  6284. * @param {Array} other The other array to compare.
  6285. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6286. * @param {Function} customizer The function to customize comparisons.
  6287. * @param {Function} equalFunc The function to determine equivalents of values.
  6288. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6289. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6290. */
  6291. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6292. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6293. arrLength = array.length,
  6294. othLength = other.length;
  6295. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6296. return false;
  6297. }
  6298. // Check that cyclic values are equal.
  6299. var arrStacked = stack.get(array);
  6300. var othStacked = stack.get(other);
  6301. if (arrStacked && othStacked) {
  6302. return arrStacked == other && othStacked == array;
  6303. }
  6304. var index = -1,
  6305. result = true,
  6306. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6307. stack.set(array, other);
  6308. stack.set(other, array);
  6309. // Ignore non-index properties.
  6310. while (++index < arrLength) {
  6311. var arrValue = array[index],
  6312. othValue = other[index];
  6313. if (customizer) {
  6314. var compared = isPartial
  6315. ? customizer(othValue, arrValue, index, other, array, stack)
  6316. : customizer(arrValue, othValue, index, array, other, stack);
  6317. }
  6318. if (compared !== undefined) {
  6319. if (compared) {
  6320. continue;
  6321. }
  6322. result = false;
  6323. break;
  6324. }
  6325. // Recursively compare arrays (susceptible to call stack limits).
  6326. if (seen) {
  6327. if (!arraySome(other, function(othValue, othIndex) {
  6328. if (!cacheHas(seen, othIndex) &&
  6329. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6330. return seen.push(othIndex);
  6331. }
  6332. })) {
  6333. result = false;
  6334. break;
  6335. }
  6336. } else if (!(
  6337. arrValue === othValue ||
  6338. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6339. )) {
  6340. result = false;
  6341. break;
  6342. }
  6343. }
  6344. stack['delete'](array);
  6345. stack['delete'](other);
  6346. return result;
  6347. }
  6348. /**
  6349. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6350. * the same `toStringTag`.
  6351. *
  6352. * **Note:** This function only supports comparing values with tags of
  6353. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6354. *
  6355. * @private
  6356. * @param {Object} object The object to compare.
  6357. * @param {Object} other The other object to compare.
  6358. * @param {string} tag The `toStringTag` of the objects to compare.
  6359. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6360. * @param {Function} customizer The function to customize comparisons.
  6361. * @param {Function} equalFunc The function to determine equivalents of values.
  6362. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6363. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6364. */
  6365. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6366. switch (tag) {
  6367. case dataViewTag:
  6368. if ((object.byteLength != other.byteLength) ||
  6369. (object.byteOffset != other.byteOffset)) {
  6370. return false;
  6371. }
  6372. object = object.buffer;
  6373. other = other.buffer;
  6374. case arrayBufferTag:
  6375. if ((object.byteLength != other.byteLength) ||
  6376. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6377. return false;
  6378. }
  6379. return true;
  6380. case boolTag:
  6381. case dateTag:
  6382. case numberTag:
  6383. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6384. // Invalid dates are coerced to `NaN`.
  6385. return eq(+object, +other);
  6386. case errorTag:
  6387. return object.name == other.name && object.message == other.message;
  6388. case regexpTag:
  6389. case stringTag:
  6390. // Coerce regexes to strings and treat strings, primitives and objects,
  6391. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6392. // for more details.
  6393. return object == (other + '');
  6394. case mapTag:
  6395. var convert = mapToArray;
  6396. case setTag:
  6397. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6398. convert || (convert = setToArray);
  6399. if (object.size != other.size && !isPartial) {
  6400. return false;
  6401. }
  6402. // Assume cyclic values are equal.
  6403. var stacked = stack.get(object);
  6404. if (stacked) {
  6405. return stacked == other;
  6406. }
  6407. bitmask |= COMPARE_UNORDERED_FLAG;
  6408. // Recursively compare objects (susceptible to call stack limits).
  6409. stack.set(object, other);
  6410. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6411. stack['delete'](object);
  6412. return result;
  6413. case symbolTag:
  6414. if (symbolValueOf) {
  6415. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6416. }
  6417. }
  6418. return false;
  6419. }
  6420. /**
  6421. * A specialized version of `baseIsEqualDeep` for objects with support for
  6422. * partial deep comparisons.
  6423. *
  6424. * @private
  6425. * @param {Object} object The object to compare.
  6426. * @param {Object} other The other object to compare.
  6427. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6428. * @param {Function} customizer The function to customize comparisons.
  6429. * @param {Function} equalFunc The function to determine equivalents of values.
  6430. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6431. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6432. */
  6433. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6434. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6435. objProps = getAllKeys(object),
  6436. objLength = objProps.length,
  6437. othProps = getAllKeys(other),
  6438. othLength = othProps.length;
  6439. if (objLength != othLength && !isPartial) {
  6440. return false;
  6441. }
  6442. var index = objLength;
  6443. while (index--) {
  6444. var key = objProps[index];
  6445. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6446. return false;
  6447. }
  6448. }
  6449. // Check that cyclic values are equal.
  6450. var objStacked = stack.get(object);
  6451. var othStacked = stack.get(other);
  6452. if (objStacked && othStacked) {
  6453. return objStacked == other && othStacked == object;
  6454. }
  6455. var result = true;
  6456. stack.set(object, other);
  6457. stack.set(other, object);
  6458. var skipCtor = isPartial;
  6459. while (++index < objLength) {
  6460. key = objProps[index];
  6461. var objValue = object[key],
  6462. othValue = other[key];
  6463. if (customizer) {
  6464. var compared = isPartial
  6465. ? customizer(othValue, objValue, key, other, object, stack)
  6466. : customizer(objValue, othValue, key, object, other, stack);
  6467. }
  6468. // Recursively compare objects (susceptible to call stack limits).
  6469. if (!(compared === undefined
  6470. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6471. : compared
  6472. )) {
  6473. result = false;
  6474. break;
  6475. }
  6476. skipCtor || (skipCtor = key == 'constructor');
  6477. }
  6478. if (result && !skipCtor) {
  6479. var objCtor = object.constructor,
  6480. othCtor = other.constructor;
  6481. // Non `Object` object instances with different constructors are not equal.
  6482. if (objCtor != othCtor &&
  6483. ('constructor' in object && 'constructor' in other) &&
  6484. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6485. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6486. result = false;
  6487. }
  6488. }
  6489. stack['delete'](object);
  6490. stack['delete'](other);
  6491. return result;
  6492. }
  6493. /**
  6494. * A specialized version of `baseRest` which flattens the rest array.
  6495. *
  6496. * @private
  6497. * @param {Function} func The function to apply a rest parameter to.
  6498. * @returns {Function} Returns the new function.
  6499. */
  6500. function flatRest(func) {
  6501. return setToString(overRest(func, undefined, flatten), func + '');
  6502. }
  6503. /**
  6504. * Creates an array of own enumerable property names and symbols of `object`.
  6505. *
  6506. * @private
  6507. * @param {Object} object The object to query.
  6508. * @returns {Array} Returns the array of property names and symbols.
  6509. */
  6510. function getAllKeys(object) {
  6511. return baseGetAllKeys(object, keys, getSymbols);
  6512. }
  6513. /**
  6514. * Creates an array of own and inherited enumerable property names and
  6515. * symbols of `object`.
  6516. *
  6517. * @private
  6518. * @param {Object} object The object to query.
  6519. * @returns {Array} Returns the array of property names and symbols.
  6520. */
  6521. function getAllKeysIn(object) {
  6522. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6523. }
  6524. /**
  6525. * Gets metadata for `func`.
  6526. *
  6527. * @private
  6528. * @param {Function} func The function to query.
  6529. * @returns {*} Returns the metadata for `func`.
  6530. */
  6531. var getData = !metaMap ? noop : function(func) {
  6532. return metaMap.get(func);
  6533. };
  6534. /**
  6535. * Gets the name of `func`.
  6536. *
  6537. * @private
  6538. * @param {Function} func The function to query.
  6539. * @returns {string} Returns the function name.
  6540. */
  6541. function getFuncName(func) {
  6542. var result = (func.name + ''),
  6543. array = realNames[result],
  6544. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6545. while (length--) {
  6546. var data = array[length],
  6547. otherFunc = data.func;
  6548. if (otherFunc == null || otherFunc == func) {
  6549. return data.name;
  6550. }
  6551. }
  6552. return result;
  6553. }
  6554. /**
  6555. * Gets the argument placeholder value for `func`.
  6556. *
  6557. * @private
  6558. * @param {Function} func The function to inspect.
  6559. * @returns {*} Returns the placeholder value.
  6560. */
  6561. function getHolder(func) {
  6562. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6563. return object.placeholder;
  6564. }
  6565. /**
  6566. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6567. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6568. * If arguments are provided, the chosen function is invoked with them and
  6569. * its result is returned.
  6570. *
  6571. * @private
  6572. * @param {*} [value] The value to convert to an iteratee.
  6573. * @param {number} [arity] The arity of the created iteratee.
  6574. * @returns {Function} Returns the chosen function or its result.
  6575. */
  6576. function getIteratee() {
  6577. var result = lodash.iteratee || iteratee;
  6578. result = result === iteratee ? baseIteratee : result;
  6579. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6580. }
  6581. /**
  6582. * Gets the data for `map`.
  6583. *
  6584. * @private
  6585. * @param {Object} map The map to query.
  6586. * @param {string} key The reference key.
  6587. * @returns {*} Returns the map data.
  6588. */
  6589. function getMapData(map, key) {
  6590. var data = map.__data__;
  6591. return isKeyable(key)
  6592. ? data[typeof key == 'string' ? 'string' : 'hash']
  6593. : data.map;
  6594. }
  6595. /**
  6596. * Gets the property names, values, and compare flags of `object`.
  6597. *
  6598. * @private
  6599. * @param {Object} object The object to query.
  6600. * @returns {Array} Returns the match data of `object`.
  6601. */
  6602. function getMatchData(object) {
  6603. var result = keys(object),
  6604. length = result.length;
  6605. while (length--) {
  6606. var key = result[length],
  6607. value = object[key];
  6608. result[length] = [key, value, isStrictComparable(value)];
  6609. }
  6610. return result;
  6611. }
  6612. /**
  6613. * Gets the native function at `key` of `object`.
  6614. *
  6615. * @private
  6616. * @param {Object} object The object to query.
  6617. * @param {string} key The key of the method to get.
  6618. * @returns {*} Returns the function if it's native, else `undefined`.
  6619. */
  6620. function getNative(object, key) {
  6621. var value = getValue(object, key);
  6622. return baseIsNative(value) ? value : undefined;
  6623. }
  6624. /**
  6625. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6626. *
  6627. * @private
  6628. * @param {*} value The value to query.
  6629. * @returns {string} Returns the raw `toStringTag`.
  6630. */
  6631. function getRawTag(value) {
  6632. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6633. tag = value[symToStringTag];
  6634. try {
  6635. value[symToStringTag] = undefined;
  6636. var unmasked = true;
  6637. } catch (e) {}
  6638. var result = nativeObjectToString.call(value);
  6639. if (unmasked) {
  6640. if (isOwn) {
  6641. value[symToStringTag] = tag;
  6642. } else {
  6643. delete value[symToStringTag];
  6644. }
  6645. }
  6646. return result;
  6647. }
  6648. /**
  6649. * Creates an array of the own enumerable symbols of `object`.
  6650. *
  6651. * @private
  6652. * @param {Object} object The object to query.
  6653. * @returns {Array} Returns the array of symbols.
  6654. */
  6655. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6656. if (object == null) {
  6657. return [];
  6658. }
  6659. object = Object(object);
  6660. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6661. return propertyIsEnumerable.call(object, symbol);
  6662. });
  6663. };
  6664. /**
  6665. * Creates an array of the own and inherited enumerable symbols of `object`.
  6666. *
  6667. * @private
  6668. * @param {Object} object The object to query.
  6669. * @returns {Array} Returns the array of symbols.
  6670. */
  6671. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6672. var result = [];
  6673. while (object) {
  6674. arrayPush(result, getSymbols(object));
  6675. object = getPrototype(object);
  6676. }
  6677. return result;
  6678. };
  6679. /**
  6680. * Gets the `toStringTag` of `value`.
  6681. *
  6682. * @private
  6683. * @param {*} value The value to query.
  6684. * @returns {string} Returns the `toStringTag`.
  6685. */
  6686. var getTag = baseGetTag;
  6687. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6688. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6689. (Map && getTag(new Map) != mapTag) ||
  6690. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6691. (Set && getTag(new Set) != setTag) ||
  6692. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6693. getTag = function(value) {
  6694. var result = baseGetTag(value),
  6695. Ctor = result == objectTag ? value.constructor : undefined,
  6696. ctorString = Ctor ? toSource(Ctor) : '';
  6697. if (ctorString) {
  6698. switch (ctorString) {
  6699. case dataViewCtorString: return dataViewTag;
  6700. case mapCtorString: return mapTag;
  6701. case promiseCtorString: return promiseTag;
  6702. case setCtorString: return setTag;
  6703. case weakMapCtorString: return weakMapTag;
  6704. }
  6705. }
  6706. return result;
  6707. };
  6708. }
  6709. /**
  6710. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6711. *
  6712. * @private
  6713. * @param {number} start The start of the view.
  6714. * @param {number} end The end of the view.
  6715. * @param {Array} transforms The transformations to apply to the view.
  6716. * @returns {Object} Returns an object containing the `start` and `end`
  6717. * positions of the view.
  6718. */
  6719. function getView(start, end, transforms) {
  6720. var index = -1,
  6721. length = transforms.length;
  6722. while (++index < length) {
  6723. var data = transforms[index],
  6724. size = data.size;
  6725. switch (data.type) {
  6726. case 'drop': start += size; break;
  6727. case 'dropRight': end -= size; break;
  6728. case 'take': end = nativeMin(end, start + size); break;
  6729. case 'takeRight': start = nativeMax(start, end - size); break;
  6730. }
  6731. }
  6732. return { 'start': start, 'end': end };
  6733. }
  6734. /**
  6735. * Extracts wrapper details from the `source` body comment.
  6736. *
  6737. * @private
  6738. * @param {string} source The source to inspect.
  6739. * @returns {Array} Returns the wrapper details.
  6740. */
  6741. function getWrapDetails(source) {
  6742. var match = source.match(reWrapDetails);
  6743. return match ? match[1].split(reSplitDetails) : [];
  6744. }
  6745. /**
  6746. * Checks if `path` exists on `object`.
  6747. *
  6748. * @private
  6749. * @param {Object} object The object to query.
  6750. * @param {Array|string} path The path to check.
  6751. * @param {Function} hasFunc The function to check properties.
  6752. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6753. */
  6754. function hasPath(object, path, hasFunc) {
  6755. path = castPath(path, object);
  6756. var index = -1,
  6757. length = path.length,
  6758. result = false;
  6759. while (++index < length) {
  6760. var key = toKey(path[index]);
  6761. if (!(result = object != null && hasFunc(object, key))) {
  6762. break;
  6763. }
  6764. object = object[key];
  6765. }
  6766. if (result || ++index != length) {
  6767. return result;
  6768. }
  6769. length = object == null ? 0 : object.length;
  6770. return !!length && isLength(length) && isIndex(key, length) &&
  6771. (isArray(object) || isArguments(object));
  6772. }
  6773. /**
  6774. * Initializes an array clone.
  6775. *
  6776. * @private
  6777. * @param {Array} array The array to clone.
  6778. * @returns {Array} Returns the initialized clone.
  6779. */
  6780. function initCloneArray(array) {
  6781. var length = array.length,
  6782. result = new array.constructor(length);
  6783. // Add properties assigned by `RegExp#exec`.
  6784. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6785. result.index = array.index;
  6786. result.input = array.input;
  6787. }
  6788. return result;
  6789. }
  6790. /**
  6791. * Initializes an object clone.
  6792. *
  6793. * @private
  6794. * @param {Object} object The object to clone.
  6795. * @returns {Object} Returns the initialized clone.
  6796. */
  6797. function initCloneObject(object) {
  6798. return (typeof object.constructor == 'function' && !isPrototype(object))
  6799. ? baseCreate(getPrototype(object))
  6800. : {};
  6801. }
  6802. /**
  6803. * Initializes an object clone based on its `toStringTag`.
  6804. *
  6805. * **Note:** This function only supports cloning values with tags of
  6806. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6807. *
  6808. * @private
  6809. * @param {Object} object The object to clone.
  6810. * @param {string} tag The `toStringTag` of the object to clone.
  6811. * @param {boolean} [isDeep] Specify a deep clone.
  6812. * @returns {Object} Returns the initialized clone.
  6813. */
  6814. function initCloneByTag(object, tag, isDeep) {
  6815. var Ctor = object.constructor;
  6816. switch (tag) {
  6817. case arrayBufferTag:
  6818. return cloneArrayBuffer(object);
  6819. case boolTag:
  6820. case dateTag:
  6821. return new Ctor(+object);
  6822. case dataViewTag:
  6823. return cloneDataView(object, isDeep);
  6824. case float32Tag: case float64Tag:
  6825. case int8Tag: case int16Tag: case int32Tag:
  6826. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6827. return cloneTypedArray(object, isDeep);
  6828. case mapTag:
  6829. return new Ctor;
  6830. case numberTag:
  6831. case stringTag:
  6832. return new Ctor(object);
  6833. case regexpTag:
  6834. return cloneRegExp(object);
  6835. case setTag:
  6836. return new Ctor;
  6837. case symbolTag:
  6838. return cloneSymbol(object);
  6839. }
  6840. }
  6841. /**
  6842. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6843. *
  6844. * @private
  6845. * @param {string} source The source to modify.
  6846. * @returns {Array} details The details to insert.
  6847. * @returns {string} Returns the modified source.
  6848. */
  6849. function insertWrapDetails(source, details) {
  6850. var length = details.length;
  6851. if (!length) {
  6852. return source;
  6853. }
  6854. var lastIndex = length - 1;
  6855. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6856. details = details.join(length > 2 ? ', ' : ' ');
  6857. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6858. }
  6859. /**
  6860. * Checks if `value` is a flattenable `arguments` object or array.
  6861. *
  6862. * @private
  6863. * @param {*} value The value to check.
  6864. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6865. */
  6866. function isFlattenable(value) {
  6867. return isArray(value) || isArguments(value) ||
  6868. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6869. }
  6870. /**
  6871. * Checks if `value` is a valid array-like index.
  6872. *
  6873. * @private
  6874. * @param {*} value The value to check.
  6875. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6876. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6877. */
  6878. function isIndex(value, length) {
  6879. var type = typeof value;
  6880. length = length == null ? MAX_SAFE_INTEGER : length;
  6881. return !!length &&
  6882. (type == 'number' ||
  6883. (type != 'symbol' && reIsUint.test(value))) &&
  6884. (value > -1 && value % 1 == 0 && value < length);
  6885. }
  6886. /**
  6887. * Checks if the given arguments are from an iteratee call.
  6888. *
  6889. * @private
  6890. * @param {*} value The potential iteratee value argument.
  6891. * @param {*} index The potential iteratee index or key argument.
  6892. * @param {*} object The potential iteratee object argument.
  6893. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6894. * else `false`.
  6895. */
  6896. function isIterateeCall(value, index, object) {
  6897. if (!isObject(object)) {
  6898. return false;
  6899. }
  6900. var type = typeof index;
  6901. if (type == 'number'
  6902. ? (isArrayLike(object) && isIndex(index, object.length))
  6903. : (type == 'string' && index in object)
  6904. ) {
  6905. return eq(object[index], value);
  6906. }
  6907. return false;
  6908. }
  6909. /**
  6910. * Checks if `value` is a property name and not a property path.
  6911. *
  6912. * @private
  6913. * @param {*} value The value to check.
  6914. * @param {Object} [object] The object to query keys on.
  6915. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6916. */
  6917. function isKey(value, object) {
  6918. if (isArray(value)) {
  6919. return false;
  6920. }
  6921. var type = typeof value;
  6922. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6923. value == null || isSymbol(value)) {
  6924. return true;
  6925. }
  6926. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6927. (object != null && value in Object(object));
  6928. }
  6929. /**
  6930. * Checks if `value` is suitable for use as unique object key.
  6931. *
  6932. * @private
  6933. * @param {*} value The value to check.
  6934. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6935. */
  6936. function isKeyable(value) {
  6937. var type = typeof value;
  6938. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6939. ? (value !== '__proto__')
  6940. : (value === null);
  6941. }
  6942. /**
  6943. * Checks if `func` has a lazy counterpart.
  6944. *
  6945. * @private
  6946. * @param {Function} func The function to check.
  6947. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6948. * else `false`.
  6949. */
  6950. function isLaziable(func) {
  6951. var funcName = getFuncName(func),
  6952. other = lodash[funcName];
  6953. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6954. return false;
  6955. }
  6956. if (func === other) {
  6957. return true;
  6958. }
  6959. var data = getData(other);
  6960. return !!data && func === data[0];
  6961. }
  6962. /**
  6963. * Checks if `func` has its source masked.
  6964. *
  6965. * @private
  6966. * @param {Function} func The function to check.
  6967. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6968. */
  6969. function isMasked(func) {
  6970. return !!maskSrcKey && (maskSrcKey in func);
  6971. }
  6972. /**
  6973. * Checks if `func` is capable of being masked.
  6974. *
  6975. * @private
  6976. * @param {*} value The value to check.
  6977. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  6978. */
  6979. var isMaskable = coreJsData ? isFunction : stubFalse;
  6980. /**
  6981. * Checks if `value` is likely a prototype object.
  6982. *
  6983. * @private
  6984. * @param {*} value The value to check.
  6985. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6986. */
  6987. function isPrototype(value) {
  6988. var Ctor = value && value.constructor,
  6989. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  6990. return value === proto;
  6991. }
  6992. /**
  6993. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6994. *
  6995. * @private
  6996. * @param {*} value The value to check.
  6997. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6998. * equality comparisons, else `false`.
  6999. */
  7000. function isStrictComparable(value) {
  7001. return value === value && !isObject(value);
  7002. }
  7003. /**
  7004. * A specialized version of `matchesProperty` for source values suitable
  7005. * for strict equality comparisons, i.e. `===`.
  7006. *
  7007. * @private
  7008. * @param {string} key The key of the property to get.
  7009. * @param {*} srcValue The value to match.
  7010. * @returns {Function} Returns the new spec function.
  7011. */
  7012. function matchesStrictComparable(key, srcValue) {
  7013. return function(object) {
  7014. if (object == null) {
  7015. return false;
  7016. }
  7017. return object[key] === srcValue &&
  7018. (srcValue !== undefined || (key in Object(object)));
  7019. };
  7020. }
  7021. /**
  7022. * A specialized version of `_.memoize` which clears the memoized function's
  7023. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7024. *
  7025. * @private
  7026. * @param {Function} func The function to have its output memoized.
  7027. * @returns {Function} Returns the new memoized function.
  7028. */
  7029. function memoizeCapped(func) {
  7030. var result = memoize(func, function(key) {
  7031. if (cache.size === MAX_MEMOIZE_SIZE) {
  7032. cache.clear();
  7033. }
  7034. return key;
  7035. });
  7036. var cache = result.cache;
  7037. return result;
  7038. }
  7039. /**
  7040. * Merges the function metadata of `source` into `data`.
  7041. *
  7042. * Merging metadata reduces the number of wrappers used to invoke a function.
  7043. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7044. * may be applied regardless of execution order. Methods like `_.ary` and
  7045. * `_.rearg` modify function arguments, making the order in which they are
  7046. * executed important, preventing the merging of metadata. However, we make
  7047. * an exception for a safe combined case where curried functions have `_.ary`
  7048. * and or `_.rearg` applied.
  7049. *
  7050. * @private
  7051. * @param {Array} data The destination metadata.
  7052. * @param {Array} source The source metadata.
  7053. * @returns {Array} Returns `data`.
  7054. */
  7055. function mergeData(data, source) {
  7056. var bitmask = data[1],
  7057. srcBitmask = source[1],
  7058. newBitmask = bitmask | srcBitmask,
  7059. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7060. var isCombo =
  7061. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7062. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7063. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7064. // Exit early if metadata can't be merged.
  7065. if (!(isCommon || isCombo)) {
  7066. return data;
  7067. }
  7068. // Use source `thisArg` if available.
  7069. if (srcBitmask & WRAP_BIND_FLAG) {
  7070. data[2] = source[2];
  7071. // Set when currying a bound function.
  7072. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7073. }
  7074. // Compose partial arguments.
  7075. var value = source[3];
  7076. if (value) {
  7077. var partials = data[3];
  7078. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7079. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7080. }
  7081. // Compose partial right arguments.
  7082. value = source[5];
  7083. if (value) {
  7084. partials = data[5];
  7085. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7086. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7087. }
  7088. // Use source `argPos` if available.
  7089. value = source[7];
  7090. if (value) {
  7091. data[7] = value;
  7092. }
  7093. // Use source `ary` if it's smaller.
  7094. if (srcBitmask & WRAP_ARY_FLAG) {
  7095. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7096. }
  7097. // Use source `arity` if one is not provided.
  7098. if (data[9] == null) {
  7099. data[9] = source[9];
  7100. }
  7101. // Use source `func` and merge bitmasks.
  7102. data[0] = source[0];
  7103. data[1] = newBitmask;
  7104. return data;
  7105. }
  7106. /**
  7107. * This function is like
  7108. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7109. * except that it includes inherited enumerable properties.
  7110. *
  7111. * @private
  7112. * @param {Object} object The object to query.
  7113. * @returns {Array} Returns the array of property names.
  7114. */
  7115. function nativeKeysIn(object) {
  7116. var result = [];
  7117. if (object != null) {
  7118. for (var key in Object(object)) {
  7119. result.push(key);
  7120. }
  7121. }
  7122. return result;
  7123. }
  7124. /**
  7125. * Converts `value` to a string using `Object.prototype.toString`.
  7126. *
  7127. * @private
  7128. * @param {*} value The value to convert.
  7129. * @returns {string} Returns the converted string.
  7130. */
  7131. function objectToString(value) {
  7132. return nativeObjectToString.call(value);
  7133. }
  7134. /**
  7135. * A specialized version of `baseRest` which transforms the rest array.
  7136. *
  7137. * @private
  7138. * @param {Function} func The function to apply a rest parameter to.
  7139. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7140. * @param {Function} transform The rest array transform.
  7141. * @returns {Function} Returns the new function.
  7142. */
  7143. function overRest(func, start, transform) {
  7144. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7145. return function() {
  7146. var args = arguments,
  7147. index = -1,
  7148. length = nativeMax(args.length - start, 0),
  7149. array = Array(length);
  7150. while (++index < length) {
  7151. array[index] = args[start + index];
  7152. }
  7153. index = -1;
  7154. var otherArgs = Array(start + 1);
  7155. while (++index < start) {
  7156. otherArgs[index] = args[index];
  7157. }
  7158. otherArgs[start] = transform(array);
  7159. return apply(func, this, otherArgs);
  7160. };
  7161. }
  7162. /**
  7163. * Gets the parent value at `path` of `object`.
  7164. *
  7165. * @private
  7166. * @param {Object} object The object to query.
  7167. * @param {Array} path The path to get the parent value of.
  7168. * @returns {*} Returns the parent value.
  7169. */
  7170. function parent(object, path) {
  7171. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7172. }
  7173. /**
  7174. * Reorder `array` according to the specified indexes where the element at
  7175. * the first index is assigned as the first element, the element at
  7176. * the second index is assigned as the second element, and so on.
  7177. *
  7178. * @private
  7179. * @param {Array} array The array to reorder.
  7180. * @param {Array} indexes The arranged array indexes.
  7181. * @returns {Array} Returns `array`.
  7182. */
  7183. function reorder(array, indexes) {
  7184. var arrLength = array.length,
  7185. length = nativeMin(indexes.length, arrLength),
  7186. oldArray = copyArray(array);
  7187. while (length--) {
  7188. var index = indexes[length];
  7189. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7190. }
  7191. return array;
  7192. }
  7193. /**
  7194. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7195. *
  7196. * @private
  7197. * @param {Object} object The object to query.
  7198. * @param {string} key The key of the property to get.
  7199. * @returns {*} Returns the property value.
  7200. */
  7201. function safeGet(object, key) {
  7202. if (key === 'constructor' && typeof object[key] === 'function') {
  7203. return;
  7204. }
  7205. if (key == '__proto__') {
  7206. return;
  7207. }
  7208. return object[key];
  7209. }
  7210. /**
  7211. * Sets metadata for `func`.
  7212. *
  7213. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7214. * period of time, it will trip its breaker and transition to an identity
  7215. * function to avoid garbage collection pauses in V8. See
  7216. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7217. * for more details.
  7218. *
  7219. * @private
  7220. * @param {Function} func The function to associate metadata with.
  7221. * @param {*} data The metadata.
  7222. * @returns {Function} Returns `func`.
  7223. */
  7224. var setData = shortOut(baseSetData);
  7225. /**
  7226. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7227. *
  7228. * @private
  7229. * @param {Function} func The function to delay.
  7230. * @param {number} wait The number of milliseconds to delay invocation.
  7231. * @returns {number|Object} Returns the timer id or timeout object.
  7232. */
  7233. var setTimeout = ctxSetTimeout || function(func, wait) {
  7234. return root.setTimeout(func, wait);
  7235. };
  7236. /**
  7237. * Sets the `toString` method of `func` to return `string`.
  7238. *
  7239. * @private
  7240. * @param {Function} func The function to modify.
  7241. * @param {Function} string The `toString` result.
  7242. * @returns {Function} Returns `func`.
  7243. */
  7244. var setToString = shortOut(baseSetToString);
  7245. /**
  7246. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7247. * with wrapper details in a comment at the top of the source body.
  7248. *
  7249. * @private
  7250. * @param {Function} wrapper The function to modify.
  7251. * @param {Function} reference The reference function.
  7252. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7253. * @returns {Function} Returns `wrapper`.
  7254. */
  7255. function setWrapToString(wrapper, reference, bitmask) {
  7256. var source = (reference + '');
  7257. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7258. }
  7259. /**
  7260. * Creates a function that'll short out and invoke `identity` instead
  7261. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7262. * milliseconds.
  7263. *
  7264. * @private
  7265. * @param {Function} func The function to restrict.
  7266. * @returns {Function} Returns the new shortable function.
  7267. */
  7268. function shortOut(func) {
  7269. var count = 0,
  7270. lastCalled = 0;
  7271. return function() {
  7272. var stamp = nativeNow(),
  7273. remaining = HOT_SPAN - (stamp - lastCalled);
  7274. lastCalled = stamp;
  7275. if (remaining > 0) {
  7276. if (++count >= HOT_COUNT) {
  7277. return arguments[0];
  7278. }
  7279. } else {
  7280. count = 0;
  7281. }
  7282. return func.apply(undefined, arguments);
  7283. };
  7284. }
  7285. /**
  7286. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7287. *
  7288. * @private
  7289. * @param {Array} array The array to shuffle.
  7290. * @param {number} [size=array.length] The size of `array`.
  7291. * @returns {Array} Returns `array`.
  7292. */
  7293. function shuffleSelf(array, size) {
  7294. var index = -1,
  7295. length = array.length,
  7296. lastIndex = length - 1;
  7297. size = size === undefined ? length : size;
  7298. while (++index < size) {
  7299. var rand = baseRandom(index, lastIndex),
  7300. value = array[rand];
  7301. array[rand] = array[index];
  7302. array[index] = value;
  7303. }
  7304. array.length = size;
  7305. return array;
  7306. }
  7307. /**
  7308. * Converts `string` to a property path array.
  7309. *
  7310. * @private
  7311. * @param {string} string The string to convert.
  7312. * @returns {Array} Returns the property path array.
  7313. */
  7314. var stringToPath = memoizeCapped(function(string) {
  7315. var result = [];
  7316. if (string.charCodeAt(0) === 46 /* . */) {
  7317. result.push('');
  7318. }
  7319. string.replace(rePropName, function(match, number, quote, subString) {
  7320. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7321. });
  7322. return result;
  7323. });
  7324. /**
  7325. * Converts `value` to a string key if it's not a string or symbol.
  7326. *
  7327. * @private
  7328. * @param {*} value The value to inspect.
  7329. * @returns {string|symbol} Returns the key.
  7330. */
  7331. function toKey(value) {
  7332. if (typeof value == 'string' || isSymbol(value)) {
  7333. return value;
  7334. }
  7335. var result = (value + '');
  7336. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7337. }
  7338. /**
  7339. * Converts `func` to its source code.
  7340. *
  7341. * @private
  7342. * @param {Function} func The function to convert.
  7343. * @returns {string} Returns the source code.
  7344. */
  7345. function toSource(func) {
  7346. if (func != null) {
  7347. try {
  7348. return funcToString.call(func);
  7349. } catch (e) {}
  7350. try {
  7351. return (func + '');
  7352. } catch (e) {}
  7353. }
  7354. return '';
  7355. }
  7356. /**
  7357. * Updates wrapper `details` based on `bitmask` flags.
  7358. *
  7359. * @private
  7360. * @returns {Array} details The details to modify.
  7361. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7362. * @returns {Array} Returns `details`.
  7363. */
  7364. function updateWrapDetails(details, bitmask) {
  7365. arrayEach(wrapFlags, function(pair) {
  7366. var value = '_.' + pair[0];
  7367. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7368. details.push(value);
  7369. }
  7370. });
  7371. return details.sort();
  7372. }
  7373. /**
  7374. * Creates a clone of `wrapper`.
  7375. *
  7376. * @private
  7377. * @param {Object} wrapper The wrapper to clone.
  7378. * @returns {Object} Returns the cloned wrapper.
  7379. */
  7380. function wrapperClone(wrapper) {
  7381. if (wrapper instanceof LazyWrapper) {
  7382. return wrapper.clone();
  7383. }
  7384. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7385. result.__actions__ = copyArray(wrapper.__actions__);
  7386. result.__index__ = wrapper.__index__;
  7387. result.__values__ = wrapper.__values__;
  7388. return result;
  7389. }
  7390. /*------------------------------------------------------------------------*/
  7391. /**
  7392. * Creates an array of elements split into groups the length of `size`.
  7393. * If `array` can't be split evenly, the final chunk will be the remaining
  7394. * elements.
  7395. *
  7396. * @static
  7397. * @memberOf _
  7398. * @since 3.0.0
  7399. * @category Array
  7400. * @param {Array} array The array to process.
  7401. * @param {number} [size=1] The length of each chunk
  7402. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7403. * @returns {Array} Returns the new array of chunks.
  7404. * @example
  7405. *
  7406. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7407. * // => [['a', 'b'], ['c', 'd']]
  7408. *
  7409. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7410. * // => [['a', 'b', 'c'], ['d']]
  7411. */
  7412. function chunk(array, size, guard) {
  7413. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7414. size = 1;
  7415. } else {
  7416. size = nativeMax(toInteger(size), 0);
  7417. }
  7418. var length = array == null ? 0 : array.length;
  7419. if (!length || size < 1) {
  7420. return [];
  7421. }
  7422. var index = 0,
  7423. resIndex = 0,
  7424. result = Array(nativeCeil(length / size));
  7425. while (index < length) {
  7426. result[resIndex++] = baseSlice(array, index, (index += size));
  7427. }
  7428. return result;
  7429. }
  7430. /**
  7431. * Creates an array with all falsey values removed. The values `false`, `null`,
  7432. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7433. *
  7434. * @static
  7435. * @memberOf _
  7436. * @since 0.1.0
  7437. * @category Array
  7438. * @param {Array} array The array to compact.
  7439. * @returns {Array} Returns the new array of filtered values.
  7440. * @example
  7441. *
  7442. * _.compact([0, 1, false, 2, '', 3]);
  7443. * // => [1, 2, 3]
  7444. */
  7445. function compact(array) {
  7446. var index = -1,
  7447. length = array == null ? 0 : array.length,
  7448. resIndex = 0,
  7449. result = [];
  7450. while (++index < length) {
  7451. var value = array[index];
  7452. if (value) {
  7453. result[resIndex++] = value;
  7454. }
  7455. }
  7456. return result;
  7457. }
  7458. /**
  7459. * Creates a new array concatenating `array` with any additional arrays
  7460. * and/or values.
  7461. *
  7462. * @static
  7463. * @memberOf _
  7464. * @since 4.0.0
  7465. * @category Array
  7466. * @param {Array} array The array to concatenate.
  7467. * @param {...*} [values] The values to concatenate.
  7468. * @returns {Array} Returns the new concatenated array.
  7469. * @example
  7470. *
  7471. * var array = [1];
  7472. * var other = _.concat(array, 2, [3], [[4]]);
  7473. *
  7474. * console.log(other);
  7475. * // => [1, 2, 3, [4]]
  7476. *
  7477. * console.log(array);
  7478. * // => [1]
  7479. */
  7480. function concat() {
  7481. var length = arguments.length;
  7482. if (!length) {
  7483. return [];
  7484. }
  7485. var args = Array(length - 1),
  7486. array = arguments[0],
  7487. index = length;
  7488. while (index--) {
  7489. args[index - 1] = arguments[index];
  7490. }
  7491. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7492. }
  7493. /**
  7494. * Creates an array of `array` values not included in the other given arrays
  7495. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7496. * for equality comparisons. The order and references of result values are
  7497. * determined by the first array.
  7498. *
  7499. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7500. *
  7501. * @static
  7502. * @memberOf _
  7503. * @since 0.1.0
  7504. * @category Array
  7505. * @param {Array} array The array to inspect.
  7506. * @param {...Array} [values] The values to exclude.
  7507. * @returns {Array} Returns the new array of filtered values.
  7508. * @see _.without, _.xor
  7509. * @example
  7510. *
  7511. * _.difference([2, 1], [2, 3]);
  7512. * // => [1]
  7513. */
  7514. var difference = baseRest(function(array, values) {
  7515. return isArrayLikeObject(array)
  7516. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7517. : [];
  7518. });
  7519. /**
  7520. * This method is like `_.difference` except that it accepts `iteratee` which
  7521. * is invoked for each element of `array` and `values` to generate the criterion
  7522. * by which they're compared. The order and references of result values are
  7523. * determined by the first array. The iteratee is invoked with one argument:
  7524. * (value).
  7525. *
  7526. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7527. *
  7528. * @static
  7529. * @memberOf _
  7530. * @since 4.0.0
  7531. * @category Array
  7532. * @param {Array} array The array to inspect.
  7533. * @param {...Array} [values] The values to exclude.
  7534. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7535. * @returns {Array} Returns the new array of filtered values.
  7536. * @example
  7537. *
  7538. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7539. * // => [1.2]
  7540. *
  7541. * // The `_.property` iteratee shorthand.
  7542. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7543. * // => [{ 'x': 2 }]
  7544. */
  7545. var differenceBy = baseRest(function(array, values) {
  7546. var iteratee = last(values);
  7547. if (isArrayLikeObject(iteratee)) {
  7548. iteratee = undefined;
  7549. }
  7550. return isArrayLikeObject(array)
  7551. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7552. : [];
  7553. });
  7554. /**
  7555. * This method is like `_.difference` except that it accepts `comparator`
  7556. * which is invoked to compare elements of `array` to `values`. The order and
  7557. * references of result values are determined by the first array. The comparator
  7558. * is invoked with two arguments: (arrVal, othVal).
  7559. *
  7560. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7561. *
  7562. * @static
  7563. * @memberOf _
  7564. * @since 4.0.0
  7565. * @category Array
  7566. * @param {Array} array The array to inspect.
  7567. * @param {...Array} [values] The values to exclude.
  7568. * @param {Function} [comparator] The comparator invoked per element.
  7569. * @returns {Array} Returns the new array of filtered values.
  7570. * @example
  7571. *
  7572. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7573. *
  7574. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7575. * // => [{ 'x': 2, 'y': 1 }]
  7576. */
  7577. var differenceWith = baseRest(function(array, values) {
  7578. var comparator = last(values);
  7579. if (isArrayLikeObject(comparator)) {
  7580. comparator = undefined;
  7581. }
  7582. return isArrayLikeObject(array)
  7583. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7584. : [];
  7585. });
  7586. /**
  7587. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7588. *
  7589. * @static
  7590. * @memberOf _
  7591. * @since 0.5.0
  7592. * @category Array
  7593. * @param {Array} array The array to query.
  7594. * @param {number} [n=1] The number of elements to drop.
  7595. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7596. * @returns {Array} Returns the slice of `array`.
  7597. * @example
  7598. *
  7599. * _.drop([1, 2, 3]);
  7600. * // => [2, 3]
  7601. *
  7602. * _.drop([1, 2, 3], 2);
  7603. * // => [3]
  7604. *
  7605. * _.drop([1, 2, 3], 5);
  7606. * // => []
  7607. *
  7608. * _.drop([1, 2, 3], 0);
  7609. * // => [1, 2, 3]
  7610. */
  7611. function drop(array, n, guard) {
  7612. var length = array == null ? 0 : array.length;
  7613. if (!length) {
  7614. return [];
  7615. }
  7616. n = (guard || n === undefined) ? 1 : toInteger(n);
  7617. return baseSlice(array, n < 0 ? 0 : n, length);
  7618. }
  7619. /**
  7620. * Creates a slice of `array` with `n` elements dropped from the end.
  7621. *
  7622. * @static
  7623. * @memberOf _
  7624. * @since 3.0.0
  7625. * @category Array
  7626. * @param {Array} array The array to query.
  7627. * @param {number} [n=1] The number of elements to drop.
  7628. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7629. * @returns {Array} Returns the slice of `array`.
  7630. * @example
  7631. *
  7632. * _.dropRight([1, 2, 3]);
  7633. * // => [1, 2]
  7634. *
  7635. * _.dropRight([1, 2, 3], 2);
  7636. * // => [1]
  7637. *
  7638. * _.dropRight([1, 2, 3], 5);
  7639. * // => []
  7640. *
  7641. * _.dropRight([1, 2, 3], 0);
  7642. * // => [1, 2, 3]
  7643. */
  7644. function dropRight(array, n, guard) {
  7645. var length = array == null ? 0 : array.length;
  7646. if (!length) {
  7647. return [];
  7648. }
  7649. n = (guard || n === undefined) ? 1 : toInteger(n);
  7650. n = length - n;
  7651. return baseSlice(array, 0, n < 0 ? 0 : n);
  7652. }
  7653. /**
  7654. * Creates a slice of `array` excluding elements dropped from the end.
  7655. * Elements are dropped until `predicate` returns falsey. The predicate is
  7656. * invoked with three arguments: (value, index, array).
  7657. *
  7658. * @static
  7659. * @memberOf _
  7660. * @since 3.0.0
  7661. * @category Array
  7662. * @param {Array} array The array to query.
  7663. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7664. * @returns {Array} Returns the slice of `array`.
  7665. * @example
  7666. *
  7667. * var users = [
  7668. * { 'user': 'barney', 'active': true },
  7669. * { 'user': 'fred', 'active': false },
  7670. * { 'user': 'pebbles', 'active': false }
  7671. * ];
  7672. *
  7673. * _.dropRightWhile(users, function(o) { return !o.active; });
  7674. * // => objects for ['barney']
  7675. *
  7676. * // The `_.matches` iteratee shorthand.
  7677. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7678. * // => objects for ['barney', 'fred']
  7679. *
  7680. * // The `_.matchesProperty` iteratee shorthand.
  7681. * _.dropRightWhile(users, ['active', false]);
  7682. * // => objects for ['barney']
  7683. *
  7684. * // The `_.property` iteratee shorthand.
  7685. * _.dropRightWhile(users, 'active');
  7686. * // => objects for ['barney', 'fred', 'pebbles']
  7687. */
  7688. function dropRightWhile(array, predicate) {
  7689. return (array && array.length)
  7690. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7691. : [];
  7692. }
  7693. /**
  7694. * Creates a slice of `array` excluding elements dropped from the beginning.
  7695. * Elements are dropped until `predicate` returns falsey. The predicate is
  7696. * invoked with three arguments: (value, index, array).
  7697. *
  7698. * @static
  7699. * @memberOf _
  7700. * @since 3.0.0
  7701. * @category Array
  7702. * @param {Array} array The array to query.
  7703. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7704. * @returns {Array} Returns the slice of `array`.
  7705. * @example
  7706. *
  7707. * var users = [
  7708. * { 'user': 'barney', 'active': false },
  7709. * { 'user': 'fred', 'active': false },
  7710. * { 'user': 'pebbles', 'active': true }
  7711. * ];
  7712. *
  7713. * _.dropWhile(users, function(o) { return !o.active; });
  7714. * // => objects for ['pebbles']
  7715. *
  7716. * // The `_.matches` iteratee shorthand.
  7717. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7718. * // => objects for ['fred', 'pebbles']
  7719. *
  7720. * // The `_.matchesProperty` iteratee shorthand.
  7721. * _.dropWhile(users, ['active', false]);
  7722. * // => objects for ['pebbles']
  7723. *
  7724. * // The `_.property` iteratee shorthand.
  7725. * _.dropWhile(users, 'active');
  7726. * // => objects for ['barney', 'fred', 'pebbles']
  7727. */
  7728. function dropWhile(array, predicate) {
  7729. return (array && array.length)
  7730. ? baseWhile(array, getIteratee(predicate, 3), true)
  7731. : [];
  7732. }
  7733. /**
  7734. * Fills elements of `array` with `value` from `start` up to, but not
  7735. * including, `end`.
  7736. *
  7737. * **Note:** This method mutates `array`.
  7738. *
  7739. * @static
  7740. * @memberOf _
  7741. * @since 3.2.0
  7742. * @category Array
  7743. * @param {Array} array The array to fill.
  7744. * @param {*} value The value to fill `array` with.
  7745. * @param {number} [start=0] The start position.
  7746. * @param {number} [end=array.length] The end position.
  7747. * @returns {Array} Returns `array`.
  7748. * @example
  7749. *
  7750. * var array = [1, 2, 3];
  7751. *
  7752. * _.fill(array, 'a');
  7753. * console.log(array);
  7754. * // => ['a', 'a', 'a']
  7755. *
  7756. * _.fill(Array(3), 2);
  7757. * // => [2, 2, 2]
  7758. *
  7759. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7760. * // => [4, '*', '*', 10]
  7761. */
  7762. function fill(array, value, start, end) {
  7763. var length = array == null ? 0 : array.length;
  7764. if (!length) {
  7765. return [];
  7766. }
  7767. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7768. start = 0;
  7769. end = length;
  7770. }
  7771. return baseFill(array, value, start, end);
  7772. }
  7773. /**
  7774. * This method is like `_.find` except that it returns the index of the first
  7775. * element `predicate` returns truthy for instead of the element itself.
  7776. *
  7777. * @static
  7778. * @memberOf _
  7779. * @since 1.1.0
  7780. * @category Array
  7781. * @param {Array} array The array to inspect.
  7782. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7783. * @param {number} [fromIndex=0] The index to search from.
  7784. * @returns {number} Returns the index of the found element, else `-1`.
  7785. * @example
  7786. *
  7787. * var users = [
  7788. * { 'user': 'barney', 'active': false },
  7789. * { 'user': 'fred', 'active': false },
  7790. * { 'user': 'pebbles', 'active': true }
  7791. * ];
  7792. *
  7793. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7794. * // => 0
  7795. *
  7796. * // The `_.matches` iteratee shorthand.
  7797. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7798. * // => 1
  7799. *
  7800. * // The `_.matchesProperty` iteratee shorthand.
  7801. * _.findIndex(users, ['active', false]);
  7802. * // => 0
  7803. *
  7804. * // The `_.property` iteratee shorthand.
  7805. * _.findIndex(users, 'active');
  7806. * // => 2
  7807. */
  7808. function findIndex(array, predicate, fromIndex) {
  7809. var length = array == null ? 0 : array.length;
  7810. if (!length) {
  7811. return -1;
  7812. }
  7813. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7814. if (index < 0) {
  7815. index = nativeMax(length + index, 0);
  7816. }
  7817. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7818. }
  7819. /**
  7820. * This method is like `_.findIndex` except that it iterates over elements
  7821. * of `collection` from right to left.
  7822. *
  7823. * @static
  7824. * @memberOf _
  7825. * @since 2.0.0
  7826. * @category Array
  7827. * @param {Array} array The array to inspect.
  7828. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7829. * @param {number} [fromIndex=array.length-1] The index to search from.
  7830. * @returns {number} Returns the index of the found element, else `-1`.
  7831. * @example
  7832. *
  7833. * var users = [
  7834. * { 'user': 'barney', 'active': true },
  7835. * { 'user': 'fred', 'active': false },
  7836. * { 'user': 'pebbles', 'active': false }
  7837. * ];
  7838. *
  7839. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7840. * // => 2
  7841. *
  7842. * // The `_.matches` iteratee shorthand.
  7843. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7844. * // => 0
  7845. *
  7846. * // The `_.matchesProperty` iteratee shorthand.
  7847. * _.findLastIndex(users, ['active', false]);
  7848. * // => 2
  7849. *
  7850. * // The `_.property` iteratee shorthand.
  7851. * _.findLastIndex(users, 'active');
  7852. * // => 0
  7853. */
  7854. function findLastIndex(array, predicate, fromIndex) {
  7855. var length = array == null ? 0 : array.length;
  7856. if (!length) {
  7857. return -1;
  7858. }
  7859. var index = length - 1;
  7860. if (fromIndex !== undefined) {
  7861. index = toInteger(fromIndex);
  7862. index = fromIndex < 0
  7863. ? nativeMax(length + index, 0)
  7864. : nativeMin(index, length - 1);
  7865. }
  7866. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7867. }
  7868. /**
  7869. * Flattens `array` a single level deep.
  7870. *
  7871. * @static
  7872. * @memberOf _
  7873. * @since 0.1.0
  7874. * @category Array
  7875. * @param {Array} array The array to flatten.
  7876. * @returns {Array} Returns the new flattened array.
  7877. * @example
  7878. *
  7879. * _.flatten([1, [2, [3, [4]], 5]]);
  7880. * // => [1, 2, [3, [4]], 5]
  7881. */
  7882. function flatten(array) {
  7883. var length = array == null ? 0 : array.length;
  7884. return length ? baseFlatten(array, 1) : [];
  7885. }
  7886. /**
  7887. * Recursively flattens `array`.
  7888. *
  7889. * @static
  7890. * @memberOf _
  7891. * @since 3.0.0
  7892. * @category Array
  7893. * @param {Array} array The array to flatten.
  7894. * @returns {Array} Returns the new flattened array.
  7895. * @example
  7896. *
  7897. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7898. * // => [1, 2, 3, 4, 5]
  7899. */
  7900. function flattenDeep(array) {
  7901. var length = array == null ? 0 : array.length;
  7902. return length ? baseFlatten(array, INFINITY) : [];
  7903. }
  7904. /**
  7905. * Recursively flatten `array` up to `depth` times.
  7906. *
  7907. * @static
  7908. * @memberOf _
  7909. * @since 4.4.0
  7910. * @category Array
  7911. * @param {Array} array The array to flatten.
  7912. * @param {number} [depth=1] The maximum recursion depth.
  7913. * @returns {Array} Returns the new flattened array.
  7914. * @example
  7915. *
  7916. * var array = [1, [2, [3, [4]], 5]];
  7917. *
  7918. * _.flattenDepth(array, 1);
  7919. * // => [1, 2, [3, [4]], 5]
  7920. *
  7921. * _.flattenDepth(array, 2);
  7922. * // => [1, 2, 3, [4], 5]
  7923. */
  7924. function flattenDepth(array, depth) {
  7925. var length = array == null ? 0 : array.length;
  7926. if (!length) {
  7927. return [];
  7928. }
  7929. depth = depth === undefined ? 1 : toInteger(depth);
  7930. return baseFlatten(array, depth);
  7931. }
  7932. /**
  7933. * The inverse of `_.toPairs`; this method returns an object composed
  7934. * from key-value `pairs`.
  7935. *
  7936. * @static
  7937. * @memberOf _
  7938. * @since 4.0.0
  7939. * @category Array
  7940. * @param {Array} pairs The key-value pairs.
  7941. * @returns {Object} Returns the new object.
  7942. * @example
  7943. *
  7944. * _.fromPairs([['a', 1], ['b', 2]]);
  7945. * // => { 'a': 1, 'b': 2 }
  7946. */
  7947. function fromPairs(pairs) {
  7948. var index = -1,
  7949. length = pairs == null ? 0 : pairs.length,
  7950. result = {};
  7951. while (++index < length) {
  7952. var pair = pairs[index];
  7953. result[pair[0]] = pair[1];
  7954. }
  7955. return result;
  7956. }
  7957. /**
  7958. * Gets the first element of `array`.
  7959. *
  7960. * @static
  7961. * @memberOf _
  7962. * @since 0.1.0
  7963. * @alias first
  7964. * @category Array
  7965. * @param {Array} array The array to query.
  7966. * @returns {*} Returns the first element of `array`.
  7967. * @example
  7968. *
  7969. * _.head([1, 2, 3]);
  7970. * // => 1
  7971. *
  7972. * _.head([]);
  7973. * // => undefined
  7974. */
  7975. function head(array) {
  7976. return (array && array.length) ? array[0] : undefined;
  7977. }
  7978. /**
  7979. * Gets the index at which the first occurrence of `value` is found in `array`
  7980. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7981. * for equality comparisons. If `fromIndex` is negative, it's used as the
  7982. * offset from the end of `array`.
  7983. *
  7984. * @static
  7985. * @memberOf _
  7986. * @since 0.1.0
  7987. * @category Array
  7988. * @param {Array} array The array to inspect.
  7989. * @param {*} value The value to search for.
  7990. * @param {number} [fromIndex=0] The index to search from.
  7991. * @returns {number} Returns the index of the matched value, else `-1`.
  7992. * @example
  7993. *
  7994. * _.indexOf([1, 2, 1, 2], 2);
  7995. * // => 1
  7996. *
  7997. * // Search from the `fromIndex`.
  7998. * _.indexOf([1, 2, 1, 2], 2, 2);
  7999. * // => 3
  8000. */
  8001. function indexOf(array, value, fromIndex) {
  8002. var length = array == null ? 0 : array.length;
  8003. if (!length) {
  8004. return -1;
  8005. }
  8006. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8007. if (index < 0) {
  8008. index = nativeMax(length + index, 0);
  8009. }
  8010. return baseIndexOf(array, value, index);
  8011. }
  8012. /**
  8013. * Gets all but the last element of `array`.
  8014. *
  8015. * @static
  8016. * @memberOf _
  8017. * @since 0.1.0
  8018. * @category Array
  8019. * @param {Array} array The array to query.
  8020. * @returns {Array} Returns the slice of `array`.
  8021. * @example
  8022. *
  8023. * _.initial([1, 2, 3]);
  8024. * // => [1, 2]
  8025. */
  8026. function initial(array) {
  8027. var length = array == null ? 0 : array.length;
  8028. return length ? baseSlice(array, 0, -1) : [];
  8029. }
  8030. /**
  8031. * Creates an array of unique values that are included in all given arrays
  8032. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8033. * for equality comparisons. The order and references of result values are
  8034. * determined by the first array.
  8035. *
  8036. * @static
  8037. * @memberOf _
  8038. * @since 0.1.0
  8039. * @category Array
  8040. * @param {...Array} [arrays] The arrays to inspect.
  8041. * @returns {Array} Returns the new array of intersecting values.
  8042. * @example
  8043. *
  8044. * _.intersection([2, 1], [2, 3]);
  8045. * // => [2]
  8046. */
  8047. var intersection = baseRest(function(arrays) {
  8048. var mapped = arrayMap(arrays, castArrayLikeObject);
  8049. return (mapped.length && mapped[0] === arrays[0])
  8050. ? baseIntersection(mapped)
  8051. : [];
  8052. });
  8053. /**
  8054. * This method is like `_.intersection` except that it accepts `iteratee`
  8055. * which is invoked for each element of each `arrays` to generate the criterion
  8056. * by which they're compared. The order and references of result values are
  8057. * determined by the first array. The iteratee is invoked with one argument:
  8058. * (value).
  8059. *
  8060. * @static
  8061. * @memberOf _
  8062. * @since 4.0.0
  8063. * @category Array
  8064. * @param {...Array} [arrays] The arrays to inspect.
  8065. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8066. * @returns {Array} Returns the new array of intersecting values.
  8067. * @example
  8068. *
  8069. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8070. * // => [2.1]
  8071. *
  8072. * // The `_.property` iteratee shorthand.
  8073. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8074. * // => [{ 'x': 1 }]
  8075. */
  8076. var intersectionBy = baseRest(function(arrays) {
  8077. var iteratee = last(arrays),
  8078. mapped = arrayMap(arrays, castArrayLikeObject);
  8079. if (iteratee === last(mapped)) {
  8080. iteratee = undefined;
  8081. } else {
  8082. mapped.pop();
  8083. }
  8084. return (mapped.length && mapped[0] === arrays[0])
  8085. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8086. : [];
  8087. });
  8088. /**
  8089. * This method is like `_.intersection` except that it accepts `comparator`
  8090. * which is invoked to compare elements of `arrays`. The order and references
  8091. * of result values are determined by the first array. The comparator is
  8092. * invoked with two arguments: (arrVal, othVal).
  8093. *
  8094. * @static
  8095. * @memberOf _
  8096. * @since 4.0.0
  8097. * @category Array
  8098. * @param {...Array} [arrays] The arrays to inspect.
  8099. * @param {Function} [comparator] The comparator invoked per element.
  8100. * @returns {Array} Returns the new array of intersecting values.
  8101. * @example
  8102. *
  8103. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8104. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8105. *
  8106. * _.intersectionWith(objects, others, _.isEqual);
  8107. * // => [{ 'x': 1, 'y': 2 }]
  8108. */
  8109. var intersectionWith = baseRest(function(arrays) {
  8110. var comparator = last(arrays),
  8111. mapped = arrayMap(arrays, castArrayLikeObject);
  8112. comparator = typeof comparator == 'function' ? comparator : undefined;
  8113. if (comparator) {
  8114. mapped.pop();
  8115. }
  8116. return (mapped.length && mapped[0] === arrays[0])
  8117. ? baseIntersection(mapped, undefined, comparator)
  8118. : [];
  8119. });
  8120. /**
  8121. * Converts all elements in `array` into a string separated by `separator`.
  8122. *
  8123. * @static
  8124. * @memberOf _
  8125. * @since 4.0.0
  8126. * @category Array
  8127. * @param {Array} array The array to convert.
  8128. * @param {string} [separator=','] The element separator.
  8129. * @returns {string} Returns the joined string.
  8130. * @example
  8131. *
  8132. * _.join(['a', 'b', 'c'], '~');
  8133. * // => 'a~b~c'
  8134. */
  8135. function join(array, separator) {
  8136. return array == null ? '' : nativeJoin.call(array, separator);
  8137. }
  8138. /**
  8139. * Gets the last element of `array`.
  8140. *
  8141. * @static
  8142. * @memberOf _
  8143. * @since 0.1.0
  8144. * @category Array
  8145. * @param {Array} array The array to query.
  8146. * @returns {*} Returns the last element of `array`.
  8147. * @example
  8148. *
  8149. * _.last([1, 2, 3]);
  8150. * // => 3
  8151. */
  8152. function last(array) {
  8153. var length = array == null ? 0 : array.length;
  8154. return length ? array[length - 1] : undefined;
  8155. }
  8156. /**
  8157. * This method is like `_.indexOf` except that it iterates over elements of
  8158. * `array` from right to left.
  8159. *
  8160. * @static
  8161. * @memberOf _
  8162. * @since 0.1.0
  8163. * @category Array
  8164. * @param {Array} array The array to inspect.
  8165. * @param {*} value The value to search for.
  8166. * @param {number} [fromIndex=array.length-1] The index to search from.
  8167. * @returns {number} Returns the index of the matched value, else `-1`.
  8168. * @example
  8169. *
  8170. * _.lastIndexOf([1, 2, 1, 2], 2);
  8171. * // => 3
  8172. *
  8173. * // Search from the `fromIndex`.
  8174. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8175. * // => 1
  8176. */
  8177. function lastIndexOf(array, value, fromIndex) {
  8178. var length = array == null ? 0 : array.length;
  8179. if (!length) {
  8180. return -1;
  8181. }
  8182. var index = length;
  8183. if (fromIndex !== undefined) {
  8184. index = toInteger(fromIndex);
  8185. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8186. }
  8187. return value === value
  8188. ? strictLastIndexOf(array, value, index)
  8189. : baseFindIndex(array, baseIsNaN, index, true);
  8190. }
  8191. /**
  8192. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8193. * element from the end is returned.
  8194. *
  8195. * @static
  8196. * @memberOf _
  8197. * @since 4.11.0
  8198. * @category Array
  8199. * @param {Array} array The array to query.
  8200. * @param {number} [n=0] The index of the element to return.
  8201. * @returns {*} Returns the nth element of `array`.
  8202. * @example
  8203. *
  8204. * var array = ['a', 'b', 'c', 'd'];
  8205. *
  8206. * _.nth(array, 1);
  8207. * // => 'b'
  8208. *
  8209. * _.nth(array, -2);
  8210. * // => 'c';
  8211. */
  8212. function nth(array, n) {
  8213. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8214. }
  8215. /**
  8216. * Removes all given values from `array` using
  8217. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8218. * for equality comparisons.
  8219. *
  8220. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8221. * to remove elements from an array by predicate.
  8222. *
  8223. * @static
  8224. * @memberOf _
  8225. * @since 2.0.0
  8226. * @category Array
  8227. * @param {Array} array The array to modify.
  8228. * @param {...*} [values] The values to remove.
  8229. * @returns {Array} Returns `array`.
  8230. * @example
  8231. *
  8232. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8233. *
  8234. * _.pull(array, 'a', 'c');
  8235. * console.log(array);
  8236. * // => ['b', 'b']
  8237. */
  8238. var pull = baseRest(pullAll);
  8239. /**
  8240. * This method is like `_.pull` except that it accepts an array of values to remove.
  8241. *
  8242. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8243. *
  8244. * @static
  8245. * @memberOf _
  8246. * @since 4.0.0
  8247. * @category Array
  8248. * @param {Array} array The array to modify.
  8249. * @param {Array} values The values to remove.
  8250. * @returns {Array} Returns `array`.
  8251. * @example
  8252. *
  8253. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8254. *
  8255. * _.pullAll(array, ['a', 'c']);
  8256. * console.log(array);
  8257. * // => ['b', 'b']
  8258. */
  8259. function pullAll(array, values) {
  8260. return (array && array.length && values && values.length)
  8261. ? basePullAll(array, values)
  8262. : array;
  8263. }
  8264. /**
  8265. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8266. * invoked for each element of `array` and `values` to generate the criterion
  8267. * by which they're compared. The iteratee is invoked with one argument: (value).
  8268. *
  8269. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8270. *
  8271. * @static
  8272. * @memberOf _
  8273. * @since 4.0.0
  8274. * @category Array
  8275. * @param {Array} array The array to modify.
  8276. * @param {Array} values The values to remove.
  8277. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8278. * @returns {Array} Returns `array`.
  8279. * @example
  8280. *
  8281. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8282. *
  8283. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8284. * console.log(array);
  8285. * // => [{ 'x': 2 }]
  8286. */
  8287. function pullAllBy(array, values, iteratee) {
  8288. return (array && array.length && values && values.length)
  8289. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8290. : array;
  8291. }
  8292. /**
  8293. * This method is like `_.pullAll` except that it accepts `comparator` which
  8294. * is invoked to compare elements of `array` to `values`. The comparator is
  8295. * invoked with two arguments: (arrVal, othVal).
  8296. *
  8297. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8298. *
  8299. * @static
  8300. * @memberOf _
  8301. * @since 4.6.0
  8302. * @category Array
  8303. * @param {Array} array The array to modify.
  8304. * @param {Array} values The values to remove.
  8305. * @param {Function} [comparator] The comparator invoked per element.
  8306. * @returns {Array} Returns `array`.
  8307. * @example
  8308. *
  8309. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8310. *
  8311. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8312. * console.log(array);
  8313. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8314. */
  8315. function pullAllWith(array, values, comparator) {
  8316. return (array && array.length && values && values.length)
  8317. ? basePullAll(array, values, undefined, comparator)
  8318. : array;
  8319. }
  8320. /**
  8321. * Removes elements from `array` corresponding to `indexes` and returns an
  8322. * array of removed elements.
  8323. *
  8324. * **Note:** Unlike `_.at`, this method mutates `array`.
  8325. *
  8326. * @static
  8327. * @memberOf _
  8328. * @since 3.0.0
  8329. * @category Array
  8330. * @param {Array} array The array to modify.
  8331. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8332. * @returns {Array} Returns the new array of removed elements.
  8333. * @example
  8334. *
  8335. * var array = ['a', 'b', 'c', 'd'];
  8336. * var pulled = _.pullAt(array, [1, 3]);
  8337. *
  8338. * console.log(array);
  8339. * // => ['a', 'c']
  8340. *
  8341. * console.log(pulled);
  8342. * // => ['b', 'd']
  8343. */
  8344. var pullAt = flatRest(function(array, indexes) {
  8345. var length = array == null ? 0 : array.length,
  8346. result = baseAt(array, indexes);
  8347. basePullAt(array, arrayMap(indexes, function(index) {
  8348. return isIndex(index, length) ? +index : index;
  8349. }).sort(compareAscending));
  8350. return result;
  8351. });
  8352. /**
  8353. * Removes all elements from `array` that `predicate` returns truthy for
  8354. * and returns an array of the removed elements. The predicate is invoked
  8355. * with three arguments: (value, index, array).
  8356. *
  8357. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8358. * to pull elements from an array by value.
  8359. *
  8360. * @static
  8361. * @memberOf _
  8362. * @since 2.0.0
  8363. * @category Array
  8364. * @param {Array} array The array to modify.
  8365. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8366. * @returns {Array} Returns the new array of removed elements.
  8367. * @example
  8368. *
  8369. * var array = [1, 2, 3, 4];
  8370. * var evens = _.remove(array, function(n) {
  8371. * return n % 2 == 0;
  8372. * });
  8373. *
  8374. * console.log(array);
  8375. * // => [1, 3]
  8376. *
  8377. * console.log(evens);
  8378. * // => [2, 4]
  8379. */
  8380. function remove(array, predicate) {
  8381. var result = [];
  8382. if (!(array && array.length)) {
  8383. return result;
  8384. }
  8385. var index = -1,
  8386. indexes = [],
  8387. length = array.length;
  8388. predicate = getIteratee(predicate, 3);
  8389. while (++index < length) {
  8390. var value = array[index];
  8391. if (predicate(value, index, array)) {
  8392. result.push(value);
  8393. indexes.push(index);
  8394. }
  8395. }
  8396. basePullAt(array, indexes);
  8397. return result;
  8398. }
  8399. /**
  8400. * Reverses `array` so that the first element becomes the last, the second
  8401. * element becomes the second to last, and so on.
  8402. *
  8403. * **Note:** This method mutates `array` and is based on
  8404. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8405. *
  8406. * @static
  8407. * @memberOf _
  8408. * @since 4.0.0
  8409. * @category Array
  8410. * @param {Array} array The array to modify.
  8411. * @returns {Array} Returns `array`.
  8412. * @example
  8413. *
  8414. * var array = [1, 2, 3];
  8415. *
  8416. * _.reverse(array);
  8417. * // => [3, 2, 1]
  8418. *
  8419. * console.log(array);
  8420. * // => [3, 2, 1]
  8421. */
  8422. function reverse(array) {
  8423. return array == null ? array : nativeReverse.call(array);
  8424. }
  8425. /**
  8426. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8427. *
  8428. * **Note:** This method is used instead of
  8429. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8430. * returned.
  8431. *
  8432. * @static
  8433. * @memberOf _
  8434. * @since 3.0.0
  8435. * @category Array
  8436. * @param {Array} array The array to slice.
  8437. * @param {number} [start=0] The start position.
  8438. * @param {number} [end=array.length] The end position.
  8439. * @returns {Array} Returns the slice of `array`.
  8440. */
  8441. function slice(array, start, end) {
  8442. var length = array == null ? 0 : array.length;
  8443. if (!length) {
  8444. return [];
  8445. }
  8446. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8447. start = 0;
  8448. end = length;
  8449. }
  8450. else {
  8451. start = start == null ? 0 : toInteger(start);
  8452. end = end === undefined ? length : toInteger(end);
  8453. }
  8454. return baseSlice(array, start, end);
  8455. }
  8456. /**
  8457. * Uses a binary search to determine the lowest index at which `value`
  8458. * should be inserted into `array` in order to maintain its sort order.
  8459. *
  8460. * @static
  8461. * @memberOf _
  8462. * @since 0.1.0
  8463. * @category Array
  8464. * @param {Array} array The sorted array to inspect.
  8465. * @param {*} value The value to evaluate.
  8466. * @returns {number} Returns the index at which `value` should be inserted
  8467. * into `array`.
  8468. * @example
  8469. *
  8470. * _.sortedIndex([30, 50], 40);
  8471. * // => 1
  8472. */
  8473. function sortedIndex(array, value) {
  8474. return baseSortedIndex(array, value);
  8475. }
  8476. /**
  8477. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8478. * which is invoked for `value` and each element of `array` to compute their
  8479. * sort ranking. The iteratee is invoked with one argument: (value).
  8480. *
  8481. * @static
  8482. * @memberOf _
  8483. * @since 4.0.0
  8484. * @category Array
  8485. * @param {Array} array The sorted array to inspect.
  8486. * @param {*} value The value to evaluate.
  8487. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8488. * @returns {number} Returns the index at which `value` should be inserted
  8489. * into `array`.
  8490. * @example
  8491. *
  8492. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8493. *
  8494. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8495. * // => 0
  8496. *
  8497. * // The `_.property` iteratee shorthand.
  8498. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8499. * // => 0
  8500. */
  8501. function sortedIndexBy(array, value, iteratee) {
  8502. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8503. }
  8504. /**
  8505. * This method is like `_.indexOf` except that it performs a binary
  8506. * search on a sorted `array`.
  8507. *
  8508. * @static
  8509. * @memberOf _
  8510. * @since 4.0.0
  8511. * @category Array
  8512. * @param {Array} array The array to inspect.
  8513. * @param {*} value The value to search for.
  8514. * @returns {number} Returns the index of the matched value, else `-1`.
  8515. * @example
  8516. *
  8517. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8518. * // => 1
  8519. */
  8520. function sortedIndexOf(array, value) {
  8521. var length = array == null ? 0 : array.length;
  8522. if (length) {
  8523. var index = baseSortedIndex(array, value);
  8524. if (index < length && eq(array[index], value)) {
  8525. return index;
  8526. }
  8527. }
  8528. return -1;
  8529. }
  8530. /**
  8531. * This method is like `_.sortedIndex` except that it returns the highest
  8532. * index at which `value` should be inserted into `array` in order to
  8533. * maintain its sort order.
  8534. *
  8535. * @static
  8536. * @memberOf _
  8537. * @since 3.0.0
  8538. * @category Array
  8539. * @param {Array} array The sorted array to inspect.
  8540. * @param {*} value The value to evaluate.
  8541. * @returns {number} Returns the index at which `value` should be inserted
  8542. * into `array`.
  8543. * @example
  8544. *
  8545. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8546. * // => 4
  8547. */
  8548. function sortedLastIndex(array, value) {
  8549. return baseSortedIndex(array, value, true);
  8550. }
  8551. /**
  8552. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8553. * which is invoked for `value` and each element of `array` to compute their
  8554. * sort ranking. The iteratee is invoked with one argument: (value).
  8555. *
  8556. * @static
  8557. * @memberOf _
  8558. * @since 4.0.0
  8559. * @category Array
  8560. * @param {Array} array The sorted array to inspect.
  8561. * @param {*} value The value to evaluate.
  8562. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8563. * @returns {number} Returns the index at which `value` should be inserted
  8564. * into `array`.
  8565. * @example
  8566. *
  8567. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8568. *
  8569. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8570. * // => 1
  8571. *
  8572. * // The `_.property` iteratee shorthand.
  8573. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8574. * // => 1
  8575. */
  8576. function sortedLastIndexBy(array, value, iteratee) {
  8577. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8578. }
  8579. /**
  8580. * This method is like `_.lastIndexOf` except that it performs a binary
  8581. * search on a sorted `array`.
  8582. *
  8583. * @static
  8584. * @memberOf _
  8585. * @since 4.0.0
  8586. * @category Array
  8587. * @param {Array} array The array to inspect.
  8588. * @param {*} value The value to search for.
  8589. * @returns {number} Returns the index of the matched value, else `-1`.
  8590. * @example
  8591. *
  8592. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8593. * // => 3
  8594. */
  8595. function sortedLastIndexOf(array, value) {
  8596. var length = array == null ? 0 : array.length;
  8597. if (length) {
  8598. var index = baseSortedIndex(array, value, true) - 1;
  8599. if (eq(array[index], value)) {
  8600. return index;
  8601. }
  8602. }
  8603. return -1;
  8604. }
  8605. /**
  8606. * This method is like `_.uniq` except that it's designed and optimized
  8607. * for sorted arrays.
  8608. *
  8609. * @static
  8610. * @memberOf _
  8611. * @since 4.0.0
  8612. * @category Array
  8613. * @param {Array} array The array to inspect.
  8614. * @returns {Array} Returns the new duplicate free array.
  8615. * @example
  8616. *
  8617. * _.sortedUniq([1, 1, 2]);
  8618. * // => [1, 2]
  8619. */
  8620. function sortedUniq(array) {
  8621. return (array && array.length)
  8622. ? baseSortedUniq(array)
  8623. : [];
  8624. }
  8625. /**
  8626. * This method is like `_.uniqBy` except that it's designed and optimized
  8627. * for sorted arrays.
  8628. *
  8629. * @static
  8630. * @memberOf _
  8631. * @since 4.0.0
  8632. * @category Array
  8633. * @param {Array} array The array to inspect.
  8634. * @param {Function} [iteratee] The iteratee invoked per element.
  8635. * @returns {Array} Returns the new duplicate free array.
  8636. * @example
  8637. *
  8638. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8639. * // => [1.1, 2.3]
  8640. */
  8641. function sortedUniqBy(array, iteratee) {
  8642. return (array && array.length)
  8643. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8644. : [];
  8645. }
  8646. /**
  8647. * Gets all but the first element of `array`.
  8648. *
  8649. * @static
  8650. * @memberOf _
  8651. * @since 4.0.0
  8652. * @category Array
  8653. * @param {Array} array The array to query.
  8654. * @returns {Array} Returns the slice of `array`.
  8655. * @example
  8656. *
  8657. * _.tail([1, 2, 3]);
  8658. * // => [2, 3]
  8659. */
  8660. function tail(array) {
  8661. var length = array == null ? 0 : array.length;
  8662. return length ? baseSlice(array, 1, length) : [];
  8663. }
  8664. /**
  8665. * Creates a slice of `array` with `n` elements taken from the beginning.
  8666. *
  8667. * @static
  8668. * @memberOf _
  8669. * @since 0.1.0
  8670. * @category Array
  8671. * @param {Array} array The array to query.
  8672. * @param {number} [n=1] The number of elements to take.
  8673. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8674. * @returns {Array} Returns the slice of `array`.
  8675. * @example
  8676. *
  8677. * _.take([1, 2, 3]);
  8678. * // => [1]
  8679. *
  8680. * _.take([1, 2, 3], 2);
  8681. * // => [1, 2]
  8682. *
  8683. * _.take([1, 2, 3], 5);
  8684. * // => [1, 2, 3]
  8685. *
  8686. * _.take([1, 2, 3], 0);
  8687. * // => []
  8688. */
  8689. function take(array, n, guard) {
  8690. if (!(array && array.length)) {
  8691. return [];
  8692. }
  8693. n = (guard || n === undefined) ? 1 : toInteger(n);
  8694. return baseSlice(array, 0, n < 0 ? 0 : n);
  8695. }
  8696. /**
  8697. * Creates a slice of `array` with `n` elements taken from the end.
  8698. *
  8699. * @static
  8700. * @memberOf _
  8701. * @since 3.0.0
  8702. * @category Array
  8703. * @param {Array} array The array to query.
  8704. * @param {number} [n=1] The number of elements to take.
  8705. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8706. * @returns {Array} Returns the slice of `array`.
  8707. * @example
  8708. *
  8709. * _.takeRight([1, 2, 3]);
  8710. * // => [3]
  8711. *
  8712. * _.takeRight([1, 2, 3], 2);
  8713. * // => [2, 3]
  8714. *
  8715. * _.takeRight([1, 2, 3], 5);
  8716. * // => [1, 2, 3]
  8717. *
  8718. * _.takeRight([1, 2, 3], 0);
  8719. * // => []
  8720. */
  8721. function takeRight(array, n, guard) {
  8722. var length = array == null ? 0 : array.length;
  8723. if (!length) {
  8724. return [];
  8725. }
  8726. n = (guard || n === undefined) ? 1 : toInteger(n);
  8727. n = length - n;
  8728. return baseSlice(array, n < 0 ? 0 : n, length);
  8729. }
  8730. /**
  8731. * Creates a slice of `array` with elements taken from the end. Elements are
  8732. * taken until `predicate` returns falsey. The predicate is invoked with
  8733. * three arguments: (value, index, array).
  8734. *
  8735. * @static
  8736. * @memberOf _
  8737. * @since 3.0.0
  8738. * @category Array
  8739. * @param {Array} array The array to query.
  8740. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8741. * @returns {Array} Returns the slice of `array`.
  8742. * @example
  8743. *
  8744. * var users = [
  8745. * { 'user': 'barney', 'active': true },
  8746. * { 'user': 'fred', 'active': false },
  8747. * { 'user': 'pebbles', 'active': false }
  8748. * ];
  8749. *
  8750. * _.takeRightWhile(users, function(o) { return !o.active; });
  8751. * // => objects for ['fred', 'pebbles']
  8752. *
  8753. * // The `_.matches` iteratee shorthand.
  8754. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8755. * // => objects for ['pebbles']
  8756. *
  8757. * // The `_.matchesProperty` iteratee shorthand.
  8758. * _.takeRightWhile(users, ['active', false]);
  8759. * // => objects for ['fred', 'pebbles']
  8760. *
  8761. * // The `_.property` iteratee shorthand.
  8762. * _.takeRightWhile(users, 'active');
  8763. * // => []
  8764. */
  8765. function takeRightWhile(array, predicate) {
  8766. return (array && array.length)
  8767. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8768. : [];
  8769. }
  8770. /**
  8771. * Creates a slice of `array` with elements taken from the beginning. Elements
  8772. * are taken until `predicate` returns falsey. The predicate is invoked with
  8773. * three arguments: (value, index, array).
  8774. *
  8775. * @static
  8776. * @memberOf _
  8777. * @since 3.0.0
  8778. * @category Array
  8779. * @param {Array} array The array to query.
  8780. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8781. * @returns {Array} Returns the slice of `array`.
  8782. * @example
  8783. *
  8784. * var users = [
  8785. * { 'user': 'barney', 'active': false },
  8786. * { 'user': 'fred', 'active': false },
  8787. * { 'user': 'pebbles', 'active': true }
  8788. * ];
  8789. *
  8790. * _.takeWhile(users, function(o) { return !o.active; });
  8791. * // => objects for ['barney', 'fred']
  8792. *
  8793. * // The `_.matches` iteratee shorthand.
  8794. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8795. * // => objects for ['barney']
  8796. *
  8797. * // The `_.matchesProperty` iteratee shorthand.
  8798. * _.takeWhile(users, ['active', false]);
  8799. * // => objects for ['barney', 'fred']
  8800. *
  8801. * // The `_.property` iteratee shorthand.
  8802. * _.takeWhile(users, 'active');
  8803. * // => []
  8804. */
  8805. function takeWhile(array, predicate) {
  8806. return (array && array.length)
  8807. ? baseWhile(array, getIteratee(predicate, 3))
  8808. : [];
  8809. }
  8810. /**
  8811. * Creates an array of unique values, in order, from all given arrays using
  8812. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8813. * for equality comparisons.
  8814. *
  8815. * @static
  8816. * @memberOf _
  8817. * @since 0.1.0
  8818. * @category Array
  8819. * @param {...Array} [arrays] The arrays to inspect.
  8820. * @returns {Array} Returns the new array of combined values.
  8821. * @example
  8822. *
  8823. * _.union([2], [1, 2]);
  8824. * // => [2, 1]
  8825. */
  8826. var union = baseRest(function(arrays) {
  8827. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8828. });
  8829. /**
  8830. * This method is like `_.union` except that it accepts `iteratee` which is
  8831. * invoked for each element of each `arrays` to generate the criterion by
  8832. * which uniqueness is computed. Result values are chosen from the first
  8833. * array in which the value occurs. The iteratee is invoked with one argument:
  8834. * (value).
  8835. *
  8836. * @static
  8837. * @memberOf _
  8838. * @since 4.0.0
  8839. * @category Array
  8840. * @param {...Array} [arrays] The arrays to inspect.
  8841. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8842. * @returns {Array} Returns the new array of combined values.
  8843. * @example
  8844. *
  8845. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8846. * // => [2.1, 1.2]
  8847. *
  8848. * // The `_.property` iteratee shorthand.
  8849. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8850. * // => [{ 'x': 1 }, { 'x': 2 }]
  8851. */
  8852. var unionBy = baseRest(function(arrays) {
  8853. var iteratee = last(arrays);
  8854. if (isArrayLikeObject(iteratee)) {
  8855. iteratee = undefined;
  8856. }
  8857. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8858. });
  8859. /**
  8860. * This method is like `_.union` except that it accepts `comparator` which
  8861. * is invoked to compare elements of `arrays`. Result values are chosen from
  8862. * the first array in which the value occurs. The comparator is invoked
  8863. * with two arguments: (arrVal, othVal).
  8864. *
  8865. * @static
  8866. * @memberOf _
  8867. * @since 4.0.0
  8868. * @category Array
  8869. * @param {...Array} [arrays] The arrays to inspect.
  8870. * @param {Function} [comparator] The comparator invoked per element.
  8871. * @returns {Array} Returns the new array of combined values.
  8872. * @example
  8873. *
  8874. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8875. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8876. *
  8877. * _.unionWith(objects, others, _.isEqual);
  8878. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8879. */
  8880. var unionWith = baseRest(function(arrays) {
  8881. var comparator = last(arrays);
  8882. comparator = typeof comparator == 'function' ? comparator : undefined;
  8883. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8884. });
  8885. /**
  8886. * Creates a duplicate-free version of an array, using
  8887. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8888. * for equality comparisons, in which only the first occurrence of each element
  8889. * is kept. The order of result values is determined by the order they occur
  8890. * in the array.
  8891. *
  8892. * @static
  8893. * @memberOf _
  8894. * @since 0.1.0
  8895. * @category Array
  8896. * @param {Array} array The array to inspect.
  8897. * @returns {Array} Returns the new duplicate free array.
  8898. * @example
  8899. *
  8900. * _.uniq([2, 1, 2]);
  8901. * // => [2, 1]
  8902. */
  8903. function uniq(array) {
  8904. return (array && array.length) ? baseUniq(array) : [];
  8905. }
  8906. /**
  8907. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8908. * invoked for each element in `array` to generate the criterion by which
  8909. * uniqueness is computed. The order of result values is determined by the
  8910. * order they occur in the array. The iteratee is invoked with one argument:
  8911. * (value).
  8912. *
  8913. * @static
  8914. * @memberOf _
  8915. * @since 4.0.0
  8916. * @category Array
  8917. * @param {Array} array The array to inspect.
  8918. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8919. * @returns {Array} Returns the new duplicate free array.
  8920. * @example
  8921. *
  8922. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8923. * // => [2.1, 1.2]
  8924. *
  8925. * // The `_.property` iteratee shorthand.
  8926. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8927. * // => [{ 'x': 1 }, { 'x': 2 }]
  8928. */
  8929. function uniqBy(array, iteratee) {
  8930. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8931. }
  8932. /**
  8933. * This method is like `_.uniq` except that it accepts `comparator` which
  8934. * is invoked to compare elements of `array`. The order of result values is
  8935. * determined by the order they occur in the array.The comparator is invoked
  8936. * with two arguments: (arrVal, othVal).
  8937. *
  8938. * @static
  8939. * @memberOf _
  8940. * @since 4.0.0
  8941. * @category Array
  8942. * @param {Array} array The array to inspect.
  8943. * @param {Function} [comparator] The comparator invoked per element.
  8944. * @returns {Array} Returns the new duplicate free array.
  8945. * @example
  8946. *
  8947. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8948. *
  8949. * _.uniqWith(objects, _.isEqual);
  8950. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8951. */
  8952. function uniqWith(array, comparator) {
  8953. comparator = typeof comparator == 'function' ? comparator : undefined;
  8954. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8955. }
  8956. /**
  8957. * This method is like `_.zip` except that it accepts an array of grouped
  8958. * elements and creates an array regrouping the elements to their pre-zip
  8959. * configuration.
  8960. *
  8961. * @static
  8962. * @memberOf _
  8963. * @since 1.2.0
  8964. * @category Array
  8965. * @param {Array} array The array of grouped elements to process.
  8966. * @returns {Array} Returns the new array of regrouped elements.
  8967. * @example
  8968. *
  8969. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  8970. * // => [['a', 1, true], ['b', 2, false]]
  8971. *
  8972. * _.unzip(zipped);
  8973. * // => [['a', 'b'], [1, 2], [true, false]]
  8974. */
  8975. function unzip(array) {
  8976. if (!(array && array.length)) {
  8977. return [];
  8978. }
  8979. var length = 0;
  8980. array = arrayFilter(array, function(group) {
  8981. if (isArrayLikeObject(group)) {
  8982. length = nativeMax(group.length, length);
  8983. return true;
  8984. }
  8985. });
  8986. return baseTimes(length, function(index) {
  8987. return arrayMap(array, baseProperty(index));
  8988. });
  8989. }
  8990. /**
  8991. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  8992. * how regrouped values should be combined. The iteratee is invoked with the
  8993. * elements of each group: (...group).
  8994. *
  8995. * @static
  8996. * @memberOf _
  8997. * @since 3.8.0
  8998. * @category Array
  8999. * @param {Array} array The array of grouped elements to process.
  9000. * @param {Function} [iteratee=_.identity] The function to combine
  9001. * regrouped values.
  9002. * @returns {Array} Returns the new array of regrouped elements.
  9003. * @example
  9004. *
  9005. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9006. * // => [[1, 10, 100], [2, 20, 200]]
  9007. *
  9008. * _.unzipWith(zipped, _.add);
  9009. * // => [3, 30, 300]
  9010. */
  9011. function unzipWith(array, iteratee) {
  9012. if (!(array && array.length)) {
  9013. return [];
  9014. }
  9015. var result = unzip(array);
  9016. if (iteratee == null) {
  9017. return result;
  9018. }
  9019. return arrayMap(result, function(group) {
  9020. return apply(iteratee, undefined, group);
  9021. });
  9022. }
  9023. /**
  9024. * Creates an array excluding all given values using
  9025. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9026. * for equality comparisons.
  9027. *
  9028. * **Note:** Unlike `_.pull`, this method returns a new array.
  9029. *
  9030. * @static
  9031. * @memberOf _
  9032. * @since 0.1.0
  9033. * @category Array
  9034. * @param {Array} array The array to inspect.
  9035. * @param {...*} [values] The values to exclude.
  9036. * @returns {Array} Returns the new array of filtered values.
  9037. * @see _.difference, _.xor
  9038. * @example
  9039. *
  9040. * _.without([2, 1, 2, 3], 1, 2);
  9041. * // => [3]
  9042. */
  9043. var without = baseRest(function(array, values) {
  9044. return isArrayLikeObject(array)
  9045. ? baseDifference(array, values)
  9046. : [];
  9047. });
  9048. /**
  9049. * Creates an array of unique values that is the
  9050. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9051. * of the given arrays. The order of result values is determined by the order
  9052. * they occur in the arrays.
  9053. *
  9054. * @static
  9055. * @memberOf _
  9056. * @since 2.4.0
  9057. * @category Array
  9058. * @param {...Array} [arrays] The arrays to inspect.
  9059. * @returns {Array} Returns the new array of filtered values.
  9060. * @see _.difference, _.without
  9061. * @example
  9062. *
  9063. * _.xor([2, 1], [2, 3]);
  9064. * // => [1, 3]
  9065. */
  9066. var xor = baseRest(function(arrays) {
  9067. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9068. });
  9069. /**
  9070. * This method is like `_.xor` except that it accepts `iteratee` which is
  9071. * invoked for each element of each `arrays` to generate the criterion by
  9072. * which by which they're compared. The order of result values is determined
  9073. * by the order they occur in the arrays. The iteratee is invoked with one
  9074. * argument: (value).
  9075. *
  9076. * @static
  9077. * @memberOf _
  9078. * @since 4.0.0
  9079. * @category Array
  9080. * @param {...Array} [arrays] The arrays to inspect.
  9081. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9082. * @returns {Array} Returns the new array of filtered values.
  9083. * @example
  9084. *
  9085. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9086. * // => [1.2, 3.4]
  9087. *
  9088. * // The `_.property` iteratee shorthand.
  9089. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9090. * // => [{ 'x': 2 }]
  9091. */
  9092. var xorBy = baseRest(function(arrays) {
  9093. var iteratee = last(arrays);
  9094. if (isArrayLikeObject(iteratee)) {
  9095. iteratee = undefined;
  9096. }
  9097. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9098. });
  9099. /**
  9100. * This method is like `_.xor` except that it accepts `comparator` which is
  9101. * invoked to compare elements of `arrays`. The order of result values is
  9102. * determined by the order they occur in the arrays. The comparator is invoked
  9103. * with two arguments: (arrVal, othVal).
  9104. *
  9105. * @static
  9106. * @memberOf _
  9107. * @since 4.0.0
  9108. * @category Array
  9109. * @param {...Array} [arrays] The arrays to inspect.
  9110. * @param {Function} [comparator] The comparator invoked per element.
  9111. * @returns {Array} Returns the new array of filtered values.
  9112. * @example
  9113. *
  9114. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9115. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9116. *
  9117. * _.xorWith(objects, others, _.isEqual);
  9118. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9119. */
  9120. var xorWith = baseRest(function(arrays) {
  9121. var comparator = last(arrays);
  9122. comparator = typeof comparator == 'function' ? comparator : undefined;
  9123. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9124. });
  9125. /**
  9126. * Creates an array of grouped elements, the first of which contains the
  9127. * first elements of the given arrays, the second of which contains the
  9128. * second elements of the given arrays, and so on.
  9129. *
  9130. * @static
  9131. * @memberOf _
  9132. * @since 0.1.0
  9133. * @category Array
  9134. * @param {...Array} [arrays] The arrays to process.
  9135. * @returns {Array} Returns the new array of grouped elements.
  9136. * @example
  9137. *
  9138. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9139. * // => [['a', 1, true], ['b', 2, false]]
  9140. */
  9141. var zip = baseRest(unzip);
  9142. /**
  9143. * This method is like `_.fromPairs` except that it accepts two arrays,
  9144. * one of property identifiers and one of corresponding values.
  9145. *
  9146. * @static
  9147. * @memberOf _
  9148. * @since 0.4.0
  9149. * @category Array
  9150. * @param {Array} [props=[]] The property identifiers.
  9151. * @param {Array} [values=[]] The property values.
  9152. * @returns {Object} Returns the new object.
  9153. * @example
  9154. *
  9155. * _.zipObject(['a', 'b'], [1, 2]);
  9156. * // => { 'a': 1, 'b': 2 }
  9157. */
  9158. function zipObject(props, values) {
  9159. return baseZipObject(props || [], values || [], assignValue);
  9160. }
  9161. /**
  9162. * This method is like `_.zipObject` except that it supports property paths.
  9163. *
  9164. * @static
  9165. * @memberOf _
  9166. * @since 4.1.0
  9167. * @category Array
  9168. * @param {Array} [props=[]] The property identifiers.
  9169. * @param {Array} [values=[]] The property values.
  9170. * @returns {Object} Returns the new object.
  9171. * @example
  9172. *
  9173. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9174. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9175. */
  9176. function zipObjectDeep(props, values) {
  9177. return baseZipObject(props || [], values || [], baseSet);
  9178. }
  9179. /**
  9180. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9181. * how grouped values should be combined. The iteratee is invoked with the
  9182. * elements of each group: (...group).
  9183. *
  9184. * @static
  9185. * @memberOf _
  9186. * @since 3.8.0
  9187. * @category Array
  9188. * @param {...Array} [arrays] The arrays to process.
  9189. * @param {Function} [iteratee=_.identity] The function to combine
  9190. * grouped values.
  9191. * @returns {Array} Returns the new array of grouped elements.
  9192. * @example
  9193. *
  9194. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9195. * return a + b + c;
  9196. * });
  9197. * // => [111, 222]
  9198. */
  9199. var zipWith = baseRest(function(arrays) {
  9200. var length = arrays.length,
  9201. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9202. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9203. return unzipWith(arrays, iteratee);
  9204. });
  9205. /*------------------------------------------------------------------------*/
  9206. /**
  9207. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9208. * chain sequences enabled. The result of such sequences must be unwrapped
  9209. * with `_#value`.
  9210. *
  9211. * @static
  9212. * @memberOf _
  9213. * @since 1.3.0
  9214. * @category Seq
  9215. * @param {*} value The value to wrap.
  9216. * @returns {Object} Returns the new `lodash` wrapper instance.
  9217. * @example
  9218. *
  9219. * var users = [
  9220. * { 'user': 'barney', 'age': 36 },
  9221. * { 'user': 'fred', 'age': 40 },
  9222. * { 'user': 'pebbles', 'age': 1 }
  9223. * ];
  9224. *
  9225. * var youngest = _
  9226. * .chain(users)
  9227. * .sortBy('age')
  9228. * .map(function(o) {
  9229. * return o.user + ' is ' + o.age;
  9230. * })
  9231. * .head()
  9232. * .value();
  9233. * // => 'pebbles is 1'
  9234. */
  9235. function chain(value) {
  9236. var result = lodash(value);
  9237. result.__chain__ = true;
  9238. return result;
  9239. }
  9240. /**
  9241. * This method invokes `interceptor` and returns `value`. The interceptor
  9242. * is invoked with one argument; (value). The purpose of this method is to
  9243. * "tap into" a method chain sequence in order to modify intermediate results.
  9244. *
  9245. * @static
  9246. * @memberOf _
  9247. * @since 0.1.0
  9248. * @category Seq
  9249. * @param {*} value The value to provide to `interceptor`.
  9250. * @param {Function} interceptor The function to invoke.
  9251. * @returns {*} Returns `value`.
  9252. * @example
  9253. *
  9254. * _([1, 2, 3])
  9255. * .tap(function(array) {
  9256. * // Mutate input array.
  9257. * array.pop();
  9258. * })
  9259. * .reverse()
  9260. * .value();
  9261. * // => [2, 1]
  9262. */
  9263. function tap(value, interceptor) {
  9264. interceptor(value);
  9265. return value;
  9266. }
  9267. /**
  9268. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9269. * The purpose of this method is to "pass thru" values replacing intermediate
  9270. * results in a method chain sequence.
  9271. *
  9272. * @static
  9273. * @memberOf _
  9274. * @since 3.0.0
  9275. * @category Seq
  9276. * @param {*} value The value to provide to `interceptor`.
  9277. * @param {Function} interceptor The function to invoke.
  9278. * @returns {*} Returns the result of `interceptor`.
  9279. * @example
  9280. *
  9281. * _(' abc ')
  9282. * .chain()
  9283. * .trim()
  9284. * .thru(function(value) {
  9285. * return [value];
  9286. * })
  9287. * .value();
  9288. * // => ['abc']
  9289. */
  9290. function thru(value, interceptor) {
  9291. return interceptor(value);
  9292. }
  9293. /**
  9294. * This method is the wrapper version of `_.at`.
  9295. *
  9296. * @name at
  9297. * @memberOf _
  9298. * @since 1.0.0
  9299. * @category Seq
  9300. * @param {...(string|string[])} [paths] The property paths to pick.
  9301. * @returns {Object} Returns the new `lodash` wrapper instance.
  9302. * @example
  9303. *
  9304. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9305. *
  9306. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9307. * // => [3, 4]
  9308. */
  9309. var wrapperAt = flatRest(function(paths) {
  9310. var length = paths.length,
  9311. start = length ? paths[0] : 0,
  9312. value = this.__wrapped__,
  9313. interceptor = function(object) { return baseAt(object, paths); };
  9314. if (length > 1 || this.__actions__.length ||
  9315. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9316. return this.thru(interceptor);
  9317. }
  9318. value = value.slice(start, +start + (length ? 1 : 0));
  9319. value.__actions__.push({
  9320. 'func': thru,
  9321. 'args': [interceptor],
  9322. 'thisArg': undefined
  9323. });
  9324. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9325. if (length && !array.length) {
  9326. array.push(undefined);
  9327. }
  9328. return array;
  9329. });
  9330. });
  9331. /**
  9332. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9333. *
  9334. * @name chain
  9335. * @memberOf _
  9336. * @since 0.1.0
  9337. * @category Seq
  9338. * @returns {Object} Returns the new `lodash` wrapper instance.
  9339. * @example
  9340. *
  9341. * var users = [
  9342. * { 'user': 'barney', 'age': 36 },
  9343. * { 'user': 'fred', 'age': 40 }
  9344. * ];
  9345. *
  9346. * // A sequence without explicit chaining.
  9347. * _(users).head();
  9348. * // => { 'user': 'barney', 'age': 36 }
  9349. *
  9350. * // A sequence with explicit chaining.
  9351. * _(users)
  9352. * .chain()
  9353. * .head()
  9354. * .pick('user')
  9355. * .value();
  9356. * // => { 'user': 'barney' }
  9357. */
  9358. function wrapperChain() {
  9359. return chain(this);
  9360. }
  9361. /**
  9362. * Executes the chain sequence and returns the wrapped result.
  9363. *
  9364. * @name commit
  9365. * @memberOf _
  9366. * @since 3.2.0
  9367. * @category Seq
  9368. * @returns {Object} Returns the new `lodash` wrapper instance.
  9369. * @example
  9370. *
  9371. * var array = [1, 2];
  9372. * var wrapped = _(array).push(3);
  9373. *
  9374. * console.log(array);
  9375. * // => [1, 2]
  9376. *
  9377. * wrapped = wrapped.commit();
  9378. * console.log(array);
  9379. * // => [1, 2, 3]
  9380. *
  9381. * wrapped.last();
  9382. * // => 3
  9383. *
  9384. * console.log(array);
  9385. * // => [1, 2, 3]
  9386. */
  9387. function wrapperCommit() {
  9388. return new LodashWrapper(this.value(), this.__chain__);
  9389. }
  9390. /**
  9391. * Gets the next value on a wrapped object following the
  9392. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9393. *
  9394. * @name next
  9395. * @memberOf _
  9396. * @since 4.0.0
  9397. * @category Seq
  9398. * @returns {Object} Returns the next iterator value.
  9399. * @example
  9400. *
  9401. * var wrapped = _([1, 2]);
  9402. *
  9403. * wrapped.next();
  9404. * // => { 'done': false, 'value': 1 }
  9405. *
  9406. * wrapped.next();
  9407. * // => { 'done': false, 'value': 2 }
  9408. *
  9409. * wrapped.next();
  9410. * // => { 'done': true, 'value': undefined }
  9411. */
  9412. function wrapperNext() {
  9413. if (this.__values__ === undefined) {
  9414. this.__values__ = toArray(this.value());
  9415. }
  9416. var done = this.__index__ >= this.__values__.length,
  9417. value = done ? undefined : this.__values__[this.__index__++];
  9418. return { 'done': done, 'value': value };
  9419. }
  9420. /**
  9421. * Enables the wrapper to be iterable.
  9422. *
  9423. * @name Symbol.iterator
  9424. * @memberOf _
  9425. * @since 4.0.0
  9426. * @category Seq
  9427. * @returns {Object} Returns the wrapper object.
  9428. * @example
  9429. *
  9430. * var wrapped = _([1, 2]);
  9431. *
  9432. * wrapped[Symbol.iterator]() === wrapped;
  9433. * // => true
  9434. *
  9435. * Array.from(wrapped);
  9436. * // => [1, 2]
  9437. */
  9438. function wrapperToIterator() {
  9439. return this;
  9440. }
  9441. /**
  9442. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9443. *
  9444. * @name plant
  9445. * @memberOf _
  9446. * @since 3.2.0
  9447. * @category Seq
  9448. * @param {*} value The value to plant.
  9449. * @returns {Object} Returns the new `lodash` wrapper instance.
  9450. * @example
  9451. *
  9452. * function square(n) {
  9453. * return n * n;
  9454. * }
  9455. *
  9456. * var wrapped = _([1, 2]).map(square);
  9457. * var other = wrapped.plant([3, 4]);
  9458. *
  9459. * other.value();
  9460. * // => [9, 16]
  9461. *
  9462. * wrapped.value();
  9463. * // => [1, 4]
  9464. */
  9465. function wrapperPlant(value) {
  9466. var result,
  9467. parent = this;
  9468. while (parent instanceof baseLodash) {
  9469. var clone = wrapperClone(parent);
  9470. clone.__index__ = 0;
  9471. clone.__values__ = undefined;
  9472. if (result) {
  9473. previous.__wrapped__ = clone;
  9474. } else {
  9475. result = clone;
  9476. }
  9477. var previous = clone;
  9478. parent = parent.__wrapped__;
  9479. }
  9480. previous.__wrapped__ = value;
  9481. return result;
  9482. }
  9483. /**
  9484. * This method is the wrapper version of `_.reverse`.
  9485. *
  9486. * **Note:** This method mutates the wrapped array.
  9487. *
  9488. * @name reverse
  9489. * @memberOf _
  9490. * @since 0.1.0
  9491. * @category Seq
  9492. * @returns {Object} Returns the new `lodash` wrapper instance.
  9493. * @example
  9494. *
  9495. * var array = [1, 2, 3];
  9496. *
  9497. * _(array).reverse().value()
  9498. * // => [3, 2, 1]
  9499. *
  9500. * console.log(array);
  9501. * // => [3, 2, 1]
  9502. */
  9503. function wrapperReverse() {
  9504. var value = this.__wrapped__;
  9505. if (value instanceof LazyWrapper) {
  9506. var wrapped = value;
  9507. if (this.__actions__.length) {
  9508. wrapped = new LazyWrapper(this);
  9509. }
  9510. wrapped = wrapped.reverse();
  9511. wrapped.__actions__.push({
  9512. 'func': thru,
  9513. 'args': [reverse],
  9514. 'thisArg': undefined
  9515. });
  9516. return new LodashWrapper(wrapped, this.__chain__);
  9517. }
  9518. return this.thru(reverse);
  9519. }
  9520. /**
  9521. * Executes the chain sequence to resolve the unwrapped value.
  9522. *
  9523. * @name value
  9524. * @memberOf _
  9525. * @since 0.1.0
  9526. * @alias toJSON, valueOf
  9527. * @category Seq
  9528. * @returns {*} Returns the resolved unwrapped value.
  9529. * @example
  9530. *
  9531. * _([1, 2, 3]).value();
  9532. * // => [1, 2, 3]
  9533. */
  9534. function wrapperValue() {
  9535. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9536. }
  9537. /*------------------------------------------------------------------------*/
  9538. /**
  9539. * Creates an object composed of keys generated from the results of running
  9540. * each element of `collection` thru `iteratee`. The corresponding value of
  9541. * each key is the number of times the key was returned by `iteratee`. The
  9542. * iteratee is invoked with one argument: (value).
  9543. *
  9544. * @static
  9545. * @memberOf _
  9546. * @since 0.5.0
  9547. * @category Collection
  9548. * @param {Array|Object} collection The collection to iterate over.
  9549. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9550. * @returns {Object} Returns the composed aggregate object.
  9551. * @example
  9552. *
  9553. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9554. * // => { '4': 1, '6': 2 }
  9555. *
  9556. * // The `_.property` iteratee shorthand.
  9557. * _.countBy(['one', 'two', 'three'], 'length');
  9558. * // => { '3': 2, '5': 1 }
  9559. */
  9560. var countBy = createAggregator(function(result, value, key) {
  9561. if (hasOwnProperty.call(result, key)) {
  9562. ++result[key];
  9563. } else {
  9564. baseAssignValue(result, key, 1);
  9565. }
  9566. });
  9567. /**
  9568. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9569. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9570. * invoked with three arguments: (value, index|key, collection).
  9571. *
  9572. * **Note:** This method returns `true` for
  9573. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9574. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9575. * elements of empty collections.
  9576. *
  9577. * @static
  9578. * @memberOf _
  9579. * @since 0.1.0
  9580. * @category Collection
  9581. * @param {Array|Object} collection The collection to iterate over.
  9582. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9583. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9584. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9585. * else `false`.
  9586. * @example
  9587. *
  9588. * _.every([true, 1, null, 'yes'], Boolean);
  9589. * // => false
  9590. *
  9591. * var users = [
  9592. * { 'user': 'barney', 'age': 36, 'active': false },
  9593. * { 'user': 'fred', 'age': 40, 'active': false }
  9594. * ];
  9595. *
  9596. * // The `_.matches` iteratee shorthand.
  9597. * _.every(users, { 'user': 'barney', 'active': false });
  9598. * // => false
  9599. *
  9600. * // The `_.matchesProperty` iteratee shorthand.
  9601. * _.every(users, ['active', false]);
  9602. * // => true
  9603. *
  9604. * // The `_.property` iteratee shorthand.
  9605. * _.every(users, 'active');
  9606. * // => false
  9607. */
  9608. function every(collection, predicate, guard) {
  9609. var func = isArray(collection) ? arrayEvery : baseEvery;
  9610. if (guard && isIterateeCall(collection, predicate, guard)) {
  9611. predicate = undefined;
  9612. }
  9613. return func(collection, getIteratee(predicate, 3));
  9614. }
  9615. /**
  9616. * Iterates over elements of `collection`, returning an array of all elements
  9617. * `predicate` returns truthy for. The predicate is invoked with three
  9618. * arguments: (value, index|key, collection).
  9619. *
  9620. * **Note:** Unlike `_.remove`, this method returns a new array.
  9621. *
  9622. * @static
  9623. * @memberOf _
  9624. * @since 0.1.0
  9625. * @category Collection
  9626. * @param {Array|Object} collection The collection to iterate over.
  9627. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9628. * @returns {Array} Returns the new filtered array.
  9629. * @see _.reject
  9630. * @example
  9631. *
  9632. * var users = [
  9633. * { 'user': 'barney', 'age': 36, 'active': true },
  9634. * { 'user': 'fred', 'age': 40, 'active': false }
  9635. * ];
  9636. *
  9637. * _.filter(users, function(o) { return !o.active; });
  9638. * // => objects for ['fred']
  9639. *
  9640. * // The `_.matches` iteratee shorthand.
  9641. * _.filter(users, { 'age': 36, 'active': true });
  9642. * // => objects for ['barney']
  9643. *
  9644. * // The `_.matchesProperty` iteratee shorthand.
  9645. * _.filter(users, ['active', false]);
  9646. * // => objects for ['fred']
  9647. *
  9648. * // The `_.property` iteratee shorthand.
  9649. * _.filter(users, 'active');
  9650. * // => objects for ['barney']
  9651. *
  9652. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9653. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9654. * // => objects for ['fred', 'barney']
  9655. */
  9656. function filter(collection, predicate) {
  9657. var func = isArray(collection) ? arrayFilter : baseFilter;
  9658. return func(collection, getIteratee(predicate, 3));
  9659. }
  9660. /**
  9661. * Iterates over elements of `collection`, returning the first element
  9662. * `predicate` returns truthy for. The predicate is invoked with three
  9663. * arguments: (value, index|key, collection).
  9664. *
  9665. * @static
  9666. * @memberOf _
  9667. * @since 0.1.0
  9668. * @category Collection
  9669. * @param {Array|Object} collection The collection to inspect.
  9670. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9671. * @param {number} [fromIndex=0] The index to search from.
  9672. * @returns {*} Returns the matched element, else `undefined`.
  9673. * @example
  9674. *
  9675. * var users = [
  9676. * { 'user': 'barney', 'age': 36, 'active': true },
  9677. * { 'user': 'fred', 'age': 40, 'active': false },
  9678. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9679. * ];
  9680. *
  9681. * _.find(users, function(o) { return o.age < 40; });
  9682. * // => object for 'barney'
  9683. *
  9684. * // The `_.matches` iteratee shorthand.
  9685. * _.find(users, { 'age': 1, 'active': true });
  9686. * // => object for 'pebbles'
  9687. *
  9688. * // The `_.matchesProperty` iteratee shorthand.
  9689. * _.find(users, ['active', false]);
  9690. * // => object for 'fred'
  9691. *
  9692. * // The `_.property` iteratee shorthand.
  9693. * _.find(users, 'active');
  9694. * // => object for 'barney'
  9695. */
  9696. var find = createFind(findIndex);
  9697. /**
  9698. * This method is like `_.find` except that it iterates over elements of
  9699. * `collection` from right to left.
  9700. *
  9701. * @static
  9702. * @memberOf _
  9703. * @since 2.0.0
  9704. * @category Collection
  9705. * @param {Array|Object} collection The collection to inspect.
  9706. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9707. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9708. * @returns {*} Returns the matched element, else `undefined`.
  9709. * @example
  9710. *
  9711. * _.findLast([1, 2, 3, 4], function(n) {
  9712. * return n % 2 == 1;
  9713. * });
  9714. * // => 3
  9715. */
  9716. var findLast = createFind(findLastIndex);
  9717. /**
  9718. * Creates a flattened array of values by running each element in `collection`
  9719. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9720. * with three arguments: (value, index|key, collection).
  9721. *
  9722. * @static
  9723. * @memberOf _
  9724. * @since 4.0.0
  9725. * @category Collection
  9726. * @param {Array|Object} collection The collection to iterate over.
  9727. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9728. * @returns {Array} Returns the new flattened array.
  9729. * @example
  9730. *
  9731. * function duplicate(n) {
  9732. * return [n, n];
  9733. * }
  9734. *
  9735. * _.flatMap([1, 2], duplicate);
  9736. * // => [1, 1, 2, 2]
  9737. */
  9738. function flatMap(collection, iteratee) {
  9739. return baseFlatten(map(collection, iteratee), 1);
  9740. }
  9741. /**
  9742. * This method is like `_.flatMap` except that it recursively flattens the
  9743. * mapped results.
  9744. *
  9745. * @static
  9746. * @memberOf _
  9747. * @since 4.7.0
  9748. * @category Collection
  9749. * @param {Array|Object} collection The collection to iterate over.
  9750. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9751. * @returns {Array} Returns the new flattened array.
  9752. * @example
  9753. *
  9754. * function duplicate(n) {
  9755. * return [[[n, n]]];
  9756. * }
  9757. *
  9758. * _.flatMapDeep([1, 2], duplicate);
  9759. * // => [1, 1, 2, 2]
  9760. */
  9761. function flatMapDeep(collection, iteratee) {
  9762. return baseFlatten(map(collection, iteratee), INFINITY);
  9763. }
  9764. /**
  9765. * This method is like `_.flatMap` except that it recursively flattens the
  9766. * mapped results up to `depth` times.
  9767. *
  9768. * @static
  9769. * @memberOf _
  9770. * @since 4.7.0
  9771. * @category Collection
  9772. * @param {Array|Object} collection The collection to iterate over.
  9773. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9774. * @param {number} [depth=1] The maximum recursion depth.
  9775. * @returns {Array} Returns the new flattened array.
  9776. * @example
  9777. *
  9778. * function duplicate(n) {
  9779. * return [[[n, n]]];
  9780. * }
  9781. *
  9782. * _.flatMapDepth([1, 2], duplicate, 2);
  9783. * // => [[1, 1], [2, 2]]
  9784. */
  9785. function flatMapDepth(collection, iteratee, depth) {
  9786. depth = depth === undefined ? 1 : toInteger(depth);
  9787. return baseFlatten(map(collection, iteratee), depth);
  9788. }
  9789. /**
  9790. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9791. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9792. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9793. *
  9794. * **Note:** As with other "Collections" methods, objects with a "length"
  9795. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9796. * or `_.forOwn` for object iteration.
  9797. *
  9798. * @static
  9799. * @memberOf _
  9800. * @since 0.1.0
  9801. * @alias each
  9802. * @category Collection
  9803. * @param {Array|Object} collection The collection to iterate over.
  9804. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9805. * @returns {Array|Object} Returns `collection`.
  9806. * @see _.forEachRight
  9807. * @example
  9808. *
  9809. * _.forEach([1, 2], function(value) {
  9810. * console.log(value);
  9811. * });
  9812. * // => Logs `1` then `2`.
  9813. *
  9814. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9815. * console.log(key);
  9816. * });
  9817. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9818. */
  9819. function forEach(collection, iteratee) {
  9820. var func = isArray(collection) ? arrayEach : baseEach;
  9821. return func(collection, getIteratee(iteratee, 3));
  9822. }
  9823. /**
  9824. * This method is like `_.forEach` except that it iterates over elements of
  9825. * `collection` from right to left.
  9826. *
  9827. * @static
  9828. * @memberOf _
  9829. * @since 2.0.0
  9830. * @alias eachRight
  9831. * @category Collection
  9832. * @param {Array|Object} collection The collection to iterate over.
  9833. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9834. * @returns {Array|Object} Returns `collection`.
  9835. * @see _.forEach
  9836. * @example
  9837. *
  9838. * _.forEachRight([1, 2], function(value) {
  9839. * console.log(value);
  9840. * });
  9841. * // => Logs `2` then `1`.
  9842. */
  9843. function forEachRight(collection, iteratee) {
  9844. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9845. return func(collection, getIteratee(iteratee, 3));
  9846. }
  9847. /**
  9848. * Creates an object composed of keys generated from the results of running
  9849. * each element of `collection` thru `iteratee`. The order of grouped values
  9850. * is determined by the order they occur in `collection`. The corresponding
  9851. * value of each key is an array of elements responsible for generating the
  9852. * key. The iteratee is invoked with one argument: (value).
  9853. *
  9854. * @static
  9855. * @memberOf _
  9856. * @since 0.1.0
  9857. * @category Collection
  9858. * @param {Array|Object} collection The collection to iterate over.
  9859. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9860. * @returns {Object} Returns the composed aggregate object.
  9861. * @example
  9862. *
  9863. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9864. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9865. *
  9866. * // The `_.property` iteratee shorthand.
  9867. * _.groupBy(['one', 'two', 'three'], 'length');
  9868. * // => { '3': ['one', 'two'], '5': ['three'] }
  9869. */
  9870. var groupBy = createAggregator(function(result, value, key) {
  9871. if (hasOwnProperty.call(result, key)) {
  9872. result[key].push(value);
  9873. } else {
  9874. baseAssignValue(result, key, [value]);
  9875. }
  9876. });
  9877. /**
  9878. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9879. * checked for a substring of `value`, otherwise
  9880. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9881. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9882. * the offset from the end of `collection`.
  9883. *
  9884. * @static
  9885. * @memberOf _
  9886. * @since 0.1.0
  9887. * @category Collection
  9888. * @param {Array|Object|string} collection The collection to inspect.
  9889. * @param {*} value The value to search for.
  9890. * @param {number} [fromIndex=0] The index to search from.
  9891. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9892. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9893. * @example
  9894. *
  9895. * _.includes([1, 2, 3], 1);
  9896. * // => true
  9897. *
  9898. * _.includes([1, 2, 3], 1, 2);
  9899. * // => false
  9900. *
  9901. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9902. * // => true
  9903. *
  9904. * _.includes('abcd', 'bc');
  9905. * // => true
  9906. */
  9907. function includes(collection, value, fromIndex, guard) {
  9908. collection = isArrayLike(collection) ? collection : values(collection);
  9909. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9910. var length = collection.length;
  9911. if (fromIndex < 0) {
  9912. fromIndex = nativeMax(length + fromIndex, 0);
  9913. }
  9914. return isString(collection)
  9915. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9916. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9917. }
  9918. /**
  9919. * Invokes the method at `path` of each element in `collection`, returning
  9920. * an array of the results of each invoked method. Any additional arguments
  9921. * are provided to each invoked method. If `path` is a function, it's invoked
  9922. * for, and `this` bound to, each element in `collection`.
  9923. *
  9924. * @static
  9925. * @memberOf _
  9926. * @since 4.0.0
  9927. * @category Collection
  9928. * @param {Array|Object} collection The collection to iterate over.
  9929. * @param {Array|Function|string} path The path of the method to invoke or
  9930. * the function invoked per iteration.
  9931. * @param {...*} [args] The arguments to invoke each method with.
  9932. * @returns {Array} Returns the array of results.
  9933. * @example
  9934. *
  9935. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9936. * // => [[1, 5, 7], [1, 2, 3]]
  9937. *
  9938. * _.invokeMap([123, 456], String.prototype.split, '');
  9939. * // => [['1', '2', '3'], ['4', '5', '6']]
  9940. */
  9941. var invokeMap = baseRest(function(collection, path, args) {
  9942. var index = -1,
  9943. isFunc = typeof path == 'function',
  9944. result = isArrayLike(collection) ? Array(collection.length) : [];
  9945. baseEach(collection, function(value) {
  9946. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9947. });
  9948. return result;
  9949. });
  9950. /**
  9951. * Creates an object composed of keys generated from the results of running
  9952. * each element of `collection` thru `iteratee`. The corresponding value of
  9953. * each key is the last element responsible for generating the key. The
  9954. * iteratee is invoked with one argument: (value).
  9955. *
  9956. * @static
  9957. * @memberOf _
  9958. * @since 4.0.0
  9959. * @category Collection
  9960. * @param {Array|Object} collection The collection to iterate over.
  9961. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9962. * @returns {Object} Returns the composed aggregate object.
  9963. * @example
  9964. *
  9965. * var array = [
  9966. * { 'dir': 'left', 'code': 97 },
  9967. * { 'dir': 'right', 'code': 100 }
  9968. * ];
  9969. *
  9970. * _.keyBy(array, function(o) {
  9971. * return String.fromCharCode(o.code);
  9972. * });
  9973. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  9974. *
  9975. * _.keyBy(array, 'dir');
  9976. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  9977. */
  9978. var keyBy = createAggregator(function(result, value, key) {
  9979. baseAssignValue(result, key, value);
  9980. });
  9981. /**
  9982. * Creates an array of values by running each element in `collection` thru
  9983. * `iteratee`. The iteratee is invoked with three arguments:
  9984. * (value, index|key, collection).
  9985. *
  9986. * Many lodash methods are guarded to work as iteratees for methods like
  9987. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  9988. *
  9989. * The guarded methods are:
  9990. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  9991. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  9992. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  9993. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  9994. *
  9995. * @static
  9996. * @memberOf _
  9997. * @since 0.1.0
  9998. * @category Collection
  9999. * @param {Array|Object} collection The collection to iterate over.
  10000. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10001. * @returns {Array} Returns the new mapped array.
  10002. * @example
  10003. *
  10004. * function square(n) {
  10005. * return n * n;
  10006. * }
  10007. *
  10008. * _.map([4, 8], square);
  10009. * // => [16, 64]
  10010. *
  10011. * _.map({ 'a': 4, 'b': 8 }, square);
  10012. * // => [16, 64] (iteration order is not guaranteed)
  10013. *
  10014. * var users = [
  10015. * { 'user': 'barney' },
  10016. * { 'user': 'fred' }
  10017. * ];
  10018. *
  10019. * // The `_.property` iteratee shorthand.
  10020. * _.map(users, 'user');
  10021. * // => ['barney', 'fred']
  10022. */
  10023. function map(collection, iteratee) {
  10024. var func = isArray(collection) ? arrayMap : baseMap;
  10025. return func(collection, getIteratee(iteratee, 3));
  10026. }
  10027. /**
  10028. * This method is like `_.sortBy` except that it allows specifying the sort
  10029. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10030. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10031. * descending or "asc" for ascending sort order of corresponding values.
  10032. *
  10033. * @static
  10034. * @memberOf _
  10035. * @since 4.0.0
  10036. * @category Collection
  10037. * @param {Array|Object} collection The collection to iterate over.
  10038. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10039. * The iteratees to sort by.
  10040. * @param {string[]} [orders] The sort orders of `iteratees`.
  10041. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10042. * @returns {Array} Returns the new sorted array.
  10043. * @example
  10044. *
  10045. * var users = [
  10046. * { 'user': 'fred', 'age': 48 },
  10047. * { 'user': 'barney', 'age': 34 },
  10048. * { 'user': 'fred', 'age': 40 },
  10049. * { 'user': 'barney', 'age': 36 }
  10050. * ];
  10051. *
  10052. * // Sort by `user` in ascending order and by `age` in descending order.
  10053. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10054. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10055. */
  10056. function orderBy(collection, iteratees, orders, guard) {
  10057. if (collection == null) {
  10058. return [];
  10059. }
  10060. if (!isArray(iteratees)) {
  10061. iteratees = iteratees == null ? [] : [iteratees];
  10062. }
  10063. orders = guard ? undefined : orders;
  10064. if (!isArray(orders)) {
  10065. orders = orders == null ? [] : [orders];
  10066. }
  10067. return baseOrderBy(collection, iteratees, orders);
  10068. }
  10069. /**
  10070. * Creates an array of elements split into two groups, the first of which
  10071. * contains elements `predicate` returns truthy for, the second of which
  10072. * contains elements `predicate` returns falsey for. The predicate is
  10073. * invoked with one argument: (value).
  10074. *
  10075. * @static
  10076. * @memberOf _
  10077. * @since 3.0.0
  10078. * @category Collection
  10079. * @param {Array|Object} collection The collection to iterate over.
  10080. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10081. * @returns {Array} Returns the array of grouped elements.
  10082. * @example
  10083. *
  10084. * var users = [
  10085. * { 'user': 'barney', 'age': 36, 'active': false },
  10086. * { 'user': 'fred', 'age': 40, 'active': true },
  10087. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10088. * ];
  10089. *
  10090. * _.partition(users, function(o) { return o.active; });
  10091. * // => objects for [['fred'], ['barney', 'pebbles']]
  10092. *
  10093. * // The `_.matches` iteratee shorthand.
  10094. * _.partition(users, { 'age': 1, 'active': false });
  10095. * // => objects for [['pebbles'], ['barney', 'fred']]
  10096. *
  10097. * // The `_.matchesProperty` iteratee shorthand.
  10098. * _.partition(users, ['active', false]);
  10099. * // => objects for [['barney', 'pebbles'], ['fred']]
  10100. *
  10101. * // The `_.property` iteratee shorthand.
  10102. * _.partition(users, 'active');
  10103. * // => objects for [['fred'], ['barney', 'pebbles']]
  10104. */
  10105. var partition = createAggregator(function(result, value, key) {
  10106. result[key ? 0 : 1].push(value);
  10107. }, function() { return [[], []]; });
  10108. /**
  10109. * Reduces `collection` to a value which is the accumulated result of running
  10110. * each element in `collection` thru `iteratee`, where each successive
  10111. * invocation is supplied the return value of the previous. If `accumulator`
  10112. * is not given, the first element of `collection` is used as the initial
  10113. * value. The iteratee is invoked with four arguments:
  10114. * (accumulator, value, index|key, collection).
  10115. *
  10116. * Many lodash methods are guarded to work as iteratees for methods like
  10117. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10118. *
  10119. * The guarded methods are:
  10120. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10121. * and `sortBy`
  10122. *
  10123. * @static
  10124. * @memberOf _
  10125. * @since 0.1.0
  10126. * @category Collection
  10127. * @param {Array|Object} collection The collection to iterate over.
  10128. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10129. * @param {*} [accumulator] The initial value.
  10130. * @returns {*} Returns the accumulated value.
  10131. * @see _.reduceRight
  10132. * @example
  10133. *
  10134. * _.reduce([1, 2], function(sum, n) {
  10135. * return sum + n;
  10136. * }, 0);
  10137. * // => 3
  10138. *
  10139. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10140. * (result[value] || (result[value] = [])).push(key);
  10141. * return result;
  10142. * }, {});
  10143. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10144. */
  10145. function reduce(collection, iteratee, accumulator) {
  10146. var func = isArray(collection) ? arrayReduce : baseReduce,
  10147. initAccum = arguments.length < 3;
  10148. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10149. }
  10150. /**
  10151. * This method is like `_.reduce` except that it iterates over elements of
  10152. * `collection` from right to left.
  10153. *
  10154. * @static
  10155. * @memberOf _
  10156. * @since 0.1.0
  10157. * @category Collection
  10158. * @param {Array|Object} collection The collection to iterate over.
  10159. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10160. * @param {*} [accumulator] The initial value.
  10161. * @returns {*} Returns the accumulated value.
  10162. * @see _.reduce
  10163. * @example
  10164. *
  10165. * var array = [[0, 1], [2, 3], [4, 5]];
  10166. *
  10167. * _.reduceRight(array, function(flattened, other) {
  10168. * return flattened.concat(other);
  10169. * }, []);
  10170. * // => [4, 5, 2, 3, 0, 1]
  10171. */
  10172. function reduceRight(collection, iteratee, accumulator) {
  10173. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10174. initAccum = arguments.length < 3;
  10175. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10176. }
  10177. /**
  10178. * The opposite of `_.filter`; this method returns the elements of `collection`
  10179. * that `predicate` does **not** return truthy for.
  10180. *
  10181. * @static
  10182. * @memberOf _
  10183. * @since 0.1.0
  10184. * @category Collection
  10185. * @param {Array|Object} collection The collection to iterate over.
  10186. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10187. * @returns {Array} Returns the new filtered array.
  10188. * @see _.filter
  10189. * @example
  10190. *
  10191. * var users = [
  10192. * { 'user': 'barney', 'age': 36, 'active': false },
  10193. * { 'user': 'fred', 'age': 40, 'active': true }
  10194. * ];
  10195. *
  10196. * _.reject(users, function(o) { return !o.active; });
  10197. * // => objects for ['fred']
  10198. *
  10199. * // The `_.matches` iteratee shorthand.
  10200. * _.reject(users, { 'age': 40, 'active': true });
  10201. * // => objects for ['barney']
  10202. *
  10203. * // The `_.matchesProperty` iteratee shorthand.
  10204. * _.reject(users, ['active', false]);
  10205. * // => objects for ['fred']
  10206. *
  10207. * // The `_.property` iteratee shorthand.
  10208. * _.reject(users, 'active');
  10209. * // => objects for ['barney']
  10210. */
  10211. function reject(collection, predicate) {
  10212. var func = isArray(collection) ? arrayFilter : baseFilter;
  10213. return func(collection, negate(getIteratee(predicate, 3)));
  10214. }
  10215. /**
  10216. * Gets a random element from `collection`.
  10217. *
  10218. * @static
  10219. * @memberOf _
  10220. * @since 2.0.0
  10221. * @category Collection
  10222. * @param {Array|Object} collection The collection to sample.
  10223. * @returns {*} Returns the random element.
  10224. * @example
  10225. *
  10226. * _.sample([1, 2, 3, 4]);
  10227. * // => 2
  10228. */
  10229. function sample(collection) {
  10230. var func = isArray(collection) ? arraySample : baseSample;
  10231. return func(collection);
  10232. }
  10233. /**
  10234. * Gets `n` random elements at unique keys from `collection` up to the
  10235. * size of `collection`.
  10236. *
  10237. * @static
  10238. * @memberOf _
  10239. * @since 4.0.0
  10240. * @category Collection
  10241. * @param {Array|Object} collection The collection to sample.
  10242. * @param {number} [n=1] The number of elements to sample.
  10243. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10244. * @returns {Array} Returns the random elements.
  10245. * @example
  10246. *
  10247. * _.sampleSize([1, 2, 3], 2);
  10248. * // => [3, 1]
  10249. *
  10250. * _.sampleSize([1, 2, 3], 4);
  10251. * // => [2, 3, 1]
  10252. */
  10253. function sampleSize(collection, n, guard) {
  10254. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10255. n = 1;
  10256. } else {
  10257. n = toInteger(n);
  10258. }
  10259. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10260. return func(collection, n);
  10261. }
  10262. /**
  10263. * Creates an array of shuffled values, using a version of the
  10264. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10265. *
  10266. * @static
  10267. * @memberOf _
  10268. * @since 0.1.0
  10269. * @category Collection
  10270. * @param {Array|Object} collection The collection to shuffle.
  10271. * @returns {Array} Returns the new shuffled array.
  10272. * @example
  10273. *
  10274. * _.shuffle([1, 2, 3, 4]);
  10275. * // => [4, 1, 3, 2]
  10276. */
  10277. function shuffle(collection) {
  10278. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10279. return func(collection);
  10280. }
  10281. /**
  10282. * Gets the size of `collection` by returning its length for array-like
  10283. * values or the number of own enumerable string keyed properties for objects.
  10284. *
  10285. * @static
  10286. * @memberOf _
  10287. * @since 0.1.0
  10288. * @category Collection
  10289. * @param {Array|Object|string} collection The collection to inspect.
  10290. * @returns {number} Returns the collection size.
  10291. * @example
  10292. *
  10293. * _.size([1, 2, 3]);
  10294. * // => 3
  10295. *
  10296. * _.size({ 'a': 1, 'b': 2 });
  10297. * // => 2
  10298. *
  10299. * _.size('pebbles');
  10300. * // => 7
  10301. */
  10302. function size(collection) {
  10303. if (collection == null) {
  10304. return 0;
  10305. }
  10306. if (isArrayLike(collection)) {
  10307. return isString(collection) ? stringSize(collection) : collection.length;
  10308. }
  10309. var tag = getTag(collection);
  10310. if (tag == mapTag || tag == setTag) {
  10311. return collection.size;
  10312. }
  10313. return baseKeys(collection).length;
  10314. }
  10315. /**
  10316. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10317. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10318. * invoked with three arguments: (value, index|key, collection).
  10319. *
  10320. * @static
  10321. * @memberOf _
  10322. * @since 0.1.0
  10323. * @category Collection
  10324. * @param {Array|Object} collection The collection to iterate over.
  10325. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10326. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10327. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10328. * else `false`.
  10329. * @example
  10330. *
  10331. * _.some([null, 0, 'yes', false], Boolean);
  10332. * // => true
  10333. *
  10334. * var users = [
  10335. * { 'user': 'barney', 'active': true },
  10336. * { 'user': 'fred', 'active': false }
  10337. * ];
  10338. *
  10339. * // The `_.matches` iteratee shorthand.
  10340. * _.some(users, { 'user': 'barney', 'active': false });
  10341. * // => false
  10342. *
  10343. * // The `_.matchesProperty` iteratee shorthand.
  10344. * _.some(users, ['active', false]);
  10345. * // => true
  10346. *
  10347. * // The `_.property` iteratee shorthand.
  10348. * _.some(users, 'active');
  10349. * // => true
  10350. */
  10351. function some(collection, predicate, guard) {
  10352. var func = isArray(collection) ? arraySome : baseSome;
  10353. if (guard && isIterateeCall(collection, predicate, guard)) {
  10354. predicate = undefined;
  10355. }
  10356. return func(collection, getIteratee(predicate, 3));
  10357. }
  10358. /**
  10359. * Creates an array of elements, sorted in ascending order by the results of
  10360. * running each element in a collection thru each iteratee. This method
  10361. * performs a stable sort, that is, it preserves the original sort order of
  10362. * equal elements. The iteratees are invoked with one argument: (value).
  10363. *
  10364. * @static
  10365. * @memberOf _
  10366. * @since 0.1.0
  10367. * @category Collection
  10368. * @param {Array|Object} collection The collection to iterate over.
  10369. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10370. * The iteratees to sort by.
  10371. * @returns {Array} Returns the new sorted array.
  10372. * @example
  10373. *
  10374. * var users = [
  10375. * { 'user': 'fred', 'age': 48 },
  10376. * { 'user': 'barney', 'age': 36 },
  10377. * { 'user': 'fred', 'age': 30 },
  10378. * { 'user': 'barney', 'age': 34 }
  10379. * ];
  10380. *
  10381. * _.sortBy(users, [function(o) { return o.user; }]);
  10382. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10383. *
  10384. * _.sortBy(users, ['user', 'age']);
  10385. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10386. */
  10387. var sortBy = baseRest(function(collection, iteratees) {
  10388. if (collection == null) {
  10389. return [];
  10390. }
  10391. var length = iteratees.length;
  10392. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10393. iteratees = [];
  10394. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10395. iteratees = [iteratees[0]];
  10396. }
  10397. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10398. });
  10399. /*------------------------------------------------------------------------*/
  10400. /**
  10401. * Gets the timestamp of the number of milliseconds that have elapsed since
  10402. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10403. *
  10404. * @static
  10405. * @memberOf _
  10406. * @since 2.4.0
  10407. * @category Date
  10408. * @returns {number} Returns the timestamp.
  10409. * @example
  10410. *
  10411. * _.defer(function(stamp) {
  10412. * console.log(_.now() - stamp);
  10413. * }, _.now());
  10414. * // => Logs the number of milliseconds it took for the deferred invocation.
  10415. */
  10416. var now = ctxNow || function() {
  10417. return root.Date.now();
  10418. };
  10419. /*------------------------------------------------------------------------*/
  10420. /**
  10421. * The opposite of `_.before`; this method creates a function that invokes
  10422. * `func` once it's called `n` or more times.
  10423. *
  10424. * @static
  10425. * @memberOf _
  10426. * @since 0.1.0
  10427. * @category Function
  10428. * @param {number} n The number of calls before `func` is invoked.
  10429. * @param {Function} func The function to restrict.
  10430. * @returns {Function} Returns the new restricted function.
  10431. * @example
  10432. *
  10433. * var saves = ['profile', 'settings'];
  10434. *
  10435. * var done = _.after(saves.length, function() {
  10436. * console.log('done saving!');
  10437. * });
  10438. *
  10439. * _.forEach(saves, function(type) {
  10440. * asyncSave({ 'type': type, 'complete': done });
  10441. * });
  10442. * // => Logs 'done saving!' after the two async saves have completed.
  10443. */
  10444. function after(n, func) {
  10445. if (typeof func != 'function') {
  10446. throw new TypeError(FUNC_ERROR_TEXT);
  10447. }
  10448. n = toInteger(n);
  10449. return function() {
  10450. if (--n < 1) {
  10451. return func.apply(this, arguments);
  10452. }
  10453. };
  10454. }
  10455. /**
  10456. * Creates a function that invokes `func`, with up to `n` arguments,
  10457. * ignoring any additional arguments.
  10458. *
  10459. * @static
  10460. * @memberOf _
  10461. * @since 3.0.0
  10462. * @category Function
  10463. * @param {Function} func The function to cap arguments for.
  10464. * @param {number} [n=func.length] The arity cap.
  10465. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10466. * @returns {Function} Returns the new capped function.
  10467. * @example
  10468. *
  10469. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10470. * // => [6, 8, 10]
  10471. */
  10472. function ary(func, n, guard) {
  10473. n = guard ? undefined : n;
  10474. n = (func && n == null) ? func.length : n;
  10475. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10476. }
  10477. /**
  10478. * Creates a function that invokes `func`, with the `this` binding and arguments
  10479. * of the created function, while it's called less than `n` times. Subsequent
  10480. * calls to the created function return the result of the last `func` invocation.
  10481. *
  10482. * @static
  10483. * @memberOf _
  10484. * @since 3.0.0
  10485. * @category Function
  10486. * @param {number} n The number of calls at which `func` is no longer invoked.
  10487. * @param {Function} func The function to restrict.
  10488. * @returns {Function} Returns the new restricted function.
  10489. * @example
  10490. *
  10491. * jQuery(element).on('click', _.before(5, addContactToList));
  10492. * // => Allows adding up to 4 contacts to the list.
  10493. */
  10494. function before(n, func) {
  10495. var result;
  10496. if (typeof func != 'function') {
  10497. throw new TypeError(FUNC_ERROR_TEXT);
  10498. }
  10499. n = toInteger(n);
  10500. return function() {
  10501. if (--n > 0) {
  10502. result = func.apply(this, arguments);
  10503. }
  10504. if (n <= 1) {
  10505. func = undefined;
  10506. }
  10507. return result;
  10508. };
  10509. }
  10510. /**
  10511. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10512. * and `partials` prepended to the arguments it receives.
  10513. *
  10514. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10515. * may be used as a placeholder for partially applied arguments.
  10516. *
  10517. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10518. * property of bound functions.
  10519. *
  10520. * @static
  10521. * @memberOf _
  10522. * @since 0.1.0
  10523. * @category Function
  10524. * @param {Function} func The function to bind.
  10525. * @param {*} thisArg The `this` binding of `func`.
  10526. * @param {...*} [partials] The arguments to be partially applied.
  10527. * @returns {Function} Returns the new bound function.
  10528. * @example
  10529. *
  10530. * function greet(greeting, punctuation) {
  10531. * return greeting + ' ' + this.user + punctuation;
  10532. * }
  10533. *
  10534. * var object = { 'user': 'fred' };
  10535. *
  10536. * var bound = _.bind(greet, object, 'hi');
  10537. * bound('!');
  10538. * // => 'hi fred!'
  10539. *
  10540. * // Bound with placeholders.
  10541. * var bound = _.bind(greet, object, _, '!');
  10542. * bound('hi');
  10543. * // => 'hi fred!'
  10544. */
  10545. var bind = baseRest(function(func, thisArg, partials) {
  10546. var bitmask = WRAP_BIND_FLAG;
  10547. if (partials.length) {
  10548. var holders = replaceHolders(partials, getHolder(bind));
  10549. bitmask |= WRAP_PARTIAL_FLAG;
  10550. }
  10551. return createWrap(func, bitmask, thisArg, partials, holders);
  10552. });
  10553. /**
  10554. * Creates a function that invokes the method at `object[key]` with `partials`
  10555. * prepended to the arguments it receives.
  10556. *
  10557. * This method differs from `_.bind` by allowing bound functions to reference
  10558. * methods that may be redefined or don't yet exist. See
  10559. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10560. * for more details.
  10561. *
  10562. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10563. * builds, may be used as a placeholder for partially applied arguments.
  10564. *
  10565. * @static
  10566. * @memberOf _
  10567. * @since 0.10.0
  10568. * @category Function
  10569. * @param {Object} object The object to invoke the method on.
  10570. * @param {string} key The key of the method.
  10571. * @param {...*} [partials] The arguments to be partially applied.
  10572. * @returns {Function} Returns the new bound function.
  10573. * @example
  10574. *
  10575. * var object = {
  10576. * 'user': 'fred',
  10577. * 'greet': function(greeting, punctuation) {
  10578. * return greeting + ' ' + this.user + punctuation;
  10579. * }
  10580. * };
  10581. *
  10582. * var bound = _.bindKey(object, 'greet', 'hi');
  10583. * bound('!');
  10584. * // => 'hi fred!'
  10585. *
  10586. * object.greet = function(greeting, punctuation) {
  10587. * return greeting + 'ya ' + this.user + punctuation;
  10588. * };
  10589. *
  10590. * bound('!');
  10591. * // => 'hiya fred!'
  10592. *
  10593. * // Bound with placeholders.
  10594. * var bound = _.bindKey(object, 'greet', _, '!');
  10595. * bound('hi');
  10596. * // => 'hiya fred!'
  10597. */
  10598. var bindKey = baseRest(function(object, key, partials) {
  10599. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10600. if (partials.length) {
  10601. var holders = replaceHolders(partials, getHolder(bindKey));
  10602. bitmask |= WRAP_PARTIAL_FLAG;
  10603. }
  10604. return createWrap(key, bitmask, object, partials, holders);
  10605. });
  10606. /**
  10607. * Creates a function that accepts arguments of `func` and either invokes
  10608. * `func` returning its result, if at least `arity` number of arguments have
  10609. * been provided, or returns a function that accepts the remaining `func`
  10610. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10611. * is not sufficient.
  10612. *
  10613. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10614. * may be used as a placeholder for provided arguments.
  10615. *
  10616. * **Note:** This method doesn't set the "length" property of curried functions.
  10617. *
  10618. * @static
  10619. * @memberOf _
  10620. * @since 2.0.0
  10621. * @category Function
  10622. * @param {Function} func The function to curry.
  10623. * @param {number} [arity=func.length] The arity of `func`.
  10624. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10625. * @returns {Function} Returns the new curried function.
  10626. * @example
  10627. *
  10628. * var abc = function(a, b, c) {
  10629. * return [a, b, c];
  10630. * };
  10631. *
  10632. * var curried = _.curry(abc);
  10633. *
  10634. * curried(1)(2)(3);
  10635. * // => [1, 2, 3]
  10636. *
  10637. * curried(1, 2)(3);
  10638. * // => [1, 2, 3]
  10639. *
  10640. * curried(1, 2, 3);
  10641. * // => [1, 2, 3]
  10642. *
  10643. * // Curried with placeholders.
  10644. * curried(1)(_, 3)(2);
  10645. * // => [1, 2, 3]
  10646. */
  10647. function curry(func, arity, guard) {
  10648. arity = guard ? undefined : arity;
  10649. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10650. result.placeholder = curry.placeholder;
  10651. return result;
  10652. }
  10653. /**
  10654. * This method is like `_.curry` except that arguments are applied to `func`
  10655. * in the manner of `_.partialRight` instead of `_.partial`.
  10656. *
  10657. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10658. * builds, may be used as a placeholder for provided arguments.
  10659. *
  10660. * **Note:** This method doesn't set the "length" property of curried functions.
  10661. *
  10662. * @static
  10663. * @memberOf _
  10664. * @since 3.0.0
  10665. * @category Function
  10666. * @param {Function} func The function to curry.
  10667. * @param {number} [arity=func.length] The arity of `func`.
  10668. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10669. * @returns {Function} Returns the new curried function.
  10670. * @example
  10671. *
  10672. * var abc = function(a, b, c) {
  10673. * return [a, b, c];
  10674. * };
  10675. *
  10676. * var curried = _.curryRight(abc);
  10677. *
  10678. * curried(3)(2)(1);
  10679. * // => [1, 2, 3]
  10680. *
  10681. * curried(2, 3)(1);
  10682. * // => [1, 2, 3]
  10683. *
  10684. * curried(1, 2, 3);
  10685. * // => [1, 2, 3]
  10686. *
  10687. * // Curried with placeholders.
  10688. * curried(3)(1, _)(2);
  10689. * // => [1, 2, 3]
  10690. */
  10691. function curryRight(func, arity, guard) {
  10692. arity = guard ? undefined : arity;
  10693. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10694. result.placeholder = curryRight.placeholder;
  10695. return result;
  10696. }
  10697. /**
  10698. * Creates a debounced function that delays invoking `func` until after `wait`
  10699. * milliseconds have elapsed since the last time the debounced function was
  10700. * invoked. The debounced function comes with a `cancel` method to cancel
  10701. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10702. * Provide `options` to indicate whether `func` should be invoked on the
  10703. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10704. * with the last arguments provided to the debounced function. Subsequent
  10705. * calls to the debounced function return the result of the last `func`
  10706. * invocation.
  10707. *
  10708. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10709. * invoked on the trailing edge of the timeout only if the debounced function
  10710. * is invoked more than once during the `wait` timeout.
  10711. *
  10712. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10713. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10714. *
  10715. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10716. * for details over the differences between `_.debounce` and `_.throttle`.
  10717. *
  10718. * @static
  10719. * @memberOf _
  10720. * @since 0.1.0
  10721. * @category Function
  10722. * @param {Function} func The function to debounce.
  10723. * @param {number} [wait=0] The number of milliseconds to delay.
  10724. * @param {Object} [options={}] The options object.
  10725. * @param {boolean} [options.leading=false]
  10726. * Specify invoking on the leading edge of the timeout.
  10727. * @param {number} [options.maxWait]
  10728. * The maximum time `func` is allowed to be delayed before it's invoked.
  10729. * @param {boolean} [options.trailing=true]
  10730. * Specify invoking on the trailing edge of the timeout.
  10731. * @returns {Function} Returns the new debounced function.
  10732. * @example
  10733. *
  10734. * // Avoid costly calculations while the window size is in flux.
  10735. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10736. *
  10737. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10738. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10739. * 'leading': true,
  10740. * 'trailing': false
  10741. * }));
  10742. *
  10743. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10744. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10745. * var source = new EventSource('/stream');
  10746. * jQuery(source).on('message', debounced);
  10747. *
  10748. * // Cancel the trailing debounced invocation.
  10749. * jQuery(window).on('popstate', debounced.cancel);
  10750. */
  10751. function debounce(func, wait, options) {
  10752. var lastArgs,
  10753. lastThis,
  10754. maxWait,
  10755. result,
  10756. timerId,
  10757. lastCallTime,
  10758. lastInvokeTime = 0,
  10759. leading = false,
  10760. maxing = false,
  10761. trailing = true;
  10762. if (typeof func != 'function') {
  10763. throw new TypeError(FUNC_ERROR_TEXT);
  10764. }
  10765. wait = toNumber(wait) || 0;
  10766. if (isObject(options)) {
  10767. leading = !!options.leading;
  10768. maxing = 'maxWait' in options;
  10769. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10770. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10771. }
  10772. function invokeFunc(time) {
  10773. var args = lastArgs,
  10774. thisArg = lastThis;
  10775. lastArgs = lastThis = undefined;
  10776. lastInvokeTime = time;
  10777. result = func.apply(thisArg, args);
  10778. return result;
  10779. }
  10780. function leadingEdge(time) {
  10781. // Reset any `maxWait` timer.
  10782. lastInvokeTime = time;
  10783. // Start the timer for the trailing edge.
  10784. timerId = setTimeout(timerExpired, wait);
  10785. // Invoke the leading edge.
  10786. return leading ? invokeFunc(time) : result;
  10787. }
  10788. function remainingWait(time) {
  10789. var timeSinceLastCall = time - lastCallTime,
  10790. timeSinceLastInvoke = time - lastInvokeTime,
  10791. timeWaiting = wait - timeSinceLastCall;
  10792. return maxing
  10793. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10794. : timeWaiting;
  10795. }
  10796. function shouldInvoke(time) {
  10797. var timeSinceLastCall = time - lastCallTime,
  10798. timeSinceLastInvoke = time - lastInvokeTime;
  10799. // Either this is the first call, activity has stopped and we're at the
  10800. // trailing edge, the system time has gone backwards and we're treating
  10801. // it as the trailing edge, or we've hit the `maxWait` limit.
  10802. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10803. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10804. }
  10805. function timerExpired() {
  10806. var time = now();
  10807. if (shouldInvoke(time)) {
  10808. return trailingEdge(time);
  10809. }
  10810. // Restart the timer.
  10811. timerId = setTimeout(timerExpired, remainingWait(time));
  10812. }
  10813. function trailingEdge(time) {
  10814. timerId = undefined;
  10815. // Only invoke if we have `lastArgs` which means `func` has been
  10816. // debounced at least once.
  10817. if (trailing && lastArgs) {
  10818. return invokeFunc(time);
  10819. }
  10820. lastArgs = lastThis = undefined;
  10821. return result;
  10822. }
  10823. function cancel() {
  10824. if (timerId !== undefined) {
  10825. clearTimeout(timerId);
  10826. }
  10827. lastInvokeTime = 0;
  10828. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10829. }
  10830. function flush() {
  10831. return timerId === undefined ? result : trailingEdge(now());
  10832. }
  10833. function debounced() {
  10834. var time = now(),
  10835. isInvoking = shouldInvoke(time);
  10836. lastArgs = arguments;
  10837. lastThis = this;
  10838. lastCallTime = time;
  10839. if (isInvoking) {
  10840. if (timerId === undefined) {
  10841. return leadingEdge(lastCallTime);
  10842. }
  10843. if (maxing) {
  10844. // Handle invocations in a tight loop.
  10845. clearTimeout(timerId);
  10846. timerId = setTimeout(timerExpired, wait);
  10847. return invokeFunc(lastCallTime);
  10848. }
  10849. }
  10850. if (timerId === undefined) {
  10851. timerId = setTimeout(timerExpired, wait);
  10852. }
  10853. return result;
  10854. }
  10855. debounced.cancel = cancel;
  10856. debounced.flush = flush;
  10857. return debounced;
  10858. }
  10859. /**
  10860. * Defers invoking the `func` until the current call stack has cleared. Any
  10861. * additional arguments are provided to `func` when it's invoked.
  10862. *
  10863. * @static
  10864. * @memberOf _
  10865. * @since 0.1.0
  10866. * @category Function
  10867. * @param {Function} func The function to defer.
  10868. * @param {...*} [args] The arguments to invoke `func` with.
  10869. * @returns {number} Returns the timer id.
  10870. * @example
  10871. *
  10872. * _.defer(function(text) {
  10873. * console.log(text);
  10874. * }, 'deferred');
  10875. * // => Logs 'deferred' after one millisecond.
  10876. */
  10877. var defer = baseRest(function(func, args) {
  10878. return baseDelay(func, 1, args);
  10879. });
  10880. /**
  10881. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10882. * provided to `func` when it's invoked.
  10883. *
  10884. * @static
  10885. * @memberOf _
  10886. * @since 0.1.0
  10887. * @category Function
  10888. * @param {Function} func The function to delay.
  10889. * @param {number} wait The number of milliseconds to delay invocation.
  10890. * @param {...*} [args] The arguments to invoke `func` with.
  10891. * @returns {number} Returns the timer id.
  10892. * @example
  10893. *
  10894. * _.delay(function(text) {
  10895. * console.log(text);
  10896. * }, 1000, 'later');
  10897. * // => Logs 'later' after one second.
  10898. */
  10899. var delay = baseRest(function(func, wait, args) {
  10900. return baseDelay(func, toNumber(wait) || 0, args);
  10901. });
  10902. /**
  10903. * Creates a function that invokes `func` with arguments reversed.
  10904. *
  10905. * @static
  10906. * @memberOf _
  10907. * @since 4.0.0
  10908. * @category Function
  10909. * @param {Function} func The function to flip arguments for.
  10910. * @returns {Function} Returns the new flipped function.
  10911. * @example
  10912. *
  10913. * var flipped = _.flip(function() {
  10914. * return _.toArray(arguments);
  10915. * });
  10916. *
  10917. * flipped('a', 'b', 'c', 'd');
  10918. * // => ['d', 'c', 'b', 'a']
  10919. */
  10920. function flip(func) {
  10921. return createWrap(func, WRAP_FLIP_FLAG);
  10922. }
  10923. /**
  10924. * Creates a function that memoizes the result of `func`. If `resolver` is
  10925. * provided, it determines the cache key for storing the result based on the
  10926. * arguments provided to the memoized function. By default, the first argument
  10927. * provided to the memoized function is used as the map cache key. The `func`
  10928. * is invoked with the `this` binding of the memoized function.
  10929. *
  10930. * **Note:** The cache is exposed as the `cache` property on the memoized
  10931. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10932. * constructor with one whose instances implement the
  10933. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10934. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10935. *
  10936. * @static
  10937. * @memberOf _
  10938. * @since 0.1.0
  10939. * @category Function
  10940. * @param {Function} func The function to have its output memoized.
  10941. * @param {Function} [resolver] The function to resolve the cache key.
  10942. * @returns {Function} Returns the new memoized function.
  10943. * @example
  10944. *
  10945. * var object = { 'a': 1, 'b': 2 };
  10946. * var other = { 'c': 3, 'd': 4 };
  10947. *
  10948. * var values = _.memoize(_.values);
  10949. * values(object);
  10950. * // => [1, 2]
  10951. *
  10952. * values(other);
  10953. * // => [3, 4]
  10954. *
  10955. * object.a = 2;
  10956. * values(object);
  10957. * // => [1, 2]
  10958. *
  10959. * // Modify the result cache.
  10960. * values.cache.set(object, ['a', 'b']);
  10961. * values(object);
  10962. * // => ['a', 'b']
  10963. *
  10964. * // Replace `_.memoize.Cache`.
  10965. * _.memoize.Cache = WeakMap;
  10966. */
  10967. function memoize(func, resolver) {
  10968. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  10969. throw new TypeError(FUNC_ERROR_TEXT);
  10970. }
  10971. var memoized = function() {
  10972. var args = arguments,
  10973. key = resolver ? resolver.apply(this, args) : args[0],
  10974. cache = memoized.cache;
  10975. if (cache.has(key)) {
  10976. return cache.get(key);
  10977. }
  10978. var result = func.apply(this, args);
  10979. memoized.cache = cache.set(key, result) || cache;
  10980. return result;
  10981. };
  10982. memoized.cache = new (memoize.Cache || MapCache);
  10983. return memoized;
  10984. }
  10985. // Expose `MapCache`.
  10986. memoize.Cache = MapCache;
  10987. /**
  10988. * Creates a function that negates the result of the predicate `func`. The
  10989. * `func` predicate is invoked with the `this` binding and arguments of the
  10990. * created function.
  10991. *
  10992. * @static
  10993. * @memberOf _
  10994. * @since 3.0.0
  10995. * @category Function
  10996. * @param {Function} predicate The predicate to negate.
  10997. * @returns {Function} Returns the new negated function.
  10998. * @example
  10999. *
  11000. * function isEven(n) {
  11001. * return n % 2 == 0;
  11002. * }
  11003. *
  11004. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11005. * // => [1, 3, 5]
  11006. */
  11007. function negate(predicate) {
  11008. if (typeof predicate != 'function') {
  11009. throw new TypeError(FUNC_ERROR_TEXT);
  11010. }
  11011. return function() {
  11012. var args = arguments;
  11013. switch (args.length) {
  11014. case 0: return !predicate.call(this);
  11015. case 1: return !predicate.call(this, args[0]);
  11016. case 2: return !predicate.call(this, args[0], args[1]);
  11017. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11018. }
  11019. return !predicate.apply(this, args);
  11020. };
  11021. }
  11022. /**
  11023. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11024. * to the function return the value of the first invocation. The `func` is
  11025. * invoked with the `this` binding and arguments of the created function.
  11026. *
  11027. * @static
  11028. * @memberOf _
  11029. * @since 0.1.0
  11030. * @category Function
  11031. * @param {Function} func The function to restrict.
  11032. * @returns {Function} Returns the new restricted function.
  11033. * @example
  11034. *
  11035. * var initialize = _.once(createApplication);
  11036. * initialize();
  11037. * initialize();
  11038. * // => `createApplication` is invoked once
  11039. */
  11040. function once(func) {
  11041. return before(2, func);
  11042. }
  11043. /**
  11044. * Creates a function that invokes `func` with its arguments transformed.
  11045. *
  11046. * @static
  11047. * @since 4.0.0
  11048. * @memberOf _
  11049. * @category Function
  11050. * @param {Function} func The function to wrap.
  11051. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11052. * The argument transforms.
  11053. * @returns {Function} Returns the new function.
  11054. * @example
  11055. *
  11056. * function doubled(n) {
  11057. * return n * 2;
  11058. * }
  11059. *
  11060. * function square(n) {
  11061. * return n * n;
  11062. * }
  11063. *
  11064. * var func = _.overArgs(function(x, y) {
  11065. * return [x, y];
  11066. * }, [square, doubled]);
  11067. *
  11068. * func(9, 3);
  11069. * // => [81, 6]
  11070. *
  11071. * func(10, 5);
  11072. * // => [100, 10]
  11073. */
  11074. var overArgs = castRest(function(func, transforms) {
  11075. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11076. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11077. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11078. var funcsLength = transforms.length;
  11079. return baseRest(function(args) {
  11080. var index = -1,
  11081. length = nativeMin(args.length, funcsLength);
  11082. while (++index < length) {
  11083. args[index] = transforms[index].call(this, args[index]);
  11084. }
  11085. return apply(func, this, args);
  11086. });
  11087. });
  11088. /**
  11089. * Creates a function that invokes `func` with `partials` prepended to the
  11090. * arguments it receives. This method is like `_.bind` except it does **not**
  11091. * alter the `this` binding.
  11092. *
  11093. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11094. * builds, may be used as a placeholder for partially applied arguments.
  11095. *
  11096. * **Note:** This method doesn't set the "length" property of partially
  11097. * applied functions.
  11098. *
  11099. * @static
  11100. * @memberOf _
  11101. * @since 0.2.0
  11102. * @category Function
  11103. * @param {Function} func The function to partially apply arguments to.
  11104. * @param {...*} [partials] The arguments to be partially applied.
  11105. * @returns {Function} Returns the new partially applied function.
  11106. * @example
  11107. *
  11108. * function greet(greeting, name) {
  11109. * return greeting + ' ' + name;
  11110. * }
  11111. *
  11112. * var sayHelloTo = _.partial(greet, 'hello');
  11113. * sayHelloTo('fred');
  11114. * // => 'hello fred'
  11115. *
  11116. * // Partially applied with placeholders.
  11117. * var greetFred = _.partial(greet, _, 'fred');
  11118. * greetFred('hi');
  11119. * // => 'hi fred'
  11120. */
  11121. var partial = baseRest(function(func, partials) {
  11122. var holders = replaceHolders(partials, getHolder(partial));
  11123. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11124. });
  11125. /**
  11126. * This method is like `_.partial` except that partially applied arguments
  11127. * are appended to the arguments it receives.
  11128. *
  11129. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11130. * builds, may be used as a placeholder for partially applied arguments.
  11131. *
  11132. * **Note:** This method doesn't set the "length" property of partially
  11133. * applied functions.
  11134. *
  11135. * @static
  11136. * @memberOf _
  11137. * @since 1.0.0
  11138. * @category Function
  11139. * @param {Function} func The function to partially apply arguments to.
  11140. * @param {...*} [partials] The arguments to be partially applied.
  11141. * @returns {Function} Returns the new partially applied function.
  11142. * @example
  11143. *
  11144. * function greet(greeting, name) {
  11145. * return greeting + ' ' + name;
  11146. * }
  11147. *
  11148. * var greetFred = _.partialRight(greet, 'fred');
  11149. * greetFred('hi');
  11150. * // => 'hi fred'
  11151. *
  11152. * // Partially applied with placeholders.
  11153. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11154. * sayHelloTo('fred');
  11155. * // => 'hello fred'
  11156. */
  11157. var partialRight = baseRest(function(func, partials) {
  11158. var holders = replaceHolders(partials, getHolder(partialRight));
  11159. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11160. });
  11161. /**
  11162. * Creates a function that invokes `func` with arguments arranged according
  11163. * to the specified `indexes` where the argument value at the first index is
  11164. * provided as the first argument, the argument value at the second index is
  11165. * provided as the second argument, and so on.
  11166. *
  11167. * @static
  11168. * @memberOf _
  11169. * @since 3.0.0
  11170. * @category Function
  11171. * @param {Function} func The function to rearrange arguments for.
  11172. * @param {...(number|number[])} indexes The arranged argument indexes.
  11173. * @returns {Function} Returns the new function.
  11174. * @example
  11175. *
  11176. * var rearged = _.rearg(function(a, b, c) {
  11177. * return [a, b, c];
  11178. * }, [2, 0, 1]);
  11179. *
  11180. * rearged('b', 'c', 'a')
  11181. * // => ['a', 'b', 'c']
  11182. */
  11183. var rearg = flatRest(function(func, indexes) {
  11184. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11185. });
  11186. /**
  11187. * Creates a function that invokes `func` with the `this` binding of the
  11188. * created function and arguments from `start` and beyond provided as
  11189. * an array.
  11190. *
  11191. * **Note:** This method is based on the
  11192. * [rest parameter](https://mdn.io/rest_parameters).
  11193. *
  11194. * @static
  11195. * @memberOf _
  11196. * @since 4.0.0
  11197. * @category Function
  11198. * @param {Function} func The function to apply a rest parameter to.
  11199. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11200. * @returns {Function} Returns the new function.
  11201. * @example
  11202. *
  11203. * var say = _.rest(function(what, names) {
  11204. * return what + ' ' + _.initial(names).join(', ') +
  11205. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11206. * });
  11207. *
  11208. * say('hello', 'fred', 'barney', 'pebbles');
  11209. * // => 'hello fred, barney, & pebbles'
  11210. */
  11211. function rest(func, start) {
  11212. if (typeof func != 'function') {
  11213. throw new TypeError(FUNC_ERROR_TEXT);
  11214. }
  11215. start = start === undefined ? start : toInteger(start);
  11216. return baseRest(func, start);
  11217. }
  11218. /**
  11219. * Creates a function that invokes `func` with the `this` binding of the
  11220. * create function and an array of arguments much like
  11221. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11222. *
  11223. * **Note:** This method is based on the
  11224. * [spread operator](https://mdn.io/spread_operator).
  11225. *
  11226. * @static
  11227. * @memberOf _
  11228. * @since 3.2.0
  11229. * @category Function
  11230. * @param {Function} func The function to spread arguments over.
  11231. * @param {number} [start=0] The start position of the spread.
  11232. * @returns {Function} Returns the new function.
  11233. * @example
  11234. *
  11235. * var say = _.spread(function(who, what) {
  11236. * return who + ' says ' + what;
  11237. * });
  11238. *
  11239. * say(['fred', 'hello']);
  11240. * // => 'fred says hello'
  11241. *
  11242. * var numbers = Promise.all([
  11243. * Promise.resolve(40),
  11244. * Promise.resolve(36)
  11245. * ]);
  11246. *
  11247. * numbers.then(_.spread(function(x, y) {
  11248. * return x + y;
  11249. * }));
  11250. * // => a Promise of 76
  11251. */
  11252. function spread(func, start) {
  11253. if (typeof func != 'function') {
  11254. throw new TypeError(FUNC_ERROR_TEXT);
  11255. }
  11256. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11257. return baseRest(function(args) {
  11258. var array = args[start],
  11259. otherArgs = castSlice(args, 0, start);
  11260. if (array) {
  11261. arrayPush(otherArgs, array);
  11262. }
  11263. return apply(func, this, otherArgs);
  11264. });
  11265. }
  11266. /**
  11267. * Creates a throttled function that only invokes `func` at most once per
  11268. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11269. * method to cancel delayed `func` invocations and a `flush` method to
  11270. * immediately invoke them. Provide `options` to indicate whether `func`
  11271. * should be invoked on the leading and/or trailing edge of the `wait`
  11272. * timeout. The `func` is invoked with the last arguments provided to the
  11273. * throttled function. Subsequent calls to the throttled function return the
  11274. * result of the last `func` invocation.
  11275. *
  11276. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11277. * invoked on the trailing edge of the timeout only if the throttled function
  11278. * is invoked more than once during the `wait` timeout.
  11279. *
  11280. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11281. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11282. *
  11283. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11284. * for details over the differences between `_.throttle` and `_.debounce`.
  11285. *
  11286. * @static
  11287. * @memberOf _
  11288. * @since 0.1.0
  11289. * @category Function
  11290. * @param {Function} func The function to throttle.
  11291. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11292. * @param {Object} [options={}] The options object.
  11293. * @param {boolean} [options.leading=true]
  11294. * Specify invoking on the leading edge of the timeout.
  11295. * @param {boolean} [options.trailing=true]
  11296. * Specify invoking on the trailing edge of the timeout.
  11297. * @returns {Function} Returns the new throttled function.
  11298. * @example
  11299. *
  11300. * // Avoid excessively updating the position while scrolling.
  11301. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11302. *
  11303. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11304. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11305. * jQuery(element).on('click', throttled);
  11306. *
  11307. * // Cancel the trailing throttled invocation.
  11308. * jQuery(window).on('popstate', throttled.cancel);
  11309. */
  11310. function throttle(func, wait, options) {
  11311. var leading = true,
  11312. trailing = true;
  11313. if (typeof func != 'function') {
  11314. throw new TypeError(FUNC_ERROR_TEXT);
  11315. }
  11316. if (isObject(options)) {
  11317. leading = 'leading' in options ? !!options.leading : leading;
  11318. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11319. }
  11320. return debounce(func, wait, {
  11321. 'leading': leading,
  11322. 'maxWait': wait,
  11323. 'trailing': trailing
  11324. });
  11325. }
  11326. /**
  11327. * Creates a function that accepts up to one argument, ignoring any
  11328. * additional arguments.
  11329. *
  11330. * @static
  11331. * @memberOf _
  11332. * @since 4.0.0
  11333. * @category Function
  11334. * @param {Function} func The function to cap arguments for.
  11335. * @returns {Function} Returns the new capped function.
  11336. * @example
  11337. *
  11338. * _.map(['6', '8', '10'], _.unary(parseInt));
  11339. * // => [6, 8, 10]
  11340. */
  11341. function unary(func) {
  11342. return ary(func, 1);
  11343. }
  11344. /**
  11345. * Creates a function that provides `value` to `wrapper` as its first
  11346. * argument. Any additional arguments provided to the function are appended
  11347. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11348. * binding of the created function.
  11349. *
  11350. * @static
  11351. * @memberOf _
  11352. * @since 0.1.0
  11353. * @category Function
  11354. * @param {*} value The value to wrap.
  11355. * @param {Function} [wrapper=identity] The wrapper function.
  11356. * @returns {Function} Returns the new function.
  11357. * @example
  11358. *
  11359. * var p = _.wrap(_.escape, function(func, text) {
  11360. * return '<p>' + func(text) + '</p>';
  11361. * });
  11362. *
  11363. * p('fred, barney, & pebbles');
  11364. * // => '<p>fred, barney, &amp; pebbles</p>'
  11365. */
  11366. function wrap(value, wrapper) {
  11367. return partial(castFunction(wrapper), value);
  11368. }
  11369. /*------------------------------------------------------------------------*/
  11370. /**
  11371. * Casts `value` as an array if it's not one.
  11372. *
  11373. * @static
  11374. * @memberOf _
  11375. * @since 4.4.0
  11376. * @category Lang
  11377. * @param {*} value The value to inspect.
  11378. * @returns {Array} Returns the cast array.
  11379. * @example
  11380. *
  11381. * _.castArray(1);
  11382. * // => [1]
  11383. *
  11384. * _.castArray({ 'a': 1 });
  11385. * // => [{ 'a': 1 }]
  11386. *
  11387. * _.castArray('abc');
  11388. * // => ['abc']
  11389. *
  11390. * _.castArray(null);
  11391. * // => [null]
  11392. *
  11393. * _.castArray(undefined);
  11394. * // => [undefined]
  11395. *
  11396. * _.castArray();
  11397. * // => []
  11398. *
  11399. * var array = [1, 2, 3];
  11400. * console.log(_.castArray(array) === array);
  11401. * // => true
  11402. */
  11403. function castArray() {
  11404. if (!arguments.length) {
  11405. return [];
  11406. }
  11407. var value = arguments[0];
  11408. return isArray(value) ? value : [value];
  11409. }
  11410. /**
  11411. * Creates a shallow clone of `value`.
  11412. *
  11413. * **Note:** This method is loosely based on the
  11414. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11415. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11416. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11417. * arrays. The own enumerable properties of `arguments` objects are cloned
  11418. * as plain objects. An empty object is returned for uncloneable values such
  11419. * as error objects, functions, DOM nodes, and WeakMaps.
  11420. *
  11421. * @static
  11422. * @memberOf _
  11423. * @since 0.1.0
  11424. * @category Lang
  11425. * @param {*} value The value to clone.
  11426. * @returns {*} Returns the cloned value.
  11427. * @see _.cloneDeep
  11428. * @example
  11429. *
  11430. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11431. *
  11432. * var shallow = _.clone(objects);
  11433. * console.log(shallow[0] === objects[0]);
  11434. * // => true
  11435. */
  11436. function clone(value) {
  11437. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11438. }
  11439. /**
  11440. * This method is like `_.clone` except that it accepts `customizer` which
  11441. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11442. * cloning is handled by the method instead. The `customizer` is invoked with
  11443. * up to four arguments; (value [, index|key, object, stack]).
  11444. *
  11445. * @static
  11446. * @memberOf _
  11447. * @since 4.0.0
  11448. * @category Lang
  11449. * @param {*} value The value to clone.
  11450. * @param {Function} [customizer] The function to customize cloning.
  11451. * @returns {*} Returns the cloned value.
  11452. * @see _.cloneDeepWith
  11453. * @example
  11454. *
  11455. * function customizer(value) {
  11456. * if (_.isElement(value)) {
  11457. * return value.cloneNode(false);
  11458. * }
  11459. * }
  11460. *
  11461. * var el = _.cloneWith(document.body, customizer);
  11462. *
  11463. * console.log(el === document.body);
  11464. * // => false
  11465. * console.log(el.nodeName);
  11466. * // => 'BODY'
  11467. * console.log(el.childNodes.length);
  11468. * // => 0
  11469. */
  11470. function cloneWith(value, customizer) {
  11471. customizer = typeof customizer == 'function' ? customizer : undefined;
  11472. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11473. }
  11474. /**
  11475. * This method is like `_.clone` except that it recursively clones `value`.
  11476. *
  11477. * @static
  11478. * @memberOf _
  11479. * @since 1.0.0
  11480. * @category Lang
  11481. * @param {*} value The value to recursively clone.
  11482. * @returns {*} Returns the deep cloned value.
  11483. * @see _.clone
  11484. * @example
  11485. *
  11486. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11487. *
  11488. * var deep = _.cloneDeep(objects);
  11489. * console.log(deep[0] === objects[0]);
  11490. * // => false
  11491. */
  11492. function cloneDeep(value) {
  11493. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11494. }
  11495. /**
  11496. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11497. *
  11498. * @static
  11499. * @memberOf _
  11500. * @since 4.0.0
  11501. * @category Lang
  11502. * @param {*} value The value to recursively clone.
  11503. * @param {Function} [customizer] The function to customize cloning.
  11504. * @returns {*} Returns the deep cloned value.
  11505. * @see _.cloneWith
  11506. * @example
  11507. *
  11508. * function customizer(value) {
  11509. * if (_.isElement(value)) {
  11510. * return value.cloneNode(true);
  11511. * }
  11512. * }
  11513. *
  11514. * var el = _.cloneDeepWith(document.body, customizer);
  11515. *
  11516. * console.log(el === document.body);
  11517. * // => false
  11518. * console.log(el.nodeName);
  11519. * // => 'BODY'
  11520. * console.log(el.childNodes.length);
  11521. * // => 20
  11522. */
  11523. function cloneDeepWith(value, customizer) {
  11524. customizer = typeof customizer == 'function' ? customizer : undefined;
  11525. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11526. }
  11527. /**
  11528. * Checks if `object` conforms to `source` by invoking the predicate
  11529. * properties of `source` with the corresponding property values of `object`.
  11530. *
  11531. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11532. * partially applied.
  11533. *
  11534. * @static
  11535. * @memberOf _
  11536. * @since 4.14.0
  11537. * @category Lang
  11538. * @param {Object} object The object to inspect.
  11539. * @param {Object} source The object of property predicates to conform to.
  11540. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11541. * @example
  11542. *
  11543. * var object = { 'a': 1, 'b': 2 };
  11544. *
  11545. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11546. * // => true
  11547. *
  11548. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11549. * // => false
  11550. */
  11551. function conformsTo(object, source) {
  11552. return source == null || baseConformsTo(object, source, keys(source));
  11553. }
  11554. /**
  11555. * Performs a
  11556. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11557. * comparison between two values to determine if they are equivalent.
  11558. *
  11559. * @static
  11560. * @memberOf _
  11561. * @since 4.0.0
  11562. * @category Lang
  11563. * @param {*} value The value to compare.
  11564. * @param {*} other The other value to compare.
  11565. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11566. * @example
  11567. *
  11568. * var object = { 'a': 1 };
  11569. * var other = { 'a': 1 };
  11570. *
  11571. * _.eq(object, object);
  11572. * // => true
  11573. *
  11574. * _.eq(object, other);
  11575. * // => false
  11576. *
  11577. * _.eq('a', 'a');
  11578. * // => true
  11579. *
  11580. * _.eq('a', Object('a'));
  11581. * // => false
  11582. *
  11583. * _.eq(NaN, NaN);
  11584. * // => true
  11585. */
  11586. function eq(value, other) {
  11587. return value === other || (value !== value && other !== other);
  11588. }
  11589. /**
  11590. * Checks if `value` is greater than `other`.
  11591. *
  11592. * @static
  11593. * @memberOf _
  11594. * @since 3.9.0
  11595. * @category Lang
  11596. * @param {*} value The value to compare.
  11597. * @param {*} other The other value to compare.
  11598. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11599. * else `false`.
  11600. * @see _.lt
  11601. * @example
  11602. *
  11603. * _.gt(3, 1);
  11604. * // => true
  11605. *
  11606. * _.gt(3, 3);
  11607. * // => false
  11608. *
  11609. * _.gt(1, 3);
  11610. * // => false
  11611. */
  11612. var gt = createRelationalOperation(baseGt);
  11613. /**
  11614. * Checks if `value` is greater than or equal to `other`.
  11615. *
  11616. * @static
  11617. * @memberOf _
  11618. * @since 3.9.0
  11619. * @category Lang
  11620. * @param {*} value The value to compare.
  11621. * @param {*} other The other value to compare.
  11622. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11623. * `other`, else `false`.
  11624. * @see _.lte
  11625. * @example
  11626. *
  11627. * _.gte(3, 1);
  11628. * // => true
  11629. *
  11630. * _.gte(3, 3);
  11631. * // => true
  11632. *
  11633. * _.gte(1, 3);
  11634. * // => false
  11635. */
  11636. var gte = createRelationalOperation(function(value, other) {
  11637. return value >= other;
  11638. });
  11639. /**
  11640. * Checks if `value` is likely an `arguments` object.
  11641. *
  11642. * @static
  11643. * @memberOf _
  11644. * @since 0.1.0
  11645. * @category Lang
  11646. * @param {*} value The value to check.
  11647. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11648. * else `false`.
  11649. * @example
  11650. *
  11651. * _.isArguments(function() { return arguments; }());
  11652. * // => true
  11653. *
  11654. * _.isArguments([1, 2, 3]);
  11655. * // => false
  11656. */
  11657. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11658. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11659. !propertyIsEnumerable.call(value, 'callee');
  11660. };
  11661. /**
  11662. * Checks if `value` is classified as an `Array` object.
  11663. *
  11664. * @static
  11665. * @memberOf _
  11666. * @since 0.1.0
  11667. * @category Lang
  11668. * @param {*} value The value to check.
  11669. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11670. * @example
  11671. *
  11672. * _.isArray([1, 2, 3]);
  11673. * // => true
  11674. *
  11675. * _.isArray(document.body.children);
  11676. * // => false
  11677. *
  11678. * _.isArray('abc');
  11679. * // => false
  11680. *
  11681. * _.isArray(_.noop);
  11682. * // => false
  11683. */
  11684. var isArray = Array.isArray;
  11685. /**
  11686. * Checks if `value` is classified as an `ArrayBuffer` object.
  11687. *
  11688. * @static
  11689. * @memberOf _
  11690. * @since 4.3.0
  11691. * @category Lang
  11692. * @param {*} value The value to check.
  11693. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11694. * @example
  11695. *
  11696. * _.isArrayBuffer(new ArrayBuffer(2));
  11697. * // => true
  11698. *
  11699. * _.isArrayBuffer(new Array(2));
  11700. * // => false
  11701. */
  11702. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11703. /**
  11704. * Checks if `value` is array-like. A value is considered array-like if it's
  11705. * not a function and has a `value.length` that's an integer greater than or
  11706. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11707. *
  11708. * @static
  11709. * @memberOf _
  11710. * @since 4.0.0
  11711. * @category Lang
  11712. * @param {*} value The value to check.
  11713. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11714. * @example
  11715. *
  11716. * _.isArrayLike([1, 2, 3]);
  11717. * // => true
  11718. *
  11719. * _.isArrayLike(document.body.children);
  11720. * // => true
  11721. *
  11722. * _.isArrayLike('abc');
  11723. * // => true
  11724. *
  11725. * _.isArrayLike(_.noop);
  11726. * // => false
  11727. */
  11728. function isArrayLike(value) {
  11729. return value != null && isLength(value.length) && !isFunction(value);
  11730. }
  11731. /**
  11732. * This method is like `_.isArrayLike` except that it also checks if `value`
  11733. * is an object.
  11734. *
  11735. * @static
  11736. * @memberOf _
  11737. * @since 4.0.0
  11738. * @category Lang
  11739. * @param {*} value The value to check.
  11740. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11741. * else `false`.
  11742. * @example
  11743. *
  11744. * _.isArrayLikeObject([1, 2, 3]);
  11745. * // => true
  11746. *
  11747. * _.isArrayLikeObject(document.body.children);
  11748. * // => true
  11749. *
  11750. * _.isArrayLikeObject('abc');
  11751. * // => false
  11752. *
  11753. * _.isArrayLikeObject(_.noop);
  11754. * // => false
  11755. */
  11756. function isArrayLikeObject(value) {
  11757. return isObjectLike(value) && isArrayLike(value);
  11758. }
  11759. /**
  11760. * Checks if `value` is classified as a boolean primitive or object.
  11761. *
  11762. * @static
  11763. * @memberOf _
  11764. * @since 0.1.0
  11765. * @category Lang
  11766. * @param {*} value The value to check.
  11767. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11768. * @example
  11769. *
  11770. * _.isBoolean(false);
  11771. * // => true
  11772. *
  11773. * _.isBoolean(null);
  11774. * // => false
  11775. */
  11776. function isBoolean(value) {
  11777. return value === true || value === false ||
  11778. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11779. }
  11780. /**
  11781. * Checks if `value` is a buffer.
  11782. *
  11783. * @static
  11784. * @memberOf _
  11785. * @since 4.3.0
  11786. * @category Lang
  11787. * @param {*} value The value to check.
  11788. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11789. * @example
  11790. *
  11791. * _.isBuffer(new Buffer(2));
  11792. * // => true
  11793. *
  11794. * _.isBuffer(new Uint8Array(2));
  11795. * // => false
  11796. */
  11797. var isBuffer = nativeIsBuffer || stubFalse;
  11798. /**
  11799. * Checks if `value` is classified as a `Date` object.
  11800. *
  11801. * @static
  11802. * @memberOf _
  11803. * @since 0.1.0
  11804. * @category Lang
  11805. * @param {*} value The value to check.
  11806. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11807. * @example
  11808. *
  11809. * _.isDate(new Date);
  11810. * // => true
  11811. *
  11812. * _.isDate('Mon April 23 2012');
  11813. * // => false
  11814. */
  11815. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11816. /**
  11817. * Checks if `value` is likely a DOM element.
  11818. *
  11819. * @static
  11820. * @memberOf _
  11821. * @since 0.1.0
  11822. * @category Lang
  11823. * @param {*} value The value to check.
  11824. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11825. * @example
  11826. *
  11827. * _.isElement(document.body);
  11828. * // => true
  11829. *
  11830. * _.isElement('<body>');
  11831. * // => false
  11832. */
  11833. function isElement(value) {
  11834. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11835. }
  11836. /**
  11837. * Checks if `value` is an empty object, collection, map, or set.
  11838. *
  11839. * Objects are considered empty if they have no own enumerable string keyed
  11840. * properties.
  11841. *
  11842. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11843. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11844. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11845. *
  11846. * @static
  11847. * @memberOf _
  11848. * @since 0.1.0
  11849. * @category Lang
  11850. * @param {*} value The value to check.
  11851. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11852. * @example
  11853. *
  11854. * _.isEmpty(null);
  11855. * // => true
  11856. *
  11857. * _.isEmpty(true);
  11858. * // => true
  11859. *
  11860. * _.isEmpty(1);
  11861. * // => true
  11862. *
  11863. * _.isEmpty([1, 2, 3]);
  11864. * // => false
  11865. *
  11866. * _.isEmpty({ 'a': 1 });
  11867. * // => false
  11868. */
  11869. function isEmpty(value) {
  11870. if (value == null) {
  11871. return true;
  11872. }
  11873. if (isArrayLike(value) &&
  11874. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11875. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11876. return !value.length;
  11877. }
  11878. var tag = getTag(value);
  11879. if (tag == mapTag || tag == setTag) {
  11880. return !value.size;
  11881. }
  11882. if (isPrototype(value)) {
  11883. return !baseKeys(value).length;
  11884. }
  11885. for (var key in value) {
  11886. if (hasOwnProperty.call(value, key)) {
  11887. return false;
  11888. }
  11889. }
  11890. return true;
  11891. }
  11892. /**
  11893. * Performs a deep comparison between two values to determine if they are
  11894. * equivalent.
  11895. *
  11896. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11897. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11898. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11899. * by their own, not inherited, enumerable properties. Functions and DOM
  11900. * nodes are compared by strict equality, i.e. `===`.
  11901. *
  11902. * @static
  11903. * @memberOf _
  11904. * @since 0.1.0
  11905. * @category Lang
  11906. * @param {*} value The value to compare.
  11907. * @param {*} other The other value to compare.
  11908. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11909. * @example
  11910. *
  11911. * var object = { 'a': 1 };
  11912. * var other = { 'a': 1 };
  11913. *
  11914. * _.isEqual(object, other);
  11915. * // => true
  11916. *
  11917. * object === other;
  11918. * // => false
  11919. */
  11920. function isEqual(value, other) {
  11921. return baseIsEqual(value, other);
  11922. }
  11923. /**
  11924. * This method is like `_.isEqual` except that it accepts `customizer` which
  11925. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11926. * are handled by the method instead. The `customizer` is invoked with up to
  11927. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11928. *
  11929. * @static
  11930. * @memberOf _
  11931. * @since 4.0.0
  11932. * @category Lang
  11933. * @param {*} value The value to compare.
  11934. * @param {*} other The other value to compare.
  11935. * @param {Function} [customizer] The function to customize comparisons.
  11936. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11937. * @example
  11938. *
  11939. * function isGreeting(value) {
  11940. * return /^h(?:i|ello)$/.test(value);
  11941. * }
  11942. *
  11943. * function customizer(objValue, othValue) {
  11944. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11945. * return true;
  11946. * }
  11947. * }
  11948. *
  11949. * var array = ['hello', 'goodbye'];
  11950. * var other = ['hi', 'goodbye'];
  11951. *
  11952. * _.isEqualWith(array, other, customizer);
  11953. * // => true
  11954. */
  11955. function isEqualWith(value, other, customizer) {
  11956. customizer = typeof customizer == 'function' ? customizer : undefined;
  11957. var result = customizer ? customizer(value, other) : undefined;
  11958. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11959. }
  11960. /**
  11961. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11962. * `SyntaxError`, `TypeError`, or `URIError` object.
  11963. *
  11964. * @static
  11965. * @memberOf _
  11966. * @since 3.0.0
  11967. * @category Lang
  11968. * @param {*} value The value to check.
  11969. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  11970. * @example
  11971. *
  11972. * _.isError(new Error);
  11973. * // => true
  11974. *
  11975. * _.isError(Error);
  11976. * // => false
  11977. */
  11978. function isError(value) {
  11979. if (!isObjectLike(value)) {
  11980. return false;
  11981. }
  11982. var tag = baseGetTag(value);
  11983. return tag == errorTag || tag == domExcTag ||
  11984. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  11985. }
  11986. /**
  11987. * Checks if `value` is a finite primitive number.
  11988. *
  11989. * **Note:** This method is based on
  11990. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  11991. *
  11992. * @static
  11993. * @memberOf _
  11994. * @since 0.1.0
  11995. * @category Lang
  11996. * @param {*} value The value to check.
  11997. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  11998. * @example
  11999. *
  12000. * _.isFinite(3);
  12001. * // => true
  12002. *
  12003. * _.isFinite(Number.MIN_VALUE);
  12004. * // => true
  12005. *
  12006. * _.isFinite(Infinity);
  12007. * // => false
  12008. *
  12009. * _.isFinite('3');
  12010. * // => false
  12011. */
  12012. function isFinite(value) {
  12013. return typeof value == 'number' && nativeIsFinite(value);
  12014. }
  12015. /**
  12016. * Checks if `value` is classified as a `Function` object.
  12017. *
  12018. * @static
  12019. * @memberOf _
  12020. * @since 0.1.0
  12021. * @category Lang
  12022. * @param {*} value The value to check.
  12023. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12024. * @example
  12025. *
  12026. * _.isFunction(_);
  12027. * // => true
  12028. *
  12029. * _.isFunction(/abc/);
  12030. * // => false
  12031. */
  12032. function isFunction(value) {
  12033. if (!isObject(value)) {
  12034. return false;
  12035. }
  12036. // The use of `Object#toString` avoids issues with the `typeof` operator
  12037. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12038. var tag = baseGetTag(value);
  12039. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12040. }
  12041. /**
  12042. * Checks if `value` is an integer.
  12043. *
  12044. * **Note:** This method is based on
  12045. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12046. *
  12047. * @static
  12048. * @memberOf _
  12049. * @since 4.0.0
  12050. * @category Lang
  12051. * @param {*} value The value to check.
  12052. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12053. * @example
  12054. *
  12055. * _.isInteger(3);
  12056. * // => true
  12057. *
  12058. * _.isInteger(Number.MIN_VALUE);
  12059. * // => false
  12060. *
  12061. * _.isInteger(Infinity);
  12062. * // => false
  12063. *
  12064. * _.isInteger('3');
  12065. * // => false
  12066. */
  12067. function isInteger(value) {
  12068. return typeof value == 'number' && value == toInteger(value);
  12069. }
  12070. /**
  12071. * Checks if `value` is a valid array-like length.
  12072. *
  12073. * **Note:** This method is loosely based on
  12074. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12075. *
  12076. * @static
  12077. * @memberOf _
  12078. * @since 4.0.0
  12079. * @category Lang
  12080. * @param {*} value The value to check.
  12081. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12082. * @example
  12083. *
  12084. * _.isLength(3);
  12085. * // => true
  12086. *
  12087. * _.isLength(Number.MIN_VALUE);
  12088. * // => false
  12089. *
  12090. * _.isLength(Infinity);
  12091. * // => false
  12092. *
  12093. * _.isLength('3');
  12094. * // => false
  12095. */
  12096. function isLength(value) {
  12097. return typeof value == 'number' &&
  12098. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12099. }
  12100. /**
  12101. * Checks if `value` is the
  12102. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12103. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12104. *
  12105. * @static
  12106. * @memberOf _
  12107. * @since 0.1.0
  12108. * @category Lang
  12109. * @param {*} value The value to check.
  12110. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12111. * @example
  12112. *
  12113. * _.isObject({});
  12114. * // => true
  12115. *
  12116. * _.isObject([1, 2, 3]);
  12117. * // => true
  12118. *
  12119. * _.isObject(_.noop);
  12120. * // => true
  12121. *
  12122. * _.isObject(null);
  12123. * // => false
  12124. */
  12125. function isObject(value) {
  12126. var type = typeof value;
  12127. return value != null && (type == 'object' || type == 'function');
  12128. }
  12129. /**
  12130. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12131. * and has a `typeof` result of "object".
  12132. *
  12133. * @static
  12134. * @memberOf _
  12135. * @since 4.0.0
  12136. * @category Lang
  12137. * @param {*} value The value to check.
  12138. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12139. * @example
  12140. *
  12141. * _.isObjectLike({});
  12142. * // => true
  12143. *
  12144. * _.isObjectLike([1, 2, 3]);
  12145. * // => true
  12146. *
  12147. * _.isObjectLike(_.noop);
  12148. * // => false
  12149. *
  12150. * _.isObjectLike(null);
  12151. * // => false
  12152. */
  12153. function isObjectLike(value) {
  12154. return value != null && typeof value == 'object';
  12155. }
  12156. /**
  12157. * Checks if `value` is classified as a `Map` object.
  12158. *
  12159. * @static
  12160. * @memberOf _
  12161. * @since 4.3.0
  12162. * @category Lang
  12163. * @param {*} value The value to check.
  12164. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12165. * @example
  12166. *
  12167. * _.isMap(new Map);
  12168. * // => true
  12169. *
  12170. * _.isMap(new WeakMap);
  12171. * // => false
  12172. */
  12173. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12174. /**
  12175. * Performs a partial deep comparison between `object` and `source` to
  12176. * determine if `object` contains equivalent property values.
  12177. *
  12178. * **Note:** This method is equivalent to `_.matches` when `source` is
  12179. * partially applied.
  12180. *
  12181. * Partial comparisons will match empty array and empty object `source`
  12182. * values against any array or object value, respectively. See `_.isEqual`
  12183. * for a list of supported value comparisons.
  12184. *
  12185. * @static
  12186. * @memberOf _
  12187. * @since 3.0.0
  12188. * @category Lang
  12189. * @param {Object} object The object to inspect.
  12190. * @param {Object} source The object of property values to match.
  12191. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12192. * @example
  12193. *
  12194. * var object = { 'a': 1, 'b': 2 };
  12195. *
  12196. * _.isMatch(object, { 'b': 2 });
  12197. * // => true
  12198. *
  12199. * _.isMatch(object, { 'b': 1 });
  12200. * // => false
  12201. */
  12202. function isMatch(object, source) {
  12203. return object === source || baseIsMatch(object, source, getMatchData(source));
  12204. }
  12205. /**
  12206. * This method is like `_.isMatch` except that it accepts `customizer` which
  12207. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12208. * are handled by the method instead. The `customizer` is invoked with five
  12209. * arguments: (objValue, srcValue, index|key, object, source).
  12210. *
  12211. * @static
  12212. * @memberOf _
  12213. * @since 4.0.0
  12214. * @category Lang
  12215. * @param {Object} object The object to inspect.
  12216. * @param {Object} source The object of property values to match.
  12217. * @param {Function} [customizer] The function to customize comparisons.
  12218. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12219. * @example
  12220. *
  12221. * function isGreeting(value) {
  12222. * return /^h(?:i|ello)$/.test(value);
  12223. * }
  12224. *
  12225. * function customizer(objValue, srcValue) {
  12226. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12227. * return true;
  12228. * }
  12229. * }
  12230. *
  12231. * var object = { 'greeting': 'hello' };
  12232. * var source = { 'greeting': 'hi' };
  12233. *
  12234. * _.isMatchWith(object, source, customizer);
  12235. * // => true
  12236. */
  12237. function isMatchWith(object, source, customizer) {
  12238. customizer = typeof customizer == 'function' ? customizer : undefined;
  12239. return baseIsMatch(object, source, getMatchData(source), customizer);
  12240. }
  12241. /**
  12242. * Checks if `value` is `NaN`.
  12243. *
  12244. * **Note:** This method is based on
  12245. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12246. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12247. * `undefined` and other non-number values.
  12248. *
  12249. * @static
  12250. * @memberOf _
  12251. * @since 0.1.0
  12252. * @category Lang
  12253. * @param {*} value The value to check.
  12254. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12255. * @example
  12256. *
  12257. * _.isNaN(NaN);
  12258. * // => true
  12259. *
  12260. * _.isNaN(new Number(NaN));
  12261. * // => true
  12262. *
  12263. * isNaN(undefined);
  12264. * // => true
  12265. *
  12266. * _.isNaN(undefined);
  12267. * // => false
  12268. */
  12269. function isNaN(value) {
  12270. // An `NaN` primitive is the only value that is not equal to itself.
  12271. // Perform the `toStringTag` check first to avoid errors with some
  12272. // ActiveX objects in IE.
  12273. return isNumber(value) && value != +value;
  12274. }
  12275. /**
  12276. * Checks if `value` is a pristine native function.
  12277. *
  12278. * **Note:** This method can't reliably detect native functions in the presence
  12279. * of the core-js package because core-js circumvents this kind of detection.
  12280. * Despite multiple requests, the core-js maintainer has made it clear: any
  12281. * attempt to fix the detection will be obstructed. As a result, we're left
  12282. * with little choice but to throw an error. Unfortunately, this also affects
  12283. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12284. * which rely on core-js.
  12285. *
  12286. * @static
  12287. * @memberOf _
  12288. * @since 3.0.0
  12289. * @category Lang
  12290. * @param {*} value The value to check.
  12291. * @returns {boolean} Returns `true` if `value` is a native function,
  12292. * else `false`.
  12293. * @example
  12294. *
  12295. * _.isNative(Array.prototype.push);
  12296. * // => true
  12297. *
  12298. * _.isNative(_);
  12299. * // => false
  12300. */
  12301. function isNative(value) {
  12302. if (isMaskable(value)) {
  12303. throw new Error(CORE_ERROR_TEXT);
  12304. }
  12305. return baseIsNative(value);
  12306. }
  12307. /**
  12308. * Checks if `value` is `null`.
  12309. *
  12310. * @static
  12311. * @memberOf _
  12312. * @since 0.1.0
  12313. * @category Lang
  12314. * @param {*} value The value to check.
  12315. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12316. * @example
  12317. *
  12318. * _.isNull(null);
  12319. * // => true
  12320. *
  12321. * _.isNull(void 0);
  12322. * // => false
  12323. */
  12324. function isNull(value) {
  12325. return value === null;
  12326. }
  12327. /**
  12328. * Checks if `value` is `null` or `undefined`.
  12329. *
  12330. * @static
  12331. * @memberOf _
  12332. * @since 4.0.0
  12333. * @category Lang
  12334. * @param {*} value The value to check.
  12335. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12336. * @example
  12337. *
  12338. * _.isNil(null);
  12339. * // => true
  12340. *
  12341. * _.isNil(void 0);
  12342. * // => true
  12343. *
  12344. * _.isNil(NaN);
  12345. * // => false
  12346. */
  12347. function isNil(value) {
  12348. return value == null;
  12349. }
  12350. /**
  12351. * Checks if `value` is classified as a `Number` primitive or object.
  12352. *
  12353. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12354. * classified as numbers, use the `_.isFinite` method.
  12355. *
  12356. * @static
  12357. * @memberOf _
  12358. * @since 0.1.0
  12359. * @category Lang
  12360. * @param {*} value The value to check.
  12361. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12362. * @example
  12363. *
  12364. * _.isNumber(3);
  12365. * // => true
  12366. *
  12367. * _.isNumber(Number.MIN_VALUE);
  12368. * // => true
  12369. *
  12370. * _.isNumber(Infinity);
  12371. * // => true
  12372. *
  12373. * _.isNumber('3');
  12374. * // => false
  12375. */
  12376. function isNumber(value) {
  12377. return typeof value == 'number' ||
  12378. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12379. }
  12380. /**
  12381. * Checks if `value` is a plain object, that is, an object created by the
  12382. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12383. *
  12384. * @static
  12385. * @memberOf _
  12386. * @since 0.8.0
  12387. * @category Lang
  12388. * @param {*} value The value to check.
  12389. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12390. * @example
  12391. *
  12392. * function Foo() {
  12393. * this.a = 1;
  12394. * }
  12395. *
  12396. * _.isPlainObject(new Foo);
  12397. * // => false
  12398. *
  12399. * _.isPlainObject([1, 2, 3]);
  12400. * // => false
  12401. *
  12402. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12403. * // => true
  12404. *
  12405. * _.isPlainObject(Object.create(null));
  12406. * // => true
  12407. */
  12408. function isPlainObject(value) {
  12409. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12410. return false;
  12411. }
  12412. var proto = getPrototype(value);
  12413. if (proto === null) {
  12414. return true;
  12415. }
  12416. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12417. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12418. funcToString.call(Ctor) == objectCtorString;
  12419. }
  12420. /**
  12421. * Checks if `value` is classified as a `RegExp` object.
  12422. *
  12423. * @static
  12424. * @memberOf _
  12425. * @since 0.1.0
  12426. * @category Lang
  12427. * @param {*} value The value to check.
  12428. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12429. * @example
  12430. *
  12431. * _.isRegExp(/abc/);
  12432. * // => true
  12433. *
  12434. * _.isRegExp('/abc/');
  12435. * // => false
  12436. */
  12437. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12438. /**
  12439. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12440. * double precision number which isn't the result of a rounded unsafe integer.
  12441. *
  12442. * **Note:** This method is based on
  12443. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12444. *
  12445. * @static
  12446. * @memberOf _
  12447. * @since 4.0.0
  12448. * @category Lang
  12449. * @param {*} value The value to check.
  12450. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12451. * @example
  12452. *
  12453. * _.isSafeInteger(3);
  12454. * // => true
  12455. *
  12456. * _.isSafeInteger(Number.MIN_VALUE);
  12457. * // => false
  12458. *
  12459. * _.isSafeInteger(Infinity);
  12460. * // => false
  12461. *
  12462. * _.isSafeInteger('3');
  12463. * // => false
  12464. */
  12465. function isSafeInteger(value) {
  12466. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12467. }
  12468. /**
  12469. * Checks if `value` is classified as a `Set` object.
  12470. *
  12471. * @static
  12472. * @memberOf _
  12473. * @since 4.3.0
  12474. * @category Lang
  12475. * @param {*} value The value to check.
  12476. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12477. * @example
  12478. *
  12479. * _.isSet(new Set);
  12480. * // => true
  12481. *
  12482. * _.isSet(new WeakSet);
  12483. * // => false
  12484. */
  12485. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12486. /**
  12487. * Checks if `value` is classified as a `String` primitive or object.
  12488. *
  12489. * @static
  12490. * @since 0.1.0
  12491. * @memberOf _
  12492. * @category Lang
  12493. * @param {*} value The value to check.
  12494. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12495. * @example
  12496. *
  12497. * _.isString('abc');
  12498. * // => true
  12499. *
  12500. * _.isString(1);
  12501. * // => false
  12502. */
  12503. function isString(value) {
  12504. return typeof value == 'string' ||
  12505. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12506. }
  12507. /**
  12508. * Checks if `value` is classified as a `Symbol` primitive or object.
  12509. *
  12510. * @static
  12511. * @memberOf _
  12512. * @since 4.0.0
  12513. * @category Lang
  12514. * @param {*} value The value to check.
  12515. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12516. * @example
  12517. *
  12518. * _.isSymbol(Symbol.iterator);
  12519. * // => true
  12520. *
  12521. * _.isSymbol('abc');
  12522. * // => false
  12523. */
  12524. function isSymbol(value) {
  12525. return typeof value == 'symbol' ||
  12526. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12527. }
  12528. /**
  12529. * Checks if `value` is classified as a typed array.
  12530. *
  12531. * @static
  12532. * @memberOf _
  12533. * @since 3.0.0
  12534. * @category Lang
  12535. * @param {*} value The value to check.
  12536. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12537. * @example
  12538. *
  12539. * _.isTypedArray(new Uint8Array);
  12540. * // => true
  12541. *
  12542. * _.isTypedArray([]);
  12543. * // => false
  12544. */
  12545. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12546. /**
  12547. * Checks if `value` is `undefined`.
  12548. *
  12549. * @static
  12550. * @since 0.1.0
  12551. * @memberOf _
  12552. * @category Lang
  12553. * @param {*} value The value to check.
  12554. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12555. * @example
  12556. *
  12557. * _.isUndefined(void 0);
  12558. * // => true
  12559. *
  12560. * _.isUndefined(null);
  12561. * // => false
  12562. */
  12563. function isUndefined(value) {
  12564. return value === undefined;
  12565. }
  12566. /**
  12567. * Checks if `value` is classified as a `WeakMap` object.
  12568. *
  12569. * @static
  12570. * @memberOf _
  12571. * @since 4.3.0
  12572. * @category Lang
  12573. * @param {*} value The value to check.
  12574. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12575. * @example
  12576. *
  12577. * _.isWeakMap(new WeakMap);
  12578. * // => true
  12579. *
  12580. * _.isWeakMap(new Map);
  12581. * // => false
  12582. */
  12583. function isWeakMap(value) {
  12584. return isObjectLike(value) && getTag(value) == weakMapTag;
  12585. }
  12586. /**
  12587. * Checks if `value` is classified as a `WeakSet` object.
  12588. *
  12589. * @static
  12590. * @memberOf _
  12591. * @since 4.3.0
  12592. * @category Lang
  12593. * @param {*} value The value to check.
  12594. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12595. * @example
  12596. *
  12597. * _.isWeakSet(new WeakSet);
  12598. * // => true
  12599. *
  12600. * _.isWeakSet(new Set);
  12601. * // => false
  12602. */
  12603. function isWeakSet(value) {
  12604. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12605. }
  12606. /**
  12607. * Checks if `value` is less than `other`.
  12608. *
  12609. * @static
  12610. * @memberOf _
  12611. * @since 3.9.0
  12612. * @category Lang
  12613. * @param {*} value The value to compare.
  12614. * @param {*} other The other value to compare.
  12615. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12616. * else `false`.
  12617. * @see _.gt
  12618. * @example
  12619. *
  12620. * _.lt(1, 3);
  12621. * // => true
  12622. *
  12623. * _.lt(3, 3);
  12624. * // => false
  12625. *
  12626. * _.lt(3, 1);
  12627. * // => false
  12628. */
  12629. var lt = createRelationalOperation(baseLt);
  12630. /**
  12631. * Checks if `value` is less than or equal to `other`.
  12632. *
  12633. * @static
  12634. * @memberOf _
  12635. * @since 3.9.0
  12636. * @category Lang
  12637. * @param {*} value The value to compare.
  12638. * @param {*} other The other value to compare.
  12639. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12640. * `other`, else `false`.
  12641. * @see _.gte
  12642. * @example
  12643. *
  12644. * _.lte(1, 3);
  12645. * // => true
  12646. *
  12647. * _.lte(3, 3);
  12648. * // => true
  12649. *
  12650. * _.lte(3, 1);
  12651. * // => false
  12652. */
  12653. var lte = createRelationalOperation(function(value, other) {
  12654. return value <= other;
  12655. });
  12656. /**
  12657. * Converts `value` to an array.
  12658. *
  12659. * @static
  12660. * @since 0.1.0
  12661. * @memberOf _
  12662. * @category Lang
  12663. * @param {*} value The value to convert.
  12664. * @returns {Array} Returns the converted array.
  12665. * @example
  12666. *
  12667. * _.toArray({ 'a': 1, 'b': 2 });
  12668. * // => [1, 2]
  12669. *
  12670. * _.toArray('abc');
  12671. * // => ['a', 'b', 'c']
  12672. *
  12673. * _.toArray(1);
  12674. * // => []
  12675. *
  12676. * _.toArray(null);
  12677. * // => []
  12678. */
  12679. function toArray(value) {
  12680. if (!value) {
  12681. return [];
  12682. }
  12683. if (isArrayLike(value)) {
  12684. return isString(value) ? stringToArray(value) : copyArray(value);
  12685. }
  12686. if (symIterator && value[symIterator]) {
  12687. return iteratorToArray(value[symIterator]());
  12688. }
  12689. var tag = getTag(value),
  12690. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12691. return func(value);
  12692. }
  12693. /**
  12694. * Converts `value` to a finite number.
  12695. *
  12696. * @static
  12697. * @memberOf _
  12698. * @since 4.12.0
  12699. * @category Lang
  12700. * @param {*} value The value to convert.
  12701. * @returns {number} Returns the converted number.
  12702. * @example
  12703. *
  12704. * _.toFinite(3.2);
  12705. * // => 3.2
  12706. *
  12707. * _.toFinite(Number.MIN_VALUE);
  12708. * // => 5e-324
  12709. *
  12710. * _.toFinite(Infinity);
  12711. * // => 1.7976931348623157e+308
  12712. *
  12713. * _.toFinite('3.2');
  12714. * // => 3.2
  12715. */
  12716. function toFinite(value) {
  12717. if (!value) {
  12718. return value === 0 ? value : 0;
  12719. }
  12720. value = toNumber(value);
  12721. if (value === INFINITY || value === -INFINITY) {
  12722. var sign = (value < 0 ? -1 : 1);
  12723. return sign * MAX_INTEGER;
  12724. }
  12725. return value === value ? value : 0;
  12726. }
  12727. /**
  12728. * Converts `value` to an integer.
  12729. *
  12730. * **Note:** This method is loosely based on
  12731. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12732. *
  12733. * @static
  12734. * @memberOf _
  12735. * @since 4.0.0
  12736. * @category Lang
  12737. * @param {*} value The value to convert.
  12738. * @returns {number} Returns the converted integer.
  12739. * @example
  12740. *
  12741. * _.toInteger(3.2);
  12742. * // => 3
  12743. *
  12744. * _.toInteger(Number.MIN_VALUE);
  12745. * // => 0
  12746. *
  12747. * _.toInteger(Infinity);
  12748. * // => 1.7976931348623157e+308
  12749. *
  12750. * _.toInteger('3.2');
  12751. * // => 3
  12752. */
  12753. function toInteger(value) {
  12754. var result = toFinite(value),
  12755. remainder = result % 1;
  12756. return result === result ? (remainder ? result - remainder : result) : 0;
  12757. }
  12758. /**
  12759. * Converts `value` to an integer suitable for use as the length of an
  12760. * array-like object.
  12761. *
  12762. * **Note:** This method is based on
  12763. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12764. *
  12765. * @static
  12766. * @memberOf _
  12767. * @since 4.0.0
  12768. * @category Lang
  12769. * @param {*} value The value to convert.
  12770. * @returns {number} Returns the converted integer.
  12771. * @example
  12772. *
  12773. * _.toLength(3.2);
  12774. * // => 3
  12775. *
  12776. * _.toLength(Number.MIN_VALUE);
  12777. * // => 0
  12778. *
  12779. * _.toLength(Infinity);
  12780. * // => 4294967295
  12781. *
  12782. * _.toLength('3.2');
  12783. * // => 3
  12784. */
  12785. function toLength(value) {
  12786. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12787. }
  12788. /**
  12789. * Converts `value` to a number.
  12790. *
  12791. * @static
  12792. * @memberOf _
  12793. * @since 4.0.0
  12794. * @category Lang
  12795. * @param {*} value The value to process.
  12796. * @returns {number} Returns the number.
  12797. * @example
  12798. *
  12799. * _.toNumber(3.2);
  12800. * // => 3.2
  12801. *
  12802. * _.toNumber(Number.MIN_VALUE);
  12803. * // => 5e-324
  12804. *
  12805. * _.toNumber(Infinity);
  12806. * // => Infinity
  12807. *
  12808. * _.toNumber('3.2');
  12809. * // => 3.2
  12810. */
  12811. function toNumber(value) {
  12812. if (typeof value == 'number') {
  12813. return value;
  12814. }
  12815. if (isSymbol(value)) {
  12816. return NAN;
  12817. }
  12818. if (isObject(value)) {
  12819. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12820. value = isObject(other) ? (other + '') : other;
  12821. }
  12822. if (typeof value != 'string') {
  12823. return value === 0 ? value : +value;
  12824. }
  12825. value = baseTrim(value);
  12826. var isBinary = reIsBinary.test(value);
  12827. return (isBinary || reIsOctal.test(value))
  12828. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12829. : (reIsBadHex.test(value) ? NAN : +value);
  12830. }
  12831. /**
  12832. * Converts `value` to a plain object flattening inherited enumerable string
  12833. * keyed properties of `value` to own properties of the plain object.
  12834. *
  12835. * @static
  12836. * @memberOf _
  12837. * @since 3.0.0
  12838. * @category Lang
  12839. * @param {*} value The value to convert.
  12840. * @returns {Object} Returns the converted plain object.
  12841. * @example
  12842. *
  12843. * function Foo() {
  12844. * this.b = 2;
  12845. * }
  12846. *
  12847. * Foo.prototype.c = 3;
  12848. *
  12849. * _.assign({ 'a': 1 }, new Foo);
  12850. * // => { 'a': 1, 'b': 2 }
  12851. *
  12852. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12853. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12854. */
  12855. function toPlainObject(value) {
  12856. return copyObject(value, keysIn(value));
  12857. }
  12858. /**
  12859. * Converts `value` to a safe integer. A safe integer can be compared and
  12860. * represented correctly.
  12861. *
  12862. * @static
  12863. * @memberOf _
  12864. * @since 4.0.0
  12865. * @category Lang
  12866. * @param {*} value The value to convert.
  12867. * @returns {number} Returns the converted integer.
  12868. * @example
  12869. *
  12870. * _.toSafeInteger(3.2);
  12871. * // => 3
  12872. *
  12873. * _.toSafeInteger(Number.MIN_VALUE);
  12874. * // => 0
  12875. *
  12876. * _.toSafeInteger(Infinity);
  12877. * // => 9007199254740991
  12878. *
  12879. * _.toSafeInteger('3.2');
  12880. * // => 3
  12881. */
  12882. function toSafeInteger(value) {
  12883. return value
  12884. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12885. : (value === 0 ? value : 0);
  12886. }
  12887. /**
  12888. * Converts `value` to a string. An empty string is returned for `null`
  12889. * and `undefined` values. The sign of `-0` is preserved.
  12890. *
  12891. * @static
  12892. * @memberOf _
  12893. * @since 4.0.0
  12894. * @category Lang
  12895. * @param {*} value The value to convert.
  12896. * @returns {string} Returns the converted string.
  12897. * @example
  12898. *
  12899. * _.toString(null);
  12900. * // => ''
  12901. *
  12902. * _.toString(-0);
  12903. * // => '-0'
  12904. *
  12905. * _.toString([1, 2, 3]);
  12906. * // => '1,2,3'
  12907. */
  12908. function toString(value) {
  12909. return value == null ? '' : baseToString(value);
  12910. }
  12911. /*------------------------------------------------------------------------*/
  12912. /**
  12913. * Assigns own enumerable string keyed properties of source objects to the
  12914. * destination object. Source objects are applied from left to right.
  12915. * Subsequent sources overwrite property assignments of previous sources.
  12916. *
  12917. * **Note:** This method mutates `object` and is loosely based on
  12918. * [`Object.assign`](https://mdn.io/Object/assign).
  12919. *
  12920. * @static
  12921. * @memberOf _
  12922. * @since 0.10.0
  12923. * @category Object
  12924. * @param {Object} object The destination object.
  12925. * @param {...Object} [sources] The source objects.
  12926. * @returns {Object} Returns `object`.
  12927. * @see _.assignIn
  12928. * @example
  12929. *
  12930. * function Foo() {
  12931. * this.a = 1;
  12932. * }
  12933. *
  12934. * function Bar() {
  12935. * this.c = 3;
  12936. * }
  12937. *
  12938. * Foo.prototype.b = 2;
  12939. * Bar.prototype.d = 4;
  12940. *
  12941. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12942. * // => { 'a': 1, 'c': 3 }
  12943. */
  12944. var assign = createAssigner(function(object, source) {
  12945. if (isPrototype(source) || isArrayLike(source)) {
  12946. copyObject(source, keys(source), object);
  12947. return;
  12948. }
  12949. for (var key in source) {
  12950. if (hasOwnProperty.call(source, key)) {
  12951. assignValue(object, key, source[key]);
  12952. }
  12953. }
  12954. });
  12955. /**
  12956. * This method is like `_.assign` except that it iterates over own and
  12957. * inherited source properties.
  12958. *
  12959. * **Note:** This method mutates `object`.
  12960. *
  12961. * @static
  12962. * @memberOf _
  12963. * @since 4.0.0
  12964. * @alias extend
  12965. * @category Object
  12966. * @param {Object} object The destination object.
  12967. * @param {...Object} [sources] The source objects.
  12968. * @returns {Object} Returns `object`.
  12969. * @see _.assign
  12970. * @example
  12971. *
  12972. * function Foo() {
  12973. * this.a = 1;
  12974. * }
  12975. *
  12976. * function Bar() {
  12977. * this.c = 3;
  12978. * }
  12979. *
  12980. * Foo.prototype.b = 2;
  12981. * Bar.prototype.d = 4;
  12982. *
  12983. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  12984. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  12985. */
  12986. var assignIn = createAssigner(function(object, source) {
  12987. copyObject(source, keysIn(source), object);
  12988. });
  12989. /**
  12990. * This method is like `_.assignIn` except that it accepts `customizer`
  12991. * which is invoked to produce the assigned values. If `customizer` returns
  12992. * `undefined`, assignment is handled by the method instead. The `customizer`
  12993. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12994. *
  12995. * **Note:** This method mutates `object`.
  12996. *
  12997. * @static
  12998. * @memberOf _
  12999. * @since 4.0.0
  13000. * @alias extendWith
  13001. * @category Object
  13002. * @param {Object} object The destination object.
  13003. * @param {...Object} sources The source objects.
  13004. * @param {Function} [customizer] The function to customize assigned values.
  13005. * @returns {Object} Returns `object`.
  13006. * @see _.assignWith
  13007. * @example
  13008. *
  13009. * function customizer(objValue, srcValue) {
  13010. * return _.isUndefined(objValue) ? srcValue : objValue;
  13011. * }
  13012. *
  13013. * var defaults = _.partialRight(_.assignInWith, customizer);
  13014. *
  13015. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13016. * // => { 'a': 1, 'b': 2 }
  13017. */
  13018. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13019. copyObject(source, keysIn(source), object, customizer);
  13020. });
  13021. /**
  13022. * This method is like `_.assign` except that it accepts `customizer`
  13023. * which is invoked to produce the assigned values. If `customizer` returns
  13024. * `undefined`, assignment is handled by the method instead. The `customizer`
  13025. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13026. *
  13027. * **Note:** This method mutates `object`.
  13028. *
  13029. * @static
  13030. * @memberOf _
  13031. * @since 4.0.0
  13032. * @category Object
  13033. * @param {Object} object The destination object.
  13034. * @param {...Object} sources The source objects.
  13035. * @param {Function} [customizer] The function to customize assigned values.
  13036. * @returns {Object} Returns `object`.
  13037. * @see _.assignInWith
  13038. * @example
  13039. *
  13040. * function customizer(objValue, srcValue) {
  13041. * return _.isUndefined(objValue) ? srcValue : objValue;
  13042. * }
  13043. *
  13044. * var defaults = _.partialRight(_.assignWith, customizer);
  13045. *
  13046. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13047. * // => { 'a': 1, 'b': 2 }
  13048. */
  13049. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13050. copyObject(source, keys(source), object, customizer);
  13051. });
  13052. /**
  13053. * Creates an array of values corresponding to `paths` of `object`.
  13054. *
  13055. * @static
  13056. * @memberOf _
  13057. * @since 1.0.0
  13058. * @category Object
  13059. * @param {Object} object The object to iterate over.
  13060. * @param {...(string|string[])} [paths] The property paths to pick.
  13061. * @returns {Array} Returns the picked values.
  13062. * @example
  13063. *
  13064. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13065. *
  13066. * _.at(object, ['a[0].b.c', 'a[1]']);
  13067. * // => [3, 4]
  13068. */
  13069. var at = flatRest(baseAt);
  13070. /**
  13071. * Creates an object that inherits from the `prototype` object. If a
  13072. * `properties` object is given, its own enumerable string keyed properties
  13073. * are assigned to the created object.
  13074. *
  13075. * @static
  13076. * @memberOf _
  13077. * @since 2.3.0
  13078. * @category Object
  13079. * @param {Object} prototype The object to inherit from.
  13080. * @param {Object} [properties] The properties to assign to the object.
  13081. * @returns {Object} Returns the new object.
  13082. * @example
  13083. *
  13084. * function Shape() {
  13085. * this.x = 0;
  13086. * this.y = 0;
  13087. * }
  13088. *
  13089. * function Circle() {
  13090. * Shape.call(this);
  13091. * }
  13092. *
  13093. * Circle.prototype = _.create(Shape.prototype, {
  13094. * 'constructor': Circle
  13095. * });
  13096. *
  13097. * var circle = new Circle;
  13098. * circle instanceof Circle;
  13099. * // => true
  13100. *
  13101. * circle instanceof Shape;
  13102. * // => true
  13103. */
  13104. function create(prototype, properties) {
  13105. var result = baseCreate(prototype);
  13106. return properties == null ? result : baseAssign(result, properties);
  13107. }
  13108. /**
  13109. * Assigns own and inherited enumerable string keyed properties of source
  13110. * objects to the destination object for all destination properties that
  13111. * resolve to `undefined`. Source objects are applied from left to right.
  13112. * Once a property is set, additional values of the same property are ignored.
  13113. *
  13114. * **Note:** This method mutates `object`.
  13115. *
  13116. * @static
  13117. * @since 0.1.0
  13118. * @memberOf _
  13119. * @category Object
  13120. * @param {Object} object The destination object.
  13121. * @param {...Object} [sources] The source objects.
  13122. * @returns {Object} Returns `object`.
  13123. * @see _.defaultsDeep
  13124. * @example
  13125. *
  13126. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13127. * // => { 'a': 1, 'b': 2 }
  13128. */
  13129. var defaults = baseRest(function(object, sources) {
  13130. object = Object(object);
  13131. var index = -1;
  13132. var length = sources.length;
  13133. var guard = length > 2 ? sources[2] : undefined;
  13134. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13135. length = 1;
  13136. }
  13137. while (++index < length) {
  13138. var source = sources[index];
  13139. var props = keysIn(source);
  13140. var propsIndex = -1;
  13141. var propsLength = props.length;
  13142. while (++propsIndex < propsLength) {
  13143. var key = props[propsIndex];
  13144. var value = object[key];
  13145. if (value === undefined ||
  13146. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13147. object[key] = source[key];
  13148. }
  13149. }
  13150. }
  13151. return object;
  13152. });
  13153. /**
  13154. * This method is like `_.defaults` except that it recursively assigns
  13155. * default properties.
  13156. *
  13157. * **Note:** This method mutates `object`.
  13158. *
  13159. * @static
  13160. * @memberOf _
  13161. * @since 3.10.0
  13162. * @category Object
  13163. * @param {Object} object The destination object.
  13164. * @param {...Object} [sources] The source objects.
  13165. * @returns {Object} Returns `object`.
  13166. * @see _.defaults
  13167. * @example
  13168. *
  13169. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13170. * // => { 'a': { 'b': 2, 'c': 3 } }
  13171. */
  13172. var defaultsDeep = baseRest(function(args) {
  13173. args.push(undefined, customDefaultsMerge);
  13174. return apply(mergeWith, undefined, args);
  13175. });
  13176. /**
  13177. * This method is like `_.find` except that it returns the key of the first
  13178. * element `predicate` returns truthy for instead of the element itself.
  13179. *
  13180. * @static
  13181. * @memberOf _
  13182. * @since 1.1.0
  13183. * @category Object
  13184. * @param {Object} object The object to inspect.
  13185. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13186. * @returns {string|undefined} Returns the key of the matched element,
  13187. * else `undefined`.
  13188. * @example
  13189. *
  13190. * var users = {
  13191. * 'barney': { 'age': 36, 'active': true },
  13192. * 'fred': { 'age': 40, 'active': false },
  13193. * 'pebbles': { 'age': 1, 'active': true }
  13194. * };
  13195. *
  13196. * _.findKey(users, function(o) { return o.age < 40; });
  13197. * // => 'barney' (iteration order is not guaranteed)
  13198. *
  13199. * // The `_.matches` iteratee shorthand.
  13200. * _.findKey(users, { 'age': 1, 'active': true });
  13201. * // => 'pebbles'
  13202. *
  13203. * // The `_.matchesProperty` iteratee shorthand.
  13204. * _.findKey(users, ['active', false]);
  13205. * // => 'fred'
  13206. *
  13207. * // The `_.property` iteratee shorthand.
  13208. * _.findKey(users, 'active');
  13209. * // => 'barney'
  13210. */
  13211. function findKey(object, predicate) {
  13212. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13213. }
  13214. /**
  13215. * This method is like `_.findKey` except that it iterates over elements of
  13216. * a collection in the opposite order.
  13217. *
  13218. * @static
  13219. * @memberOf _
  13220. * @since 2.0.0
  13221. * @category Object
  13222. * @param {Object} object The object to inspect.
  13223. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13224. * @returns {string|undefined} Returns the key of the matched element,
  13225. * else `undefined`.
  13226. * @example
  13227. *
  13228. * var users = {
  13229. * 'barney': { 'age': 36, 'active': true },
  13230. * 'fred': { 'age': 40, 'active': false },
  13231. * 'pebbles': { 'age': 1, 'active': true }
  13232. * };
  13233. *
  13234. * _.findLastKey(users, function(o) { return o.age < 40; });
  13235. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13236. *
  13237. * // The `_.matches` iteratee shorthand.
  13238. * _.findLastKey(users, { 'age': 36, 'active': true });
  13239. * // => 'barney'
  13240. *
  13241. * // The `_.matchesProperty` iteratee shorthand.
  13242. * _.findLastKey(users, ['active', false]);
  13243. * // => 'fred'
  13244. *
  13245. * // The `_.property` iteratee shorthand.
  13246. * _.findLastKey(users, 'active');
  13247. * // => 'pebbles'
  13248. */
  13249. function findLastKey(object, predicate) {
  13250. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13251. }
  13252. /**
  13253. * Iterates over own and inherited enumerable string keyed properties of an
  13254. * object and invokes `iteratee` for each property. The iteratee is invoked
  13255. * with three arguments: (value, key, object). Iteratee functions may exit
  13256. * iteration early by explicitly returning `false`.
  13257. *
  13258. * @static
  13259. * @memberOf _
  13260. * @since 0.3.0
  13261. * @category Object
  13262. * @param {Object} object The object to iterate over.
  13263. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13264. * @returns {Object} Returns `object`.
  13265. * @see _.forInRight
  13266. * @example
  13267. *
  13268. * function Foo() {
  13269. * this.a = 1;
  13270. * this.b = 2;
  13271. * }
  13272. *
  13273. * Foo.prototype.c = 3;
  13274. *
  13275. * _.forIn(new Foo, function(value, key) {
  13276. * console.log(key);
  13277. * });
  13278. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13279. */
  13280. function forIn(object, iteratee) {
  13281. return object == null
  13282. ? object
  13283. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13284. }
  13285. /**
  13286. * This method is like `_.forIn` except that it iterates over properties of
  13287. * `object` in the opposite order.
  13288. *
  13289. * @static
  13290. * @memberOf _
  13291. * @since 2.0.0
  13292. * @category Object
  13293. * @param {Object} object The object to iterate over.
  13294. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13295. * @returns {Object} Returns `object`.
  13296. * @see _.forIn
  13297. * @example
  13298. *
  13299. * function Foo() {
  13300. * this.a = 1;
  13301. * this.b = 2;
  13302. * }
  13303. *
  13304. * Foo.prototype.c = 3;
  13305. *
  13306. * _.forInRight(new Foo, function(value, key) {
  13307. * console.log(key);
  13308. * });
  13309. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13310. */
  13311. function forInRight(object, iteratee) {
  13312. return object == null
  13313. ? object
  13314. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13315. }
  13316. /**
  13317. * Iterates over own enumerable string keyed properties of an object and
  13318. * invokes `iteratee` for each property. The iteratee is invoked with three
  13319. * arguments: (value, key, object). Iteratee functions may exit iteration
  13320. * early by explicitly returning `false`.
  13321. *
  13322. * @static
  13323. * @memberOf _
  13324. * @since 0.3.0
  13325. * @category Object
  13326. * @param {Object} object The object to iterate over.
  13327. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13328. * @returns {Object} Returns `object`.
  13329. * @see _.forOwnRight
  13330. * @example
  13331. *
  13332. * function Foo() {
  13333. * this.a = 1;
  13334. * this.b = 2;
  13335. * }
  13336. *
  13337. * Foo.prototype.c = 3;
  13338. *
  13339. * _.forOwn(new Foo, function(value, key) {
  13340. * console.log(key);
  13341. * });
  13342. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13343. */
  13344. function forOwn(object, iteratee) {
  13345. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13346. }
  13347. /**
  13348. * This method is like `_.forOwn` except that it iterates over properties of
  13349. * `object` in the opposite order.
  13350. *
  13351. * @static
  13352. * @memberOf _
  13353. * @since 2.0.0
  13354. * @category Object
  13355. * @param {Object} object The object to iterate over.
  13356. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13357. * @returns {Object} Returns `object`.
  13358. * @see _.forOwn
  13359. * @example
  13360. *
  13361. * function Foo() {
  13362. * this.a = 1;
  13363. * this.b = 2;
  13364. * }
  13365. *
  13366. * Foo.prototype.c = 3;
  13367. *
  13368. * _.forOwnRight(new Foo, function(value, key) {
  13369. * console.log(key);
  13370. * });
  13371. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13372. */
  13373. function forOwnRight(object, iteratee) {
  13374. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13375. }
  13376. /**
  13377. * Creates an array of function property names from own enumerable properties
  13378. * of `object`.
  13379. *
  13380. * @static
  13381. * @since 0.1.0
  13382. * @memberOf _
  13383. * @category Object
  13384. * @param {Object} object The object to inspect.
  13385. * @returns {Array} Returns the function names.
  13386. * @see _.functionsIn
  13387. * @example
  13388. *
  13389. * function Foo() {
  13390. * this.a = _.constant('a');
  13391. * this.b = _.constant('b');
  13392. * }
  13393. *
  13394. * Foo.prototype.c = _.constant('c');
  13395. *
  13396. * _.functions(new Foo);
  13397. * // => ['a', 'b']
  13398. */
  13399. function functions(object) {
  13400. return object == null ? [] : baseFunctions(object, keys(object));
  13401. }
  13402. /**
  13403. * Creates an array of function property names from own and inherited
  13404. * enumerable properties of `object`.
  13405. *
  13406. * @static
  13407. * @memberOf _
  13408. * @since 4.0.0
  13409. * @category Object
  13410. * @param {Object} object The object to inspect.
  13411. * @returns {Array} Returns the function names.
  13412. * @see _.functions
  13413. * @example
  13414. *
  13415. * function Foo() {
  13416. * this.a = _.constant('a');
  13417. * this.b = _.constant('b');
  13418. * }
  13419. *
  13420. * Foo.prototype.c = _.constant('c');
  13421. *
  13422. * _.functionsIn(new Foo);
  13423. * // => ['a', 'b', 'c']
  13424. */
  13425. function functionsIn(object) {
  13426. return object == null ? [] : baseFunctions(object, keysIn(object));
  13427. }
  13428. /**
  13429. * Gets the value at `path` of `object`. If the resolved value is
  13430. * `undefined`, the `defaultValue` is returned in its place.
  13431. *
  13432. * @static
  13433. * @memberOf _
  13434. * @since 3.7.0
  13435. * @category Object
  13436. * @param {Object} object The object to query.
  13437. * @param {Array|string} path The path of the property to get.
  13438. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13439. * @returns {*} Returns the resolved value.
  13440. * @example
  13441. *
  13442. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13443. *
  13444. * _.get(object, 'a[0].b.c');
  13445. * // => 3
  13446. *
  13447. * _.get(object, ['a', '0', 'b', 'c']);
  13448. * // => 3
  13449. *
  13450. * _.get(object, 'a.b.c', 'default');
  13451. * // => 'default'
  13452. */
  13453. function get(object, path, defaultValue) {
  13454. var result = object == null ? undefined : baseGet(object, path);
  13455. return result === undefined ? defaultValue : result;
  13456. }
  13457. /**
  13458. * Checks if `path` is a direct property of `object`.
  13459. *
  13460. * @static
  13461. * @since 0.1.0
  13462. * @memberOf _
  13463. * @category Object
  13464. * @param {Object} object The object to query.
  13465. * @param {Array|string} path The path to check.
  13466. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13467. * @example
  13468. *
  13469. * var object = { 'a': { 'b': 2 } };
  13470. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13471. *
  13472. * _.has(object, 'a');
  13473. * // => true
  13474. *
  13475. * _.has(object, 'a.b');
  13476. * // => true
  13477. *
  13478. * _.has(object, ['a', 'b']);
  13479. * // => true
  13480. *
  13481. * _.has(other, 'a');
  13482. * // => false
  13483. */
  13484. function has(object, path) {
  13485. return object != null && hasPath(object, path, baseHas);
  13486. }
  13487. /**
  13488. * Checks if `path` is a direct or inherited property of `object`.
  13489. *
  13490. * @static
  13491. * @memberOf _
  13492. * @since 4.0.0
  13493. * @category Object
  13494. * @param {Object} object The object to query.
  13495. * @param {Array|string} path The path to check.
  13496. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13497. * @example
  13498. *
  13499. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13500. *
  13501. * _.hasIn(object, 'a');
  13502. * // => true
  13503. *
  13504. * _.hasIn(object, 'a.b');
  13505. * // => true
  13506. *
  13507. * _.hasIn(object, ['a', 'b']);
  13508. * // => true
  13509. *
  13510. * _.hasIn(object, 'b');
  13511. * // => false
  13512. */
  13513. function hasIn(object, path) {
  13514. return object != null && hasPath(object, path, baseHasIn);
  13515. }
  13516. /**
  13517. * Creates an object composed of the inverted keys and values of `object`.
  13518. * If `object` contains duplicate values, subsequent values overwrite
  13519. * property assignments of previous values.
  13520. *
  13521. * @static
  13522. * @memberOf _
  13523. * @since 0.7.0
  13524. * @category Object
  13525. * @param {Object} object The object to invert.
  13526. * @returns {Object} Returns the new inverted object.
  13527. * @example
  13528. *
  13529. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13530. *
  13531. * _.invert(object);
  13532. * // => { '1': 'c', '2': 'b' }
  13533. */
  13534. var invert = createInverter(function(result, value, key) {
  13535. if (value != null &&
  13536. typeof value.toString != 'function') {
  13537. value = nativeObjectToString.call(value);
  13538. }
  13539. result[value] = key;
  13540. }, constant(identity));
  13541. /**
  13542. * This method is like `_.invert` except that the inverted object is generated
  13543. * from the results of running each element of `object` thru `iteratee`. The
  13544. * corresponding inverted value of each inverted key is an array of keys
  13545. * responsible for generating the inverted value. The iteratee is invoked
  13546. * with one argument: (value).
  13547. *
  13548. * @static
  13549. * @memberOf _
  13550. * @since 4.1.0
  13551. * @category Object
  13552. * @param {Object} object The object to invert.
  13553. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13554. * @returns {Object} Returns the new inverted object.
  13555. * @example
  13556. *
  13557. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13558. *
  13559. * _.invertBy(object);
  13560. * // => { '1': ['a', 'c'], '2': ['b'] }
  13561. *
  13562. * _.invertBy(object, function(value) {
  13563. * return 'group' + value;
  13564. * });
  13565. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13566. */
  13567. var invertBy = createInverter(function(result, value, key) {
  13568. if (value != null &&
  13569. typeof value.toString != 'function') {
  13570. value = nativeObjectToString.call(value);
  13571. }
  13572. if (hasOwnProperty.call(result, value)) {
  13573. result[value].push(key);
  13574. } else {
  13575. result[value] = [key];
  13576. }
  13577. }, getIteratee);
  13578. /**
  13579. * Invokes the method at `path` of `object`.
  13580. *
  13581. * @static
  13582. * @memberOf _
  13583. * @since 4.0.0
  13584. * @category Object
  13585. * @param {Object} object The object to query.
  13586. * @param {Array|string} path The path of the method to invoke.
  13587. * @param {...*} [args] The arguments to invoke the method with.
  13588. * @returns {*} Returns the result of the invoked method.
  13589. * @example
  13590. *
  13591. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13592. *
  13593. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13594. * // => [2, 3]
  13595. */
  13596. var invoke = baseRest(baseInvoke);
  13597. /**
  13598. * Creates an array of the own enumerable property names of `object`.
  13599. *
  13600. * **Note:** Non-object values are coerced to objects. See the
  13601. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13602. * for more details.
  13603. *
  13604. * @static
  13605. * @since 0.1.0
  13606. * @memberOf _
  13607. * @category Object
  13608. * @param {Object} object The object to query.
  13609. * @returns {Array} Returns the array of property names.
  13610. * @example
  13611. *
  13612. * function Foo() {
  13613. * this.a = 1;
  13614. * this.b = 2;
  13615. * }
  13616. *
  13617. * Foo.prototype.c = 3;
  13618. *
  13619. * _.keys(new Foo);
  13620. * // => ['a', 'b'] (iteration order is not guaranteed)
  13621. *
  13622. * _.keys('hi');
  13623. * // => ['0', '1']
  13624. */
  13625. function keys(object) {
  13626. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13627. }
  13628. /**
  13629. * Creates an array of the own and inherited enumerable property names of `object`.
  13630. *
  13631. * **Note:** Non-object values are coerced to objects.
  13632. *
  13633. * @static
  13634. * @memberOf _
  13635. * @since 3.0.0
  13636. * @category Object
  13637. * @param {Object} object The object to query.
  13638. * @returns {Array} Returns the array of property names.
  13639. * @example
  13640. *
  13641. * function Foo() {
  13642. * this.a = 1;
  13643. * this.b = 2;
  13644. * }
  13645. *
  13646. * Foo.prototype.c = 3;
  13647. *
  13648. * _.keysIn(new Foo);
  13649. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13650. */
  13651. function keysIn(object) {
  13652. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13653. }
  13654. /**
  13655. * The opposite of `_.mapValues`; this method creates an object with the
  13656. * same values as `object` and keys generated by running each own enumerable
  13657. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13658. * with three arguments: (value, key, object).
  13659. *
  13660. * @static
  13661. * @memberOf _
  13662. * @since 3.8.0
  13663. * @category Object
  13664. * @param {Object} object The object to iterate over.
  13665. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13666. * @returns {Object} Returns the new mapped object.
  13667. * @see _.mapValues
  13668. * @example
  13669. *
  13670. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13671. * return key + value;
  13672. * });
  13673. * // => { 'a1': 1, 'b2': 2 }
  13674. */
  13675. function mapKeys(object, iteratee) {
  13676. var result = {};
  13677. iteratee = getIteratee(iteratee, 3);
  13678. baseForOwn(object, function(value, key, object) {
  13679. baseAssignValue(result, iteratee(value, key, object), value);
  13680. });
  13681. return result;
  13682. }
  13683. /**
  13684. * Creates an object with the same keys as `object` and values generated
  13685. * by running each own enumerable string keyed property of `object` thru
  13686. * `iteratee`. The iteratee is invoked with three arguments:
  13687. * (value, key, object).
  13688. *
  13689. * @static
  13690. * @memberOf _
  13691. * @since 2.4.0
  13692. * @category Object
  13693. * @param {Object} object The object to iterate over.
  13694. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13695. * @returns {Object} Returns the new mapped object.
  13696. * @see _.mapKeys
  13697. * @example
  13698. *
  13699. * var users = {
  13700. * 'fred': { 'user': 'fred', 'age': 40 },
  13701. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13702. * };
  13703. *
  13704. * _.mapValues(users, function(o) { return o.age; });
  13705. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13706. *
  13707. * // The `_.property` iteratee shorthand.
  13708. * _.mapValues(users, 'age');
  13709. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13710. */
  13711. function mapValues(object, iteratee) {
  13712. var result = {};
  13713. iteratee = getIteratee(iteratee, 3);
  13714. baseForOwn(object, function(value, key, object) {
  13715. baseAssignValue(result, key, iteratee(value, key, object));
  13716. });
  13717. return result;
  13718. }
  13719. /**
  13720. * This method is like `_.assign` except that it recursively merges own and
  13721. * inherited enumerable string keyed properties of source objects into the
  13722. * destination object. Source properties that resolve to `undefined` are
  13723. * skipped if a destination value exists. Array and plain object properties
  13724. * are merged recursively. Other objects and value types are overridden by
  13725. * assignment. Source objects are applied from left to right. Subsequent
  13726. * sources overwrite property assignments of previous sources.
  13727. *
  13728. * **Note:** This method mutates `object`.
  13729. *
  13730. * @static
  13731. * @memberOf _
  13732. * @since 0.5.0
  13733. * @category Object
  13734. * @param {Object} object The destination object.
  13735. * @param {...Object} [sources] The source objects.
  13736. * @returns {Object} Returns `object`.
  13737. * @example
  13738. *
  13739. * var object = {
  13740. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13741. * };
  13742. *
  13743. * var other = {
  13744. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13745. * };
  13746. *
  13747. * _.merge(object, other);
  13748. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13749. */
  13750. var merge = createAssigner(function(object, source, srcIndex) {
  13751. baseMerge(object, source, srcIndex);
  13752. });
  13753. /**
  13754. * This method is like `_.merge` except that it accepts `customizer` which
  13755. * is invoked to produce the merged values of the destination and source
  13756. * properties. If `customizer` returns `undefined`, merging is handled by the
  13757. * method instead. The `customizer` is invoked with six arguments:
  13758. * (objValue, srcValue, key, object, source, stack).
  13759. *
  13760. * **Note:** This method mutates `object`.
  13761. *
  13762. * @static
  13763. * @memberOf _
  13764. * @since 4.0.0
  13765. * @category Object
  13766. * @param {Object} object The destination object.
  13767. * @param {...Object} sources The source objects.
  13768. * @param {Function} customizer The function to customize assigned values.
  13769. * @returns {Object} Returns `object`.
  13770. * @example
  13771. *
  13772. * function customizer(objValue, srcValue) {
  13773. * if (_.isArray(objValue)) {
  13774. * return objValue.concat(srcValue);
  13775. * }
  13776. * }
  13777. *
  13778. * var object = { 'a': [1], 'b': [2] };
  13779. * var other = { 'a': [3], 'b': [4] };
  13780. *
  13781. * _.mergeWith(object, other, customizer);
  13782. * // => { 'a': [1, 3], 'b': [2, 4] }
  13783. */
  13784. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13785. baseMerge(object, source, srcIndex, customizer);
  13786. });
  13787. /**
  13788. * The opposite of `_.pick`; this method creates an object composed of the
  13789. * own and inherited enumerable property paths of `object` that are not omitted.
  13790. *
  13791. * **Note:** This method is considerably slower than `_.pick`.
  13792. *
  13793. * @static
  13794. * @since 0.1.0
  13795. * @memberOf _
  13796. * @category Object
  13797. * @param {Object} object The source object.
  13798. * @param {...(string|string[])} [paths] The property paths to omit.
  13799. * @returns {Object} Returns the new object.
  13800. * @example
  13801. *
  13802. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13803. *
  13804. * _.omit(object, ['a', 'c']);
  13805. * // => { 'b': '2' }
  13806. */
  13807. var omit = flatRest(function(object, paths) {
  13808. var result = {};
  13809. if (object == null) {
  13810. return result;
  13811. }
  13812. var isDeep = false;
  13813. paths = arrayMap(paths, function(path) {
  13814. path = castPath(path, object);
  13815. isDeep || (isDeep = path.length > 1);
  13816. return path;
  13817. });
  13818. copyObject(object, getAllKeysIn(object), result);
  13819. if (isDeep) {
  13820. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13821. }
  13822. var length = paths.length;
  13823. while (length--) {
  13824. baseUnset(result, paths[length]);
  13825. }
  13826. return result;
  13827. });
  13828. /**
  13829. * The opposite of `_.pickBy`; this method creates an object composed of
  13830. * the own and inherited enumerable string keyed properties of `object` that
  13831. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13832. * arguments: (value, key).
  13833. *
  13834. * @static
  13835. * @memberOf _
  13836. * @since 4.0.0
  13837. * @category Object
  13838. * @param {Object} object The source object.
  13839. * @param {Function} [predicate=_.identity] The function invoked per property.
  13840. * @returns {Object} Returns the new object.
  13841. * @example
  13842. *
  13843. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13844. *
  13845. * _.omitBy(object, _.isNumber);
  13846. * // => { 'b': '2' }
  13847. */
  13848. function omitBy(object, predicate) {
  13849. return pickBy(object, negate(getIteratee(predicate)));
  13850. }
  13851. /**
  13852. * Creates an object composed of the picked `object` properties.
  13853. *
  13854. * @static
  13855. * @since 0.1.0
  13856. * @memberOf _
  13857. * @category Object
  13858. * @param {Object} object The source object.
  13859. * @param {...(string|string[])} [paths] The property paths to pick.
  13860. * @returns {Object} Returns the new object.
  13861. * @example
  13862. *
  13863. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13864. *
  13865. * _.pick(object, ['a', 'c']);
  13866. * // => { 'a': 1, 'c': 3 }
  13867. */
  13868. var pick = flatRest(function(object, paths) {
  13869. return object == null ? {} : basePick(object, paths);
  13870. });
  13871. /**
  13872. * Creates an object composed of the `object` properties `predicate` returns
  13873. * truthy for. The predicate is invoked with two arguments: (value, key).
  13874. *
  13875. * @static
  13876. * @memberOf _
  13877. * @since 4.0.0
  13878. * @category Object
  13879. * @param {Object} object The source object.
  13880. * @param {Function} [predicate=_.identity] The function invoked per property.
  13881. * @returns {Object} Returns the new object.
  13882. * @example
  13883. *
  13884. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13885. *
  13886. * _.pickBy(object, _.isNumber);
  13887. * // => { 'a': 1, 'c': 3 }
  13888. */
  13889. function pickBy(object, predicate) {
  13890. if (object == null) {
  13891. return {};
  13892. }
  13893. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13894. return [prop];
  13895. });
  13896. predicate = getIteratee(predicate);
  13897. return basePickBy(object, props, function(value, path) {
  13898. return predicate(value, path[0]);
  13899. });
  13900. }
  13901. /**
  13902. * This method is like `_.get` except that if the resolved value is a
  13903. * function it's invoked with the `this` binding of its parent object and
  13904. * its result is returned.
  13905. *
  13906. * @static
  13907. * @since 0.1.0
  13908. * @memberOf _
  13909. * @category Object
  13910. * @param {Object} object The object to query.
  13911. * @param {Array|string} path The path of the property to resolve.
  13912. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13913. * @returns {*} Returns the resolved value.
  13914. * @example
  13915. *
  13916. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13917. *
  13918. * _.result(object, 'a[0].b.c1');
  13919. * // => 3
  13920. *
  13921. * _.result(object, 'a[0].b.c2');
  13922. * // => 4
  13923. *
  13924. * _.result(object, 'a[0].b.c3', 'default');
  13925. * // => 'default'
  13926. *
  13927. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13928. * // => 'default'
  13929. */
  13930. function result(object, path, defaultValue) {
  13931. path = castPath(path, object);
  13932. var index = -1,
  13933. length = path.length;
  13934. // Ensure the loop is entered when path is empty.
  13935. if (!length) {
  13936. length = 1;
  13937. object = undefined;
  13938. }
  13939. while (++index < length) {
  13940. var value = object == null ? undefined : object[toKey(path[index])];
  13941. if (value === undefined) {
  13942. index = length;
  13943. value = defaultValue;
  13944. }
  13945. object = isFunction(value) ? value.call(object) : value;
  13946. }
  13947. return object;
  13948. }
  13949. /**
  13950. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13951. * it's created. Arrays are created for missing index properties while objects
  13952. * are created for all other missing properties. Use `_.setWith` to customize
  13953. * `path` creation.
  13954. *
  13955. * **Note:** This method mutates `object`.
  13956. *
  13957. * @static
  13958. * @memberOf _
  13959. * @since 3.7.0
  13960. * @category Object
  13961. * @param {Object} object The object to modify.
  13962. * @param {Array|string} path The path of the property to set.
  13963. * @param {*} value The value to set.
  13964. * @returns {Object} Returns `object`.
  13965. * @example
  13966. *
  13967. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13968. *
  13969. * _.set(object, 'a[0].b.c', 4);
  13970. * console.log(object.a[0].b.c);
  13971. * // => 4
  13972. *
  13973. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13974. * console.log(object.x[0].y.z);
  13975. * // => 5
  13976. */
  13977. function set(object, path, value) {
  13978. return object == null ? object : baseSet(object, path, value);
  13979. }
  13980. /**
  13981. * This method is like `_.set` except that it accepts `customizer` which is
  13982. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  13983. * path creation is handled by the method instead. The `customizer` is invoked
  13984. * with three arguments: (nsValue, key, nsObject).
  13985. *
  13986. * **Note:** This method mutates `object`.
  13987. *
  13988. * @static
  13989. * @memberOf _
  13990. * @since 4.0.0
  13991. * @category Object
  13992. * @param {Object} object The object to modify.
  13993. * @param {Array|string} path The path of the property to set.
  13994. * @param {*} value The value to set.
  13995. * @param {Function} [customizer] The function to customize assigned values.
  13996. * @returns {Object} Returns `object`.
  13997. * @example
  13998. *
  13999. * var object = {};
  14000. *
  14001. * _.setWith(object, '[0][1]', 'a', Object);
  14002. * // => { '0': { '1': 'a' } }
  14003. */
  14004. function setWith(object, path, value, customizer) {
  14005. customizer = typeof customizer == 'function' ? customizer : undefined;
  14006. return object == null ? object : baseSet(object, path, value, customizer);
  14007. }
  14008. /**
  14009. * Creates an array of own enumerable string keyed-value pairs for `object`
  14010. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14011. * entries are returned.
  14012. *
  14013. * @static
  14014. * @memberOf _
  14015. * @since 4.0.0
  14016. * @alias entries
  14017. * @category Object
  14018. * @param {Object} object The object to query.
  14019. * @returns {Array} Returns the key-value pairs.
  14020. * @example
  14021. *
  14022. * function Foo() {
  14023. * this.a = 1;
  14024. * this.b = 2;
  14025. * }
  14026. *
  14027. * Foo.prototype.c = 3;
  14028. *
  14029. * _.toPairs(new Foo);
  14030. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14031. */
  14032. var toPairs = createToPairs(keys);
  14033. /**
  14034. * Creates an array of own and inherited enumerable string keyed-value pairs
  14035. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14036. * or set, its entries are returned.
  14037. *
  14038. * @static
  14039. * @memberOf _
  14040. * @since 4.0.0
  14041. * @alias entriesIn
  14042. * @category Object
  14043. * @param {Object} object The object to query.
  14044. * @returns {Array} Returns the key-value pairs.
  14045. * @example
  14046. *
  14047. * function Foo() {
  14048. * this.a = 1;
  14049. * this.b = 2;
  14050. * }
  14051. *
  14052. * Foo.prototype.c = 3;
  14053. *
  14054. * _.toPairsIn(new Foo);
  14055. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14056. */
  14057. var toPairsIn = createToPairs(keysIn);
  14058. /**
  14059. * An alternative to `_.reduce`; this method transforms `object` to a new
  14060. * `accumulator` object which is the result of running each of its own
  14061. * enumerable string keyed properties thru `iteratee`, with each invocation
  14062. * potentially mutating the `accumulator` object. If `accumulator` is not
  14063. * provided, a new object with the same `[[Prototype]]` will be used. The
  14064. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14065. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14066. *
  14067. * @static
  14068. * @memberOf _
  14069. * @since 1.3.0
  14070. * @category Object
  14071. * @param {Object} object The object to iterate over.
  14072. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14073. * @param {*} [accumulator] The custom accumulator value.
  14074. * @returns {*} Returns the accumulated value.
  14075. * @example
  14076. *
  14077. * _.transform([2, 3, 4], function(result, n) {
  14078. * result.push(n *= n);
  14079. * return n % 2 == 0;
  14080. * }, []);
  14081. * // => [4, 9]
  14082. *
  14083. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14084. * (result[value] || (result[value] = [])).push(key);
  14085. * }, {});
  14086. * // => { '1': ['a', 'c'], '2': ['b'] }
  14087. */
  14088. function transform(object, iteratee, accumulator) {
  14089. var isArr = isArray(object),
  14090. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14091. iteratee = getIteratee(iteratee, 4);
  14092. if (accumulator == null) {
  14093. var Ctor = object && object.constructor;
  14094. if (isArrLike) {
  14095. accumulator = isArr ? new Ctor : [];
  14096. }
  14097. else if (isObject(object)) {
  14098. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14099. }
  14100. else {
  14101. accumulator = {};
  14102. }
  14103. }
  14104. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14105. return iteratee(accumulator, value, index, object);
  14106. });
  14107. return accumulator;
  14108. }
  14109. /**
  14110. * Removes the property at `path` of `object`.
  14111. *
  14112. * **Note:** This method mutates `object`.
  14113. *
  14114. * @static
  14115. * @memberOf _
  14116. * @since 4.0.0
  14117. * @category Object
  14118. * @param {Object} object The object to modify.
  14119. * @param {Array|string} path The path of the property to unset.
  14120. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14121. * @example
  14122. *
  14123. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14124. * _.unset(object, 'a[0].b.c');
  14125. * // => true
  14126. *
  14127. * console.log(object);
  14128. * // => { 'a': [{ 'b': {} }] };
  14129. *
  14130. * _.unset(object, ['a', '0', 'b', 'c']);
  14131. * // => true
  14132. *
  14133. * console.log(object);
  14134. * // => { 'a': [{ 'b': {} }] };
  14135. */
  14136. function unset(object, path) {
  14137. return object == null ? true : baseUnset(object, path);
  14138. }
  14139. /**
  14140. * This method is like `_.set` except that accepts `updater` to produce the
  14141. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14142. * is invoked with one argument: (value).
  14143. *
  14144. * **Note:** This method mutates `object`.
  14145. *
  14146. * @static
  14147. * @memberOf _
  14148. * @since 4.6.0
  14149. * @category Object
  14150. * @param {Object} object The object to modify.
  14151. * @param {Array|string} path The path of the property to set.
  14152. * @param {Function} updater The function to produce the updated value.
  14153. * @returns {Object} Returns `object`.
  14154. * @example
  14155. *
  14156. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14157. *
  14158. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14159. * console.log(object.a[0].b.c);
  14160. * // => 9
  14161. *
  14162. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14163. * console.log(object.x[0].y.z);
  14164. * // => 0
  14165. */
  14166. function update(object, path, updater) {
  14167. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14168. }
  14169. /**
  14170. * This method is like `_.update` except that it accepts `customizer` which is
  14171. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14172. * path creation is handled by the method instead. The `customizer` is invoked
  14173. * with three arguments: (nsValue, key, nsObject).
  14174. *
  14175. * **Note:** This method mutates `object`.
  14176. *
  14177. * @static
  14178. * @memberOf _
  14179. * @since 4.6.0
  14180. * @category Object
  14181. * @param {Object} object The object to modify.
  14182. * @param {Array|string} path The path of the property to set.
  14183. * @param {Function} updater The function to produce the updated value.
  14184. * @param {Function} [customizer] The function to customize assigned values.
  14185. * @returns {Object} Returns `object`.
  14186. * @example
  14187. *
  14188. * var object = {};
  14189. *
  14190. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14191. * // => { '0': { '1': 'a' } }
  14192. */
  14193. function updateWith(object, path, updater, customizer) {
  14194. customizer = typeof customizer == 'function' ? customizer : undefined;
  14195. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14196. }
  14197. /**
  14198. * Creates an array of the own enumerable string keyed property values of `object`.
  14199. *
  14200. * **Note:** Non-object values are coerced to objects.
  14201. *
  14202. * @static
  14203. * @since 0.1.0
  14204. * @memberOf _
  14205. * @category Object
  14206. * @param {Object} object The object to query.
  14207. * @returns {Array} Returns the array of property values.
  14208. * @example
  14209. *
  14210. * function Foo() {
  14211. * this.a = 1;
  14212. * this.b = 2;
  14213. * }
  14214. *
  14215. * Foo.prototype.c = 3;
  14216. *
  14217. * _.values(new Foo);
  14218. * // => [1, 2] (iteration order is not guaranteed)
  14219. *
  14220. * _.values('hi');
  14221. * // => ['h', 'i']
  14222. */
  14223. function values(object) {
  14224. return object == null ? [] : baseValues(object, keys(object));
  14225. }
  14226. /**
  14227. * Creates an array of the own and inherited enumerable string keyed property
  14228. * values of `object`.
  14229. *
  14230. * **Note:** Non-object values are coerced to objects.
  14231. *
  14232. * @static
  14233. * @memberOf _
  14234. * @since 3.0.0
  14235. * @category Object
  14236. * @param {Object} object The object to query.
  14237. * @returns {Array} Returns the array of property values.
  14238. * @example
  14239. *
  14240. * function Foo() {
  14241. * this.a = 1;
  14242. * this.b = 2;
  14243. * }
  14244. *
  14245. * Foo.prototype.c = 3;
  14246. *
  14247. * _.valuesIn(new Foo);
  14248. * // => [1, 2, 3] (iteration order is not guaranteed)
  14249. */
  14250. function valuesIn(object) {
  14251. return object == null ? [] : baseValues(object, keysIn(object));
  14252. }
  14253. /*------------------------------------------------------------------------*/
  14254. /**
  14255. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14256. *
  14257. * @static
  14258. * @memberOf _
  14259. * @since 4.0.0
  14260. * @category Number
  14261. * @param {number} number The number to clamp.
  14262. * @param {number} [lower] The lower bound.
  14263. * @param {number} upper The upper bound.
  14264. * @returns {number} Returns the clamped number.
  14265. * @example
  14266. *
  14267. * _.clamp(-10, -5, 5);
  14268. * // => -5
  14269. *
  14270. * _.clamp(10, -5, 5);
  14271. * // => 5
  14272. */
  14273. function clamp(number, lower, upper) {
  14274. if (upper === undefined) {
  14275. upper = lower;
  14276. lower = undefined;
  14277. }
  14278. if (upper !== undefined) {
  14279. upper = toNumber(upper);
  14280. upper = upper === upper ? upper : 0;
  14281. }
  14282. if (lower !== undefined) {
  14283. lower = toNumber(lower);
  14284. lower = lower === lower ? lower : 0;
  14285. }
  14286. return baseClamp(toNumber(number), lower, upper);
  14287. }
  14288. /**
  14289. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14290. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14291. * If `start` is greater than `end` the params are swapped to support
  14292. * negative ranges.
  14293. *
  14294. * @static
  14295. * @memberOf _
  14296. * @since 3.3.0
  14297. * @category Number
  14298. * @param {number} number The number to check.
  14299. * @param {number} [start=0] The start of the range.
  14300. * @param {number} end The end of the range.
  14301. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14302. * @see _.range, _.rangeRight
  14303. * @example
  14304. *
  14305. * _.inRange(3, 2, 4);
  14306. * // => true
  14307. *
  14308. * _.inRange(4, 8);
  14309. * // => true
  14310. *
  14311. * _.inRange(4, 2);
  14312. * // => false
  14313. *
  14314. * _.inRange(2, 2);
  14315. * // => false
  14316. *
  14317. * _.inRange(1.2, 2);
  14318. * // => true
  14319. *
  14320. * _.inRange(5.2, 4);
  14321. * // => false
  14322. *
  14323. * _.inRange(-3, -2, -6);
  14324. * // => true
  14325. */
  14326. function inRange(number, start, end) {
  14327. start = toFinite(start);
  14328. if (end === undefined) {
  14329. end = start;
  14330. start = 0;
  14331. } else {
  14332. end = toFinite(end);
  14333. }
  14334. number = toNumber(number);
  14335. return baseInRange(number, start, end);
  14336. }
  14337. /**
  14338. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14339. * If only one argument is provided a number between `0` and the given number
  14340. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14341. * floats, a floating-point number is returned instead of an integer.
  14342. *
  14343. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14344. * floating-point values which can produce unexpected results.
  14345. *
  14346. * @static
  14347. * @memberOf _
  14348. * @since 0.7.0
  14349. * @category Number
  14350. * @param {number} [lower=0] The lower bound.
  14351. * @param {number} [upper=1] The upper bound.
  14352. * @param {boolean} [floating] Specify returning a floating-point number.
  14353. * @returns {number} Returns the random number.
  14354. * @example
  14355. *
  14356. * _.random(0, 5);
  14357. * // => an integer between 0 and 5
  14358. *
  14359. * _.random(5);
  14360. * // => also an integer between 0 and 5
  14361. *
  14362. * _.random(5, true);
  14363. * // => a floating-point number between 0 and 5
  14364. *
  14365. * _.random(1.2, 5.2);
  14366. * // => a floating-point number between 1.2 and 5.2
  14367. */
  14368. function random(lower, upper, floating) {
  14369. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14370. upper = floating = undefined;
  14371. }
  14372. if (floating === undefined) {
  14373. if (typeof upper == 'boolean') {
  14374. floating = upper;
  14375. upper = undefined;
  14376. }
  14377. else if (typeof lower == 'boolean') {
  14378. floating = lower;
  14379. lower = undefined;
  14380. }
  14381. }
  14382. if (lower === undefined && upper === undefined) {
  14383. lower = 0;
  14384. upper = 1;
  14385. }
  14386. else {
  14387. lower = toFinite(lower);
  14388. if (upper === undefined) {
  14389. upper = lower;
  14390. lower = 0;
  14391. } else {
  14392. upper = toFinite(upper);
  14393. }
  14394. }
  14395. if (lower > upper) {
  14396. var temp = lower;
  14397. lower = upper;
  14398. upper = temp;
  14399. }
  14400. if (floating || lower % 1 || upper % 1) {
  14401. var rand = nativeRandom();
  14402. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14403. }
  14404. return baseRandom(lower, upper);
  14405. }
  14406. /*------------------------------------------------------------------------*/
  14407. /**
  14408. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14409. *
  14410. * @static
  14411. * @memberOf _
  14412. * @since 3.0.0
  14413. * @category String
  14414. * @param {string} [string=''] The string to convert.
  14415. * @returns {string} Returns the camel cased string.
  14416. * @example
  14417. *
  14418. * _.camelCase('Foo Bar');
  14419. * // => 'fooBar'
  14420. *
  14421. * _.camelCase('--foo-bar--');
  14422. * // => 'fooBar'
  14423. *
  14424. * _.camelCase('__FOO_BAR__');
  14425. * // => 'fooBar'
  14426. */
  14427. var camelCase = createCompounder(function(result, word, index) {
  14428. word = word.toLowerCase();
  14429. return result + (index ? capitalize(word) : word);
  14430. });
  14431. /**
  14432. * Converts the first character of `string` to upper case and the remaining
  14433. * to lower case.
  14434. *
  14435. * @static
  14436. * @memberOf _
  14437. * @since 3.0.0
  14438. * @category String
  14439. * @param {string} [string=''] The string to capitalize.
  14440. * @returns {string} Returns the capitalized string.
  14441. * @example
  14442. *
  14443. * _.capitalize('FRED');
  14444. * // => 'Fred'
  14445. */
  14446. function capitalize(string) {
  14447. return upperFirst(toString(string).toLowerCase());
  14448. }
  14449. /**
  14450. * Deburrs `string` by converting
  14451. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14452. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14453. * letters to basic Latin letters and removing
  14454. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14455. *
  14456. * @static
  14457. * @memberOf _
  14458. * @since 3.0.0
  14459. * @category String
  14460. * @param {string} [string=''] The string to deburr.
  14461. * @returns {string} Returns the deburred string.
  14462. * @example
  14463. *
  14464. * _.deburr('déjà vu');
  14465. * // => 'deja vu'
  14466. */
  14467. function deburr(string) {
  14468. string = toString(string);
  14469. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14470. }
  14471. /**
  14472. * Checks if `string` ends with the given target string.
  14473. *
  14474. * @static
  14475. * @memberOf _
  14476. * @since 3.0.0
  14477. * @category String
  14478. * @param {string} [string=''] The string to inspect.
  14479. * @param {string} [target] The string to search for.
  14480. * @param {number} [position=string.length] The position to search up to.
  14481. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14482. * else `false`.
  14483. * @example
  14484. *
  14485. * _.endsWith('abc', 'c');
  14486. * // => true
  14487. *
  14488. * _.endsWith('abc', 'b');
  14489. * // => false
  14490. *
  14491. * _.endsWith('abc', 'b', 2);
  14492. * // => true
  14493. */
  14494. function endsWith(string, target, position) {
  14495. string = toString(string);
  14496. target = baseToString(target);
  14497. var length = string.length;
  14498. position = position === undefined
  14499. ? length
  14500. : baseClamp(toInteger(position), 0, length);
  14501. var end = position;
  14502. position -= target.length;
  14503. return position >= 0 && string.slice(position, end) == target;
  14504. }
  14505. /**
  14506. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14507. * corresponding HTML entities.
  14508. *
  14509. * **Note:** No other characters are escaped. To escape additional
  14510. * characters use a third-party library like [_he_](https://mths.be/he).
  14511. *
  14512. * Though the ">" character is escaped for symmetry, characters like
  14513. * ">" and "/" don't need escaping in HTML and have no special meaning
  14514. * unless they're part of a tag or unquoted attribute value. See
  14515. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14516. * (under "semi-related fun fact") for more details.
  14517. *
  14518. * When working with HTML you should always
  14519. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14520. * XSS vectors.
  14521. *
  14522. * @static
  14523. * @since 0.1.0
  14524. * @memberOf _
  14525. * @category String
  14526. * @param {string} [string=''] The string to escape.
  14527. * @returns {string} Returns the escaped string.
  14528. * @example
  14529. *
  14530. * _.escape('fred, barney, & pebbles');
  14531. * // => 'fred, barney, &amp; pebbles'
  14532. */
  14533. function escape(string) {
  14534. string = toString(string);
  14535. return (string && reHasUnescapedHtml.test(string))
  14536. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14537. : string;
  14538. }
  14539. /**
  14540. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14541. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14542. *
  14543. * @static
  14544. * @memberOf _
  14545. * @since 3.0.0
  14546. * @category String
  14547. * @param {string} [string=''] The string to escape.
  14548. * @returns {string} Returns the escaped string.
  14549. * @example
  14550. *
  14551. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14552. * // => '\[lodash\]\(https://lodash\.com/\)'
  14553. */
  14554. function escapeRegExp(string) {
  14555. string = toString(string);
  14556. return (string && reHasRegExpChar.test(string))
  14557. ? string.replace(reRegExpChar, '\\$&')
  14558. : string;
  14559. }
  14560. /**
  14561. * Converts `string` to
  14562. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 3.0.0
  14567. * @category String
  14568. * @param {string} [string=''] The string to convert.
  14569. * @returns {string} Returns the kebab cased string.
  14570. * @example
  14571. *
  14572. * _.kebabCase('Foo Bar');
  14573. * // => 'foo-bar'
  14574. *
  14575. * _.kebabCase('fooBar');
  14576. * // => 'foo-bar'
  14577. *
  14578. * _.kebabCase('__FOO_BAR__');
  14579. * // => 'foo-bar'
  14580. */
  14581. var kebabCase = createCompounder(function(result, word, index) {
  14582. return result + (index ? '-' : '') + word.toLowerCase();
  14583. });
  14584. /**
  14585. * Converts `string`, as space separated words, to lower case.
  14586. *
  14587. * @static
  14588. * @memberOf _
  14589. * @since 4.0.0
  14590. * @category String
  14591. * @param {string} [string=''] The string to convert.
  14592. * @returns {string} Returns the lower cased string.
  14593. * @example
  14594. *
  14595. * _.lowerCase('--Foo-Bar--');
  14596. * // => 'foo bar'
  14597. *
  14598. * _.lowerCase('fooBar');
  14599. * // => 'foo bar'
  14600. *
  14601. * _.lowerCase('__FOO_BAR__');
  14602. * // => 'foo bar'
  14603. */
  14604. var lowerCase = createCompounder(function(result, word, index) {
  14605. return result + (index ? ' ' : '') + word.toLowerCase();
  14606. });
  14607. /**
  14608. * Converts the first character of `string` to lower case.
  14609. *
  14610. * @static
  14611. * @memberOf _
  14612. * @since 4.0.0
  14613. * @category String
  14614. * @param {string} [string=''] The string to convert.
  14615. * @returns {string} Returns the converted string.
  14616. * @example
  14617. *
  14618. * _.lowerFirst('Fred');
  14619. * // => 'fred'
  14620. *
  14621. * _.lowerFirst('FRED');
  14622. * // => 'fRED'
  14623. */
  14624. var lowerFirst = createCaseFirst('toLowerCase');
  14625. /**
  14626. * Pads `string` on the left and right sides if it's shorter than `length`.
  14627. * Padding characters are truncated if they can't be evenly divided by `length`.
  14628. *
  14629. * @static
  14630. * @memberOf _
  14631. * @since 3.0.0
  14632. * @category String
  14633. * @param {string} [string=''] The string to pad.
  14634. * @param {number} [length=0] The padding length.
  14635. * @param {string} [chars=' '] The string used as padding.
  14636. * @returns {string} Returns the padded string.
  14637. * @example
  14638. *
  14639. * _.pad('abc', 8);
  14640. * // => ' abc '
  14641. *
  14642. * _.pad('abc', 8, '_-');
  14643. * // => '_-abc_-_'
  14644. *
  14645. * _.pad('abc', 3);
  14646. * // => 'abc'
  14647. */
  14648. function pad(string, length, chars) {
  14649. string = toString(string);
  14650. length = toInteger(length);
  14651. var strLength = length ? stringSize(string) : 0;
  14652. if (!length || strLength >= length) {
  14653. return string;
  14654. }
  14655. var mid = (length - strLength) / 2;
  14656. return (
  14657. createPadding(nativeFloor(mid), chars) +
  14658. string +
  14659. createPadding(nativeCeil(mid), chars)
  14660. );
  14661. }
  14662. /**
  14663. * Pads `string` on the right side if it's shorter than `length`. Padding
  14664. * characters are truncated if they exceed `length`.
  14665. *
  14666. * @static
  14667. * @memberOf _
  14668. * @since 4.0.0
  14669. * @category String
  14670. * @param {string} [string=''] The string to pad.
  14671. * @param {number} [length=0] The padding length.
  14672. * @param {string} [chars=' '] The string used as padding.
  14673. * @returns {string} Returns the padded string.
  14674. * @example
  14675. *
  14676. * _.padEnd('abc', 6);
  14677. * // => 'abc '
  14678. *
  14679. * _.padEnd('abc', 6, '_-');
  14680. * // => 'abc_-_'
  14681. *
  14682. * _.padEnd('abc', 3);
  14683. * // => 'abc'
  14684. */
  14685. function padEnd(string, length, chars) {
  14686. string = toString(string);
  14687. length = toInteger(length);
  14688. var strLength = length ? stringSize(string) : 0;
  14689. return (length && strLength < length)
  14690. ? (string + createPadding(length - strLength, chars))
  14691. : string;
  14692. }
  14693. /**
  14694. * Pads `string` on the left side if it's shorter than `length`. Padding
  14695. * characters are truncated if they exceed `length`.
  14696. *
  14697. * @static
  14698. * @memberOf _
  14699. * @since 4.0.0
  14700. * @category String
  14701. * @param {string} [string=''] The string to pad.
  14702. * @param {number} [length=0] The padding length.
  14703. * @param {string} [chars=' '] The string used as padding.
  14704. * @returns {string} Returns the padded string.
  14705. * @example
  14706. *
  14707. * _.padStart('abc', 6);
  14708. * // => ' abc'
  14709. *
  14710. * _.padStart('abc', 6, '_-');
  14711. * // => '_-_abc'
  14712. *
  14713. * _.padStart('abc', 3);
  14714. * // => 'abc'
  14715. */
  14716. function padStart(string, length, chars) {
  14717. string = toString(string);
  14718. length = toInteger(length);
  14719. var strLength = length ? stringSize(string) : 0;
  14720. return (length && strLength < length)
  14721. ? (createPadding(length - strLength, chars) + string)
  14722. : string;
  14723. }
  14724. /**
  14725. * Converts `string` to an integer of the specified radix. If `radix` is
  14726. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14727. * hexadecimal, in which case a `radix` of `16` is used.
  14728. *
  14729. * **Note:** This method aligns with the
  14730. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14731. *
  14732. * @static
  14733. * @memberOf _
  14734. * @since 1.1.0
  14735. * @category String
  14736. * @param {string} string The string to convert.
  14737. * @param {number} [radix=10] The radix to interpret `value` by.
  14738. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14739. * @returns {number} Returns the converted integer.
  14740. * @example
  14741. *
  14742. * _.parseInt('08');
  14743. * // => 8
  14744. *
  14745. * _.map(['6', '08', '10'], _.parseInt);
  14746. * // => [6, 8, 10]
  14747. */
  14748. function parseInt(string, radix, guard) {
  14749. if (guard || radix == null) {
  14750. radix = 0;
  14751. } else if (radix) {
  14752. radix = +radix;
  14753. }
  14754. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14755. }
  14756. /**
  14757. * Repeats the given string `n` times.
  14758. *
  14759. * @static
  14760. * @memberOf _
  14761. * @since 3.0.0
  14762. * @category String
  14763. * @param {string} [string=''] The string to repeat.
  14764. * @param {number} [n=1] The number of times to repeat the string.
  14765. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14766. * @returns {string} Returns the repeated string.
  14767. * @example
  14768. *
  14769. * _.repeat('*', 3);
  14770. * // => '***'
  14771. *
  14772. * _.repeat('abc', 2);
  14773. * // => 'abcabc'
  14774. *
  14775. * _.repeat('abc', 0);
  14776. * // => ''
  14777. */
  14778. function repeat(string, n, guard) {
  14779. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14780. n = 1;
  14781. } else {
  14782. n = toInteger(n);
  14783. }
  14784. return baseRepeat(toString(string), n);
  14785. }
  14786. /**
  14787. * Replaces matches for `pattern` in `string` with `replacement`.
  14788. *
  14789. * **Note:** This method is based on
  14790. * [`String#replace`](https://mdn.io/String/replace).
  14791. *
  14792. * @static
  14793. * @memberOf _
  14794. * @since 4.0.0
  14795. * @category String
  14796. * @param {string} [string=''] The string to modify.
  14797. * @param {RegExp|string} pattern The pattern to replace.
  14798. * @param {Function|string} replacement The match replacement.
  14799. * @returns {string} Returns the modified string.
  14800. * @example
  14801. *
  14802. * _.replace('Hi Fred', 'Fred', 'Barney');
  14803. * // => 'Hi Barney'
  14804. */
  14805. function replace() {
  14806. var args = arguments,
  14807. string = toString(args[0]);
  14808. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14809. }
  14810. /**
  14811. * Converts `string` to
  14812. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14813. *
  14814. * @static
  14815. * @memberOf _
  14816. * @since 3.0.0
  14817. * @category String
  14818. * @param {string} [string=''] The string to convert.
  14819. * @returns {string} Returns the snake cased string.
  14820. * @example
  14821. *
  14822. * _.snakeCase('Foo Bar');
  14823. * // => 'foo_bar'
  14824. *
  14825. * _.snakeCase('fooBar');
  14826. * // => 'foo_bar'
  14827. *
  14828. * _.snakeCase('--FOO-BAR--');
  14829. * // => 'foo_bar'
  14830. */
  14831. var snakeCase = createCompounder(function(result, word, index) {
  14832. return result + (index ? '_' : '') + word.toLowerCase();
  14833. });
  14834. /**
  14835. * Splits `string` by `separator`.
  14836. *
  14837. * **Note:** This method is based on
  14838. * [`String#split`](https://mdn.io/String/split).
  14839. *
  14840. * @static
  14841. * @memberOf _
  14842. * @since 4.0.0
  14843. * @category String
  14844. * @param {string} [string=''] The string to split.
  14845. * @param {RegExp|string} separator The separator pattern to split by.
  14846. * @param {number} [limit] The length to truncate results to.
  14847. * @returns {Array} Returns the string segments.
  14848. * @example
  14849. *
  14850. * _.split('a-b-c', '-', 2);
  14851. * // => ['a', 'b']
  14852. */
  14853. function split(string, separator, limit) {
  14854. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14855. separator = limit = undefined;
  14856. }
  14857. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14858. if (!limit) {
  14859. return [];
  14860. }
  14861. string = toString(string);
  14862. if (string && (
  14863. typeof separator == 'string' ||
  14864. (separator != null && !isRegExp(separator))
  14865. )) {
  14866. separator = baseToString(separator);
  14867. if (!separator && hasUnicode(string)) {
  14868. return castSlice(stringToArray(string), 0, limit);
  14869. }
  14870. }
  14871. return string.split(separator, limit);
  14872. }
  14873. /**
  14874. * Converts `string` to
  14875. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14876. *
  14877. * @static
  14878. * @memberOf _
  14879. * @since 3.1.0
  14880. * @category String
  14881. * @param {string} [string=''] The string to convert.
  14882. * @returns {string} Returns the start cased string.
  14883. * @example
  14884. *
  14885. * _.startCase('--foo-bar--');
  14886. * // => 'Foo Bar'
  14887. *
  14888. * _.startCase('fooBar');
  14889. * // => 'Foo Bar'
  14890. *
  14891. * _.startCase('__FOO_BAR__');
  14892. * // => 'FOO BAR'
  14893. */
  14894. var startCase = createCompounder(function(result, word, index) {
  14895. return result + (index ? ' ' : '') + upperFirst(word);
  14896. });
  14897. /**
  14898. * Checks if `string` starts with the given target string.
  14899. *
  14900. * @static
  14901. * @memberOf _
  14902. * @since 3.0.0
  14903. * @category String
  14904. * @param {string} [string=''] The string to inspect.
  14905. * @param {string} [target] The string to search for.
  14906. * @param {number} [position=0] The position to search from.
  14907. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14908. * else `false`.
  14909. * @example
  14910. *
  14911. * _.startsWith('abc', 'a');
  14912. * // => true
  14913. *
  14914. * _.startsWith('abc', 'b');
  14915. * // => false
  14916. *
  14917. * _.startsWith('abc', 'b', 1);
  14918. * // => true
  14919. */
  14920. function startsWith(string, target, position) {
  14921. string = toString(string);
  14922. position = position == null
  14923. ? 0
  14924. : baseClamp(toInteger(position), 0, string.length);
  14925. target = baseToString(target);
  14926. return string.slice(position, position + target.length) == target;
  14927. }
  14928. /**
  14929. * Creates a compiled template function that can interpolate data properties
  14930. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14931. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14932. * properties may be accessed as free variables in the template. If a setting
  14933. * object is given, it takes precedence over `_.templateSettings` values.
  14934. *
  14935. * **Note:** In the development build `_.template` utilizes
  14936. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14937. * for easier debugging.
  14938. *
  14939. * For more information on precompiling templates see
  14940. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14941. *
  14942. * For more information on Chrome extension sandboxes see
  14943. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14944. *
  14945. * @static
  14946. * @since 0.1.0
  14947. * @memberOf _
  14948. * @category String
  14949. * @param {string} [string=''] The template string.
  14950. * @param {Object} [options={}] The options object.
  14951. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14952. * The HTML "escape" delimiter.
  14953. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14954. * The "evaluate" delimiter.
  14955. * @param {Object} [options.imports=_.templateSettings.imports]
  14956. * An object to import into the template as free variables.
  14957. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14958. * The "interpolate" delimiter.
  14959. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14960. * The sourceURL of the compiled template.
  14961. * @param {string} [options.variable='obj']
  14962. * The data object variable name.
  14963. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14964. * @returns {Function} Returns the compiled template function.
  14965. * @example
  14966. *
  14967. * // Use the "interpolate" delimiter to create a compiled template.
  14968. * var compiled = _.template('hello <%= user %>!');
  14969. * compiled({ 'user': 'fred' });
  14970. * // => 'hello fred!'
  14971. *
  14972. * // Use the HTML "escape" delimiter to escape data property values.
  14973. * var compiled = _.template('<b><%- value %></b>');
  14974. * compiled({ 'value': '<script>' });
  14975. * // => '<b>&lt;script&gt;</b>'
  14976. *
  14977. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  14978. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  14979. * compiled({ 'users': ['fred', 'barney'] });
  14980. * // => '<li>fred</li><li>barney</li>'
  14981. *
  14982. * // Use the internal `print` function in "evaluate" delimiters.
  14983. * var compiled = _.template('<% print("hello " + user); %>!');
  14984. * compiled({ 'user': 'barney' });
  14985. * // => 'hello barney!'
  14986. *
  14987. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  14988. * // Disable support by replacing the "interpolate" delimiter.
  14989. * var compiled = _.template('hello ${ user }!');
  14990. * compiled({ 'user': 'pebbles' });
  14991. * // => 'hello pebbles!'
  14992. *
  14993. * // Use backslashes to treat delimiters as plain text.
  14994. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  14995. * compiled({ 'value': 'ignored' });
  14996. * // => '<%- value %>'
  14997. *
  14998. * // Use the `imports` option to import `jQuery` as `jq`.
  14999. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15000. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15001. * compiled({ 'users': ['fred', 'barney'] });
  15002. * // => '<li>fred</li><li>barney</li>'
  15003. *
  15004. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15005. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15006. * compiled(data);
  15007. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15008. *
  15009. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15010. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15011. * compiled.source;
  15012. * // => function(data) {
  15013. * // var __t, __p = '';
  15014. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15015. * // return __p;
  15016. * // }
  15017. *
  15018. * // Use custom template delimiters.
  15019. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15020. * var compiled = _.template('hello {{ user }}!');
  15021. * compiled({ 'user': 'mustache' });
  15022. * // => 'hello mustache!'
  15023. *
  15024. * // Use the `source` property to inline compiled templates for meaningful
  15025. * // line numbers in error messages and stack traces.
  15026. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15027. * var JST = {\
  15028. * "main": ' + _.template(mainText).source + '\
  15029. * };\
  15030. * ');
  15031. */
  15032. function template(string, options, guard) {
  15033. // Based on John Resig's `tmpl` implementation
  15034. // (http://ejohn.org/blog/javascript-micro-templating/)
  15035. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15036. var settings = lodash.templateSettings;
  15037. if (guard && isIterateeCall(string, options, guard)) {
  15038. options = undefined;
  15039. }
  15040. string = toString(string);
  15041. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15042. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15043. importsKeys = keys(imports),
  15044. importsValues = baseValues(imports, importsKeys);
  15045. var isEscaping,
  15046. isEvaluating,
  15047. index = 0,
  15048. interpolate = options.interpolate || reNoMatch,
  15049. source = "__p += '";
  15050. // Compile the regexp to match each delimiter.
  15051. var reDelimiters = RegExp(
  15052. (options.escape || reNoMatch).source + '|' +
  15053. interpolate.source + '|' +
  15054. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15055. (options.evaluate || reNoMatch).source + '|$'
  15056. , 'g');
  15057. // Use a sourceURL for easier debugging.
  15058. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15059. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15060. // and escape the comment, thus injecting code that gets evaled.
  15061. var sourceURL = '//# sourceURL=' +
  15062. (hasOwnProperty.call(options, 'sourceURL')
  15063. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15064. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15065. ) + '\n';
  15066. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15067. interpolateValue || (interpolateValue = esTemplateValue);
  15068. // Escape characters that can't be included in string literals.
  15069. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15070. // Replace delimiters with snippets.
  15071. if (escapeValue) {
  15072. isEscaping = true;
  15073. source += "' +\n__e(" + escapeValue + ") +\n'";
  15074. }
  15075. if (evaluateValue) {
  15076. isEvaluating = true;
  15077. source += "';\n" + evaluateValue + ";\n__p += '";
  15078. }
  15079. if (interpolateValue) {
  15080. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15081. }
  15082. index = offset + match.length;
  15083. // The JS engine embedded in Adobe products needs `match` returned in
  15084. // order to produce the correct `offset` value.
  15085. return match;
  15086. });
  15087. source += "';\n";
  15088. // If `variable` is not specified wrap a with-statement around the generated
  15089. // code to add the data object to the top of the scope chain.
  15090. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15091. if (!variable) {
  15092. source = 'with (obj) {\n' + source + '\n}\n';
  15093. }
  15094. // Throw an error if a forbidden character was found in `variable`, to prevent
  15095. // potential command injection attacks.
  15096. else if (reForbiddenIdentifierChars.test(variable)) {
  15097. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15098. }
  15099. // Cleanup code by stripping empty strings.
  15100. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15101. .replace(reEmptyStringMiddle, '$1')
  15102. .replace(reEmptyStringTrailing, '$1;');
  15103. // Frame code as the function body.
  15104. source = 'function(' + (variable || 'obj') + ') {\n' +
  15105. (variable
  15106. ? ''
  15107. : 'obj || (obj = {});\n'
  15108. ) +
  15109. "var __t, __p = ''" +
  15110. (isEscaping
  15111. ? ', __e = _.escape'
  15112. : ''
  15113. ) +
  15114. (isEvaluating
  15115. ? ', __j = Array.prototype.join;\n' +
  15116. "function print() { __p += __j.call(arguments, '') }\n"
  15117. : ';\n'
  15118. ) +
  15119. source +
  15120. 'return __p\n}';
  15121. var result = attempt(function() {
  15122. return Function(importsKeys, sourceURL + 'return ' + source)
  15123. .apply(undefined, importsValues);
  15124. });
  15125. // Provide the compiled function's source by its `toString` method or
  15126. // the `source` property as a convenience for inlining compiled templates.
  15127. result.source = source;
  15128. if (isError(result)) {
  15129. throw result;
  15130. }
  15131. return result;
  15132. }
  15133. /**
  15134. * Converts `string`, as a whole, to lower case just like
  15135. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15136. *
  15137. * @static
  15138. * @memberOf _
  15139. * @since 4.0.0
  15140. * @category String
  15141. * @param {string} [string=''] The string to convert.
  15142. * @returns {string} Returns the lower cased string.
  15143. * @example
  15144. *
  15145. * _.toLower('--Foo-Bar--');
  15146. * // => '--foo-bar--'
  15147. *
  15148. * _.toLower('fooBar');
  15149. * // => 'foobar'
  15150. *
  15151. * _.toLower('__FOO_BAR__');
  15152. * // => '__foo_bar__'
  15153. */
  15154. function toLower(value) {
  15155. return toString(value).toLowerCase();
  15156. }
  15157. /**
  15158. * Converts `string`, as a whole, to upper case just like
  15159. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15160. *
  15161. * @static
  15162. * @memberOf _
  15163. * @since 4.0.0
  15164. * @category String
  15165. * @param {string} [string=''] The string to convert.
  15166. * @returns {string} Returns the upper cased string.
  15167. * @example
  15168. *
  15169. * _.toUpper('--foo-bar--');
  15170. * // => '--FOO-BAR--'
  15171. *
  15172. * _.toUpper('fooBar');
  15173. * // => 'FOOBAR'
  15174. *
  15175. * _.toUpper('__foo_bar__');
  15176. * // => '__FOO_BAR__'
  15177. */
  15178. function toUpper(value) {
  15179. return toString(value).toUpperCase();
  15180. }
  15181. /**
  15182. * Removes leading and trailing whitespace or specified characters from `string`.
  15183. *
  15184. * @static
  15185. * @memberOf _
  15186. * @since 3.0.0
  15187. * @category String
  15188. * @param {string} [string=''] The string to trim.
  15189. * @param {string} [chars=whitespace] The characters to trim.
  15190. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15191. * @returns {string} Returns the trimmed string.
  15192. * @example
  15193. *
  15194. * _.trim(' abc ');
  15195. * // => 'abc'
  15196. *
  15197. * _.trim('-_-abc-_-', '_-');
  15198. * // => 'abc'
  15199. *
  15200. * _.map([' foo ', ' bar '], _.trim);
  15201. * // => ['foo', 'bar']
  15202. */
  15203. function trim(string, chars, guard) {
  15204. string = toString(string);
  15205. if (string && (guard || chars === undefined)) {
  15206. return baseTrim(string);
  15207. }
  15208. if (!string || !(chars = baseToString(chars))) {
  15209. return string;
  15210. }
  15211. var strSymbols = stringToArray(string),
  15212. chrSymbols = stringToArray(chars),
  15213. start = charsStartIndex(strSymbols, chrSymbols),
  15214. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15215. return castSlice(strSymbols, start, end).join('');
  15216. }
  15217. /**
  15218. * Removes trailing whitespace or specified characters from `string`.
  15219. *
  15220. * @static
  15221. * @memberOf _
  15222. * @since 4.0.0
  15223. * @category String
  15224. * @param {string} [string=''] The string to trim.
  15225. * @param {string} [chars=whitespace] The characters to trim.
  15226. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15227. * @returns {string} Returns the trimmed string.
  15228. * @example
  15229. *
  15230. * _.trimEnd(' abc ');
  15231. * // => ' abc'
  15232. *
  15233. * _.trimEnd('-_-abc-_-', '_-');
  15234. * // => '-_-abc'
  15235. */
  15236. function trimEnd(string, chars, guard) {
  15237. string = toString(string);
  15238. if (string && (guard || chars === undefined)) {
  15239. return string.slice(0, trimmedEndIndex(string) + 1);
  15240. }
  15241. if (!string || !(chars = baseToString(chars))) {
  15242. return string;
  15243. }
  15244. var strSymbols = stringToArray(string),
  15245. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15246. return castSlice(strSymbols, 0, end).join('');
  15247. }
  15248. /**
  15249. * Removes leading whitespace or specified characters from `string`.
  15250. *
  15251. * @static
  15252. * @memberOf _
  15253. * @since 4.0.0
  15254. * @category String
  15255. * @param {string} [string=''] The string to trim.
  15256. * @param {string} [chars=whitespace] The characters to trim.
  15257. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15258. * @returns {string} Returns the trimmed string.
  15259. * @example
  15260. *
  15261. * _.trimStart(' abc ');
  15262. * // => 'abc '
  15263. *
  15264. * _.trimStart('-_-abc-_-', '_-');
  15265. * // => 'abc-_-'
  15266. */
  15267. function trimStart(string, chars, guard) {
  15268. string = toString(string);
  15269. if (string && (guard || chars === undefined)) {
  15270. return string.replace(reTrimStart, '');
  15271. }
  15272. if (!string || !(chars = baseToString(chars))) {
  15273. return string;
  15274. }
  15275. var strSymbols = stringToArray(string),
  15276. start = charsStartIndex(strSymbols, stringToArray(chars));
  15277. return castSlice(strSymbols, start).join('');
  15278. }
  15279. /**
  15280. * Truncates `string` if it's longer than the given maximum string length.
  15281. * The last characters of the truncated string are replaced with the omission
  15282. * string which defaults to "...".
  15283. *
  15284. * @static
  15285. * @memberOf _
  15286. * @since 4.0.0
  15287. * @category String
  15288. * @param {string} [string=''] The string to truncate.
  15289. * @param {Object} [options={}] The options object.
  15290. * @param {number} [options.length=30] The maximum string length.
  15291. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15292. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15293. * @returns {string} Returns the truncated string.
  15294. * @example
  15295. *
  15296. * _.truncate('hi-diddly-ho there, neighborino');
  15297. * // => 'hi-diddly-ho there, neighbo...'
  15298. *
  15299. * _.truncate('hi-diddly-ho there, neighborino', {
  15300. * 'length': 24,
  15301. * 'separator': ' '
  15302. * });
  15303. * // => 'hi-diddly-ho there,...'
  15304. *
  15305. * _.truncate('hi-diddly-ho there, neighborino', {
  15306. * 'length': 24,
  15307. * 'separator': /,? +/
  15308. * });
  15309. * // => 'hi-diddly-ho there...'
  15310. *
  15311. * _.truncate('hi-diddly-ho there, neighborino', {
  15312. * 'omission': ' [...]'
  15313. * });
  15314. * // => 'hi-diddly-ho there, neig [...]'
  15315. */
  15316. function truncate(string, options) {
  15317. var length = DEFAULT_TRUNC_LENGTH,
  15318. omission = DEFAULT_TRUNC_OMISSION;
  15319. if (isObject(options)) {
  15320. var separator = 'separator' in options ? options.separator : separator;
  15321. length = 'length' in options ? toInteger(options.length) : length;
  15322. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15323. }
  15324. string = toString(string);
  15325. var strLength = string.length;
  15326. if (hasUnicode(string)) {
  15327. var strSymbols = stringToArray(string);
  15328. strLength = strSymbols.length;
  15329. }
  15330. if (length >= strLength) {
  15331. return string;
  15332. }
  15333. var end = length - stringSize(omission);
  15334. if (end < 1) {
  15335. return omission;
  15336. }
  15337. var result = strSymbols
  15338. ? castSlice(strSymbols, 0, end).join('')
  15339. : string.slice(0, end);
  15340. if (separator === undefined) {
  15341. return result + omission;
  15342. }
  15343. if (strSymbols) {
  15344. end += (result.length - end);
  15345. }
  15346. if (isRegExp(separator)) {
  15347. if (string.slice(end).search(separator)) {
  15348. var match,
  15349. substring = result;
  15350. if (!separator.global) {
  15351. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15352. }
  15353. separator.lastIndex = 0;
  15354. while ((match = separator.exec(substring))) {
  15355. var newEnd = match.index;
  15356. }
  15357. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15358. }
  15359. } else if (string.indexOf(baseToString(separator), end) != end) {
  15360. var index = result.lastIndexOf(separator);
  15361. if (index > -1) {
  15362. result = result.slice(0, index);
  15363. }
  15364. }
  15365. return result + omission;
  15366. }
  15367. /**
  15368. * The inverse of `_.escape`; this method converts the HTML entities
  15369. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15370. * their corresponding characters.
  15371. *
  15372. * **Note:** No other HTML entities are unescaped. To unescape additional
  15373. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15374. *
  15375. * @static
  15376. * @memberOf _
  15377. * @since 0.6.0
  15378. * @category String
  15379. * @param {string} [string=''] The string to unescape.
  15380. * @returns {string} Returns the unescaped string.
  15381. * @example
  15382. *
  15383. * _.unescape('fred, barney, &amp; pebbles');
  15384. * // => 'fred, barney, & pebbles'
  15385. */
  15386. function unescape(string) {
  15387. string = toString(string);
  15388. return (string && reHasEscapedHtml.test(string))
  15389. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15390. : string;
  15391. }
  15392. /**
  15393. * Converts `string`, as space separated words, to upper case.
  15394. *
  15395. * @static
  15396. * @memberOf _
  15397. * @since 4.0.0
  15398. * @category String
  15399. * @param {string} [string=''] The string to convert.
  15400. * @returns {string} Returns the upper cased string.
  15401. * @example
  15402. *
  15403. * _.upperCase('--foo-bar');
  15404. * // => 'FOO BAR'
  15405. *
  15406. * _.upperCase('fooBar');
  15407. * // => 'FOO BAR'
  15408. *
  15409. * _.upperCase('__foo_bar__');
  15410. * // => 'FOO BAR'
  15411. */
  15412. var upperCase = createCompounder(function(result, word, index) {
  15413. return result + (index ? ' ' : '') + word.toUpperCase();
  15414. });
  15415. /**
  15416. * Converts the first character of `string` to upper case.
  15417. *
  15418. * @static
  15419. * @memberOf _
  15420. * @since 4.0.0
  15421. * @category String
  15422. * @param {string} [string=''] The string to convert.
  15423. * @returns {string} Returns the converted string.
  15424. * @example
  15425. *
  15426. * _.upperFirst('fred');
  15427. * // => 'Fred'
  15428. *
  15429. * _.upperFirst('FRED');
  15430. * // => 'FRED'
  15431. */
  15432. var upperFirst = createCaseFirst('toUpperCase');
  15433. /**
  15434. * Splits `string` into an array of its words.
  15435. *
  15436. * @static
  15437. * @memberOf _
  15438. * @since 3.0.0
  15439. * @category String
  15440. * @param {string} [string=''] The string to inspect.
  15441. * @param {RegExp|string} [pattern] The pattern to match words.
  15442. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15443. * @returns {Array} Returns the words of `string`.
  15444. * @example
  15445. *
  15446. * _.words('fred, barney, & pebbles');
  15447. * // => ['fred', 'barney', 'pebbles']
  15448. *
  15449. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15450. * // => ['fred', 'barney', '&', 'pebbles']
  15451. */
  15452. function words(string, pattern, guard) {
  15453. string = toString(string);
  15454. pattern = guard ? undefined : pattern;
  15455. if (pattern === undefined) {
  15456. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15457. }
  15458. return string.match(pattern) || [];
  15459. }
  15460. /*------------------------------------------------------------------------*/
  15461. /**
  15462. * Attempts to invoke `func`, returning either the result or the caught error
  15463. * object. Any additional arguments are provided to `func` when it's invoked.
  15464. *
  15465. * @static
  15466. * @memberOf _
  15467. * @since 3.0.0
  15468. * @category Util
  15469. * @param {Function} func The function to attempt.
  15470. * @param {...*} [args] The arguments to invoke `func` with.
  15471. * @returns {*} Returns the `func` result or error object.
  15472. * @example
  15473. *
  15474. * // Avoid throwing errors for invalid selectors.
  15475. * var elements = _.attempt(function(selector) {
  15476. * return document.querySelectorAll(selector);
  15477. * }, '>_>');
  15478. *
  15479. * if (_.isError(elements)) {
  15480. * elements = [];
  15481. * }
  15482. */
  15483. var attempt = baseRest(function(func, args) {
  15484. try {
  15485. return apply(func, undefined, args);
  15486. } catch (e) {
  15487. return isError(e) ? e : new Error(e);
  15488. }
  15489. });
  15490. /**
  15491. * Binds methods of an object to the object itself, overwriting the existing
  15492. * method.
  15493. *
  15494. * **Note:** This method doesn't set the "length" property of bound functions.
  15495. *
  15496. * @static
  15497. * @since 0.1.0
  15498. * @memberOf _
  15499. * @category Util
  15500. * @param {Object} object The object to bind and assign the bound methods to.
  15501. * @param {...(string|string[])} methodNames The object method names to bind.
  15502. * @returns {Object} Returns `object`.
  15503. * @example
  15504. *
  15505. * var view = {
  15506. * 'label': 'docs',
  15507. * 'click': function() {
  15508. * console.log('clicked ' + this.label);
  15509. * }
  15510. * };
  15511. *
  15512. * _.bindAll(view, ['click']);
  15513. * jQuery(element).on('click', view.click);
  15514. * // => Logs 'clicked docs' when clicked.
  15515. */
  15516. var bindAll = flatRest(function(object, methodNames) {
  15517. arrayEach(methodNames, function(key) {
  15518. key = toKey(key);
  15519. baseAssignValue(object, key, bind(object[key], object));
  15520. });
  15521. return object;
  15522. });
  15523. /**
  15524. * Creates a function that iterates over `pairs` and invokes the corresponding
  15525. * function of the first predicate to return truthy. The predicate-function
  15526. * pairs are invoked with the `this` binding and arguments of the created
  15527. * function.
  15528. *
  15529. * @static
  15530. * @memberOf _
  15531. * @since 4.0.0
  15532. * @category Util
  15533. * @param {Array} pairs The predicate-function pairs.
  15534. * @returns {Function} Returns the new composite function.
  15535. * @example
  15536. *
  15537. * var func = _.cond([
  15538. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15539. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15540. * [_.stubTrue, _.constant('no match')]
  15541. * ]);
  15542. *
  15543. * func({ 'a': 1, 'b': 2 });
  15544. * // => 'matches A'
  15545. *
  15546. * func({ 'a': 0, 'b': 1 });
  15547. * // => 'matches B'
  15548. *
  15549. * func({ 'a': '1', 'b': '2' });
  15550. * // => 'no match'
  15551. */
  15552. function cond(pairs) {
  15553. var length = pairs == null ? 0 : pairs.length,
  15554. toIteratee = getIteratee();
  15555. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15556. if (typeof pair[1] != 'function') {
  15557. throw new TypeError(FUNC_ERROR_TEXT);
  15558. }
  15559. return [toIteratee(pair[0]), pair[1]];
  15560. });
  15561. return baseRest(function(args) {
  15562. var index = -1;
  15563. while (++index < length) {
  15564. var pair = pairs[index];
  15565. if (apply(pair[0], this, args)) {
  15566. return apply(pair[1], this, args);
  15567. }
  15568. }
  15569. });
  15570. }
  15571. /**
  15572. * Creates a function that invokes the predicate properties of `source` with
  15573. * the corresponding property values of a given object, returning `true` if
  15574. * all predicates return truthy, else `false`.
  15575. *
  15576. * **Note:** The created function is equivalent to `_.conformsTo` with
  15577. * `source` partially applied.
  15578. *
  15579. * @static
  15580. * @memberOf _
  15581. * @since 4.0.0
  15582. * @category Util
  15583. * @param {Object} source The object of property predicates to conform to.
  15584. * @returns {Function} Returns the new spec function.
  15585. * @example
  15586. *
  15587. * var objects = [
  15588. * { 'a': 2, 'b': 1 },
  15589. * { 'a': 1, 'b': 2 }
  15590. * ];
  15591. *
  15592. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15593. * // => [{ 'a': 1, 'b': 2 }]
  15594. */
  15595. function conforms(source) {
  15596. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15597. }
  15598. /**
  15599. * Creates a function that returns `value`.
  15600. *
  15601. * @static
  15602. * @memberOf _
  15603. * @since 2.4.0
  15604. * @category Util
  15605. * @param {*} value The value to return from the new function.
  15606. * @returns {Function} Returns the new constant function.
  15607. * @example
  15608. *
  15609. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15610. *
  15611. * console.log(objects);
  15612. * // => [{ 'a': 1 }, { 'a': 1 }]
  15613. *
  15614. * console.log(objects[0] === objects[1]);
  15615. * // => true
  15616. */
  15617. function constant(value) {
  15618. return function() {
  15619. return value;
  15620. };
  15621. }
  15622. /**
  15623. * Checks `value` to determine whether a default value should be returned in
  15624. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15625. * or `undefined`.
  15626. *
  15627. * @static
  15628. * @memberOf _
  15629. * @since 4.14.0
  15630. * @category Util
  15631. * @param {*} value The value to check.
  15632. * @param {*} defaultValue The default value.
  15633. * @returns {*} Returns the resolved value.
  15634. * @example
  15635. *
  15636. * _.defaultTo(1, 10);
  15637. * // => 1
  15638. *
  15639. * _.defaultTo(undefined, 10);
  15640. * // => 10
  15641. */
  15642. function defaultTo(value, defaultValue) {
  15643. return (value == null || value !== value) ? defaultValue : value;
  15644. }
  15645. /**
  15646. * Creates a function that returns the result of invoking the given functions
  15647. * with the `this` binding of the created function, where each successive
  15648. * invocation is supplied the return value of the previous.
  15649. *
  15650. * @static
  15651. * @memberOf _
  15652. * @since 3.0.0
  15653. * @category Util
  15654. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15655. * @returns {Function} Returns the new composite function.
  15656. * @see _.flowRight
  15657. * @example
  15658. *
  15659. * function square(n) {
  15660. * return n * n;
  15661. * }
  15662. *
  15663. * var addSquare = _.flow([_.add, square]);
  15664. * addSquare(1, 2);
  15665. * // => 9
  15666. */
  15667. var flow = createFlow();
  15668. /**
  15669. * This method is like `_.flow` except that it creates a function that
  15670. * invokes the given functions from right to left.
  15671. *
  15672. * @static
  15673. * @since 3.0.0
  15674. * @memberOf _
  15675. * @category Util
  15676. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15677. * @returns {Function} Returns the new composite function.
  15678. * @see _.flow
  15679. * @example
  15680. *
  15681. * function square(n) {
  15682. * return n * n;
  15683. * }
  15684. *
  15685. * var addSquare = _.flowRight([square, _.add]);
  15686. * addSquare(1, 2);
  15687. * // => 9
  15688. */
  15689. var flowRight = createFlow(true);
  15690. /**
  15691. * This method returns the first argument it receives.
  15692. *
  15693. * @static
  15694. * @since 0.1.0
  15695. * @memberOf _
  15696. * @category Util
  15697. * @param {*} value Any value.
  15698. * @returns {*} Returns `value`.
  15699. * @example
  15700. *
  15701. * var object = { 'a': 1 };
  15702. *
  15703. * console.log(_.identity(object) === object);
  15704. * // => true
  15705. */
  15706. function identity(value) {
  15707. return value;
  15708. }
  15709. /**
  15710. * Creates a function that invokes `func` with the arguments of the created
  15711. * function. If `func` is a property name, the created function returns the
  15712. * property value for a given element. If `func` is an array or object, the
  15713. * created function returns `true` for elements that contain the equivalent
  15714. * source properties, otherwise it returns `false`.
  15715. *
  15716. * @static
  15717. * @since 4.0.0
  15718. * @memberOf _
  15719. * @category Util
  15720. * @param {*} [func=_.identity] The value to convert to a callback.
  15721. * @returns {Function} Returns the callback.
  15722. * @example
  15723. *
  15724. * var users = [
  15725. * { 'user': 'barney', 'age': 36, 'active': true },
  15726. * { 'user': 'fred', 'age': 40, 'active': false }
  15727. * ];
  15728. *
  15729. * // The `_.matches` iteratee shorthand.
  15730. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15731. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15732. *
  15733. * // The `_.matchesProperty` iteratee shorthand.
  15734. * _.filter(users, _.iteratee(['user', 'fred']));
  15735. * // => [{ 'user': 'fred', 'age': 40 }]
  15736. *
  15737. * // The `_.property` iteratee shorthand.
  15738. * _.map(users, _.iteratee('user'));
  15739. * // => ['barney', 'fred']
  15740. *
  15741. * // Create custom iteratee shorthands.
  15742. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15743. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15744. * return func.test(string);
  15745. * };
  15746. * });
  15747. *
  15748. * _.filter(['abc', 'def'], /ef/);
  15749. * // => ['def']
  15750. */
  15751. function iteratee(func) {
  15752. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15753. }
  15754. /**
  15755. * Creates a function that performs a partial deep comparison between a given
  15756. * object and `source`, returning `true` if the given object has equivalent
  15757. * property values, else `false`.
  15758. *
  15759. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15760. * partially applied.
  15761. *
  15762. * Partial comparisons will match empty array and empty object `source`
  15763. * values against any array or object value, respectively. See `_.isEqual`
  15764. * for a list of supported value comparisons.
  15765. *
  15766. * **Note:** Multiple values can be checked by combining several matchers
  15767. * using `_.overSome`
  15768. *
  15769. * @static
  15770. * @memberOf _
  15771. * @since 3.0.0
  15772. * @category Util
  15773. * @param {Object} source The object of property values to match.
  15774. * @returns {Function} Returns the new spec function.
  15775. * @example
  15776. *
  15777. * var objects = [
  15778. * { 'a': 1, 'b': 2, 'c': 3 },
  15779. * { 'a': 4, 'b': 5, 'c': 6 }
  15780. * ];
  15781. *
  15782. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15783. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15784. *
  15785. * // Checking for several possible values
  15786. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15787. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15788. */
  15789. function matches(source) {
  15790. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15791. }
  15792. /**
  15793. * Creates a function that performs a partial deep comparison between the
  15794. * value at `path` of a given object to `srcValue`, returning `true` if the
  15795. * object value is equivalent, else `false`.
  15796. *
  15797. * **Note:** Partial comparisons will match empty array and empty object
  15798. * `srcValue` values against any array or object value, respectively. See
  15799. * `_.isEqual` for a list of supported value comparisons.
  15800. *
  15801. * **Note:** Multiple values can be checked by combining several matchers
  15802. * using `_.overSome`
  15803. *
  15804. * @static
  15805. * @memberOf _
  15806. * @since 3.2.0
  15807. * @category Util
  15808. * @param {Array|string} path The path of the property to get.
  15809. * @param {*} srcValue The value to match.
  15810. * @returns {Function} Returns the new spec function.
  15811. * @example
  15812. *
  15813. * var objects = [
  15814. * { 'a': 1, 'b': 2, 'c': 3 },
  15815. * { 'a': 4, 'b': 5, 'c': 6 }
  15816. * ];
  15817. *
  15818. * _.find(objects, _.matchesProperty('a', 4));
  15819. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15820. *
  15821. * // Checking for several possible values
  15822. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15823. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15824. */
  15825. function matchesProperty(path, srcValue) {
  15826. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15827. }
  15828. /**
  15829. * Creates a function that invokes the method at `path` of a given object.
  15830. * Any additional arguments are provided to the invoked method.
  15831. *
  15832. * @static
  15833. * @memberOf _
  15834. * @since 3.7.0
  15835. * @category Util
  15836. * @param {Array|string} path The path of the method to invoke.
  15837. * @param {...*} [args] The arguments to invoke the method with.
  15838. * @returns {Function} Returns the new invoker function.
  15839. * @example
  15840. *
  15841. * var objects = [
  15842. * { 'a': { 'b': _.constant(2) } },
  15843. * { 'a': { 'b': _.constant(1) } }
  15844. * ];
  15845. *
  15846. * _.map(objects, _.method('a.b'));
  15847. * // => [2, 1]
  15848. *
  15849. * _.map(objects, _.method(['a', 'b']));
  15850. * // => [2, 1]
  15851. */
  15852. var method = baseRest(function(path, args) {
  15853. return function(object) {
  15854. return baseInvoke(object, path, args);
  15855. };
  15856. });
  15857. /**
  15858. * The opposite of `_.method`; this method creates a function that invokes
  15859. * the method at a given path of `object`. Any additional arguments are
  15860. * provided to the invoked method.
  15861. *
  15862. * @static
  15863. * @memberOf _
  15864. * @since 3.7.0
  15865. * @category Util
  15866. * @param {Object} object The object to query.
  15867. * @param {...*} [args] The arguments to invoke the method with.
  15868. * @returns {Function} Returns the new invoker function.
  15869. * @example
  15870. *
  15871. * var array = _.times(3, _.constant),
  15872. * object = { 'a': array, 'b': array, 'c': array };
  15873. *
  15874. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15875. * // => [2, 0]
  15876. *
  15877. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15878. * // => [2, 0]
  15879. */
  15880. var methodOf = baseRest(function(object, args) {
  15881. return function(path) {
  15882. return baseInvoke(object, path, args);
  15883. };
  15884. });
  15885. /**
  15886. * Adds all own enumerable string keyed function properties of a source
  15887. * object to the destination object. If `object` is a function, then methods
  15888. * are added to its prototype as well.
  15889. *
  15890. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15891. * avoid conflicts caused by modifying the original.
  15892. *
  15893. * @static
  15894. * @since 0.1.0
  15895. * @memberOf _
  15896. * @category Util
  15897. * @param {Function|Object} [object=lodash] The destination object.
  15898. * @param {Object} source The object of functions to add.
  15899. * @param {Object} [options={}] The options object.
  15900. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15901. * @returns {Function|Object} Returns `object`.
  15902. * @example
  15903. *
  15904. * function vowels(string) {
  15905. * return _.filter(string, function(v) {
  15906. * return /[aeiou]/i.test(v);
  15907. * });
  15908. * }
  15909. *
  15910. * _.mixin({ 'vowels': vowels });
  15911. * _.vowels('fred');
  15912. * // => ['e']
  15913. *
  15914. * _('fred').vowels().value();
  15915. * // => ['e']
  15916. *
  15917. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15918. * _('fred').vowels();
  15919. * // => ['e']
  15920. */
  15921. function mixin(object, source, options) {
  15922. var props = keys(source),
  15923. methodNames = baseFunctions(source, props);
  15924. if (options == null &&
  15925. !(isObject(source) && (methodNames.length || !props.length))) {
  15926. options = source;
  15927. source = object;
  15928. object = this;
  15929. methodNames = baseFunctions(source, keys(source));
  15930. }
  15931. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15932. isFunc = isFunction(object);
  15933. arrayEach(methodNames, function(methodName) {
  15934. var func = source[methodName];
  15935. object[methodName] = func;
  15936. if (isFunc) {
  15937. object.prototype[methodName] = function() {
  15938. var chainAll = this.__chain__;
  15939. if (chain || chainAll) {
  15940. var result = object(this.__wrapped__),
  15941. actions = result.__actions__ = copyArray(this.__actions__);
  15942. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15943. result.__chain__ = chainAll;
  15944. return result;
  15945. }
  15946. return func.apply(object, arrayPush([this.value()], arguments));
  15947. };
  15948. }
  15949. });
  15950. return object;
  15951. }
  15952. /**
  15953. * Reverts the `_` variable to its previous value and returns a reference to
  15954. * the `lodash` function.
  15955. *
  15956. * @static
  15957. * @since 0.1.0
  15958. * @memberOf _
  15959. * @category Util
  15960. * @returns {Function} Returns the `lodash` function.
  15961. * @example
  15962. *
  15963. * var lodash = _.noConflict();
  15964. */
  15965. function noConflict() {
  15966. if (root._ === this) {
  15967. root._ = oldDash;
  15968. }
  15969. return this;
  15970. }
  15971. /**
  15972. * This method returns `undefined`.
  15973. *
  15974. * @static
  15975. * @memberOf _
  15976. * @since 2.3.0
  15977. * @category Util
  15978. * @example
  15979. *
  15980. * _.times(2, _.noop);
  15981. * // => [undefined, undefined]
  15982. */
  15983. function noop() {
  15984. // No operation performed.
  15985. }
  15986. /**
  15987. * Creates a function that gets the argument at index `n`. If `n` is negative,
  15988. * the nth argument from the end is returned.
  15989. *
  15990. * @static
  15991. * @memberOf _
  15992. * @since 4.0.0
  15993. * @category Util
  15994. * @param {number} [n=0] The index of the argument to return.
  15995. * @returns {Function} Returns the new pass-thru function.
  15996. * @example
  15997. *
  15998. * var func = _.nthArg(1);
  15999. * func('a', 'b', 'c', 'd');
  16000. * // => 'b'
  16001. *
  16002. * var func = _.nthArg(-2);
  16003. * func('a', 'b', 'c', 'd');
  16004. * // => 'c'
  16005. */
  16006. function nthArg(n) {
  16007. n = toInteger(n);
  16008. return baseRest(function(args) {
  16009. return baseNth(args, n);
  16010. });
  16011. }
  16012. /**
  16013. * Creates a function that invokes `iteratees` with the arguments it receives
  16014. * and returns their results.
  16015. *
  16016. * @static
  16017. * @memberOf _
  16018. * @since 4.0.0
  16019. * @category Util
  16020. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16021. * The iteratees to invoke.
  16022. * @returns {Function} Returns the new function.
  16023. * @example
  16024. *
  16025. * var func = _.over([Math.max, Math.min]);
  16026. *
  16027. * func(1, 2, 3, 4);
  16028. * // => [4, 1]
  16029. */
  16030. var over = createOver(arrayMap);
  16031. /**
  16032. * Creates a function that checks if **all** of the `predicates` return
  16033. * truthy when invoked with the arguments it receives.
  16034. *
  16035. * Following shorthands are possible for providing predicates.
  16036. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16037. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16038. *
  16039. * @static
  16040. * @memberOf _
  16041. * @since 4.0.0
  16042. * @category Util
  16043. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16044. * The predicates to check.
  16045. * @returns {Function} Returns the new function.
  16046. * @example
  16047. *
  16048. * var func = _.overEvery([Boolean, isFinite]);
  16049. *
  16050. * func('1');
  16051. * // => true
  16052. *
  16053. * func(null);
  16054. * // => false
  16055. *
  16056. * func(NaN);
  16057. * // => false
  16058. */
  16059. var overEvery = createOver(arrayEvery);
  16060. /**
  16061. * Creates a function that checks if **any** of the `predicates` return
  16062. * truthy when invoked with the arguments it receives.
  16063. *
  16064. * Following shorthands are possible for providing predicates.
  16065. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16066. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16067. *
  16068. * @static
  16069. * @memberOf _
  16070. * @since 4.0.0
  16071. * @category Util
  16072. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16073. * The predicates to check.
  16074. * @returns {Function} Returns the new function.
  16075. * @example
  16076. *
  16077. * var func = _.overSome([Boolean, isFinite]);
  16078. *
  16079. * func('1');
  16080. * // => true
  16081. *
  16082. * func(null);
  16083. * // => true
  16084. *
  16085. * func(NaN);
  16086. * // => false
  16087. *
  16088. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16089. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16090. */
  16091. var overSome = createOver(arraySome);
  16092. /**
  16093. * Creates a function that returns the value at `path` of a given object.
  16094. *
  16095. * @static
  16096. * @memberOf _
  16097. * @since 2.4.0
  16098. * @category Util
  16099. * @param {Array|string} path The path of the property to get.
  16100. * @returns {Function} Returns the new accessor function.
  16101. * @example
  16102. *
  16103. * var objects = [
  16104. * { 'a': { 'b': 2 } },
  16105. * { 'a': { 'b': 1 } }
  16106. * ];
  16107. *
  16108. * _.map(objects, _.property('a.b'));
  16109. * // => [2, 1]
  16110. *
  16111. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16112. * // => [1, 2]
  16113. */
  16114. function property(path) {
  16115. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16116. }
  16117. /**
  16118. * The opposite of `_.property`; this method creates a function that returns
  16119. * the value at a given path of `object`.
  16120. *
  16121. * @static
  16122. * @memberOf _
  16123. * @since 3.0.0
  16124. * @category Util
  16125. * @param {Object} object The object to query.
  16126. * @returns {Function} Returns the new accessor function.
  16127. * @example
  16128. *
  16129. * var array = [0, 1, 2],
  16130. * object = { 'a': array, 'b': array, 'c': array };
  16131. *
  16132. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16133. * // => [2, 0]
  16134. *
  16135. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16136. * // => [2, 0]
  16137. */
  16138. function propertyOf(object) {
  16139. return function(path) {
  16140. return object == null ? undefined : baseGet(object, path);
  16141. };
  16142. }
  16143. /**
  16144. * Creates an array of numbers (positive and/or negative) progressing from
  16145. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16146. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16147. * it's set to `start` with `start` then set to `0`.
  16148. *
  16149. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16150. * floating-point values which can produce unexpected results.
  16151. *
  16152. * @static
  16153. * @since 0.1.0
  16154. * @memberOf _
  16155. * @category Util
  16156. * @param {number} [start=0] The start of the range.
  16157. * @param {number} end The end of the range.
  16158. * @param {number} [step=1] The value to increment or decrement by.
  16159. * @returns {Array} Returns the range of numbers.
  16160. * @see _.inRange, _.rangeRight
  16161. * @example
  16162. *
  16163. * _.range(4);
  16164. * // => [0, 1, 2, 3]
  16165. *
  16166. * _.range(-4);
  16167. * // => [0, -1, -2, -3]
  16168. *
  16169. * _.range(1, 5);
  16170. * // => [1, 2, 3, 4]
  16171. *
  16172. * _.range(0, 20, 5);
  16173. * // => [0, 5, 10, 15]
  16174. *
  16175. * _.range(0, -4, -1);
  16176. * // => [0, -1, -2, -3]
  16177. *
  16178. * _.range(1, 4, 0);
  16179. * // => [1, 1, 1]
  16180. *
  16181. * _.range(0);
  16182. * // => []
  16183. */
  16184. var range = createRange();
  16185. /**
  16186. * This method is like `_.range` except that it populates values in
  16187. * descending order.
  16188. *
  16189. * @static
  16190. * @memberOf _
  16191. * @since 4.0.0
  16192. * @category Util
  16193. * @param {number} [start=0] The start of the range.
  16194. * @param {number} end The end of the range.
  16195. * @param {number} [step=1] The value to increment or decrement by.
  16196. * @returns {Array} Returns the range of numbers.
  16197. * @see _.inRange, _.range
  16198. * @example
  16199. *
  16200. * _.rangeRight(4);
  16201. * // => [3, 2, 1, 0]
  16202. *
  16203. * _.rangeRight(-4);
  16204. * // => [-3, -2, -1, 0]
  16205. *
  16206. * _.rangeRight(1, 5);
  16207. * // => [4, 3, 2, 1]
  16208. *
  16209. * _.rangeRight(0, 20, 5);
  16210. * // => [15, 10, 5, 0]
  16211. *
  16212. * _.rangeRight(0, -4, -1);
  16213. * // => [-3, -2, -1, 0]
  16214. *
  16215. * _.rangeRight(1, 4, 0);
  16216. * // => [1, 1, 1]
  16217. *
  16218. * _.rangeRight(0);
  16219. * // => []
  16220. */
  16221. var rangeRight = createRange(true);
  16222. /**
  16223. * This method returns a new empty array.
  16224. *
  16225. * @static
  16226. * @memberOf _
  16227. * @since 4.13.0
  16228. * @category Util
  16229. * @returns {Array} Returns the new empty array.
  16230. * @example
  16231. *
  16232. * var arrays = _.times(2, _.stubArray);
  16233. *
  16234. * console.log(arrays);
  16235. * // => [[], []]
  16236. *
  16237. * console.log(arrays[0] === arrays[1]);
  16238. * // => false
  16239. */
  16240. function stubArray() {
  16241. return [];
  16242. }
  16243. /**
  16244. * This method returns `false`.
  16245. *
  16246. * @static
  16247. * @memberOf _
  16248. * @since 4.13.0
  16249. * @category Util
  16250. * @returns {boolean} Returns `false`.
  16251. * @example
  16252. *
  16253. * _.times(2, _.stubFalse);
  16254. * // => [false, false]
  16255. */
  16256. function stubFalse() {
  16257. return false;
  16258. }
  16259. /**
  16260. * This method returns a new empty object.
  16261. *
  16262. * @static
  16263. * @memberOf _
  16264. * @since 4.13.0
  16265. * @category Util
  16266. * @returns {Object} Returns the new empty object.
  16267. * @example
  16268. *
  16269. * var objects = _.times(2, _.stubObject);
  16270. *
  16271. * console.log(objects);
  16272. * // => [{}, {}]
  16273. *
  16274. * console.log(objects[0] === objects[1]);
  16275. * // => false
  16276. */
  16277. function stubObject() {
  16278. return {};
  16279. }
  16280. /**
  16281. * This method returns an empty string.
  16282. *
  16283. * @static
  16284. * @memberOf _
  16285. * @since 4.13.0
  16286. * @category Util
  16287. * @returns {string} Returns the empty string.
  16288. * @example
  16289. *
  16290. * _.times(2, _.stubString);
  16291. * // => ['', '']
  16292. */
  16293. function stubString() {
  16294. return '';
  16295. }
  16296. /**
  16297. * This method returns `true`.
  16298. *
  16299. * @static
  16300. * @memberOf _
  16301. * @since 4.13.0
  16302. * @category Util
  16303. * @returns {boolean} Returns `true`.
  16304. * @example
  16305. *
  16306. * _.times(2, _.stubTrue);
  16307. * // => [true, true]
  16308. */
  16309. function stubTrue() {
  16310. return true;
  16311. }
  16312. /**
  16313. * Invokes the iteratee `n` times, returning an array of the results of
  16314. * each invocation. The iteratee is invoked with one argument; (index).
  16315. *
  16316. * @static
  16317. * @since 0.1.0
  16318. * @memberOf _
  16319. * @category Util
  16320. * @param {number} n The number of times to invoke `iteratee`.
  16321. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16322. * @returns {Array} Returns the array of results.
  16323. * @example
  16324. *
  16325. * _.times(3, String);
  16326. * // => ['0', '1', '2']
  16327. *
  16328. * _.times(4, _.constant(0));
  16329. * // => [0, 0, 0, 0]
  16330. */
  16331. function times(n, iteratee) {
  16332. n = toInteger(n);
  16333. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16334. return [];
  16335. }
  16336. var index = MAX_ARRAY_LENGTH,
  16337. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16338. iteratee = getIteratee(iteratee);
  16339. n -= MAX_ARRAY_LENGTH;
  16340. var result = baseTimes(length, iteratee);
  16341. while (++index < n) {
  16342. iteratee(index);
  16343. }
  16344. return result;
  16345. }
  16346. /**
  16347. * Converts `value` to a property path array.
  16348. *
  16349. * @static
  16350. * @memberOf _
  16351. * @since 4.0.0
  16352. * @category Util
  16353. * @param {*} value The value to convert.
  16354. * @returns {Array} Returns the new property path array.
  16355. * @example
  16356. *
  16357. * _.toPath('a.b.c');
  16358. * // => ['a', 'b', 'c']
  16359. *
  16360. * _.toPath('a[0].b.c');
  16361. * // => ['a', '0', 'b', 'c']
  16362. */
  16363. function toPath(value) {
  16364. if (isArray(value)) {
  16365. return arrayMap(value, toKey);
  16366. }
  16367. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16368. }
  16369. /**
  16370. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16371. *
  16372. * @static
  16373. * @since 0.1.0
  16374. * @memberOf _
  16375. * @category Util
  16376. * @param {string} [prefix=''] The value to prefix the ID with.
  16377. * @returns {string} Returns the unique ID.
  16378. * @example
  16379. *
  16380. * _.uniqueId('contact_');
  16381. * // => 'contact_104'
  16382. *
  16383. * _.uniqueId();
  16384. * // => '105'
  16385. */
  16386. function uniqueId(prefix) {
  16387. var id = ++idCounter;
  16388. return toString(prefix) + id;
  16389. }
  16390. /*------------------------------------------------------------------------*/
  16391. /**
  16392. * Adds two numbers.
  16393. *
  16394. * @static
  16395. * @memberOf _
  16396. * @since 3.4.0
  16397. * @category Math
  16398. * @param {number} augend The first number in an addition.
  16399. * @param {number} addend The second number in an addition.
  16400. * @returns {number} Returns the total.
  16401. * @example
  16402. *
  16403. * _.add(6, 4);
  16404. * // => 10
  16405. */
  16406. var add = createMathOperation(function(augend, addend) {
  16407. return augend + addend;
  16408. }, 0);
  16409. /**
  16410. * Computes `number` rounded up to `precision`.
  16411. *
  16412. * @static
  16413. * @memberOf _
  16414. * @since 3.10.0
  16415. * @category Math
  16416. * @param {number} number The number to round up.
  16417. * @param {number} [precision=0] The precision to round up to.
  16418. * @returns {number} Returns the rounded up number.
  16419. * @example
  16420. *
  16421. * _.ceil(4.006);
  16422. * // => 5
  16423. *
  16424. * _.ceil(6.004, 2);
  16425. * // => 6.01
  16426. *
  16427. * _.ceil(6040, -2);
  16428. * // => 6100
  16429. */
  16430. var ceil = createRound('ceil');
  16431. /**
  16432. * Divide two numbers.
  16433. *
  16434. * @static
  16435. * @memberOf _
  16436. * @since 4.7.0
  16437. * @category Math
  16438. * @param {number} dividend The first number in a division.
  16439. * @param {number} divisor The second number in a division.
  16440. * @returns {number} Returns the quotient.
  16441. * @example
  16442. *
  16443. * _.divide(6, 4);
  16444. * // => 1.5
  16445. */
  16446. var divide = createMathOperation(function(dividend, divisor) {
  16447. return dividend / divisor;
  16448. }, 1);
  16449. /**
  16450. * Computes `number` rounded down to `precision`.
  16451. *
  16452. * @static
  16453. * @memberOf _
  16454. * @since 3.10.0
  16455. * @category Math
  16456. * @param {number} number The number to round down.
  16457. * @param {number} [precision=0] The precision to round down to.
  16458. * @returns {number} Returns the rounded down number.
  16459. * @example
  16460. *
  16461. * _.floor(4.006);
  16462. * // => 4
  16463. *
  16464. * _.floor(0.046, 2);
  16465. * // => 0.04
  16466. *
  16467. * _.floor(4060, -2);
  16468. * // => 4000
  16469. */
  16470. var floor = createRound('floor');
  16471. /**
  16472. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16473. * `undefined` is returned.
  16474. *
  16475. * @static
  16476. * @since 0.1.0
  16477. * @memberOf _
  16478. * @category Math
  16479. * @param {Array} array The array to iterate over.
  16480. * @returns {*} Returns the maximum value.
  16481. * @example
  16482. *
  16483. * _.max([4, 2, 8, 6]);
  16484. * // => 8
  16485. *
  16486. * _.max([]);
  16487. * // => undefined
  16488. */
  16489. function max(array) {
  16490. return (array && array.length)
  16491. ? baseExtremum(array, identity, baseGt)
  16492. : undefined;
  16493. }
  16494. /**
  16495. * This method is like `_.max` except that it accepts `iteratee` which is
  16496. * invoked for each element in `array` to generate the criterion by which
  16497. * the value is ranked. The iteratee is invoked with one argument: (value).
  16498. *
  16499. * @static
  16500. * @memberOf _
  16501. * @since 4.0.0
  16502. * @category Math
  16503. * @param {Array} array The array to iterate over.
  16504. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16505. * @returns {*} Returns the maximum value.
  16506. * @example
  16507. *
  16508. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16509. *
  16510. * _.maxBy(objects, function(o) { return o.n; });
  16511. * // => { 'n': 2 }
  16512. *
  16513. * // The `_.property` iteratee shorthand.
  16514. * _.maxBy(objects, 'n');
  16515. * // => { 'n': 2 }
  16516. */
  16517. function maxBy(array, iteratee) {
  16518. return (array && array.length)
  16519. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16520. : undefined;
  16521. }
  16522. /**
  16523. * Computes the mean of the values in `array`.
  16524. *
  16525. * @static
  16526. * @memberOf _
  16527. * @since 4.0.0
  16528. * @category Math
  16529. * @param {Array} array The array to iterate over.
  16530. * @returns {number} Returns the mean.
  16531. * @example
  16532. *
  16533. * _.mean([4, 2, 8, 6]);
  16534. * // => 5
  16535. */
  16536. function mean(array) {
  16537. return baseMean(array, identity);
  16538. }
  16539. /**
  16540. * This method is like `_.mean` except that it accepts `iteratee` which is
  16541. * invoked for each element in `array` to generate the value to be averaged.
  16542. * The iteratee is invoked with one argument: (value).
  16543. *
  16544. * @static
  16545. * @memberOf _
  16546. * @since 4.7.0
  16547. * @category Math
  16548. * @param {Array} array The array to iterate over.
  16549. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16550. * @returns {number} Returns the mean.
  16551. * @example
  16552. *
  16553. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16554. *
  16555. * _.meanBy(objects, function(o) { return o.n; });
  16556. * // => 5
  16557. *
  16558. * // The `_.property` iteratee shorthand.
  16559. * _.meanBy(objects, 'n');
  16560. * // => 5
  16561. */
  16562. function meanBy(array, iteratee) {
  16563. return baseMean(array, getIteratee(iteratee, 2));
  16564. }
  16565. /**
  16566. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16567. * `undefined` is returned.
  16568. *
  16569. * @static
  16570. * @since 0.1.0
  16571. * @memberOf _
  16572. * @category Math
  16573. * @param {Array} array The array to iterate over.
  16574. * @returns {*} Returns the minimum value.
  16575. * @example
  16576. *
  16577. * _.min([4, 2, 8, 6]);
  16578. * // => 2
  16579. *
  16580. * _.min([]);
  16581. * // => undefined
  16582. */
  16583. function min(array) {
  16584. return (array && array.length)
  16585. ? baseExtremum(array, identity, baseLt)
  16586. : undefined;
  16587. }
  16588. /**
  16589. * This method is like `_.min` except that it accepts `iteratee` which is
  16590. * invoked for each element in `array` to generate the criterion by which
  16591. * the value is ranked. The iteratee is invoked with one argument: (value).
  16592. *
  16593. * @static
  16594. * @memberOf _
  16595. * @since 4.0.0
  16596. * @category Math
  16597. * @param {Array} array The array to iterate over.
  16598. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16599. * @returns {*} Returns the minimum value.
  16600. * @example
  16601. *
  16602. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16603. *
  16604. * _.minBy(objects, function(o) { return o.n; });
  16605. * // => { 'n': 1 }
  16606. *
  16607. * // The `_.property` iteratee shorthand.
  16608. * _.minBy(objects, 'n');
  16609. * // => { 'n': 1 }
  16610. */
  16611. function minBy(array, iteratee) {
  16612. return (array && array.length)
  16613. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16614. : undefined;
  16615. }
  16616. /**
  16617. * Multiply two numbers.
  16618. *
  16619. * @static
  16620. * @memberOf _
  16621. * @since 4.7.0
  16622. * @category Math
  16623. * @param {number} multiplier The first number in a multiplication.
  16624. * @param {number} multiplicand The second number in a multiplication.
  16625. * @returns {number} Returns the product.
  16626. * @example
  16627. *
  16628. * _.multiply(6, 4);
  16629. * // => 24
  16630. */
  16631. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16632. return multiplier * multiplicand;
  16633. }, 1);
  16634. /**
  16635. * Computes `number` rounded to `precision`.
  16636. *
  16637. * @static
  16638. * @memberOf _
  16639. * @since 3.10.0
  16640. * @category Math
  16641. * @param {number} number The number to round.
  16642. * @param {number} [precision=0] The precision to round to.
  16643. * @returns {number} Returns the rounded number.
  16644. * @example
  16645. *
  16646. * _.round(4.006);
  16647. * // => 4
  16648. *
  16649. * _.round(4.006, 2);
  16650. * // => 4.01
  16651. *
  16652. * _.round(4060, -2);
  16653. * // => 4100
  16654. */
  16655. var round = createRound('round');
  16656. /**
  16657. * Subtract two numbers.
  16658. *
  16659. * @static
  16660. * @memberOf _
  16661. * @since 4.0.0
  16662. * @category Math
  16663. * @param {number} minuend The first number in a subtraction.
  16664. * @param {number} subtrahend The second number in a subtraction.
  16665. * @returns {number} Returns the difference.
  16666. * @example
  16667. *
  16668. * _.subtract(6, 4);
  16669. * // => 2
  16670. */
  16671. var subtract = createMathOperation(function(minuend, subtrahend) {
  16672. return minuend - subtrahend;
  16673. }, 0);
  16674. /**
  16675. * Computes the sum of the values in `array`.
  16676. *
  16677. * @static
  16678. * @memberOf _
  16679. * @since 3.4.0
  16680. * @category Math
  16681. * @param {Array} array The array to iterate over.
  16682. * @returns {number} Returns the sum.
  16683. * @example
  16684. *
  16685. * _.sum([4, 2, 8, 6]);
  16686. * // => 20
  16687. */
  16688. function sum(array) {
  16689. return (array && array.length)
  16690. ? baseSum(array, identity)
  16691. : 0;
  16692. }
  16693. /**
  16694. * This method is like `_.sum` except that it accepts `iteratee` which is
  16695. * invoked for each element in `array` to generate the value to be summed.
  16696. * The iteratee is invoked with one argument: (value).
  16697. *
  16698. * @static
  16699. * @memberOf _
  16700. * @since 4.0.0
  16701. * @category Math
  16702. * @param {Array} array The array to iterate over.
  16703. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16704. * @returns {number} Returns the sum.
  16705. * @example
  16706. *
  16707. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16708. *
  16709. * _.sumBy(objects, function(o) { return o.n; });
  16710. * // => 20
  16711. *
  16712. * // The `_.property` iteratee shorthand.
  16713. * _.sumBy(objects, 'n');
  16714. * // => 20
  16715. */
  16716. function sumBy(array, iteratee) {
  16717. return (array && array.length)
  16718. ? baseSum(array, getIteratee(iteratee, 2))
  16719. : 0;
  16720. }
  16721. /*------------------------------------------------------------------------*/
  16722. // Add methods that return wrapped values in chain sequences.
  16723. lodash.after = after;
  16724. lodash.ary = ary;
  16725. lodash.assign = assign;
  16726. lodash.assignIn = assignIn;
  16727. lodash.assignInWith = assignInWith;
  16728. lodash.assignWith = assignWith;
  16729. lodash.at = at;
  16730. lodash.before = before;
  16731. lodash.bind = bind;
  16732. lodash.bindAll = bindAll;
  16733. lodash.bindKey = bindKey;
  16734. lodash.castArray = castArray;
  16735. lodash.chain = chain;
  16736. lodash.chunk = chunk;
  16737. lodash.compact = compact;
  16738. lodash.concat = concat;
  16739. lodash.cond = cond;
  16740. lodash.conforms = conforms;
  16741. lodash.constant = constant;
  16742. lodash.countBy = countBy;
  16743. lodash.create = create;
  16744. lodash.curry = curry;
  16745. lodash.curryRight = curryRight;
  16746. lodash.debounce = debounce;
  16747. lodash.defaults = defaults;
  16748. lodash.defaultsDeep = defaultsDeep;
  16749. lodash.defer = defer;
  16750. lodash.delay = delay;
  16751. lodash.difference = difference;
  16752. lodash.differenceBy = differenceBy;
  16753. lodash.differenceWith = differenceWith;
  16754. lodash.drop = drop;
  16755. lodash.dropRight = dropRight;
  16756. lodash.dropRightWhile = dropRightWhile;
  16757. lodash.dropWhile = dropWhile;
  16758. lodash.fill = fill;
  16759. lodash.filter = filter;
  16760. lodash.flatMap = flatMap;
  16761. lodash.flatMapDeep = flatMapDeep;
  16762. lodash.flatMapDepth = flatMapDepth;
  16763. lodash.flatten = flatten;
  16764. lodash.flattenDeep = flattenDeep;
  16765. lodash.flattenDepth = flattenDepth;
  16766. lodash.flip = flip;
  16767. lodash.flow = flow;
  16768. lodash.flowRight = flowRight;
  16769. lodash.fromPairs = fromPairs;
  16770. lodash.functions = functions;
  16771. lodash.functionsIn = functionsIn;
  16772. lodash.groupBy = groupBy;
  16773. lodash.initial = initial;
  16774. lodash.intersection = intersection;
  16775. lodash.intersectionBy = intersectionBy;
  16776. lodash.intersectionWith = intersectionWith;
  16777. lodash.invert = invert;
  16778. lodash.invertBy = invertBy;
  16779. lodash.invokeMap = invokeMap;
  16780. lodash.iteratee = iteratee;
  16781. lodash.keyBy = keyBy;
  16782. lodash.keys = keys;
  16783. lodash.keysIn = keysIn;
  16784. lodash.map = map;
  16785. lodash.mapKeys = mapKeys;
  16786. lodash.mapValues = mapValues;
  16787. lodash.matches = matches;
  16788. lodash.matchesProperty = matchesProperty;
  16789. lodash.memoize = memoize;
  16790. lodash.merge = merge;
  16791. lodash.mergeWith = mergeWith;
  16792. lodash.method = method;
  16793. lodash.methodOf = methodOf;
  16794. lodash.mixin = mixin;
  16795. lodash.negate = negate;
  16796. lodash.nthArg = nthArg;
  16797. lodash.omit = omit;
  16798. lodash.omitBy = omitBy;
  16799. lodash.once = once;
  16800. lodash.orderBy = orderBy;
  16801. lodash.over = over;
  16802. lodash.overArgs = overArgs;
  16803. lodash.overEvery = overEvery;
  16804. lodash.overSome = overSome;
  16805. lodash.partial = partial;
  16806. lodash.partialRight = partialRight;
  16807. lodash.partition = partition;
  16808. lodash.pick = pick;
  16809. lodash.pickBy = pickBy;
  16810. lodash.property = property;
  16811. lodash.propertyOf = propertyOf;
  16812. lodash.pull = pull;
  16813. lodash.pullAll = pullAll;
  16814. lodash.pullAllBy = pullAllBy;
  16815. lodash.pullAllWith = pullAllWith;
  16816. lodash.pullAt = pullAt;
  16817. lodash.range = range;
  16818. lodash.rangeRight = rangeRight;
  16819. lodash.rearg = rearg;
  16820. lodash.reject = reject;
  16821. lodash.remove = remove;
  16822. lodash.rest = rest;
  16823. lodash.reverse = reverse;
  16824. lodash.sampleSize = sampleSize;
  16825. lodash.set = set;
  16826. lodash.setWith = setWith;
  16827. lodash.shuffle = shuffle;
  16828. lodash.slice = slice;
  16829. lodash.sortBy = sortBy;
  16830. lodash.sortedUniq = sortedUniq;
  16831. lodash.sortedUniqBy = sortedUniqBy;
  16832. lodash.split = split;
  16833. lodash.spread = spread;
  16834. lodash.tail = tail;
  16835. lodash.take = take;
  16836. lodash.takeRight = takeRight;
  16837. lodash.takeRightWhile = takeRightWhile;
  16838. lodash.takeWhile = takeWhile;
  16839. lodash.tap = tap;
  16840. lodash.throttle = throttle;
  16841. lodash.thru = thru;
  16842. lodash.toArray = toArray;
  16843. lodash.toPairs = toPairs;
  16844. lodash.toPairsIn = toPairsIn;
  16845. lodash.toPath = toPath;
  16846. lodash.toPlainObject = toPlainObject;
  16847. lodash.transform = transform;
  16848. lodash.unary = unary;
  16849. lodash.union = union;
  16850. lodash.unionBy = unionBy;
  16851. lodash.unionWith = unionWith;
  16852. lodash.uniq = uniq;
  16853. lodash.uniqBy = uniqBy;
  16854. lodash.uniqWith = uniqWith;
  16855. lodash.unset = unset;
  16856. lodash.unzip = unzip;
  16857. lodash.unzipWith = unzipWith;
  16858. lodash.update = update;
  16859. lodash.updateWith = updateWith;
  16860. lodash.values = values;
  16861. lodash.valuesIn = valuesIn;
  16862. lodash.without = without;
  16863. lodash.words = words;
  16864. lodash.wrap = wrap;
  16865. lodash.xor = xor;
  16866. lodash.xorBy = xorBy;
  16867. lodash.xorWith = xorWith;
  16868. lodash.zip = zip;
  16869. lodash.zipObject = zipObject;
  16870. lodash.zipObjectDeep = zipObjectDeep;
  16871. lodash.zipWith = zipWith;
  16872. // Add aliases.
  16873. lodash.entries = toPairs;
  16874. lodash.entriesIn = toPairsIn;
  16875. lodash.extend = assignIn;
  16876. lodash.extendWith = assignInWith;
  16877. // Add methods to `lodash.prototype`.
  16878. mixin(lodash, lodash);
  16879. /*------------------------------------------------------------------------*/
  16880. // Add methods that return unwrapped values in chain sequences.
  16881. lodash.add = add;
  16882. lodash.attempt = attempt;
  16883. lodash.camelCase = camelCase;
  16884. lodash.capitalize = capitalize;
  16885. lodash.ceil = ceil;
  16886. lodash.clamp = clamp;
  16887. lodash.clone = clone;
  16888. lodash.cloneDeep = cloneDeep;
  16889. lodash.cloneDeepWith = cloneDeepWith;
  16890. lodash.cloneWith = cloneWith;
  16891. lodash.conformsTo = conformsTo;
  16892. lodash.deburr = deburr;
  16893. lodash.defaultTo = defaultTo;
  16894. lodash.divide = divide;
  16895. lodash.endsWith = endsWith;
  16896. lodash.eq = eq;
  16897. lodash.escape = escape;
  16898. lodash.escapeRegExp = escapeRegExp;
  16899. lodash.every = every;
  16900. lodash.find = find;
  16901. lodash.findIndex = findIndex;
  16902. lodash.findKey = findKey;
  16903. lodash.findLast = findLast;
  16904. lodash.findLastIndex = findLastIndex;
  16905. lodash.findLastKey = findLastKey;
  16906. lodash.floor = floor;
  16907. lodash.forEach = forEach;
  16908. lodash.forEachRight = forEachRight;
  16909. lodash.forIn = forIn;
  16910. lodash.forInRight = forInRight;
  16911. lodash.forOwn = forOwn;
  16912. lodash.forOwnRight = forOwnRight;
  16913. lodash.get = get;
  16914. lodash.gt = gt;
  16915. lodash.gte = gte;
  16916. lodash.has = has;
  16917. lodash.hasIn = hasIn;
  16918. lodash.head = head;
  16919. lodash.identity = identity;
  16920. lodash.includes = includes;
  16921. lodash.indexOf = indexOf;
  16922. lodash.inRange = inRange;
  16923. lodash.invoke = invoke;
  16924. lodash.isArguments = isArguments;
  16925. lodash.isArray = isArray;
  16926. lodash.isArrayBuffer = isArrayBuffer;
  16927. lodash.isArrayLike = isArrayLike;
  16928. lodash.isArrayLikeObject = isArrayLikeObject;
  16929. lodash.isBoolean = isBoolean;
  16930. lodash.isBuffer = isBuffer;
  16931. lodash.isDate = isDate;
  16932. lodash.isElement = isElement;
  16933. lodash.isEmpty = isEmpty;
  16934. lodash.isEqual = isEqual;
  16935. lodash.isEqualWith = isEqualWith;
  16936. lodash.isError = isError;
  16937. lodash.isFinite = isFinite;
  16938. lodash.isFunction = isFunction;
  16939. lodash.isInteger = isInteger;
  16940. lodash.isLength = isLength;
  16941. lodash.isMap = isMap;
  16942. lodash.isMatch = isMatch;
  16943. lodash.isMatchWith = isMatchWith;
  16944. lodash.isNaN = isNaN;
  16945. lodash.isNative = isNative;
  16946. lodash.isNil = isNil;
  16947. lodash.isNull = isNull;
  16948. lodash.isNumber = isNumber;
  16949. lodash.isObject = isObject;
  16950. lodash.isObjectLike = isObjectLike;
  16951. lodash.isPlainObject = isPlainObject;
  16952. lodash.isRegExp = isRegExp;
  16953. lodash.isSafeInteger = isSafeInteger;
  16954. lodash.isSet = isSet;
  16955. lodash.isString = isString;
  16956. lodash.isSymbol = isSymbol;
  16957. lodash.isTypedArray = isTypedArray;
  16958. lodash.isUndefined = isUndefined;
  16959. lodash.isWeakMap = isWeakMap;
  16960. lodash.isWeakSet = isWeakSet;
  16961. lodash.join = join;
  16962. lodash.kebabCase = kebabCase;
  16963. lodash.last = last;
  16964. lodash.lastIndexOf = lastIndexOf;
  16965. lodash.lowerCase = lowerCase;
  16966. lodash.lowerFirst = lowerFirst;
  16967. lodash.lt = lt;
  16968. lodash.lte = lte;
  16969. lodash.max = max;
  16970. lodash.maxBy = maxBy;
  16971. lodash.mean = mean;
  16972. lodash.meanBy = meanBy;
  16973. lodash.min = min;
  16974. lodash.minBy = minBy;
  16975. lodash.stubArray = stubArray;
  16976. lodash.stubFalse = stubFalse;
  16977. lodash.stubObject = stubObject;
  16978. lodash.stubString = stubString;
  16979. lodash.stubTrue = stubTrue;
  16980. lodash.multiply = multiply;
  16981. lodash.nth = nth;
  16982. lodash.noConflict = noConflict;
  16983. lodash.noop = noop;
  16984. lodash.now = now;
  16985. lodash.pad = pad;
  16986. lodash.padEnd = padEnd;
  16987. lodash.padStart = padStart;
  16988. lodash.parseInt = parseInt;
  16989. lodash.random = random;
  16990. lodash.reduce = reduce;
  16991. lodash.reduceRight = reduceRight;
  16992. lodash.repeat = repeat;
  16993. lodash.replace = replace;
  16994. lodash.result = result;
  16995. lodash.round = round;
  16996. lodash.runInContext = runInContext;
  16997. lodash.sample = sample;
  16998. lodash.size = size;
  16999. lodash.snakeCase = snakeCase;
  17000. lodash.some = some;
  17001. lodash.sortedIndex = sortedIndex;
  17002. lodash.sortedIndexBy = sortedIndexBy;
  17003. lodash.sortedIndexOf = sortedIndexOf;
  17004. lodash.sortedLastIndex = sortedLastIndex;
  17005. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17006. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17007. lodash.startCase = startCase;
  17008. lodash.startsWith = startsWith;
  17009. lodash.subtract = subtract;
  17010. lodash.sum = sum;
  17011. lodash.sumBy = sumBy;
  17012. lodash.template = template;
  17013. lodash.times = times;
  17014. lodash.toFinite = toFinite;
  17015. lodash.toInteger = toInteger;
  17016. lodash.toLength = toLength;
  17017. lodash.toLower = toLower;
  17018. lodash.toNumber = toNumber;
  17019. lodash.toSafeInteger = toSafeInteger;
  17020. lodash.toString = toString;
  17021. lodash.toUpper = toUpper;
  17022. lodash.trim = trim;
  17023. lodash.trimEnd = trimEnd;
  17024. lodash.trimStart = trimStart;
  17025. lodash.truncate = truncate;
  17026. lodash.unescape = unescape;
  17027. lodash.uniqueId = uniqueId;
  17028. lodash.upperCase = upperCase;
  17029. lodash.upperFirst = upperFirst;
  17030. // Add aliases.
  17031. lodash.each = forEach;
  17032. lodash.eachRight = forEachRight;
  17033. lodash.first = head;
  17034. mixin(lodash, (function() {
  17035. var source = {};
  17036. baseForOwn(lodash, function(func, methodName) {
  17037. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17038. source[methodName] = func;
  17039. }
  17040. });
  17041. return source;
  17042. }()), { 'chain': false });
  17043. /*------------------------------------------------------------------------*/
  17044. /**
  17045. * The semantic version number.
  17046. *
  17047. * @static
  17048. * @memberOf _
  17049. * @type {string}
  17050. */
  17051. lodash.VERSION = VERSION;
  17052. // Assign default placeholders.
  17053. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17054. lodash[methodName].placeholder = lodash;
  17055. });
  17056. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17057. arrayEach(['drop', 'take'], function(methodName, index) {
  17058. LazyWrapper.prototype[methodName] = function(n) {
  17059. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17060. var result = (this.__filtered__ && !index)
  17061. ? new LazyWrapper(this)
  17062. : this.clone();
  17063. if (result.__filtered__) {
  17064. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17065. } else {
  17066. result.__views__.push({
  17067. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17068. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17069. });
  17070. }
  17071. return result;
  17072. };
  17073. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17074. return this.reverse()[methodName](n).reverse();
  17075. };
  17076. });
  17077. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17078. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17079. var type = index + 1,
  17080. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17081. LazyWrapper.prototype[methodName] = function(iteratee) {
  17082. var result = this.clone();
  17083. result.__iteratees__.push({
  17084. 'iteratee': getIteratee(iteratee, 3),
  17085. 'type': type
  17086. });
  17087. result.__filtered__ = result.__filtered__ || isFilter;
  17088. return result;
  17089. };
  17090. });
  17091. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17092. arrayEach(['head', 'last'], function(methodName, index) {
  17093. var takeName = 'take' + (index ? 'Right' : '');
  17094. LazyWrapper.prototype[methodName] = function() {
  17095. return this[takeName](1).value()[0];
  17096. };
  17097. });
  17098. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17099. arrayEach(['initial', 'tail'], function(methodName, index) {
  17100. var dropName = 'drop' + (index ? '' : 'Right');
  17101. LazyWrapper.prototype[methodName] = function() {
  17102. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17103. };
  17104. });
  17105. LazyWrapper.prototype.compact = function() {
  17106. return this.filter(identity);
  17107. };
  17108. LazyWrapper.prototype.find = function(predicate) {
  17109. return this.filter(predicate).head();
  17110. };
  17111. LazyWrapper.prototype.findLast = function(predicate) {
  17112. return this.reverse().find(predicate);
  17113. };
  17114. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17115. if (typeof path == 'function') {
  17116. return new LazyWrapper(this);
  17117. }
  17118. return this.map(function(value) {
  17119. return baseInvoke(value, path, args);
  17120. });
  17121. });
  17122. LazyWrapper.prototype.reject = function(predicate) {
  17123. return this.filter(negate(getIteratee(predicate)));
  17124. };
  17125. LazyWrapper.prototype.slice = function(start, end) {
  17126. start = toInteger(start);
  17127. var result = this;
  17128. if (result.__filtered__ && (start > 0 || end < 0)) {
  17129. return new LazyWrapper(result);
  17130. }
  17131. if (start < 0) {
  17132. result = result.takeRight(-start);
  17133. } else if (start) {
  17134. result = result.drop(start);
  17135. }
  17136. if (end !== undefined) {
  17137. end = toInteger(end);
  17138. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17139. }
  17140. return result;
  17141. };
  17142. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17143. return this.reverse().takeWhile(predicate).reverse();
  17144. };
  17145. LazyWrapper.prototype.toArray = function() {
  17146. return this.take(MAX_ARRAY_LENGTH);
  17147. };
  17148. // Add `LazyWrapper` methods to `lodash.prototype`.
  17149. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17150. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17151. isTaker = /^(?:head|last)$/.test(methodName),
  17152. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17153. retUnwrapped = isTaker || /^find/.test(methodName);
  17154. if (!lodashFunc) {
  17155. return;
  17156. }
  17157. lodash.prototype[methodName] = function() {
  17158. var value = this.__wrapped__,
  17159. args = isTaker ? [1] : arguments,
  17160. isLazy = value instanceof LazyWrapper,
  17161. iteratee = args[0],
  17162. useLazy = isLazy || isArray(value);
  17163. var interceptor = function(value) {
  17164. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17165. return (isTaker && chainAll) ? result[0] : result;
  17166. };
  17167. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17168. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17169. isLazy = useLazy = false;
  17170. }
  17171. var chainAll = this.__chain__,
  17172. isHybrid = !!this.__actions__.length,
  17173. isUnwrapped = retUnwrapped && !chainAll,
  17174. onlyLazy = isLazy && !isHybrid;
  17175. if (!retUnwrapped && useLazy) {
  17176. value = onlyLazy ? value : new LazyWrapper(this);
  17177. var result = func.apply(value, args);
  17178. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17179. return new LodashWrapper(result, chainAll);
  17180. }
  17181. if (isUnwrapped && onlyLazy) {
  17182. return func.apply(this, args);
  17183. }
  17184. result = this.thru(interceptor);
  17185. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17186. };
  17187. });
  17188. // Add `Array` methods to `lodash.prototype`.
  17189. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17190. var func = arrayProto[methodName],
  17191. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17192. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17193. lodash.prototype[methodName] = function() {
  17194. var args = arguments;
  17195. if (retUnwrapped && !this.__chain__) {
  17196. var value = this.value();
  17197. return func.apply(isArray(value) ? value : [], args);
  17198. }
  17199. return this[chainName](function(value) {
  17200. return func.apply(isArray(value) ? value : [], args);
  17201. });
  17202. };
  17203. });
  17204. // Map minified method names to their real names.
  17205. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17206. var lodashFunc = lodash[methodName];
  17207. if (lodashFunc) {
  17208. var key = lodashFunc.name + '';
  17209. if (!hasOwnProperty.call(realNames, key)) {
  17210. realNames[key] = [];
  17211. }
  17212. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17213. }
  17214. });
  17215. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17216. 'name': 'wrapper',
  17217. 'func': undefined
  17218. }];
  17219. // Add methods to `LazyWrapper`.
  17220. LazyWrapper.prototype.clone = lazyClone;
  17221. LazyWrapper.prototype.reverse = lazyReverse;
  17222. LazyWrapper.prototype.value = lazyValue;
  17223. // Add chain sequence methods to the `lodash` wrapper.
  17224. lodash.prototype.at = wrapperAt;
  17225. lodash.prototype.chain = wrapperChain;
  17226. lodash.prototype.commit = wrapperCommit;
  17227. lodash.prototype.next = wrapperNext;
  17228. lodash.prototype.plant = wrapperPlant;
  17229. lodash.prototype.reverse = wrapperReverse;
  17230. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17231. // Add lazy aliases.
  17232. lodash.prototype.first = lodash.prototype.head;
  17233. if (symIterator) {
  17234. lodash.prototype[symIterator] = wrapperToIterator;
  17235. }
  17236. return lodash;
  17237. });
  17238. /*--------------------------------------------------------------------------*/
  17239. // Export lodash.
  17240. var _ = runInContext();
  17241. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17242. if (true) {
  17243. // Expose Lodash on the global object to prevent errors when Lodash is
  17244. // loaded by a script tag in the presence of an AMD loader.
  17245. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17246. // Use `_.noConflict` to remove Lodash from the global object.
  17247. root._ = _;
  17248. // Define as an anonymous module so, through path mapping, it can be
  17249. // referenced as the "underscore" module.
  17250. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17251. return _;
  17252. }).call(exports, __webpack_require__, exports, module),
  17253. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17254. }
  17255. // Check for `exports` after `define` in case a build optimizer adds it.
  17256. else {}
  17257. }.call(this));
  17258. /***/ }),
  17259. /***/ "./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":
  17260. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17261. !*** ./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 ***!
  17262. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17263. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17264. "use strict";
  17265. __webpack_require__.r(__webpack_exports__);
  17266. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17267. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17268. /* harmony export */ });
  17269. /* 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");
  17270. /* 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__);
  17271. /* 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");
  17272. var options = {};
  17273. options.insert = "head";
  17274. options.singleton = false;
  17275. 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);
  17276. /* 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 || {});
  17277. /***/ }),
  17278. /***/ "./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":
  17279. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17280. !*** ./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 ***!
  17281. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17282. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17283. "use strict";
  17284. __webpack_require__.r(__webpack_exports__);
  17285. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17286. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17287. /* harmony export */ });
  17288. /* 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");
  17289. /* 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__);
  17290. /* 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");
  17291. var options = {};
  17292. options.insert = "head";
  17293. options.singleton = false;
  17294. 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);
  17295. /* 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 || {});
  17296. /***/ }),
  17297. /***/ "./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":
  17298. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17299. !*** ./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 ***!
  17300. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17301. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17302. "use strict";
  17303. __webpack_require__.r(__webpack_exports__);
  17304. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17305. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17306. /* harmony export */ });
  17307. /* 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");
  17308. /* 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__);
  17309. /* 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");
  17310. var options = {};
  17311. options.insert = "head";
  17312. options.singleton = false;
  17313. 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);
  17314. /* 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 || {});
  17315. /***/ }),
  17316. /***/ "./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":
  17317. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17318. !*** ./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 ***!
  17319. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17320. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17321. "use strict";
  17322. __webpack_require__.r(__webpack_exports__);
  17323. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17324. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17325. /* harmony export */ });
  17326. /* 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");
  17327. /* 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__);
  17328. /* 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");
  17329. var options = {};
  17330. options.insert = "head";
  17331. options.singleton = false;
  17332. 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);
  17333. /* 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 || {});
  17334. /***/ }),
  17335. /***/ "./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":
  17336. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17337. !*** ./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 ***!
  17338. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17339. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17340. "use strict";
  17341. __webpack_require__.r(__webpack_exports__);
  17342. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17343. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17344. /* harmony export */ });
  17345. /* 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");
  17346. /* 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__);
  17347. /* 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");
  17348. var options = {};
  17349. options.insert = "head";
  17350. options.singleton = false;
  17351. 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);
  17352. /* 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 || {});
  17353. /***/ }),
  17354. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17355. /*!******************************************************!*\
  17356. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17357. \******************************************************/
  17358. /***/ ((__unused_webpack_module, exports) => {
  17359. "use strict";
  17360. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17361. // runtime helper for setting properties on components
  17362. // in a tree-shakable way
  17363. exports["default"] = (sfc, props) => {
  17364. const target = sfc.__vccOpts || sfc;
  17365. for (const [key, val] of props) {
  17366. target[key] = val;
  17367. }
  17368. return target;
  17369. };
  17370. /***/ }),
  17371. /***/ "./resources/js/components/AppButtonLink.vue":
  17372. /*!***************************************************!*\
  17373. !*** ./resources/js/components/AppButtonLink.vue ***!
  17374. \***************************************************/
  17375. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17376. "use strict";
  17377. __webpack_require__.r(__webpack_exports__);
  17378. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17379. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17380. /* harmony export */ });
  17381. /* 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");
  17382. /* 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");
  17383. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17384. ;
  17385. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17386. /* hot reload */
  17387. if (false) {}
  17388. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17389. /***/ }),
  17390. /***/ "./resources/js/components/AppFooter.vue":
  17391. /*!***********************************************!*\
  17392. !*** ./resources/js/components/AppFooter.vue ***!
  17393. \***********************************************/
  17394. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17395. "use strict";
  17396. __webpack_require__.r(__webpack_exports__);
  17397. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17398. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17399. /* harmony export */ });
  17400. /* 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");
  17401. /* 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");
  17402. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17403. const script = {}
  17404. ;
  17405. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17406. /* hot reload */
  17407. if (false) {}
  17408. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17409. /***/ }),
  17410. /***/ "./resources/js/components/AppMessage.vue":
  17411. /*!************************************************!*\
  17412. !*** ./resources/js/components/AppMessage.vue ***!
  17413. \************************************************/
  17414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17415. "use strict";
  17416. __webpack_require__.r(__webpack_exports__);
  17417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17418. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17419. /* harmony export */ });
  17420. /* 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");
  17421. /* 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");
  17422. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17423. ;
  17424. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17425. /* hot reload */
  17426. if (false) {}
  17427. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17428. /***/ }),
  17429. /***/ "./resources/js/components/AppPagination.vue":
  17430. /*!***************************************************!*\
  17431. !*** ./resources/js/components/AppPagination.vue ***!
  17432. \***************************************************/
  17433. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17434. "use strict";
  17435. __webpack_require__.r(__webpack_exports__);
  17436. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17437. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17438. /* harmony export */ });
  17439. /* 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");
  17440. /* 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");
  17441. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17442. ;
  17443. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17444. /* hot reload */
  17445. if (false) {}
  17446. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17447. /***/ }),
  17448. /***/ "./resources/js/components/AppSidebar.vue":
  17449. /*!************************************************!*\
  17450. !*** ./resources/js/components/AppSidebar.vue ***!
  17451. \************************************************/
  17452. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17453. "use strict";
  17454. __webpack_require__.r(__webpack_exports__);
  17455. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17456. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17457. /* harmony export */ });
  17458. /* 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");
  17459. /* 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");
  17460. /* 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");
  17461. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17462. ;
  17463. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17464. /* hot reload */
  17465. if (false) {}
  17466. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17467. /***/ }),
  17468. /***/ "./resources/js/components/AppSubSidebar.vue":
  17469. /*!***************************************************!*\
  17470. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17471. \***************************************************/
  17472. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17473. "use strict";
  17474. __webpack_require__.r(__webpack_exports__);
  17475. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17476. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17477. /* harmony export */ });
  17478. /* 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");
  17479. /* 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");
  17480. /* 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");
  17481. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17482. ;
  17483. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17484. /* hot reload */
  17485. if (false) {}
  17486. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17487. /***/ }),
  17488. /***/ "./resources/js/components/AppTopBar.vue":
  17489. /*!***********************************************!*\
  17490. !*** ./resources/js/components/AppTopBar.vue ***!
  17491. \***********************************************/
  17492. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17493. "use strict";
  17494. __webpack_require__.r(__webpack_exports__);
  17495. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17496. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17497. /* harmony export */ });
  17498. /* 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");
  17499. /* 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");
  17500. /* 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");
  17501. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17502. ;
  17503. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17504. /* hot reload */
  17505. if (false) {}
  17506. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17507. /***/ }),
  17508. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17509. /*!**************************************************!*\
  17510. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17511. \**************************************************/
  17512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17513. "use strict";
  17514. __webpack_require__.r(__webpack_exports__);
  17515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17516. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17517. /* harmony export */ });
  17518. /* 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");
  17519. /* 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");
  17520. /* 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");
  17521. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17522. ;
  17523. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17524. /* hot reload */
  17525. if (false) {}
  17526. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17527. /***/ }),
  17528. /***/ "./resources/js/pages/user/Index.vue":
  17529. /*!*******************************************!*\
  17530. !*** ./resources/js/pages/user/Index.vue ***!
  17531. \*******************************************/
  17532. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17533. "use strict";
  17534. __webpack_require__.r(__webpack_exports__);
  17535. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17536. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17537. /* harmony export */ });
  17538. /* 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");
  17539. /* 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");
  17540. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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");
  17541. ;
  17542. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_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"]])
  17543. /* hot reload */
  17544. if (false) {}
  17545. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17546. /***/ }),
  17547. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17548. /*!**************************************************************************************!*\
  17549. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17550. \**************************************************************************************/
  17551. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17552. "use strict";
  17553. __webpack_require__.r(__webpack_exports__);
  17554. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17555. /* 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"])
  17556. /* harmony export */ });
  17557. /* 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");
  17558. /***/ }),
  17559. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17560. /*!***********************************************************************************!*\
  17561. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17562. \***********************************************************************************/
  17563. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17564. "use strict";
  17565. __webpack_require__.r(__webpack_exports__);
  17566. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17567. /* 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"])
  17568. /* harmony export */ });
  17569. /* 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");
  17570. /***/ }),
  17571. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17572. /*!**************************************************************************************!*\
  17573. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17574. \**************************************************************************************/
  17575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17576. "use strict";
  17577. __webpack_require__.r(__webpack_exports__);
  17578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17579. /* harmony export */ "default": () => (/* 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"])
  17580. /* harmony export */ });
  17581. /* 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");
  17582. /***/ }),
  17583. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17584. /*!***********************************************************************************!*\
  17585. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17586. \***********************************************************************************/
  17587. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17588. "use strict";
  17589. __webpack_require__.r(__webpack_exports__);
  17590. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17591. /* 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"])
  17592. /* harmony export */ });
  17593. /* 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");
  17594. /***/ }),
  17595. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17596. /*!**************************************************************************************!*\
  17597. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17598. \**************************************************************************************/
  17599. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17600. "use strict";
  17601. __webpack_require__.r(__webpack_exports__);
  17602. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17603. /* harmony export */ "default": () => (/* 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"])
  17604. /* harmony export */ });
  17605. /* 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");
  17606. /***/ }),
  17607. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17608. /*!**********************************************************************************!*\
  17609. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17610. \**********************************************************************************/
  17611. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17612. "use strict";
  17613. __webpack_require__.r(__webpack_exports__);
  17614. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17615. /* 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"])
  17616. /* harmony export */ });
  17617. /* 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");
  17618. /***/ }),
  17619. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17620. /*!*************************************************************************************!*\
  17621. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17622. \*************************************************************************************/
  17623. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17624. "use strict";
  17625. __webpack_require__.r(__webpack_exports__);
  17626. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17627. /* 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"])
  17628. /* harmony export */ });
  17629. /* 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");
  17630. /***/ }),
  17631. /***/ "./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  17632. /*!******************************************************************************!*\
  17633. !*** ./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  17634. \******************************************************************************/
  17635. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17636. "use strict";
  17637. __webpack_require__.r(__webpack_exports__);
  17638. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17639. /* harmony export */ "default": () => (/* 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"])
  17640. /* harmony export */ });
  17641. /* 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");
  17642. /***/ }),
  17643. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17644. /*!*********************************************************************************!*\
  17645. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17646. \*********************************************************************************/
  17647. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17648. "use strict";
  17649. __webpack_require__.r(__webpack_exports__);
  17650. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17651. /* 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)
  17652. /* harmony export */ });
  17653. /* 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");
  17654. /***/ }),
  17655. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17656. /*!*****************************************************************************************!*\
  17657. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17658. \*****************************************************************************************/
  17659. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17660. "use strict";
  17661. __webpack_require__.r(__webpack_exports__);
  17662. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17663. /* 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)
  17664. /* harmony export */ });
  17665. /* 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");
  17666. /***/ }),
  17667. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17668. /*!******************************************************************************!*\
  17669. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17670. \******************************************************************************/
  17671. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17672. "use strict";
  17673. __webpack_require__.r(__webpack_exports__);
  17674. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17675. /* 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)
  17676. /* harmony export */ });
  17677. /* 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");
  17678. /***/ }),
  17679. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17680. /*!*********************************************************************************!*\
  17681. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17682. \*********************************************************************************/
  17683. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17684. "use strict";
  17685. __webpack_require__.r(__webpack_exports__);
  17686. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17687. /* 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)
  17688. /* harmony export */ });
  17689. /* 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");
  17690. /***/ }),
  17691. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17692. /*!******************************************************************************************!*\
  17693. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17694. \******************************************************************************************/
  17695. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17696. "use strict";
  17697. __webpack_require__.r(__webpack_exports__);
  17698. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17699. /* 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)
  17700. /* harmony export */ });
  17701. /* 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");
  17702. /***/ }),
  17703. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17704. /*!*********************************************************************************************!*\
  17705. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17706. \*********************************************************************************************/
  17707. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17708. "use strict";
  17709. __webpack_require__.r(__webpack_exports__);
  17710. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17711. /* 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)
  17712. /* harmony export */ });
  17713. /* 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");
  17714. /***/ }),
  17715. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17716. /*!*****************************************************************************************!*\
  17717. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17718. \*****************************************************************************************/
  17719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17720. "use strict";
  17721. __webpack_require__.r(__webpack_exports__);
  17722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17723. /* 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)
  17724. /* harmony export */ });
  17725. /* 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");
  17726. /***/ }),
  17727. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17728. /*!********************************************************************************************!*\
  17729. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17730. \********************************************************************************************/
  17731. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17732. "use strict";
  17733. __webpack_require__.r(__webpack_exports__);
  17734. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17735. /* 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)
  17736. /* harmony export */ });
  17737. /* 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");
  17738. /***/ }),
  17739. /***/ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  17740. /*!*************************************************************************!*\
  17741. !*** ./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  17742. \*************************************************************************/
  17743. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17744. "use strict";
  17745. __webpack_require__.r(__webpack_exports__);
  17746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17747. /* 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)
  17748. /* harmony export */ });
  17749. /* 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");
  17750. /***/ }),
  17751. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17752. /*!********************************************************************************************************!*\
  17753. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17754. \********************************************************************************************************/
  17755. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17756. "use strict";
  17757. __webpack_require__.r(__webpack_exports__);
  17758. /* 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");
  17759. /***/ }),
  17760. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17761. /*!*********************************************************************************************************!*\
  17762. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17763. \*********************************************************************************************************/
  17764. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17765. "use strict";
  17766. __webpack_require__.r(__webpack_exports__);
  17767. /* 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");
  17768. /***/ }),
  17769. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17770. /*!************************************************************************************************************!*\
  17771. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17772. \************************************************************************************************************/
  17773. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17774. "use strict";
  17775. __webpack_require__.r(__webpack_exports__);
  17776. /* 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");
  17777. /***/ }),
  17778. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17779. /*!********************************************************************************************************!*\
  17780. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17781. \********************************************************************************************************/
  17782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17783. "use strict";
  17784. __webpack_require__.r(__webpack_exports__);
  17785. /* 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");
  17786. /***/ }),
  17787. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17788. /*!***********************************************************************************************************!*\
  17789. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17790. \***********************************************************************************************************/
  17791. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17792. "use strict";
  17793. __webpack_require__.r(__webpack_exports__);
  17794. /* 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");
  17795. /***/ })
  17796. }]);