resources_js_pages_user_Index_vue.js 693KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_user_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!**********************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \**********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/user/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. users: Object,
  281. initialSearch: String
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props.initialSearch),
  288. search = _useSearchText.search;
  289. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  290. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  291. search: search.value
  292. }), {
  293. preserveState: true
  294. });
  295. });
  296. var __returned__ = {
  297. props: props,
  298. search: search,
  299. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  300. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  301. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  302. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  303. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  304. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  305. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  306. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  307. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  308. };
  309. Object.defineProperty(__returned__, '__isScriptSetup', {
  310. enumerable: false,
  311. value: true
  312. });
  313. return __returned__;
  314. }
  315. });
  316. /***/ }),
  317. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  318. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  319. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  320. \***********************************************************************************************************************************************************************************************************************************************************************************/
  321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  322. "use strict";
  323. __webpack_require__.r(__webpack_exports__);
  324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  325. /* harmony export */ "render": () => (/* binding */ render)
  326. /* harmony export */ });
  327. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  328. var _hoisted_1 = {
  329. key: 1,
  330. "class": "p-button-label"
  331. };
  332. var _hoisted_2 = {
  333. key: 1,
  334. "class": "p-button-label"
  335. };
  336. function render(_ctx, _cache, $props, $setup, $data, $options) {
  337. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  338. key: 0,
  339. "class": "p-button p-component",
  340. as: "button",
  341. type: "button"
  342. }, {
  343. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  344. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  345. key: 0,
  346. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  347. }, null, 2
  348. /* CLASS */
  349. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  350. /* TEXT */
  351. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  352. }),
  353. _: 1
  354. /* STABLE */
  355. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  356. key: 1,
  357. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  358. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  359. key: 0,
  360. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  361. }, null, 2
  362. /* CLASS */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  364. /* TEXT */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  366. /* CLASS */
  367. ));
  368. }
  369. /***/ }),
  370. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  371. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  372. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  373. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  374. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  375. "use strict";
  376. __webpack_require__.r(__webpack_exports__);
  377. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  378. /* harmony export */ "render": () => (/* binding */ render)
  379. /* harmony export */ });
  380. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  381. var _withScopeId = function _withScopeId(n) {
  382. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  383. };
  384. var _hoisted_1 = {
  385. "class": "layout-footer"
  386. };
  387. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  388. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  389. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  390. href: "https://dijitalcode.com",
  391. target: "_blank",
  392. "class": "font-medium ml-2"
  393. }, "DijitalCODE", -1
  394. /* HOISTED */
  395. );
  396. });
  397. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  398. function render(_ctx, _cache) {
  399. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  400. }
  401. /***/ }),
  402. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  403. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  404. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  405. \********************************************************************************************************************************************************************************************************************************************************************************/
  406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  407. "use strict";
  408. __webpack_require__.r(__webpack_exports__);
  409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  410. /* harmony export */ "render": () => (/* binding */ render)
  411. /* harmony export */ });
  412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  413. var _hoisted_1 = {
  414. "class": "grid"
  415. };
  416. var _hoisted_2 = {
  417. "class": "col-12"
  418. };
  419. var _hoisted_3 = {
  420. key: 0
  421. };
  422. var _hoisted_4 = {
  423. key: 1
  424. };
  425. function render(_ctx, _cache, $props, $setup, $data, $options) {
  426. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  427. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  428. key: 0,
  429. severity: "success",
  430. onClose: $setup.onClose
  431. }, {
  432. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  433. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  434. /* TEXT */
  435. )];
  436. }),
  437. _: 1
  438. /* STABLE */
  439. })) : (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, {
  440. key: 1,
  441. severity: "error",
  442. onClose: $setup.onClose
  443. }, {
  444. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  445. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  446. /* TEXT */
  447. )];
  448. }),
  449. _: 1
  450. /* STABLE */
  451. })) : (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, {
  452. key: 2,
  453. severity: "error",
  454. onClose: $setup.onClose
  455. }, {
  456. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  457. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  458. /* TEXT */
  459. ))];
  460. }),
  461. _: 1
  462. /* STABLE */
  463. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]);
  464. }
  465. /***/ }),
  466. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  467. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  468. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  469. \***********************************************************************************************************************************************************************************************************************************************************************************/
  470. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  471. "use strict";
  472. __webpack_require__.r(__webpack_exports__);
  473. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  474. /* harmony export */ "render": () => (/* binding */ render)
  475. /* harmony export */ });
  476. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  477. var _hoisted_1 = {
  478. key: 0,
  479. "class": "p-paginator p-component flex justify-content-start"
  480. };
  481. var _hoisted_2 = {
  482. "class": "p-paginator-pages"
  483. };
  484. var _hoisted_3 = ["innerHTML"];
  485. function render(_ctx, _cache, $props, $setup, $data, $options) {
  486. 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) {
  487. 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", {
  488. key: "link-".concat(key),
  489. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  490. 'p-disabled': link
  491. }]),
  492. innerHTML: link.label
  493. }, null, 10
  494. /* CLASS, PROPS */
  495. , _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"], {
  496. key: "link-".concat(key),
  497. href: link.url,
  498. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  499. 'p-highlight': link.active
  500. }, "p-paginator-page p-paginator-element p-link"]),
  501. innerHTML: link.label
  502. }, null, 8
  503. /* PROPS */
  504. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  505. /* STABLE_FRAGMENT */
  506. );
  507. }), 256
  508. /* UNKEYED_FRAGMENT */
  509. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  510. }
  511. /***/ }),
  512. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  513. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  514. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  515. \********************************************************************************************************************************************************************************************************************************************************************************************/
  516. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  517. "use strict";
  518. __webpack_require__.r(__webpack_exports__);
  519. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  520. /* harmony export */ "render": () => (/* binding */ render)
  521. /* harmony export */ });
  522. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  523. function render(_ctx, _cache, $props, $setup, $data, $options) {
  524. 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"], {
  525. "class": "layout-menu",
  526. items: $props.menu,
  527. root: true
  528. }, null, 8
  529. /* PROPS */
  530. , ["items"])]);
  531. }
  532. /***/ }),
  533. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  534. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  535. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  536. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  537. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  538. "use strict";
  539. __webpack_require__.r(__webpack_exports__);
  540. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  541. /* harmony export */ "render": () => (/* binding */ render)
  542. /* harmony export */ });
  543. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  544. var _withScopeId = function _withScopeId(n) {
  545. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  546. };
  547. var _hoisted_1 = {
  548. key: 0
  549. };
  550. var _hoisted_2 = ["aria-label"];
  551. var _hoisted_3 = ["aria-label"];
  552. function render(_ctx, _cache, $props, $setup, $data, $options) {
  553. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  554. 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) {
  555. 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", {
  556. key: i,
  557. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  558. 'layout-menuitem-category': $props.root
  559. }]),
  560. role: "none"
  561. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  562. key: 0
  563. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  564. "class": "layout-menuitem-root-text",
  565. "aria-label": item.label
  566. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  567. /* TEXT, PROPS */
  568. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  569. items: item.items
  570. }, null, 8
  571. /* PROPS */
  572. , ["items"])], 64
  573. /* STABLE_FRAGMENT */
  574. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  575. key: 1
  576. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  577. key: 0,
  578. role: "menuitem",
  579. href: item.to,
  580. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  581. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  582. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  583. }]),
  584. "aria-label": item.label
  585. }, {
  586. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  587. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  588. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  589. }, null, 2
  590. /* CLASS */
  591. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  592. /* TEXT */
  593. )];
  594. }),
  595. _: 2
  596. /* DYNAMIC */
  597. }, 1032
  598. /* PROPS, DYNAMIC_SLOTS */
  599. , ["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", {
  600. key: 1,
  601. href: "#",
  602. role: "menuitem",
  603. "aria-label": item.label
  604. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  605. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  606. }, null, 2
  607. /* CLASS */
  608. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  609. /* TEXT */
  610. )], 8
  611. /* PROPS */
  612. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  613. items: item.items
  614. }, null, 8
  615. /* PROPS */
  616. , ["items"])], 64
  617. /* STABLE_FRAGMENT */
  618. ))], 2
  619. /* CLASS */
  620. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  621. /* STABLE_FRAGMENT */
  622. );
  623. }), 256
  624. /* UNKEYED_FRAGMENT */
  625. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  626. }
  627. /***/ }),
  628. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  629. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  630. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  631. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  632. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  633. "use strict";
  634. __webpack_require__.r(__webpack_exports__);
  635. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  636. /* harmony export */ "render": () => (/* binding */ render)
  637. /* harmony export */ });
  638. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  639. var _withScopeId = function _withScopeId(n) {
  640. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  641. };
  642. var _hoisted_1 = {
  643. "class": "layout-topbar"
  644. };
  645. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  646. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  647. alt: "Logo",
  648. src: "/images/logo.svg",
  649. "class": "md:mr-3"
  650. }, null, -1
  651. /* HOISTED */
  652. );
  653. });
  654. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  655. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  656. /* HOISTED */
  657. );
  658. });
  659. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  660. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  661. "class": "pi pi-bars"
  662. }, null, -1
  663. /* HOISTED */
  664. );
  665. });
  666. var _hoisted_5 = [_hoisted_4];
  667. var _hoisted_6 = {
  668. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  669. };
  670. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  671. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  672. "class": "pi pi-ellipsis-v"
  673. }, null, -1
  674. /* HOISTED */
  675. );
  676. });
  677. var _hoisted_8 = [_hoisted_7];
  678. var _hoisted_9 = {
  679. "class": "layout-topbar-menu hidden lg:flex origin-top"
  680. };
  681. var _hoisted_10 = {
  682. "class": "align-self-center"
  683. };
  684. var _hoisted_11 = {
  685. "class": "hidden lg:inline"
  686. };
  687. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  688. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  689. "class": "pi pi-user"
  690. }, null, -1
  691. /* HOISTED */
  692. );
  693. });
  694. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  695. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  696. /* HOISTED */
  697. );
  698. });
  699. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  701. "class": "pi pi-sign-out"
  702. }, null, -1
  703. /* HOISTED */
  704. );
  705. });
  706. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  707. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  708. /* HOISTED */
  709. );
  710. });
  711. function render(_ctx, _cache, $props, $setup, $data, $options) {
  712. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  713. 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"], {
  714. href: "/",
  715. "class": "layout-topbar-logo"
  716. }, {
  717. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  718. return [_hoisted_2, _hoisted_3];
  719. }),
  720. _: 1
  721. /* STABLE */
  722. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  723. "class": "p-link layout-menu-button layout-topbar-button",
  724. onClick: _cache[0] || (_cache[0] = function ($event) {
  725. return _ctx.$emit('menu-toggle', $event);
  726. })
  727. }, _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, {
  728. selector: '@next',
  729. enterClass: 'hidden',
  730. enterActiveClass: 'scalein',
  731. leaveToClass: 'hidden',
  732. leaveActiveClass: 'fadeout',
  733. hideOnOutsideClick: true
  734. }]]), (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
  735. /* TEXT */
  736. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  737. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  738. "class": "p-link layout-topbar-button"
  739. }, {
  740. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  741. return [_hoisted_12, _hoisted_13];
  742. }),
  743. _: 1
  744. /* STABLE */
  745. }, 8
  746. /* PROPS */
  747. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  748. href: _ctx.route('logout'),
  749. as: "button",
  750. method: "post",
  751. "class": "p-link layout-topbar-button"
  752. }, {
  753. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  754. return [_hoisted_14, _hoisted_15];
  755. }),
  756. _: 1
  757. /* STABLE */
  758. }, 8
  759. /* PROPS */
  760. , ["href"])])])]);
  761. }
  762. /***/ }),
  763. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  764. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  765. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  766. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  767. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  768. "use strict";
  769. __webpack_require__.r(__webpack_exports__);
  770. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  771. /* harmony export */ "render": () => (/* binding */ render)
  772. /* harmony export */ });
  773. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  774. var _withScopeId = function _withScopeId(n) {
  775. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  776. };
  777. var _hoisted_1 = {
  778. "class": "layout-sidebar"
  779. };
  780. var _hoisted_2 = {
  781. "class": "layout-main-container"
  782. };
  783. var _hoisted_3 = {
  784. "class": "layout-main"
  785. };
  786. var _hoisted_4 = {
  787. key: 0,
  788. "class": "layout-mask p-component-overlay"
  789. };
  790. function render(_ctx, _cache, $props, $setup, $data, $options) {
  791. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  792. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  793. onClick: $setup.onWrapperClick
  794. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  795. onMenuToggle: $setup.onMenuToggle
  796. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  797. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  798. }, null, 8
  799. /* PROPS */
  800. , ["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, {
  801. name: "layout-mask"
  802. }, {
  803. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  804. 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)];
  805. }),
  806. _: 1
  807. /* STABLE */
  808. })], 2
  809. /* CLASS */
  810. );
  811. }
  812. /***/ }),
  813. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  814. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  815. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  816. \***************************************************************************************************************************************************************************************************************************************************************************/
  817. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  818. "use strict";
  819. __webpack_require__.r(__webpack_exports__);
  820. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  821. /* harmony export */ "render": () => (/* binding */ render)
  822. /* harmony export */ });
  823. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  824. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  825. /* HOISTED */
  826. );
  827. var _hoisted_2 = {
  828. "class": "grid"
  829. };
  830. var _hoisted_3 = {
  831. "class": "col-12 md:col-8"
  832. };
  833. var _hoisted_4 = {
  834. "class": "flex align-items-center"
  835. };
  836. var _hoisted_5 = {
  837. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  838. };
  839. function render(_ctx, _cache, $props, $setup, $data, $options) {
  840. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  841. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  842. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  843. 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"], {
  844. title: "Daftar User"
  845. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  846. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  847. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  848. responsiveLayout: "scroll",
  849. columnResizeMode: "expand",
  850. value: $props.users.data,
  851. rowHover: true,
  852. stripedRows: true
  853. }, {
  854. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  855. 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, {
  856. "class": "w-full md:w-27rem",
  857. placeholder: "cari, contoh: 08xx, tina, tina@xx.com",
  858. modelValue: $setup.search,
  859. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  860. return $setup.search = $event;
  861. })
  862. }, null, 8
  863. /* PROPS */
  864. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  865. label: "Tambah User",
  866. icon: "pi pi-pencil",
  867. "class": "p-button-outlined",
  868. href: _ctx.route('users.create')
  869. }, null, 8
  870. /* PROPS */
  871. , ["href"])])])];
  872. }),
  873. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  874. 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) {
  875. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  876. field: value.field,
  877. header: value.header,
  878. key: value.field
  879. }, null, 8
  880. /* PROPS */
  881. , ["field", "header"]);
  882. }), 128
  883. /* KEYED_FRAGMENT */
  884. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  885. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  886. var data = _ref.data;
  887. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  888. icon: "pi pi-pencil",
  889. "class": "p-button-icon-only p-button-rounded p-button-text",
  890. href: _ctx.route('users.edit', data.id)
  891. }, null, 8
  892. /* PROPS */
  893. , ["href"])];
  894. }),
  895. _: 1
  896. /* STABLE */
  897. })];
  898. }),
  899. _: 1
  900. /* STABLE */
  901. }, 8
  902. /* PROPS */
  903. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  904. links: $props.users.links
  905. }, null, 8
  906. /* PROPS */
  907. , ["links"])];
  908. }),
  909. _: 1
  910. /* STABLE */
  911. })], 64
  912. /* STABLE_FRAGMENT */
  913. );
  914. }
  915. /***/ }),
  916. /***/ "./resources/js/components/useSearchText.js":
  917. /*!**************************************************!*\
  918. !*** ./resources/js/components/useSearchText.js ***!
  919. \**************************************************/
  920. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  921. "use strict";
  922. __webpack_require__.r(__webpack_exports__);
  923. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  924. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  925. /* harmony export */ });
  926. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  927. function useSearchText(initialSearch) {
  928. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(initialSearch);
  929. return {
  930. search: search
  931. };
  932. }
  933. /***/ }),
  934. /***/ "./resources/js/pages/user/tableHeader.js":
  935. /*!************************************************!*\
  936. !*** ./resources/js/pages/user/tableHeader.js ***!
  937. \************************************************/
  938. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  939. "use strict";
  940. __webpack_require__.r(__webpack_exports__);
  941. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  942. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  943. /* harmony export */ });
  944. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  945. field: 'name',
  946. header: 'Nama'
  947. }, {
  948. field: 'phone',
  949. header: 'No HP'
  950. }, {
  951. field: 'email',
  952. header: 'Email'
  953. }, {
  954. field: 'role',
  955. header: 'Hak Akses'
  956. }, {
  957. field: 'status',
  958. header: 'Status'
  959. }]);
  960. /***/ }),
  961. /***/ "./resources/js/utils/menu.js":
  962. /*!************************************!*\
  963. !*** ./resources/js/utils/menu.js ***!
  964. \************************************/
  965. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  966. "use strict";
  967. __webpack_require__.r(__webpack_exports__);
  968. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  969. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  970. /* harmony export */ });
  971. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  972. // Admin
  973. 1: [{
  974. label: 'Home',
  975. items: [{
  976. label: 'Dashboard',
  977. icon: 'pi pi-home',
  978. to: '/dashboards',
  979. component: 'home/Index'
  980. }]
  981. }, {
  982. label: 'Master',
  983. items: [{
  984. label: 'User',
  985. icon: 'pi pi-user',
  986. to: '/users',
  987. component: 'user/Index'
  988. }]
  989. }],
  990. // Supervisor
  991. 2: [{
  992. label: 'Home',
  993. items: [{
  994. label: 'Dashboard',
  995. icon: 'pi pi-home',
  996. to: '/dashboards',
  997. component: 'home/Index'
  998. }]
  999. }, {
  1000. label: 'Menu',
  1001. items: [{
  1002. label: 'Pengeluaran',
  1003. icon: 'pi pi-wallet',
  1004. to: '/expenses',
  1005. component: 'expense/Index'
  1006. }, {
  1007. label: 'Laporan',
  1008. icon: 'pi pi-book',
  1009. items: [{
  1010. label: 'Mutasi',
  1011. icon: 'pi pi-circle',
  1012. to: '/reports/mutations',
  1013. component: 'mutation/Report'
  1014. }]
  1015. }]
  1016. }, {
  1017. label: 'Master',
  1018. items: [{
  1019. label: 'Jenis Kendaraan',
  1020. icon: 'pi pi-car',
  1021. to: '/type-vehicles',
  1022. component: 'typevehicle/Index'
  1023. }, {
  1024. label: 'Jenis Member',
  1025. icon: 'pi pi-id-card',
  1026. to: '/type-members',
  1027. component: 'typemember/Index'
  1028. }]
  1029. }, {
  1030. label: 'Pengaturan',
  1031. items: [{
  1032. label: 'Tarif Parkir',
  1033. icon: 'pi pi-car',
  1034. to: '/parking-fees/create',
  1035. component: 'parkingfee/Create'
  1036. }]
  1037. }],
  1038. // Operator
  1039. 3: [{
  1040. label: 'Home',
  1041. items: [{
  1042. label: 'Dashboard',
  1043. icon: 'pi pi-home',
  1044. to: '/dashboards',
  1045. component: 'home/Index'
  1046. }]
  1047. }, {
  1048. label: 'Menu',
  1049. items: [{
  1050. label: 'Pengeluaran',
  1051. icon: 'pi pi-wallet',
  1052. to: '/expenses',
  1053. component: 'expense/Index'
  1054. }, {
  1055. label: 'Member',
  1056. icon: 'pi pi-id-card',
  1057. to: '/members',
  1058. component: 'member/Index'
  1059. }, {
  1060. label: 'Top Up',
  1061. icon: 'pi pi-car',
  1062. to: '/top-ups',
  1063. component: 'topup/Index'
  1064. }]
  1065. }]
  1066. });
  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/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&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/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&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-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}", ""]);
  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/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1103. // Exports
  1104. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1105. /***/ }),
  1106. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1107. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1108. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1109. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1110. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1111. "use strict";
  1112. __webpack_require__.r(__webpack_exports__);
  1113. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1114. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1115. /* harmony export */ });
  1116. /* 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");
  1117. /* 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__);
  1118. // Imports
  1119. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1120. // Module
  1121. ___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}", ""]);
  1122. // Exports
  1123. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1124. /***/ }),
  1125. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1126. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1127. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1128. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1129. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1130. "use strict";
  1131. __webpack_require__.r(__webpack_exports__);
  1132. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1133. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1134. /* harmony export */ });
  1135. /* 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");
  1136. /* 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__);
  1137. // Imports
  1138. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1139. // Module
  1140. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 12px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1141. // Exports
  1142. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1143. /***/ }),
  1144. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1145. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1146. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1147. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1148. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1149. "use strict";
  1150. __webpack_require__.r(__webpack_exports__);
  1151. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1152. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1153. /* harmony export */ });
  1154. /* 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");
  1155. /* 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__);
  1156. // Imports
  1157. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1158. // Module
  1159. ___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}", ""]);
  1160. // Exports
  1161. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1162. /***/ }),
  1163. /***/ "./node_modules/lodash/lodash.js":
  1164. /*!***************************************!*\
  1165. !*** ./node_modules/lodash/lodash.js ***!
  1166. \***************************************/
  1167. /***/ (function(module, exports, __webpack_require__) {
  1168. /* module decorator */ module = __webpack_require__.nmd(module);
  1169. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1170. * @license
  1171. * Lodash <https://lodash.com/>
  1172. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1173. * Released under MIT license <https://lodash.com/license>
  1174. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1175. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1176. */
  1177. ;(function() {
  1178. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1179. var undefined;
  1180. /** Used as the semantic version number. */
  1181. var VERSION = '4.17.21';
  1182. /** Used as the size to enable large array optimizations. */
  1183. var LARGE_ARRAY_SIZE = 200;
  1184. /** Error message constants. */
  1185. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1186. FUNC_ERROR_TEXT = 'Expected a function',
  1187. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1188. /** Used to stand-in for `undefined` hash values. */
  1189. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1190. /** Used as the maximum memoize cache size. */
  1191. var MAX_MEMOIZE_SIZE = 500;
  1192. /** Used as the internal argument placeholder. */
  1193. var PLACEHOLDER = '__lodash_placeholder__';
  1194. /** Used to compose bitmasks for cloning. */
  1195. var CLONE_DEEP_FLAG = 1,
  1196. CLONE_FLAT_FLAG = 2,
  1197. CLONE_SYMBOLS_FLAG = 4;
  1198. /** Used to compose bitmasks for value comparisons. */
  1199. var COMPARE_PARTIAL_FLAG = 1,
  1200. COMPARE_UNORDERED_FLAG = 2;
  1201. /** Used to compose bitmasks for function metadata. */
  1202. var WRAP_BIND_FLAG = 1,
  1203. WRAP_BIND_KEY_FLAG = 2,
  1204. WRAP_CURRY_BOUND_FLAG = 4,
  1205. WRAP_CURRY_FLAG = 8,
  1206. WRAP_CURRY_RIGHT_FLAG = 16,
  1207. WRAP_PARTIAL_FLAG = 32,
  1208. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1209. WRAP_ARY_FLAG = 128,
  1210. WRAP_REARG_FLAG = 256,
  1211. WRAP_FLIP_FLAG = 512;
  1212. /** Used as default options for `_.truncate`. */
  1213. var DEFAULT_TRUNC_LENGTH = 30,
  1214. DEFAULT_TRUNC_OMISSION = '...';
  1215. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1216. var HOT_COUNT = 800,
  1217. HOT_SPAN = 16;
  1218. /** Used to indicate the type of lazy iteratees. */
  1219. var LAZY_FILTER_FLAG = 1,
  1220. LAZY_MAP_FLAG = 2,
  1221. LAZY_WHILE_FLAG = 3;
  1222. /** Used as references for various `Number` constants. */
  1223. var INFINITY = 1 / 0,
  1224. MAX_SAFE_INTEGER = 9007199254740991,
  1225. MAX_INTEGER = 1.7976931348623157e+308,
  1226. NAN = 0 / 0;
  1227. /** Used as references for the maximum length and index of an array. */
  1228. var MAX_ARRAY_LENGTH = 4294967295,
  1229. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1230. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1231. /** Used to associate wrap methods with their bit flags. */
  1232. var wrapFlags = [
  1233. ['ary', WRAP_ARY_FLAG],
  1234. ['bind', WRAP_BIND_FLAG],
  1235. ['bindKey', WRAP_BIND_KEY_FLAG],
  1236. ['curry', WRAP_CURRY_FLAG],
  1237. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1238. ['flip', WRAP_FLIP_FLAG],
  1239. ['partial', WRAP_PARTIAL_FLAG],
  1240. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1241. ['rearg', WRAP_REARG_FLAG]
  1242. ];
  1243. /** `Object#toString` result references. */
  1244. var argsTag = '[object Arguments]',
  1245. arrayTag = '[object Array]',
  1246. asyncTag = '[object AsyncFunction]',
  1247. boolTag = '[object Boolean]',
  1248. dateTag = '[object Date]',
  1249. domExcTag = '[object DOMException]',
  1250. errorTag = '[object Error]',
  1251. funcTag = '[object Function]',
  1252. genTag = '[object GeneratorFunction]',
  1253. mapTag = '[object Map]',
  1254. numberTag = '[object Number]',
  1255. nullTag = '[object Null]',
  1256. objectTag = '[object Object]',
  1257. promiseTag = '[object Promise]',
  1258. proxyTag = '[object Proxy]',
  1259. regexpTag = '[object RegExp]',
  1260. setTag = '[object Set]',
  1261. stringTag = '[object String]',
  1262. symbolTag = '[object Symbol]',
  1263. undefinedTag = '[object Undefined]',
  1264. weakMapTag = '[object WeakMap]',
  1265. weakSetTag = '[object WeakSet]';
  1266. var arrayBufferTag = '[object ArrayBuffer]',
  1267. dataViewTag = '[object DataView]',
  1268. float32Tag = '[object Float32Array]',
  1269. float64Tag = '[object Float64Array]',
  1270. int8Tag = '[object Int8Array]',
  1271. int16Tag = '[object Int16Array]',
  1272. int32Tag = '[object Int32Array]',
  1273. uint8Tag = '[object Uint8Array]',
  1274. uint8ClampedTag = '[object Uint8ClampedArray]',
  1275. uint16Tag = '[object Uint16Array]',
  1276. uint32Tag = '[object Uint32Array]';
  1277. /** Used to match empty string literals in compiled template source. */
  1278. var reEmptyStringLeading = /\b__p \+= '';/g,
  1279. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1280. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1281. /** Used to match HTML entities and HTML characters. */
  1282. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1283. reUnescapedHtml = /[&<>"']/g,
  1284. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1285. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1286. /** Used to match template delimiters. */
  1287. var reEscape = /<%-([\s\S]+?)%>/g,
  1288. reEvaluate = /<%([\s\S]+?)%>/g,
  1289. reInterpolate = /<%=([\s\S]+?)%>/g;
  1290. /** Used to match property names within property paths. */
  1291. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1292. reIsPlainProp = /^\w*$/,
  1293. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1294. /**
  1295. * Used to match `RegExp`
  1296. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1297. */
  1298. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1299. reHasRegExpChar = RegExp(reRegExpChar.source);
  1300. /** Used to match leading whitespace. */
  1301. var reTrimStart = /^\s+/;
  1302. /** Used to match a single whitespace character. */
  1303. var reWhitespace = /\s/;
  1304. /** Used to match wrap detail comments. */
  1305. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1306. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1307. reSplitDetails = /,? & /;
  1308. /** Used to match words composed of alphanumeric characters. */
  1309. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1310. /**
  1311. * Used to validate the `validate` option in `_.template` variable.
  1312. *
  1313. * Forbids characters which could potentially change the meaning of the function argument definition:
  1314. * - "()," (modification of function parameters)
  1315. * - "=" (default value)
  1316. * - "[]{}" (destructuring of function parameters)
  1317. * - "/" (beginning of a comment)
  1318. * - whitespace
  1319. */
  1320. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1321. /** Used to match backslashes in property paths. */
  1322. var reEscapeChar = /\\(\\)?/g;
  1323. /**
  1324. * Used to match
  1325. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1326. */
  1327. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1328. /** Used to match `RegExp` flags from their coerced string values. */
  1329. var reFlags = /\w*$/;
  1330. /** Used to detect bad signed hexadecimal string values. */
  1331. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1332. /** Used to detect binary string values. */
  1333. var reIsBinary = /^0b[01]+$/i;
  1334. /** Used to detect host constructors (Safari). */
  1335. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1336. /** Used to detect octal string values. */
  1337. var reIsOctal = /^0o[0-7]+$/i;
  1338. /** Used to detect unsigned integer values. */
  1339. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1340. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1341. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1342. /** Used to ensure capturing order of template delimiters. */
  1343. var reNoMatch = /($^)/;
  1344. /** Used to match unescaped characters in compiled string literals. */
  1345. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1346. /** Used to compose unicode character classes. */
  1347. var rsAstralRange = '\\ud800-\\udfff',
  1348. rsComboMarksRange = '\\u0300-\\u036f',
  1349. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1350. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1351. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1352. rsDingbatRange = '\\u2700-\\u27bf',
  1353. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1354. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1355. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1356. rsPunctuationRange = '\\u2000-\\u206f',
  1357. 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',
  1358. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1359. rsVarRange = '\\ufe0e\\ufe0f',
  1360. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1361. /** Used to compose unicode capture groups. */
  1362. var rsApos = "['\u2019]",
  1363. rsAstral = '[' + rsAstralRange + ']',
  1364. rsBreak = '[' + rsBreakRange + ']',
  1365. rsCombo = '[' + rsComboRange + ']',
  1366. rsDigits = '\\d+',
  1367. rsDingbat = '[' + rsDingbatRange + ']',
  1368. rsLower = '[' + rsLowerRange + ']',
  1369. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1370. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1371. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1372. rsNonAstral = '[^' + rsAstralRange + ']',
  1373. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1374. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1375. rsUpper = '[' + rsUpperRange + ']',
  1376. rsZWJ = '\\u200d';
  1377. /** Used to compose unicode regexes. */
  1378. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1379. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1380. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1381. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1382. reOptMod = rsModifier + '?',
  1383. rsOptVar = '[' + rsVarRange + ']?',
  1384. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1385. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1386. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1387. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1388. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1389. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1390. /** Used to match apostrophes. */
  1391. var reApos = RegExp(rsApos, 'g');
  1392. /**
  1393. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1394. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1395. */
  1396. var reComboMark = RegExp(rsCombo, 'g');
  1397. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1398. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1399. /** Used to match complex or compound words. */
  1400. var reUnicodeWord = RegExp([
  1401. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1402. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1403. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1404. rsUpper + '+' + rsOptContrUpper,
  1405. rsOrdUpper,
  1406. rsOrdLower,
  1407. rsDigits,
  1408. rsEmoji
  1409. ].join('|'), 'g');
  1410. /** 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/). */
  1411. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1412. /** Used to detect strings that need a more robust regexp to match words. */
  1413. 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 ]/;
  1414. /** Used to assign default `context` object properties. */
  1415. var contextProps = [
  1416. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1417. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1418. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1419. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1420. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1421. ];
  1422. /** Used to make template sourceURLs easier to identify. */
  1423. var templateCounter = -1;
  1424. /** Used to identify `toStringTag` values of typed arrays. */
  1425. var typedArrayTags = {};
  1426. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1427. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1428. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1429. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1430. typedArrayTags[uint32Tag] = true;
  1431. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1432. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1433. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1434. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1435. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1436. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1437. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1438. typedArrayTags[weakMapTag] = false;
  1439. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1440. var cloneableTags = {};
  1441. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1442. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1443. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1444. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1445. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1446. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1447. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1448. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1449. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1450. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1451. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1452. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1453. cloneableTags[weakMapTag] = false;
  1454. /** Used to map Latin Unicode letters to basic Latin letters. */
  1455. var deburredLetters = {
  1456. // Latin-1 Supplement block.
  1457. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1458. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1459. '\xc7': 'C', '\xe7': 'c',
  1460. '\xd0': 'D', '\xf0': 'd',
  1461. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1462. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1463. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1464. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1465. '\xd1': 'N', '\xf1': 'n',
  1466. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1467. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1468. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1469. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1470. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1471. '\xc6': 'Ae', '\xe6': 'ae',
  1472. '\xde': 'Th', '\xfe': 'th',
  1473. '\xdf': 'ss',
  1474. // Latin Extended-A block.
  1475. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1476. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1477. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1478. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1479. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1480. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1481. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1482. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1483. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1484. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1485. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1486. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1487. '\u0134': 'J', '\u0135': 'j',
  1488. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1489. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1490. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1491. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1492. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1493. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1494. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1495. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1496. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1497. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1498. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1499. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1500. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1501. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1502. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1503. '\u0174': 'W', '\u0175': 'w',
  1504. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1505. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1506. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1507. '\u0132': 'IJ', '\u0133': 'ij',
  1508. '\u0152': 'Oe', '\u0153': 'oe',
  1509. '\u0149': "'n", '\u017f': 's'
  1510. };
  1511. /** Used to map characters to HTML entities. */
  1512. var htmlEscapes = {
  1513. '&': '&amp;',
  1514. '<': '&lt;',
  1515. '>': '&gt;',
  1516. '"': '&quot;',
  1517. "'": '&#39;'
  1518. };
  1519. /** Used to map HTML entities to characters. */
  1520. var htmlUnescapes = {
  1521. '&amp;': '&',
  1522. '&lt;': '<',
  1523. '&gt;': '>',
  1524. '&quot;': '"',
  1525. '&#39;': "'"
  1526. };
  1527. /** Used to escape characters for inclusion in compiled string literals. */
  1528. var stringEscapes = {
  1529. '\\': '\\',
  1530. "'": "'",
  1531. '\n': 'n',
  1532. '\r': 'r',
  1533. '\u2028': 'u2028',
  1534. '\u2029': 'u2029'
  1535. };
  1536. /** Built-in method references without a dependency on `root`. */
  1537. var freeParseFloat = parseFloat,
  1538. freeParseInt = parseInt;
  1539. /** Detect free variable `global` from Node.js. */
  1540. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1541. /** Detect free variable `self`. */
  1542. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1543. /** Used as a reference to the global object. */
  1544. var root = freeGlobal || freeSelf || Function('return this')();
  1545. /** Detect free variable `exports`. */
  1546. var freeExports = true && exports && !exports.nodeType && exports;
  1547. /** Detect free variable `module`. */
  1548. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1549. /** Detect the popular CommonJS extension `module.exports`. */
  1550. var moduleExports = freeModule && freeModule.exports === freeExports;
  1551. /** Detect free variable `process` from Node.js. */
  1552. var freeProcess = moduleExports && freeGlobal.process;
  1553. /** Used to access faster Node.js helpers. */
  1554. var nodeUtil = (function() {
  1555. try {
  1556. // Use `util.types` for Node.js 10+.
  1557. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1558. if (types) {
  1559. return types;
  1560. }
  1561. // Legacy `process.binding('util')` for Node.js < 10.
  1562. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1563. } catch (e) {}
  1564. }());
  1565. /* Node.js helper references. */
  1566. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1567. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1568. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1569. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1570. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1571. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1572. /*--------------------------------------------------------------------------*/
  1573. /**
  1574. * A faster alternative to `Function#apply`, this function invokes `func`
  1575. * with the `this` binding of `thisArg` and the arguments of `args`.
  1576. *
  1577. * @private
  1578. * @param {Function} func The function to invoke.
  1579. * @param {*} thisArg The `this` binding of `func`.
  1580. * @param {Array} args The arguments to invoke `func` with.
  1581. * @returns {*} Returns the result of `func`.
  1582. */
  1583. function apply(func, thisArg, args) {
  1584. switch (args.length) {
  1585. case 0: return func.call(thisArg);
  1586. case 1: return func.call(thisArg, args[0]);
  1587. case 2: return func.call(thisArg, args[0], args[1]);
  1588. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1589. }
  1590. return func.apply(thisArg, args);
  1591. }
  1592. /**
  1593. * A specialized version of `baseAggregator` for arrays.
  1594. *
  1595. * @private
  1596. * @param {Array} [array] The array to iterate over.
  1597. * @param {Function} setter The function to set `accumulator` values.
  1598. * @param {Function} iteratee The iteratee to transform keys.
  1599. * @param {Object} accumulator The initial aggregated object.
  1600. * @returns {Function} Returns `accumulator`.
  1601. */
  1602. function arrayAggregator(array, setter, iteratee, accumulator) {
  1603. var index = -1,
  1604. length = array == null ? 0 : array.length;
  1605. while (++index < length) {
  1606. var value = array[index];
  1607. setter(accumulator, value, iteratee(value), array);
  1608. }
  1609. return accumulator;
  1610. }
  1611. /**
  1612. * A specialized version of `_.forEach` for arrays without support for
  1613. * iteratee shorthands.
  1614. *
  1615. * @private
  1616. * @param {Array} [array] The array to iterate over.
  1617. * @param {Function} iteratee The function invoked per iteration.
  1618. * @returns {Array} Returns `array`.
  1619. */
  1620. function arrayEach(array, iteratee) {
  1621. var index = -1,
  1622. length = array == null ? 0 : array.length;
  1623. while (++index < length) {
  1624. if (iteratee(array[index], index, array) === false) {
  1625. break;
  1626. }
  1627. }
  1628. return array;
  1629. }
  1630. /**
  1631. * A specialized version of `_.forEachRight` for arrays without support for
  1632. * iteratee shorthands.
  1633. *
  1634. * @private
  1635. * @param {Array} [array] The array to iterate over.
  1636. * @param {Function} iteratee The function invoked per iteration.
  1637. * @returns {Array} Returns `array`.
  1638. */
  1639. function arrayEachRight(array, iteratee) {
  1640. var length = array == null ? 0 : array.length;
  1641. while (length--) {
  1642. if (iteratee(array[length], length, array) === false) {
  1643. break;
  1644. }
  1645. }
  1646. return array;
  1647. }
  1648. /**
  1649. * A specialized version of `_.every` for arrays without support for
  1650. * iteratee shorthands.
  1651. *
  1652. * @private
  1653. * @param {Array} [array] The array to iterate over.
  1654. * @param {Function} predicate The function invoked per iteration.
  1655. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1656. * else `false`.
  1657. */
  1658. function arrayEvery(array, predicate) {
  1659. var index = -1,
  1660. length = array == null ? 0 : array.length;
  1661. while (++index < length) {
  1662. if (!predicate(array[index], index, array)) {
  1663. return false;
  1664. }
  1665. }
  1666. return true;
  1667. }
  1668. /**
  1669. * A specialized version of `_.filter` for arrays without support for
  1670. * iteratee shorthands.
  1671. *
  1672. * @private
  1673. * @param {Array} [array] The array to iterate over.
  1674. * @param {Function} predicate The function invoked per iteration.
  1675. * @returns {Array} Returns the new filtered array.
  1676. */
  1677. function arrayFilter(array, predicate) {
  1678. var index = -1,
  1679. length = array == null ? 0 : array.length,
  1680. resIndex = 0,
  1681. result = [];
  1682. while (++index < length) {
  1683. var value = array[index];
  1684. if (predicate(value, index, array)) {
  1685. result[resIndex++] = value;
  1686. }
  1687. }
  1688. return result;
  1689. }
  1690. /**
  1691. * A specialized version of `_.includes` for arrays without support for
  1692. * specifying an index to search from.
  1693. *
  1694. * @private
  1695. * @param {Array} [array] The array to inspect.
  1696. * @param {*} target The value to search for.
  1697. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1698. */
  1699. function arrayIncludes(array, value) {
  1700. var length = array == null ? 0 : array.length;
  1701. return !!length && baseIndexOf(array, value, 0) > -1;
  1702. }
  1703. /**
  1704. * This function is like `arrayIncludes` except that it accepts a comparator.
  1705. *
  1706. * @private
  1707. * @param {Array} [array] The array to inspect.
  1708. * @param {*} target The value to search for.
  1709. * @param {Function} comparator The comparator invoked per element.
  1710. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1711. */
  1712. function arrayIncludesWith(array, value, comparator) {
  1713. var index = -1,
  1714. length = array == null ? 0 : array.length;
  1715. while (++index < length) {
  1716. if (comparator(value, array[index])) {
  1717. return true;
  1718. }
  1719. }
  1720. return false;
  1721. }
  1722. /**
  1723. * A specialized version of `_.map` for arrays without support for iteratee
  1724. * shorthands.
  1725. *
  1726. * @private
  1727. * @param {Array} [array] The array to iterate over.
  1728. * @param {Function} iteratee The function invoked per iteration.
  1729. * @returns {Array} Returns the new mapped array.
  1730. */
  1731. function arrayMap(array, iteratee) {
  1732. var index = -1,
  1733. length = array == null ? 0 : array.length,
  1734. result = Array(length);
  1735. while (++index < length) {
  1736. result[index] = iteratee(array[index], index, array);
  1737. }
  1738. return result;
  1739. }
  1740. /**
  1741. * Appends the elements of `values` to `array`.
  1742. *
  1743. * @private
  1744. * @param {Array} array The array to modify.
  1745. * @param {Array} values The values to append.
  1746. * @returns {Array} Returns `array`.
  1747. */
  1748. function arrayPush(array, values) {
  1749. var index = -1,
  1750. length = values.length,
  1751. offset = array.length;
  1752. while (++index < length) {
  1753. array[offset + index] = values[index];
  1754. }
  1755. return array;
  1756. }
  1757. /**
  1758. * A specialized version of `_.reduce` for arrays without support for
  1759. * iteratee shorthands.
  1760. *
  1761. * @private
  1762. * @param {Array} [array] The array to iterate over.
  1763. * @param {Function} iteratee The function invoked per iteration.
  1764. * @param {*} [accumulator] The initial value.
  1765. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1766. * the initial value.
  1767. * @returns {*} Returns the accumulated value.
  1768. */
  1769. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1770. var index = -1,
  1771. length = array == null ? 0 : array.length;
  1772. if (initAccum && length) {
  1773. accumulator = array[++index];
  1774. }
  1775. while (++index < length) {
  1776. accumulator = iteratee(accumulator, array[index], index, array);
  1777. }
  1778. return accumulator;
  1779. }
  1780. /**
  1781. * A specialized version of `_.reduceRight` for arrays without support for
  1782. * iteratee shorthands.
  1783. *
  1784. * @private
  1785. * @param {Array} [array] The array to iterate over.
  1786. * @param {Function} iteratee The function invoked per iteration.
  1787. * @param {*} [accumulator] The initial value.
  1788. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1789. * the initial value.
  1790. * @returns {*} Returns the accumulated value.
  1791. */
  1792. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1793. var length = array == null ? 0 : array.length;
  1794. if (initAccum && length) {
  1795. accumulator = array[--length];
  1796. }
  1797. while (length--) {
  1798. accumulator = iteratee(accumulator, array[length], length, array);
  1799. }
  1800. return accumulator;
  1801. }
  1802. /**
  1803. * A specialized version of `_.some` for arrays without support for iteratee
  1804. * shorthands.
  1805. *
  1806. * @private
  1807. * @param {Array} [array] The array to iterate over.
  1808. * @param {Function} predicate The function invoked per iteration.
  1809. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1810. * else `false`.
  1811. */
  1812. function arraySome(array, predicate) {
  1813. var index = -1,
  1814. length = array == null ? 0 : array.length;
  1815. while (++index < length) {
  1816. if (predicate(array[index], index, array)) {
  1817. return true;
  1818. }
  1819. }
  1820. return false;
  1821. }
  1822. /**
  1823. * Gets the size of an ASCII `string`.
  1824. *
  1825. * @private
  1826. * @param {string} string The string inspect.
  1827. * @returns {number} Returns the string size.
  1828. */
  1829. var asciiSize = baseProperty('length');
  1830. /**
  1831. * Converts an ASCII `string` to an array.
  1832. *
  1833. * @private
  1834. * @param {string} string The string to convert.
  1835. * @returns {Array} Returns the converted array.
  1836. */
  1837. function asciiToArray(string) {
  1838. return string.split('');
  1839. }
  1840. /**
  1841. * Splits an ASCII `string` into an array of its words.
  1842. *
  1843. * @private
  1844. * @param {string} The string to inspect.
  1845. * @returns {Array} Returns the words of `string`.
  1846. */
  1847. function asciiWords(string) {
  1848. return string.match(reAsciiWord) || [];
  1849. }
  1850. /**
  1851. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1852. * without support for iteratee shorthands, which iterates over `collection`
  1853. * using `eachFunc`.
  1854. *
  1855. * @private
  1856. * @param {Array|Object} collection The collection to inspect.
  1857. * @param {Function} predicate The function invoked per iteration.
  1858. * @param {Function} eachFunc The function to iterate over `collection`.
  1859. * @returns {*} Returns the found element or its key, else `undefined`.
  1860. */
  1861. function baseFindKey(collection, predicate, eachFunc) {
  1862. var result;
  1863. eachFunc(collection, function(value, key, collection) {
  1864. if (predicate(value, key, collection)) {
  1865. result = key;
  1866. return false;
  1867. }
  1868. });
  1869. return result;
  1870. }
  1871. /**
  1872. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1873. * support for iteratee shorthands.
  1874. *
  1875. * @private
  1876. * @param {Array} array The array to inspect.
  1877. * @param {Function} predicate The function invoked per iteration.
  1878. * @param {number} fromIndex The index to search from.
  1879. * @param {boolean} [fromRight] Specify iterating from right to left.
  1880. * @returns {number} Returns the index of the matched value, else `-1`.
  1881. */
  1882. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1883. var length = array.length,
  1884. index = fromIndex + (fromRight ? 1 : -1);
  1885. while ((fromRight ? index-- : ++index < length)) {
  1886. if (predicate(array[index], index, array)) {
  1887. return index;
  1888. }
  1889. }
  1890. return -1;
  1891. }
  1892. /**
  1893. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1894. *
  1895. * @private
  1896. * @param {Array} array The array to inspect.
  1897. * @param {*} value The value to search for.
  1898. * @param {number} fromIndex The index to search from.
  1899. * @returns {number} Returns the index of the matched value, else `-1`.
  1900. */
  1901. function baseIndexOf(array, value, fromIndex) {
  1902. return value === value
  1903. ? strictIndexOf(array, value, fromIndex)
  1904. : baseFindIndex(array, baseIsNaN, fromIndex);
  1905. }
  1906. /**
  1907. * This function is like `baseIndexOf` except that it accepts a comparator.
  1908. *
  1909. * @private
  1910. * @param {Array} array The array to inspect.
  1911. * @param {*} value The value to search for.
  1912. * @param {number} fromIndex The index to search from.
  1913. * @param {Function} comparator The comparator invoked per element.
  1914. * @returns {number} Returns the index of the matched value, else `-1`.
  1915. */
  1916. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1917. var index = fromIndex - 1,
  1918. length = array.length;
  1919. while (++index < length) {
  1920. if (comparator(array[index], value)) {
  1921. return index;
  1922. }
  1923. }
  1924. return -1;
  1925. }
  1926. /**
  1927. * The base implementation of `_.isNaN` without support for number objects.
  1928. *
  1929. * @private
  1930. * @param {*} value The value to check.
  1931. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1932. */
  1933. function baseIsNaN(value) {
  1934. return value !== value;
  1935. }
  1936. /**
  1937. * The base implementation of `_.mean` and `_.meanBy` without support for
  1938. * iteratee shorthands.
  1939. *
  1940. * @private
  1941. * @param {Array} array The array to iterate over.
  1942. * @param {Function} iteratee The function invoked per iteration.
  1943. * @returns {number} Returns the mean.
  1944. */
  1945. function baseMean(array, iteratee) {
  1946. var length = array == null ? 0 : array.length;
  1947. return length ? (baseSum(array, iteratee) / length) : NAN;
  1948. }
  1949. /**
  1950. * The base implementation of `_.property` without support for deep paths.
  1951. *
  1952. * @private
  1953. * @param {string} key The key of the property to get.
  1954. * @returns {Function} Returns the new accessor function.
  1955. */
  1956. function baseProperty(key) {
  1957. return function(object) {
  1958. return object == null ? undefined : object[key];
  1959. };
  1960. }
  1961. /**
  1962. * The base implementation of `_.propertyOf` without support for deep paths.
  1963. *
  1964. * @private
  1965. * @param {Object} object The object to query.
  1966. * @returns {Function} Returns the new accessor function.
  1967. */
  1968. function basePropertyOf(object) {
  1969. return function(key) {
  1970. return object == null ? undefined : object[key];
  1971. };
  1972. }
  1973. /**
  1974. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1975. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1976. *
  1977. * @private
  1978. * @param {Array|Object} collection The collection to iterate over.
  1979. * @param {Function} iteratee The function invoked per iteration.
  1980. * @param {*} accumulator The initial value.
  1981. * @param {boolean} initAccum Specify using the first or last element of
  1982. * `collection` as the initial value.
  1983. * @param {Function} eachFunc The function to iterate over `collection`.
  1984. * @returns {*} Returns the accumulated value.
  1985. */
  1986. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1987. eachFunc(collection, function(value, index, collection) {
  1988. accumulator = initAccum
  1989. ? (initAccum = false, value)
  1990. : iteratee(accumulator, value, index, collection);
  1991. });
  1992. return accumulator;
  1993. }
  1994. /**
  1995. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1996. * sort order of `array` and replaces criteria objects with their corresponding
  1997. * values.
  1998. *
  1999. * @private
  2000. * @param {Array} array The array to sort.
  2001. * @param {Function} comparer The function to define sort order.
  2002. * @returns {Array} Returns `array`.
  2003. */
  2004. function baseSortBy(array, comparer) {
  2005. var length = array.length;
  2006. array.sort(comparer);
  2007. while (length--) {
  2008. array[length] = array[length].value;
  2009. }
  2010. return array;
  2011. }
  2012. /**
  2013. * The base implementation of `_.sum` and `_.sumBy` without support for
  2014. * iteratee shorthands.
  2015. *
  2016. * @private
  2017. * @param {Array} array The array to iterate over.
  2018. * @param {Function} iteratee The function invoked per iteration.
  2019. * @returns {number} Returns the sum.
  2020. */
  2021. function baseSum(array, iteratee) {
  2022. var result,
  2023. index = -1,
  2024. length = array.length;
  2025. while (++index < length) {
  2026. var current = iteratee(array[index]);
  2027. if (current !== undefined) {
  2028. result = result === undefined ? current : (result + current);
  2029. }
  2030. }
  2031. return result;
  2032. }
  2033. /**
  2034. * The base implementation of `_.times` without support for iteratee shorthands
  2035. * or max array length checks.
  2036. *
  2037. * @private
  2038. * @param {number} n The number of times to invoke `iteratee`.
  2039. * @param {Function} iteratee The function invoked per iteration.
  2040. * @returns {Array} Returns the array of results.
  2041. */
  2042. function baseTimes(n, iteratee) {
  2043. var index = -1,
  2044. result = Array(n);
  2045. while (++index < n) {
  2046. result[index] = iteratee(index);
  2047. }
  2048. return result;
  2049. }
  2050. /**
  2051. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2052. * of key-value pairs for `object` corresponding to the property names of `props`.
  2053. *
  2054. * @private
  2055. * @param {Object} object The object to query.
  2056. * @param {Array} props The property names to get values for.
  2057. * @returns {Object} Returns the key-value pairs.
  2058. */
  2059. function baseToPairs(object, props) {
  2060. return arrayMap(props, function(key) {
  2061. return [key, object[key]];
  2062. });
  2063. }
  2064. /**
  2065. * The base implementation of `_.trim`.
  2066. *
  2067. * @private
  2068. * @param {string} string The string to trim.
  2069. * @returns {string} Returns the trimmed string.
  2070. */
  2071. function baseTrim(string) {
  2072. return string
  2073. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2074. : string;
  2075. }
  2076. /**
  2077. * The base implementation of `_.unary` without support for storing metadata.
  2078. *
  2079. * @private
  2080. * @param {Function} func The function to cap arguments for.
  2081. * @returns {Function} Returns the new capped function.
  2082. */
  2083. function baseUnary(func) {
  2084. return function(value) {
  2085. return func(value);
  2086. };
  2087. }
  2088. /**
  2089. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2090. * array of `object` property values corresponding to the property names
  2091. * of `props`.
  2092. *
  2093. * @private
  2094. * @param {Object} object The object to query.
  2095. * @param {Array} props The property names to get values for.
  2096. * @returns {Object} Returns the array of property values.
  2097. */
  2098. function baseValues(object, props) {
  2099. return arrayMap(props, function(key) {
  2100. return object[key];
  2101. });
  2102. }
  2103. /**
  2104. * Checks if a `cache` value for `key` exists.
  2105. *
  2106. * @private
  2107. * @param {Object} cache The cache to query.
  2108. * @param {string} key The key of the entry to check.
  2109. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2110. */
  2111. function cacheHas(cache, key) {
  2112. return cache.has(key);
  2113. }
  2114. /**
  2115. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2116. * that is not found in the character symbols.
  2117. *
  2118. * @private
  2119. * @param {Array} strSymbols The string symbols to inspect.
  2120. * @param {Array} chrSymbols The character symbols to find.
  2121. * @returns {number} Returns the index of the first unmatched string symbol.
  2122. */
  2123. function charsStartIndex(strSymbols, chrSymbols) {
  2124. var index = -1,
  2125. length = strSymbols.length;
  2126. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2127. return index;
  2128. }
  2129. /**
  2130. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2131. * that is not found in the character symbols.
  2132. *
  2133. * @private
  2134. * @param {Array} strSymbols The string symbols to inspect.
  2135. * @param {Array} chrSymbols The character symbols to find.
  2136. * @returns {number} Returns the index of the last unmatched string symbol.
  2137. */
  2138. function charsEndIndex(strSymbols, chrSymbols) {
  2139. var index = strSymbols.length;
  2140. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2141. return index;
  2142. }
  2143. /**
  2144. * Gets the number of `placeholder` occurrences in `array`.
  2145. *
  2146. * @private
  2147. * @param {Array} array The array to inspect.
  2148. * @param {*} placeholder The placeholder to search for.
  2149. * @returns {number} Returns the placeholder count.
  2150. */
  2151. function countHolders(array, placeholder) {
  2152. var length = array.length,
  2153. result = 0;
  2154. while (length--) {
  2155. if (array[length] === placeholder) {
  2156. ++result;
  2157. }
  2158. }
  2159. return result;
  2160. }
  2161. /**
  2162. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2163. * letters to basic Latin letters.
  2164. *
  2165. * @private
  2166. * @param {string} letter The matched letter to deburr.
  2167. * @returns {string} Returns the deburred letter.
  2168. */
  2169. var deburrLetter = basePropertyOf(deburredLetters);
  2170. /**
  2171. * Used by `_.escape` to convert characters to HTML entities.
  2172. *
  2173. * @private
  2174. * @param {string} chr The matched character to escape.
  2175. * @returns {string} Returns the escaped character.
  2176. */
  2177. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2178. /**
  2179. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2180. *
  2181. * @private
  2182. * @param {string} chr The matched character to escape.
  2183. * @returns {string} Returns the escaped character.
  2184. */
  2185. function escapeStringChar(chr) {
  2186. return '\\' + stringEscapes[chr];
  2187. }
  2188. /**
  2189. * Gets the value at `key` of `object`.
  2190. *
  2191. * @private
  2192. * @param {Object} [object] The object to query.
  2193. * @param {string} key The key of the property to get.
  2194. * @returns {*} Returns the property value.
  2195. */
  2196. function getValue(object, key) {
  2197. return object == null ? undefined : object[key];
  2198. }
  2199. /**
  2200. * Checks if `string` contains Unicode symbols.
  2201. *
  2202. * @private
  2203. * @param {string} string The string to inspect.
  2204. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2205. */
  2206. function hasUnicode(string) {
  2207. return reHasUnicode.test(string);
  2208. }
  2209. /**
  2210. * Checks if `string` contains a word composed of Unicode symbols.
  2211. *
  2212. * @private
  2213. * @param {string} string The string to inspect.
  2214. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2215. */
  2216. function hasUnicodeWord(string) {
  2217. return reHasUnicodeWord.test(string);
  2218. }
  2219. /**
  2220. * Converts `iterator` to an array.
  2221. *
  2222. * @private
  2223. * @param {Object} iterator The iterator to convert.
  2224. * @returns {Array} Returns the converted array.
  2225. */
  2226. function iteratorToArray(iterator) {
  2227. var data,
  2228. result = [];
  2229. while (!(data = iterator.next()).done) {
  2230. result.push(data.value);
  2231. }
  2232. return result;
  2233. }
  2234. /**
  2235. * Converts `map` to its key-value pairs.
  2236. *
  2237. * @private
  2238. * @param {Object} map The map to convert.
  2239. * @returns {Array} Returns the key-value pairs.
  2240. */
  2241. function mapToArray(map) {
  2242. var index = -1,
  2243. result = Array(map.size);
  2244. map.forEach(function(value, key) {
  2245. result[++index] = [key, value];
  2246. });
  2247. return result;
  2248. }
  2249. /**
  2250. * Creates a unary function that invokes `func` with its argument transformed.
  2251. *
  2252. * @private
  2253. * @param {Function} func The function to wrap.
  2254. * @param {Function} transform The argument transform.
  2255. * @returns {Function} Returns the new function.
  2256. */
  2257. function overArg(func, transform) {
  2258. return function(arg) {
  2259. return func(transform(arg));
  2260. };
  2261. }
  2262. /**
  2263. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2264. * and returns an array of their indexes.
  2265. *
  2266. * @private
  2267. * @param {Array} array The array to modify.
  2268. * @param {*} placeholder The placeholder to replace.
  2269. * @returns {Array} Returns the new array of placeholder indexes.
  2270. */
  2271. function replaceHolders(array, placeholder) {
  2272. var index = -1,
  2273. length = array.length,
  2274. resIndex = 0,
  2275. result = [];
  2276. while (++index < length) {
  2277. var value = array[index];
  2278. if (value === placeholder || value === PLACEHOLDER) {
  2279. array[index] = PLACEHOLDER;
  2280. result[resIndex++] = index;
  2281. }
  2282. }
  2283. return result;
  2284. }
  2285. /**
  2286. * Converts `set` to an array of its values.
  2287. *
  2288. * @private
  2289. * @param {Object} set The set to convert.
  2290. * @returns {Array} Returns the values.
  2291. */
  2292. function setToArray(set) {
  2293. var index = -1,
  2294. result = Array(set.size);
  2295. set.forEach(function(value) {
  2296. result[++index] = value;
  2297. });
  2298. return result;
  2299. }
  2300. /**
  2301. * Converts `set` to its value-value pairs.
  2302. *
  2303. * @private
  2304. * @param {Object} set The set to convert.
  2305. * @returns {Array} Returns the value-value pairs.
  2306. */
  2307. function setToPairs(set) {
  2308. var index = -1,
  2309. result = Array(set.size);
  2310. set.forEach(function(value) {
  2311. result[++index] = [value, value];
  2312. });
  2313. return result;
  2314. }
  2315. /**
  2316. * A specialized version of `_.indexOf` which performs strict equality
  2317. * comparisons of values, i.e. `===`.
  2318. *
  2319. * @private
  2320. * @param {Array} array The array to inspect.
  2321. * @param {*} value The value to search for.
  2322. * @param {number} fromIndex The index to search from.
  2323. * @returns {number} Returns the index of the matched value, else `-1`.
  2324. */
  2325. function strictIndexOf(array, value, fromIndex) {
  2326. var index = fromIndex - 1,
  2327. length = array.length;
  2328. while (++index < length) {
  2329. if (array[index] === value) {
  2330. return index;
  2331. }
  2332. }
  2333. return -1;
  2334. }
  2335. /**
  2336. * A specialized version of `_.lastIndexOf` which performs strict equality
  2337. * comparisons of values, i.e. `===`.
  2338. *
  2339. * @private
  2340. * @param {Array} array The array to inspect.
  2341. * @param {*} value The value to search for.
  2342. * @param {number} fromIndex The index to search from.
  2343. * @returns {number} Returns the index of the matched value, else `-1`.
  2344. */
  2345. function strictLastIndexOf(array, value, fromIndex) {
  2346. var index = fromIndex + 1;
  2347. while (index--) {
  2348. if (array[index] === value) {
  2349. return index;
  2350. }
  2351. }
  2352. return index;
  2353. }
  2354. /**
  2355. * Gets the number of symbols in `string`.
  2356. *
  2357. * @private
  2358. * @param {string} string The string to inspect.
  2359. * @returns {number} Returns the string size.
  2360. */
  2361. function stringSize(string) {
  2362. return hasUnicode(string)
  2363. ? unicodeSize(string)
  2364. : asciiSize(string);
  2365. }
  2366. /**
  2367. * Converts `string` to an array.
  2368. *
  2369. * @private
  2370. * @param {string} string The string to convert.
  2371. * @returns {Array} Returns the converted array.
  2372. */
  2373. function stringToArray(string) {
  2374. return hasUnicode(string)
  2375. ? unicodeToArray(string)
  2376. : asciiToArray(string);
  2377. }
  2378. /**
  2379. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2380. * character of `string`.
  2381. *
  2382. * @private
  2383. * @param {string} string The string to inspect.
  2384. * @returns {number} Returns the index of the last non-whitespace character.
  2385. */
  2386. function trimmedEndIndex(string) {
  2387. var index = string.length;
  2388. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2389. return index;
  2390. }
  2391. /**
  2392. * Used by `_.unescape` to convert HTML entities to characters.
  2393. *
  2394. * @private
  2395. * @param {string} chr The matched character to unescape.
  2396. * @returns {string} Returns the unescaped character.
  2397. */
  2398. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2399. /**
  2400. * Gets the size of a Unicode `string`.
  2401. *
  2402. * @private
  2403. * @param {string} string The string inspect.
  2404. * @returns {number} Returns the string size.
  2405. */
  2406. function unicodeSize(string) {
  2407. var result = reUnicode.lastIndex = 0;
  2408. while (reUnicode.test(string)) {
  2409. ++result;
  2410. }
  2411. return result;
  2412. }
  2413. /**
  2414. * Converts a Unicode `string` to an array.
  2415. *
  2416. * @private
  2417. * @param {string} string The string to convert.
  2418. * @returns {Array} Returns the converted array.
  2419. */
  2420. function unicodeToArray(string) {
  2421. return string.match(reUnicode) || [];
  2422. }
  2423. /**
  2424. * Splits a Unicode `string` into an array of its words.
  2425. *
  2426. * @private
  2427. * @param {string} The string to inspect.
  2428. * @returns {Array} Returns the words of `string`.
  2429. */
  2430. function unicodeWords(string) {
  2431. return string.match(reUnicodeWord) || [];
  2432. }
  2433. /*--------------------------------------------------------------------------*/
  2434. /**
  2435. * Create a new pristine `lodash` function using the `context` object.
  2436. *
  2437. * @static
  2438. * @memberOf _
  2439. * @since 1.1.0
  2440. * @category Util
  2441. * @param {Object} [context=root] The context object.
  2442. * @returns {Function} Returns a new `lodash` function.
  2443. * @example
  2444. *
  2445. * _.mixin({ 'foo': _.constant('foo') });
  2446. *
  2447. * var lodash = _.runInContext();
  2448. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2449. *
  2450. * _.isFunction(_.foo);
  2451. * // => true
  2452. * _.isFunction(_.bar);
  2453. * // => false
  2454. *
  2455. * lodash.isFunction(lodash.foo);
  2456. * // => false
  2457. * lodash.isFunction(lodash.bar);
  2458. * // => true
  2459. *
  2460. * // Create a suped-up `defer` in Node.js.
  2461. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2462. */
  2463. var runInContext = (function runInContext(context) {
  2464. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2465. /** Built-in constructor references. */
  2466. var Array = context.Array,
  2467. Date = context.Date,
  2468. Error = context.Error,
  2469. Function = context.Function,
  2470. Math = context.Math,
  2471. Object = context.Object,
  2472. RegExp = context.RegExp,
  2473. String = context.String,
  2474. TypeError = context.TypeError;
  2475. /** Used for built-in method references. */
  2476. var arrayProto = Array.prototype,
  2477. funcProto = Function.prototype,
  2478. objectProto = Object.prototype;
  2479. /** Used to detect overreaching core-js shims. */
  2480. var coreJsData = context['__core-js_shared__'];
  2481. /** Used to resolve the decompiled source of functions. */
  2482. var funcToString = funcProto.toString;
  2483. /** Used to check objects for own properties. */
  2484. var hasOwnProperty = objectProto.hasOwnProperty;
  2485. /** Used to generate unique IDs. */
  2486. var idCounter = 0;
  2487. /** Used to detect methods masquerading as native. */
  2488. var maskSrcKey = (function() {
  2489. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2490. return uid ? ('Symbol(src)_1.' + uid) : '';
  2491. }());
  2492. /**
  2493. * Used to resolve the
  2494. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2495. * of values.
  2496. */
  2497. var nativeObjectToString = objectProto.toString;
  2498. /** Used to infer the `Object` constructor. */
  2499. var objectCtorString = funcToString.call(Object);
  2500. /** Used to restore the original `_` reference in `_.noConflict`. */
  2501. var oldDash = root._;
  2502. /** Used to detect if a method is native. */
  2503. var reIsNative = RegExp('^' +
  2504. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2505. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2506. );
  2507. /** Built-in value references. */
  2508. var Buffer = moduleExports ? context.Buffer : undefined,
  2509. Symbol = context.Symbol,
  2510. Uint8Array = context.Uint8Array,
  2511. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2512. getPrototype = overArg(Object.getPrototypeOf, Object),
  2513. objectCreate = Object.create,
  2514. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2515. splice = arrayProto.splice,
  2516. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2517. symIterator = Symbol ? Symbol.iterator : undefined,
  2518. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2519. var defineProperty = (function() {
  2520. try {
  2521. var func = getNative(Object, 'defineProperty');
  2522. func({}, '', {});
  2523. return func;
  2524. } catch (e) {}
  2525. }());
  2526. /** Mocked built-ins. */
  2527. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2528. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2529. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2530. /* Built-in method references for those with the same name as other `lodash` methods. */
  2531. var nativeCeil = Math.ceil,
  2532. nativeFloor = Math.floor,
  2533. nativeGetSymbols = Object.getOwnPropertySymbols,
  2534. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2535. nativeIsFinite = context.isFinite,
  2536. nativeJoin = arrayProto.join,
  2537. nativeKeys = overArg(Object.keys, Object),
  2538. nativeMax = Math.max,
  2539. nativeMin = Math.min,
  2540. nativeNow = Date.now,
  2541. nativeParseInt = context.parseInt,
  2542. nativeRandom = Math.random,
  2543. nativeReverse = arrayProto.reverse;
  2544. /* Built-in method references that are verified to be native. */
  2545. var DataView = getNative(context, 'DataView'),
  2546. Map = getNative(context, 'Map'),
  2547. Promise = getNative(context, 'Promise'),
  2548. Set = getNative(context, 'Set'),
  2549. WeakMap = getNative(context, 'WeakMap'),
  2550. nativeCreate = getNative(Object, 'create');
  2551. /** Used to store function metadata. */
  2552. var metaMap = WeakMap && new WeakMap;
  2553. /** Used to lookup unminified function names. */
  2554. var realNames = {};
  2555. /** Used to detect maps, sets, and weakmaps. */
  2556. var dataViewCtorString = toSource(DataView),
  2557. mapCtorString = toSource(Map),
  2558. promiseCtorString = toSource(Promise),
  2559. setCtorString = toSource(Set),
  2560. weakMapCtorString = toSource(WeakMap);
  2561. /** Used to convert symbols to primitives and strings. */
  2562. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2563. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2564. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2565. /*------------------------------------------------------------------------*/
  2566. /**
  2567. * Creates a `lodash` object which wraps `value` to enable implicit method
  2568. * chain sequences. Methods that operate on and return arrays, collections,
  2569. * and functions can be chained together. Methods that retrieve a single value
  2570. * or may return a primitive value will automatically end the chain sequence
  2571. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2572. * with `_#value`.
  2573. *
  2574. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2575. * enabled using `_.chain`.
  2576. *
  2577. * The execution of chained methods is lazy, that is, it's deferred until
  2578. * `_#value` is implicitly or explicitly called.
  2579. *
  2580. * Lazy evaluation allows several methods to support shortcut fusion.
  2581. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2582. * the creation of intermediate arrays and can greatly reduce the number of
  2583. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2584. * fusion if the section is applied to an array and iteratees accept only
  2585. * one argument. The heuristic for whether a section qualifies for shortcut
  2586. * fusion is subject to change.
  2587. *
  2588. * Chaining is supported in custom builds as long as the `_#value` method is
  2589. * directly or indirectly included in the build.
  2590. *
  2591. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2592. *
  2593. * The wrapper `Array` methods are:
  2594. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2595. *
  2596. * The wrapper `String` methods are:
  2597. * `replace` and `split`
  2598. *
  2599. * The wrapper methods that support shortcut fusion are:
  2600. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2601. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2602. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2603. *
  2604. * The chainable wrapper methods are:
  2605. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2606. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2607. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2608. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2609. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2610. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2611. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2612. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2613. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2614. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2615. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2616. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2617. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2618. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2619. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2620. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2621. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2622. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2623. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2624. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2625. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2626. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2627. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2628. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2629. *
  2630. * The wrapper methods that are **not** chainable by default are:
  2631. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2632. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2633. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2634. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2635. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2636. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2637. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2638. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2639. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2640. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2641. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2642. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2643. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2644. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2645. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2646. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2647. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2648. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2649. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2650. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2651. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2652. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2653. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2654. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2655. * `upperFirst`, `value`, and `words`
  2656. *
  2657. * @name _
  2658. * @constructor
  2659. * @category Seq
  2660. * @param {*} value The value to wrap in a `lodash` instance.
  2661. * @returns {Object} Returns the new `lodash` wrapper instance.
  2662. * @example
  2663. *
  2664. * function square(n) {
  2665. * return n * n;
  2666. * }
  2667. *
  2668. * var wrapped = _([1, 2, 3]);
  2669. *
  2670. * // Returns an unwrapped value.
  2671. * wrapped.reduce(_.add);
  2672. * // => 6
  2673. *
  2674. * // Returns a wrapped value.
  2675. * var squares = wrapped.map(square);
  2676. *
  2677. * _.isArray(squares);
  2678. * // => false
  2679. *
  2680. * _.isArray(squares.value());
  2681. * // => true
  2682. */
  2683. function lodash(value) {
  2684. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2685. if (value instanceof LodashWrapper) {
  2686. return value;
  2687. }
  2688. if (hasOwnProperty.call(value, '__wrapped__')) {
  2689. return wrapperClone(value);
  2690. }
  2691. }
  2692. return new LodashWrapper(value);
  2693. }
  2694. /**
  2695. * The base implementation of `_.create` without support for assigning
  2696. * properties to the created object.
  2697. *
  2698. * @private
  2699. * @param {Object} proto The object to inherit from.
  2700. * @returns {Object} Returns the new object.
  2701. */
  2702. var baseCreate = (function() {
  2703. function object() {}
  2704. return function(proto) {
  2705. if (!isObject(proto)) {
  2706. return {};
  2707. }
  2708. if (objectCreate) {
  2709. return objectCreate(proto);
  2710. }
  2711. object.prototype = proto;
  2712. var result = new object;
  2713. object.prototype = undefined;
  2714. return result;
  2715. };
  2716. }());
  2717. /**
  2718. * The function whose prototype chain sequence wrappers inherit from.
  2719. *
  2720. * @private
  2721. */
  2722. function baseLodash() {
  2723. // No operation performed.
  2724. }
  2725. /**
  2726. * The base constructor for creating `lodash` wrapper objects.
  2727. *
  2728. * @private
  2729. * @param {*} value The value to wrap.
  2730. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2731. */
  2732. function LodashWrapper(value, chainAll) {
  2733. this.__wrapped__ = value;
  2734. this.__actions__ = [];
  2735. this.__chain__ = !!chainAll;
  2736. this.__index__ = 0;
  2737. this.__values__ = undefined;
  2738. }
  2739. /**
  2740. * By default, the template delimiters used by lodash are like those in
  2741. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2742. * following template settings to use alternative delimiters.
  2743. *
  2744. * @static
  2745. * @memberOf _
  2746. * @type {Object}
  2747. */
  2748. lodash.templateSettings = {
  2749. /**
  2750. * Used to detect `data` property values to be HTML-escaped.
  2751. *
  2752. * @memberOf _.templateSettings
  2753. * @type {RegExp}
  2754. */
  2755. 'escape': reEscape,
  2756. /**
  2757. * Used to detect code to be evaluated.
  2758. *
  2759. * @memberOf _.templateSettings
  2760. * @type {RegExp}
  2761. */
  2762. 'evaluate': reEvaluate,
  2763. /**
  2764. * Used to detect `data` property values to inject.
  2765. *
  2766. * @memberOf _.templateSettings
  2767. * @type {RegExp}
  2768. */
  2769. 'interpolate': reInterpolate,
  2770. /**
  2771. * Used to reference the data object in the template text.
  2772. *
  2773. * @memberOf _.templateSettings
  2774. * @type {string}
  2775. */
  2776. 'variable': '',
  2777. /**
  2778. * Used to import variables into the compiled template.
  2779. *
  2780. * @memberOf _.templateSettings
  2781. * @type {Object}
  2782. */
  2783. 'imports': {
  2784. /**
  2785. * A reference to the `lodash` function.
  2786. *
  2787. * @memberOf _.templateSettings.imports
  2788. * @type {Function}
  2789. */
  2790. '_': lodash
  2791. }
  2792. };
  2793. // Ensure wrappers are instances of `baseLodash`.
  2794. lodash.prototype = baseLodash.prototype;
  2795. lodash.prototype.constructor = lodash;
  2796. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2797. LodashWrapper.prototype.constructor = LodashWrapper;
  2798. /*------------------------------------------------------------------------*/
  2799. /**
  2800. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2801. *
  2802. * @private
  2803. * @constructor
  2804. * @param {*} value The value to wrap.
  2805. */
  2806. function LazyWrapper(value) {
  2807. this.__wrapped__ = value;
  2808. this.__actions__ = [];
  2809. this.__dir__ = 1;
  2810. this.__filtered__ = false;
  2811. this.__iteratees__ = [];
  2812. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2813. this.__views__ = [];
  2814. }
  2815. /**
  2816. * Creates a clone of the lazy wrapper object.
  2817. *
  2818. * @private
  2819. * @name clone
  2820. * @memberOf LazyWrapper
  2821. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2822. */
  2823. function lazyClone() {
  2824. var result = new LazyWrapper(this.__wrapped__);
  2825. result.__actions__ = copyArray(this.__actions__);
  2826. result.__dir__ = this.__dir__;
  2827. result.__filtered__ = this.__filtered__;
  2828. result.__iteratees__ = copyArray(this.__iteratees__);
  2829. result.__takeCount__ = this.__takeCount__;
  2830. result.__views__ = copyArray(this.__views__);
  2831. return result;
  2832. }
  2833. /**
  2834. * Reverses the direction of lazy iteration.
  2835. *
  2836. * @private
  2837. * @name reverse
  2838. * @memberOf LazyWrapper
  2839. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2840. */
  2841. function lazyReverse() {
  2842. if (this.__filtered__) {
  2843. var result = new LazyWrapper(this);
  2844. result.__dir__ = -1;
  2845. result.__filtered__ = true;
  2846. } else {
  2847. result = this.clone();
  2848. result.__dir__ *= -1;
  2849. }
  2850. return result;
  2851. }
  2852. /**
  2853. * Extracts the unwrapped value from its lazy wrapper.
  2854. *
  2855. * @private
  2856. * @name value
  2857. * @memberOf LazyWrapper
  2858. * @returns {*} Returns the unwrapped value.
  2859. */
  2860. function lazyValue() {
  2861. var array = this.__wrapped__.value(),
  2862. dir = this.__dir__,
  2863. isArr = isArray(array),
  2864. isRight = dir < 0,
  2865. arrLength = isArr ? array.length : 0,
  2866. view = getView(0, arrLength, this.__views__),
  2867. start = view.start,
  2868. end = view.end,
  2869. length = end - start,
  2870. index = isRight ? end : (start - 1),
  2871. iteratees = this.__iteratees__,
  2872. iterLength = iteratees.length,
  2873. resIndex = 0,
  2874. takeCount = nativeMin(length, this.__takeCount__);
  2875. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2876. return baseWrapperValue(array, this.__actions__);
  2877. }
  2878. var result = [];
  2879. outer:
  2880. while (length-- && resIndex < takeCount) {
  2881. index += dir;
  2882. var iterIndex = -1,
  2883. value = array[index];
  2884. while (++iterIndex < iterLength) {
  2885. var data = iteratees[iterIndex],
  2886. iteratee = data.iteratee,
  2887. type = data.type,
  2888. computed = iteratee(value);
  2889. if (type == LAZY_MAP_FLAG) {
  2890. value = computed;
  2891. } else if (!computed) {
  2892. if (type == LAZY_FILTER_FLAG) {
  2893. continue outer;
  2894. } else {
  2895. break outer;
  2896. }
  2897. }
  2898. }
  2899. result[resIndex++] = value;
  2900. }
  2901. return result;
  2902. }
  2903. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2904. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2905. LazyWrapper.prototype.constructor = LazyWrapper;
  2906. /*------------------------------------------------------------------------*/
  2907. /**
  2908. * Creates a hash object.
  2909. *
  2910. * @private
  2911. * @constructor
  2912. * @param {Array} [entries] The key-value pairs to cache.
  2913. */
  2914. function Hash(entries) {
  2915. var index = -1,
  2916. length = entries == null ? 0 : entries.length;
  2917. this.clear();
  2918. while (++index < length) {
  2919. var entry = entries[index];
  2920. this.set(entry[0], entry[1]);
  2921. }
  2922. }
  2923. /**
  2924. * Removes all key-value entries from the hash.
  2925. *
  2926. * @private
  2927. * @name clear
  2928. * @memberOf Hash
  2929. */
  2930. function hashClear() {
  2931. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2932. this.size = 0;
  2933. }
  2934. /**
  2935. * Removes `key` and its value from the hash.
  2936. *
  2937. * @private
  2938. * @name delete
  2939. * @memberOf Hash
  2940. * @param {Object} hash The hash to modify.
  2941. * @param {string} key The key of the value to remove.
  2942. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2943. */
  2944. function hashDelete(key) {
  2945. var result = this.has(key) && delete this.__data__[key];
  2946. this.size -= result ? 1 : 0;
  2947. return result;
  2948. }
  2949. /**
  2950. * Gets the hash value for `key`.
  2951. *
  2952. * @private
  2953. * @name get
  2954. * @memberOf Hash
  2955. * @param {string} key The key of the value to get.
  2956. * @returns {*} Returns the entry value.
  2957. */
  2958. function hashGet(key) {
  2959. var data = this.__data__;
  2960. if (nativeCreate) {
  2961. var result = data[key];
  2962. return result === HASH_UNDEFINED ? undefined : result;
  2963. }
  2964. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2965. }
  2966. /**
  2967. * Checks if a hash value for `key` exists.
  2968. *
  2969. * @private
  2970. * @name has
  2971. * @memberOf Hash
  2972. * @param {string} key The key of the entry to check.
  2973. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2974. */
  2975. function hashHas(key) {
  2976. var data = this.__data__;
  2977. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2978. }
  2979. /**
  2980. * Sets the hash `key` to `value`.
  2981. *
  2982. * @private
  2983. * @name set
  2984. * @memberOf Hash
  2985. * @param {string} key The key of the value to set.
  2986. * @param {*} value The value to set.
  2987. * @returns {Object} Returns the hash instance.
  2988. */
  2989. function hashSet(key, value) {
  2990. var data = this.__data__;
  2991. this.size += this.has(key) ? 0 : 1;
  2992. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2993. return this;
  2994. }
  2995. // Add methods to `Hash`.
  2996. Hash.prototype.clear = hashClear;
  2997. Hash.prototype['delete'] = hashDelete;
  2998. Hash.prototype.get = hashGet;
  2999. Hash.prototype.has = hashHas;
  3000. Hash.prototype.set = hashSet;
  3001. /*------------------------------------------------------------------------*/
  3002. /**
  3003. * Creates an list cache object.
  3004. *
  3005. * @private
  3006. * @constructor
  3007. * @param {Array} [entries] The key-value pairs to cache.
  3008. */
  3009. function ListCache(entries) {
  3010. var index = -1,
  3011. length = entries == null ? 0 : entries.length;
  3012. this.clear();
  3013. while (++index < length) {
  3014. var entry = entries[index];
  3015. this.set(entry[0], entry[1]);
  3016. }
  3017. }
  3018. /**
  3019. * Removes all key-value entries from the list cache.
  3020. *
  3021. * @private
  3022. * @name clear
  3023. * @memberOf ListCache
  3024. */
  3025. function listCacheClear() {
  3026. this.__data__ = [];
  3027. this.size = 0;
  3028. }
  3029. /**
  3030. * Removes `key` and its value from the list cache.
  3031. *
  3032. * @private
  3033. * @name delete
  3034. * @memberOf ListCache
  3035. * @param {string} key The key of the value to remove.
  3036. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3037. */
  3038. function listCacheDelete(key) {
  3039. var data = this.__data__,
  3040. index = assocIndexOf(data, key);
  3041. if (index < 0) {
  3042. return false;
  3043. }
  3044. var lastIndex = data.length - 1;
  3045. if (index == lastIndex) {
  3046. data.pop();
  3047. } else {
  3048. splice.call(data, index, 1);
  3049. }
  3050. --this.size;
  3051. return true;
  3052. }
  3053. /**
  3054. * Gets the list cache value for `key`.
  3055. *
  3056. * @private
  3057. * @name get
  3058. * @memberOf ListCache
  3059. * @param {string} key The key of the value to get.
  3060. * @returns {*} Returns the entry value.
  3061. */
  3062. function listCacheGet(key) {
  3063. var data = this.__data__,
  3064. index = assocIndexOf(data, key);
  3065. return index < 0 ? undefined : data[index][1];
  3066. }
  3067. /**
  3068. * Checks if a list cache value for `key` exists.
  3069. *
  3070. * @private
  3071. * @name has
  3072. * @memberOf ListCache
  3073. * @param {string} key The key of the entry to check.
  3074. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3075. */
  3076. function listCacheHas(key) {
  3077. return assocIndexOf(this.__data__, key) > -1;
  3078. }
  3079. /**
  3080. * Sets the list cache `key` to `value`.
  3081. *
  3082. * @private
  3083. * @name set
  3084. * @memberOf ListCache
  3085. * @param {string} key The key of the value to set.
  3086. * @param {*} value The value to set.
  3087. * @returns {Object} Returns the list cache instance.
  3088. */
  3089. function listCacheSet(key, value) {
  3090. var data = this.__data__,
  3091. index = assocIndexOf(data, key);
  3092. if (index < 0) {
  3093. ++this.size;
  3094. data.push([key, value]);
  3095. } else {
  3096. data[index][1] = value;
  3097. }
  3098. return this;
  3099. }
  3100. // Add methods to `ListCache`.
  3101. ListCache.prototype.clear = listCacheClear;
  3102. ListCache.prototype['delete'] = listCacheDelete;
  3103. ListCache.prototype.get = listCacheGet;
  3104. ListCache.prototype.has = listCacheHas;
  3105. ListCache.prototype.set = listCacheSet;
  3106. /*------------------------------------------------------------------------*/
  3107. /**
  3108. * Creates a map cache object to store key-value pairs.
  3109. *
  3110. * @private
  3111. * @constructor
  3112. * @param {Array} [entries] The key-value pairs to cache.
  3113. */
  3114. function MapCache(entries) {
  3115. var index = -1,
  3116. length = entries == null ? 0 : entries.length;
  3117. this.clear();
  3118. while (++index < length) {
  3119. var entry = entries[index];
  3120. this.set(entry[0], entry[1]);
  3121. }
  3122. }
  3123. /**
  3124. * Removes all key-value entries from the map.
  3125. *
  3126. * @private
  3127. * @name clear
  3128. * @memberOf MapCache
  3129. */
  3130. function mapCacheClear() {
  3131. this.size = 0;
  3132. this.__data__ = {
  3133. 'hash': new Hash,
  3134. 'map': new (Map || ListCache),
  3135. 'string': new Hash
  3136. };
  3137. }
  3138. /**
  3139. * Removes `key` and its value from the map.
  3140. *
  3141. * @private
  3142. * @name delete
  3143. * @memberOf MapCache
  3144. * @param {string} key The key of the value to remove.
  3145. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3146. */
  3147. function mapCacheDelete(key) {
  3148. var result = getMapData(this, key)['delete'](key);
  3149. this.size -= result ? 1 : 0;
  3150. return result;
  3151. }
  3152. /**
  3153. * Gets the map value for `key`.
  3154. *
  3155. * @private
  3156. * @name get
  3157. * @memberOf MapCache
  3158. * @param {string} key The key of the value to get.
  3159. * @returns {*} Returns the entry value.
  3160. */
  3161. function mapCacheGet(key) {
  3162. return getMapData(this, key).get(key);
  3163. }
  3164. /**
  3165. * Checks if a map value for `key` exists.
  3166. *
  3167. * @private
  3168. * @name has
  3169. * @memberOf MapCache
  3170. * @param {string} key The key of the entry to check.
  3171. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3172. */
  3173. function mapCacheHas(key) {
  3174. return getMapData(this, key).has(key);
  3175. }
  3176. /**
  3177. * Sets the map `key` to `value`.
  3178. *
  3179. * @private
  3180. * @name set
  3181. * @memberOf MapCache
  3182. * @param {string} key The key of the value to set.
  3183. * @param {*} value The value to set.
  3184. * @returns {Object} Returns the map cache instance.
  3185. */
  3186. function mapCacheSet(key, value) {
  3187. var data = getMapData(this, key),
  3188. size = data.size;
  3189. data.set(key, value);
  3190. this.size += data.size == size ? 0 : 1;
  3191. return this;
  3192. }
  3193. // Add methods to `MapCache`.
  3194. MapCache.prototype.clear = mapCacheClear;
  3195. MapCache.prototype['delete'] = mapCacheDelete;
  3196. MapCache.prototype.get = mapCacheGet;
  3197. MapCache.prototype.has = mapCacheHas;
  3198. MapCache.prototype.set = mapCacheSet;
  3199. /*------------------------------------------------------------------------*/
  3200. /**
  3201. *
  3202. * Creates an array cache object to store unique values.
  3203. *
  3204. * @private
  3205. * @constructor
  3206. * @param {Array} [values] The values to cache.
  3207. */
  3208. function SetCache(values) {
  3209. var index = -1,
  3210. length = values == null ? 0 : values.length;
  3211. this.__data__ = new MapCache;
  3212. while (++index < length) {
  3213. this.add(values[index]);
  3214. }
  3215. }
  3216. /**
  3217. * Adds `value` to the array cache.
  3218. *
  3219. * @private
  3220. * @name add
  3221. * @memberOf SetCache
  3222. * @alias push
  3223. * @param {*} value The value to cache.
  3224. * @returns {Object} Returns the cache instance.
  3225. */
  3226. function setCacheAdd(value) {
  3227. this.__data__.set(value, HASH_UNDEFINED);
  3228. return this;
  3229. }
  3230. /**
  3231. * Checks if `value` is in the array cache.
  3232. *
  3233. * @private
  3234. * @name has
  3235. * @memberOf SetCache
  3236. * @param {*} value The value to search for.
  3237. * @returns {number} Returns `true` if `value` is found, else `false`.
  3238. */
  3239. function setCacheHas(value) {
  3240. return this.__data__.has(value);
  3241. }
  3242. // Add methods to `SetCache`.
  3243. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3244. SetCache.prototype.has = setCacheHas;
  3245. /*------------------------------------------------------------------------*/
  3246. /**
  3247. * Creates a stack cache object to store key-value pairs.
  3248. *
  3249. * @private
  3250. * @constructor
  3251. * @param {Array} [entries] The key-value pairs to cache.
  3252. */
  3253. function Stack(entries) {
  3254. var data = this.__data__ = new ListCache(entries);
  3255. this.size = data.size;
  3256. }
  3257. /**
  3258. * Removes all key-value entries from the stack.
  3259. *
  3260. * @private
  3261. * @name clear
  3262. * @memberOf Stack
  3263. */
  3264. function stackClear() {
  3265. this.__data__ = new ListCache;
  3266. this.size = 0;
  3267. }
  3268. /**
  3269. * Removes `key` and its value from the stack.
  3270. *
  3271. * @private
  3272. * @name delete
  3273. * @memberOf Stack
  3274. * @param {string} key The key of the value to remove.
  3275. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3276. */
  3277. function stackDelete(key) {
  3278. var data = this.__data__,
  3279. result = data['delete'](key);
  3280. this.size = data.size;
  3281. return result;
  3282. }
  3283. /**
  3284. * Gets the stack value for `key`.
  3285. *
  3286. * @private
  3287. * @name get
  3288. * @memberOf Stack
  3289. * @param {string} key The key of the value to get.
  3290. * @returns {*} Returns the entry value.
  3291. */
  3292. function stackGet(key) {
  3293. return this.__data__.get(key);
  3294. }
  3295. /**
  3296. * Checks if a stack value for `key` exists.
  3297. *
  3298. * @private
  3299. * @name has
  3300. * @memberOf Stack
  3301. * @param {string} key The key of the entry to check.
  3302. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3303. */
  3304. function stackHas(key) {
  3305. return this.__data__.has(key);
  3306. }
  3307. /**
  3308. * Sets the stack `key` to `value`.
  3309. *
  3310. * @private
  3311. * @name set
  3312. * @memberOf Stack
  3313. * @param {string} key The key of the value to set.
  3314. * @param {*} value The value to set.
  3315. * @returns {Object} Returns the stack cache instance.
  3316. */
  3317. function stackSet(key, value) {
  3318. var data = this.__data__;
  3319. if (data instanceof ListCache) {
  3320. var pairs = data.__data__;
  3321. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3322. pairs.push([key, value]);
  3323. this.size = ++data.size;
  3324. return this;
  3325. }
  3326. data = this.__data__ = new MapCache(pairs);
  3327. }
  3328. data.set(key, value);
  3329. this.size = data.size;
  3330. return this;
  3331. }
  3332. // Add methods to `Stack`.
  3333. Stack.prototype.clear = stackClear;
  3334. Stack.prototype['delete'] = stackDelete;
  3335. Stack.prototype.get = stackGet;
  3336. Stack.prototype.has = stackHas;
  3337. Stack.prototype.set = stackSet;
  3338. /*------------------------------------------------------------------------*/
  3339. /**
  3340. * Creates an array of the enumerable property names of the array-like `value`.
  3341. *
  3342. * @private
  3343. * @param {*} value The value to query.
  3344. * @param {boolean} inherited Specify returning inherited property names.
  3345. * @returns {Array} Returns the array of property names.
  3346. */
  3347. function arrayLikeKeys(value, inherited) {
  3348. var isArr = isArray(value),
  3349. isArg = !isArr && isArguments(value),
  3350. isBuff = !isArr && !isArg && isBuffer(value),
  3351. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3352. skipIndexes = isArr || isArg || isBuff || isType,
  3353. result = skipIndexes ? baseTimes(value.length, String) : [],
  3354. length = result.length;
  3355. for (var key in value) {
  3356. if ((inherited || hasOwnProperty.call(value, key)) &&
  3357. !(skipIndexes && (
  3358. // Safari 9 has enumerable `arguments.length` in strict mode.
  3359. key == 'length' ||
  3360. // Node.js 0.10 has enumerable non-index properties on buffers.
  3361. (isBuff && (key == 'offset' || key == 'parent')) ||
  3362. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3363. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3364. // Skip index properties.
  3365. isIndex(key, length)
  3366. ))) {
  3367. result.push(key);
  3368. }
  3369. }
  3370. return result;
  3371. }
  3372. /**
  3373. * A specialized version of `_.sample` for arrays.
  3374. *
  3375. * @private
  3376. * @param {Array} array The array to sample.
  3377. * @returns {*} Returns the random element.
  3378. */
  3379. function arraySample(array) {
  3380. var length = array.length;
  3381. return length ? array[baseRandom(0, length - 1)] : undefined;
  3382. }
  3383. /**
  3384. * A specialized version of `_.sampleSize` for arrays.
  3385. *
  3386. * @private
  3387. * @param {Array} array The array to sample.
  3388. * @param {number} n The number of elements to sample.
  3389. * @returns {Array} Returns the random elements.
  3390. */
  3391. function arraySampleSize(array, n) {
  3392. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3393. }
  3394. /**
  3395. * A specialized version of `_.shuffle` for arrays.
  3396. *
  3397. * @private
  3398. * @param {Array} array The array to shuffle.
  3399. * @returns {Array} Returns the new shuffled array.
  3400. */
  3401. function arrayShuffle(array) {
  3402. return shuffleSelf(copyArray(array));
  3403. }
  3404. /**
  3405. * This function is like `assignValue` except that it doesn't assign
  3406. * `undefined` values.
  3407. *
  3408. * @private
  3409. * @param {Object} object The object to modify.
  3410. * @param {string} key The key of the property to assign.
  3411. * @param {*} value The value to assign.
  3412. */
  3413. function assignMergeValue(object, key, value) {
  3414. if ((value !== undefined && !eq(object[key], value)) ||
  3415. (value === undefined && !(key in object))) {
  3416. baseAssignValue(object, key, value);
  3417. }
  3418. }
  3419. /**
  3420. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3421. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3422. * for equality comparisons.
  3423. *
  3424. * @private
  3425. * @param {Object} object The object to modify.
  3426. * @param {string} key The key of the property to assign.
  3427. * @param {*} value The value to assign.
  3428. */
  3429. function assignValue(object, key, value) {
  3430. var objValue = object[key];
  3431. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3432. (value === undefined && !(key in object))) {
  3433. baseAssignValue(object, key, value);
  3434. }
  3435. }
  3436. /**
  3437. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3438. *
  3439. * @private
  3440. * @param {Array} array The array to inspect.
  3441. * @param {*} key The key to search for.
  3442. * @returns {number} Returns the index of the matched value, else `-1`.
  3443. */
  3444. function assocIndexOf(array, key) {
  3445. var length = array.length;
  3446. while (length--) {
  3447. if (eq(array[length][0], key)) {
  3448. return length;
  3449. }
  3450. }
  3451. return -1;
  3452. }
  3453. /**
  3454. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3455. * by `iteratee` and values set by `setter`.
  3456. *
  3457. * @private
  3458. * @param {Array|Object} collection The collection to iterate over.
  3459. * @param {Function} setter The function to set `accumulator` values.
  3460. * @param {Function} iteratee The iteratee to transform keys.
  3461. * @param {Object} accumulator The initial aggregated object.
  3462. * @returns {Function} Returns `accumulator`.
  3463. */
  3464. function baseAggregator(collection, setter, iteratee, accumulator) {
  3465. baseEach(collection, function(value, key, collection) {
  3466. setter(accumulator, value, iteratee(value), collection);
  3467. });
  3468. return accumulator;
  3469. }
  3470. /**
  3471. * The base implementation of `_.assign` without support for multiple sources
  3472. * or `customizer` functions.
  3473. *
  3474. * @private
  3475. * @param {Object} object The destination object.
  3476. * @param {Object} source The source object.
  3477. * @returns {Object} Returns `object`.
  3478. */
  3479. function baseAssign(object, source) {
  3480. return object && copyObject(source, keys(source), object);
  3481. }
  3482. /**
  3483. * The base implementation of `_.assignIn` without support for multiple sources
  3484. * or `customizer` functions.
  3485. *
  3486. * @private
  3487. * @param {Object} object The destination object.
  3488. * @param {Object} source The source object.
  3489. * @returns {Object} Returns `object`.
  3490. */
  3491. function baseAssignIn(object, source) {
  3492. return object && copyObject(source, keysIn(source), object);
  3493. }
  3494. /**
  3495. * The base implementation of `assignValue` and `assignMergeValue` without
  3496. * value checks.
  3497. *
  3498. * @private
  3499. * @param {Object} object The object to modify.
  3500. * @param {string} key The key of the property to assign.
  3501. * @param {*} value The value to assign.
  3502. */
  3503. function baseAssignValue(object, key, value) {
  3504. if (key == '__proto__' && defineProperty) {
  3505. defineProperty(object, key, {
  3506. 'configurable': true,
  3507. 'enumerable': true,
  3508. 'value': value,
  3509. 'writable': true
  3510. });
  3511. } else {
  3512. object[key] = value;
  3513. }
  3514. }
  3515. /**
  3516. * The base implementation of `_.at` without support for individual paths.
  3517. *
  3518. * @private
  3519. * @param {Object} object The object to iterate over.
  3520. * @param {string[]} paths The property paths to pick.
  3521. * @returns {Array} Returns the picked elements.
  3522. */
  3523. function baseAt(object, paths) {
  3524. var index = -1,
  3525. length = paths.length,
  3526. result = Array(length),
  3527. skip = object == null;
  3528. while (++index < length) {
  3529. result[index] = skip ? undefined : get(object, paths[index]);
  3530. }
  3531. return result;
  3532. }
  3533. /**
  3534. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3535. *
  3536. * @private
  3537. * @param {number} number The number to clamp.
  3538. * @param {number} [lower] The lower bound.
  3539. * @param {number} upper The upper bound.
  3540. * @returns {number} Returns the clamped number.
  3541. */
  3542. function baseClamp(number, lower, upper) {
  3543. if (number === number) {
  3544. if (upper !== undefined) {
  3545. number = number <= upper ? number : upper;
  3546. }
  3547. if (lower !== undefined) {
  3548. number = number >= lower ? number : lower;
  3549. }
  3550. }
  3551. return number;
  3552. }
  3553. /**
  3554. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3555. * traversed objects.
  3556. *
  3557. * @private
  3558. * @param {*} value The value to clone.
  3559. * @param {boolean} bitmask The bitmask flags.
  3560. * 1 - Deep clone
  3561. * 2 - Flatten inherited properties
  3562. * 4 - Clone symbols
  3563. * @param {Function} [customizer] The function to customize cloning.
  3564. * @param {string} [key] The key of `value`.
  3565. * @param {Object} [object] The parent object of `value`.
  3566. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3567. * @returns {*} Returns the cloned value.
  3568. */
  3569. function baseClone(value, bitmask, customizer, key, object, stack) {
  3570. var result,
  3571. isDeep = bitmask & CLONE_DEEP_FLAG,
  3572. isFlat = bitmask & CLONE_FLAT_FLAG,
  3573. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3574. if (customizer) {
  3575. result = object ? customizer(value, key, object, stack) : customizer(value);
  3576. }
  3577. if (result !== undefined) {
  3578. return result;
  3579. }
  3580. if (!isObject(value)) {
  3581. return value;
  3582. }
  3583. var isArr = isArray(value);
  3584. if (isArr) {
  3585. result = initCloneArray(value);
  3586. if (!isDeep) {
  3587. return copyArray(value, result);
  3588. }
  3589. } else {
  3590. var tag = getTag(value),
  3591. isFunc = tag == funcTag || tag == genTag;
  3592. if (isBuffer(value)) {
  3593. return cloneBuffer(value, isDeep);
  3594. }
  3595. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3596. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3597. if (!isDeep) {
  3598. return isFlat
  3599. ? copySymbolsIn(value, baseAssignIn(result, value))
  3600. : copySymbols(value, baseAssign(result, value));
  3601. }
  3602. } else {
  3603. if (!cloneableTags[tag]) {
  3604. return object ? value : {};
  3605. }
  3606. result = initCloneByTag(value, tag, isDeep);
  3607. }
  3608. }
  3609. // Check for circular references and return its corresponding clone.
  3610. stack || (stack = new Stack);
  3611. var stacked = stack.get(value);
  3612. if (stacked) {
  3613. return stacked;
  3614. }
  3615. stack.set(value, result);
  3616. if (isSet(value)) {
  3617. value.forEach(function(subValue) {
  3618. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3619. });
  3620. } else if (isMap(value)) {
  3621. value.forEach(function(subValue, key) {
  3622. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3623. });
  3624. }
  3625. var keysFunc = isFull
  3626. ? (isFlat ? getAllKeysIn : getAllKeys)
  3627. : (isFlat ? keysIn : keys);
  3628. var props = isArr ? undefined : keysFunc(value);
  3629. arrayEach(props || value, function(subValue, key) {
  3630. if (props) {
  3631. key = subValue;
  3632. subValue = value[key];
  3633. }
  3634. // Recursively populate clone (susceptible to call stack limits).
  3635. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3636. });
  3637. return result;
  3638. }
  3639. /**
  3640. * The base implementation of `_.conforms` which doesn't clone `source`.
  3641. *
  3642. * @private
  3643. * @param {Object} source The object of property predicates to conform to.
  3644. * @returns {Function} Returns the new spec function.
  3645. */
  3646. function baseConforms(source) {
  3647. var props = keys(source);
  3648. return function(object) {
  3649. return baseConformsTo(object, source, props);
  3650. };
  3651. }
  3652. /**
  3653. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3654. *
  3655. * @private
  3656. * @param {Object} object The object to inspect.
  3657. * @param {Object} source The object of property predicates to conform to.
  3658. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3659. */
  3660. function baseConformsTo(object, source, props) {
  3661. var length = props.length;
  3662. if (object == null) {
  3663. return !length;
  3664. }
  3665. object = Object(object);
  3666. while (length--) {
  3667. var key = props[length],
  3668. predicate = source[key],
  3669. value = object[key];
  3670. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3671. return false;
  3672. }
  3673. }
  3674. return true;
  3675. }
  3676. /**
  3677. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3678. * to provide to `func`.
  3679. *
  3680. * @private
  3681. * @param {Function} func The function to delay.
  3682. * @param {number} wait The number of milliseconds to delay invocation.
  3683. * @param {Array} args The arguments to provide to `func`.
  3684. * @returns {number|Object} Returns the timer id or timeout object.
  3685. */
  3686. function baseDelay(func, wait, args) {
  3687. if (typeof func != 'function') {
  3688. throw new TypeError(FUNC_ERROR_TEXT);
  3689. }
  3690. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3691. }
  3692. /**
  3693. * The base implementation of methods like `_.difference` without support
  3694. * for excluding multiple arrays or iteratee shorthands.
  3695. *
  3696. * @private
  3697. * @param {Array} array The array to inspect.
  3698. * @param {Array} values The values to exclude.
  3699. * @param {Function} [iteratee] The iteratee invoked per element.
  3700. * @param {Function} [comparator] The comparator invoked per element.
  3701. * @returns {Array} Returns the new array of filtered values.
  3702. */
  3703. function baseDifference(array, values, iteratee, comparator) {
  3704. var index = -1,
  3705. includes = arrayIncludes,
  3706. isCommon = true,
  3707. length = array.length,
  3708. result = [],
  3709. valuesLength = values.length;
  3710. if (!length) {
  3711. return result;
  3712. }
  3713. if (iteratee) {
  3714. values = arrayMap(values, baseUnary(iteratee));
  3715. }
  3716. if (comparator) {
  3717. includes = arrayIncludesWith;
  3718. isCommon = false;
  3719. }
  3720. else if (values.length >= LARGE_ARRAY_SIZE) {
  3721. includes = cacheHas;
  3722. isCommon = false;
  3723. values = new SetCache(values);
  3724. }
  3725. outer:
  3726. while (++index < length) {
  3727. var value = array[index],
  3728. computed = iteratee == null ? value : iteratee(value);
  3729. value = (comparator || value !== 0) ? value : 0;
  3730. if (isCommon && computed === computed) {
  3731. var valuesIndex = valuesLength;
  3732. while (valuesIndex--) {
  3733. if (values[valuesIndex] === computed) {
  3734. continue outer;
  3735. }
  3736. }
  3737. result.push(value);
  3738. }
  3739. else if (!includes(values, computed, comparator)) {
  3740. result.push(value);
  3741. }
  3742. }
  3743. return result;
  3744. }
  3745. /**
  3746. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3747. *
  3748. * @private
  3749. * @param {Array|Object} collection The collection to iterate over.
  3750. * @param {Function} iteratee The function invoked per iteration.
  3751. * @returns {Array|Object} Returns `collection`.
  3752. */
  3753. var baseEach = createBaseEach(baseForOwn);
  3754. /**
  3755. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3756. *
  3757. * @private
  3758. * @param {Array|Object} collection The collection to iterate over.
  3759. * @param {Function} iteratee The function invoked per iteration.
  3760. * @returns {Array|Object} Returns `collection`.
  3761. */
  3762. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3763. /**
  3764. * The base implementation of `_.every` without support for iteratee shorthands.
  3765. *
  3766. * @private
  3767. * @param {Array|Object} collection The collection to iterate over.
  3768. * @param {Function} predicate The function invoked per iteration.
  3769. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3770. * else `false`
  3771. */
  3772. function baseEvery(collection, predicate) {
  3773. var result = true;
  3774. baseEach(collection, function(value, index, collection) {
  3775. result = !!predicate(value, index, collection);
  3776. return result;
  3777. });
  3778. return result;
  3779. }
  3780. /**
  3781. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3782. * `comparator` to determine the extremum value.
  3783. *
  3784. * @private
  3785. * @param {Array} array The array to iterate over.
  3786. * @param {Function} iteratee The iteratee invoked per iteration.
  3787. * @param {Function} comparator The comparator used to compare values.
  3788. * @returns {*} Returns the extremum value.
  3789. */
  3790. function baseExtremum(array, iteratee, comparator) {
  3791. var index = -1,
  3792. length = array.length;
  3793. while (++index < length) {
  3794. var value = array[index],
  3795. current = iteratee(value);
  3796. if (current != null && (computed === undefined
  3797. ? (current === current && !isSymbol(current))
  3798. : comparator(current, computed)
  3799. )) {
  3800. var computed = current,
  3801. result = value;
  3802. }
  3803. }
  3804. return result;
  3805. }
  3806. /**
  3807. * The base implementation of `_.fill` without an iteratee call guard.
  3808. *
  3809. * @private
  3810. * @param {Array} array The array to fill.
  3811. * @param {*} value The value to fill `array` with.
  3812. * @param {number} [start=0] The start position.
  3813. * @param {number} [end=array.length] The end position.
  3814. * @returns {Array} Returns `array`.
  3815. */
  3816. function baseFill(array, value, start, end) {
  3817. var length = array.length;
  3818. start = toInteger(start);
  3819. if (start < 0) {
  3820. start = -start > length ? 0 : (length + start);
  3821. }
  3822. end = (end === undefined || end > length) ? length : toInteger(end);
  3823. if (end < 0) {
  3824. end += length;
  3825. }
  3826. end = start > end ? 0 : toLength(end);
  3827. while (start < end) {
  3828. array[start++] = value;
  3829. }
  3830. return array;
  3831. }
  3832. /**
  3833. * The base implementation of `_.filter` without support for iteratee shorthands.
  3834. *
  3835. * @private
  3836. * @param {Array|Object} collection The collection to iterate over.
  3837. * @param {Function} predicate The function invoked per iteration.
  3838. * @returns {Array} Returns the new filtered array.
  3839. */
  3840. function baseFilter(collection, predicate) {
  3841. var result = [];
  3842. baseEach(collection, function(value, index, collection) {
  3843. if (predicate(value, index, collection)) {
  3844. result.push(value);
  3845. }
  3846. });
  3847. return result;
  3848. }
  3849. /**
  3850. * The base implementation of `_.flatten` with support for restricting flattening.
  3851. *
  3852. * @private
  3853. * @param {Array} array The array to flatten.
  3854. * @param {number} depth The maximum recursion depth.
  3855. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3856. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3857. * @param {Array} [result=[]] The initial result value.
  3858. * @returns {Array} Returns the new flattened array.
  3859. */
  3860. function baseFlatten(array, depth, predicate, isStrict, result) {
  3861. var index = -1,
  3862. length = array.length;
  3863. predicate || (predicate = isFlattenable);
  3864. result || (result = []);
  3865. while (++index < length) {
  3866. var value = array[index];
  3867. if (depth > 0 && predicate(value)) {
  3868. if (depth > 1) {
  3869. // Recursively flatten arrays (susceptible to call stack limits).
  3870. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3871. } else {
  3872. arrayPush(result, value);
  3873. }
  3874. } else if (!isStrict) {
  3875. result[result.length] = value;
  3876. }
  3877. }
  3878. return result;
  3879. }
  3880. /**
  3881. * The base implementation of `baseForOwn` which iterates over `object`
  3882. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3883. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3884. *
  3885. * @private
  3886. * @param {Object} object The object to iterate over.
  3887. * @param {Function} iteratee The function invoked per iteration.
  3888. * @param {Function} keysFunc The function to get the keys of `object`.
  3889. * @returns {Object} Returns `object`.
  3890. */
  3891. var baseFor = createBaseFor();
  3892. /**
  3893. * This function is like `baseFor` except that it iterates over properties
  3894. * in the opposite order.
  3895. *
  3896. * @private
  3897. * @param {Object} object The object to iterate over.
  3898. * @param {Function} iteratee The function invoked per iteration.
  3899. * @param {Function} keysFunc The function to get the keys of `object`.
  3900. * @returns {Object} Returns `object`.
  3901. */
  3902. var baseForRight = createBaseFor(true);
  3903. /**
  3904. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3905. *
  3906. * @private
  3907. * @param {Object} object The object to iterate over.
  3908. * @param {Function} iteratee The function invoked per iteration.
  3909. * @returns {Object} Returns `object`.
  3910. */
  3911. function baseForOwn(object, iteratee) {
  3912. return object && baseFor(object, iteratee, keys);
  3913. }
  3914. /**
  3915. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3916. *
  3917. * @private
  3918. * @param {Object} object The object to iterate over.
  3919. * @param {Function} iteratee The function invoked per iteration.
  3920. * @returns {Object} Returns `object`.
  3921. */
  3922. function baseForOwnRight(object, iteratee) {
  3923. return object && baseForRight(object, iteratee, keys);
  3924. }
  3925. /**
  3926. * The base implementation of `_.functions` which creates an array of
  3927. * `object` function property names filtered from `props`.
  3928. *
  3929. * @private
  3930. * @param {Object} object The object to inspect.
  3931. * @param {Array} props The property names to filter.
  3932. * @returns {Array} Returns the function names.
  3933. */
  3934. function baseFunctions(object, props) {
  3935. return arrayFilter(props, function(key) {
  3936. return isFunction(object[key]);
  3937. });
  3938. }
  3939. /**
  3940. * The base implementation of `_.get` without support for default values.
  3941. *
  3942. * @private
  3943. * @param {Object} object The object to query.
  3944. * @param {Array|string} path The path of the property to get.
  3945. * @returns {*} Returns the resolved value.
  3946. */
  3947. function baseGet(object, path) {
  3948. path = castPath(path, object);
  3949. var index = 0,
  3950. length = path.length;
  3951. while (object != null && index < length) {
  3952. object = object[toKey(path[index++])];
  3953. }
  3954. return (index && index == length) ? object : undefined;
  3955. }
  3956. /**
  3957. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3958. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3959. * symbols of `object`.
  3960. *
  3961. * @private
  3962. * @param {Object} object The object to query.
  3963. * @param {Function} keysFunc The function to get the keys of `object`.
  3964. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3965. * @returns {Array} Returns the array of property names and symbols.
  3966. */
  3967. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3968. var result = keysFunc(object);
  3969. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3970. }
  3971. /**
  3972. * The base implementation of `getTag` without fallbacks for buggy environments.
  3973. *
  3974. * @private
  3975. * @param {*} value The value to query.
  3976. * @returns {string} Returns the `toStringTag`.
  3977. */
  3978. function baseGetTag(value) {
  3979. if (value == null) {
  3980. return value === undefined ? undefinedTag : nullTag;
  3981. }
  3982. return (symToStringTag && symToStringTag in Object(value))
  3983. ? getRawTag(value)
  3984. : objectToString(value);
  3985. }
  3986. /**
  3987. * The base implementation of `_.gt` which doesn't coerce arguments.
  3988. *
  3989. * @private
  3990. * @param {*} value The value to compare.
  3991. * @param {*} other The other value to compare.
  3992. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3993. * else `false`.
  3994. */
  3995. function baseGt(value, other) {
  3996. return value > other;
  3997. }
  3998. /**
  3999. * The base implementation of `_.has` without support for deep paths.
  4000. *
  4001. * @private
  4002. * @param {Object} [object] The object to query.
  4003. * @param {Array|string} key The key to check.
  4004. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4005. */
  4006. function baseHas(object, key) {
  4007. return object != null && hasOwnProperty.call(object, key);
  4008. }
  4009. /**
  4010. * The base implementation of `_.hasIn` without support for deep paths.
  4011. *
  4012. * @private
  4013. * @param {Object} [object] The object to query.
  4014. * @param {Array|string} key The key to check.
  4015. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4016. */
  4017. function baseHasIn(object, key) {
  4018. return object != null && key in Object(object);
  4019. }
  4020. /**
  4021. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4022. *
  4023. * @private
  4024. * @param {number} number The number to check.
  4025. * @param {number} start The start of the range.
  4026. * @param {number} end The end of the range.
  4027. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4028. */
  4029. function baseInRange(number, start, end) {
  4030. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4031. }
  4032. /**
  4033. * The base implementation of methods like `_.intersection`, without support
  4034. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4035. *
  4036. * @private
  4037. * @param {Array} arrays The arrays to inspect.
  4038. * @param {Function} [iteratee] The iteratee invoked per element.
  4039. * @param {Function} [comparator] The comparator invoked per element.
  4040. * @returns {Array} Returns the new array of shared values.
  4041. */
  4042. function baseIntersection(arrays, iteratee, comparator) {
  4043. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4044. length = arrays[0].length,
  4045. othLength = arrays.length,
  4046. othIndex = othLength,
  4047. caches = Array(othLength),
  4048. maxLength = Infinity,
  4049. result = [];
  4050. while (othIndex--) {
  4051. var array = arrays[othIndex];
  4052. if (othIndex && iteratee) {
  4053. array = arrayMap(array, baseUnary(iteratee));
  4054. }
  4055. maxLength = nativeMin(array.length, maxLength);
  4056. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4057. ? new SetCache(othIndex && array)
  4058. : undefined;
  4059. }
  4060. array = arrays[0];
  4061. var index = -1,
  4062. seen = caches[0];
  4063. outer:
  4064. while (++index < length && result.length < maxLength) {
  4065. var value = array[index],
  4066. computed = iteratee ? iteratee(value) : value;
  4067. value = (comparator || value !== 0) ? value : 0;
  4068. if (!(seen
  4069. ? cacheHas(seen, computed)
  4070. : includes(result, computed, comparator)
  4071. )) {
  4072. othIndex = othLength;
  4073. while (--othIndex) {
  4074. var cache = caches[othIndex];
  4075. if (!(cache
  4076. ? cacheHas(cache, computed)
  4077. : includes(arrays[othIndex], computed, comparator))
  4078. ) {
  4079. continue outer;
  4080. }
  4081. }
  4082. if (seen) {
  4083. seen.push(computed);
  4084. }
  4085. result.push(value);
  4086. }
  4087. }
  4088. return result;
  4089. }
  4090. /**
  4091. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4092. * `object` with values transformed by `iteratee` and set by `setter`.
  4093. *
  4094. * @private
  4095. * @param {Object} object The object to iterate over.
  4096. * @param {Function} setter The function to set `accumulator` values.
  4097. * @param {Function} iteratee The iteratee to transform values.
  4098. * @param {Object} accumulator The initial inverted object.
  4099. * @returns {Function} Returns `accumulator`.
  4100. */
  4101. function baseInverter(object, setter, iteratee, accumulator) {
  4102. baseForOwn(object, function(value, key, object) {
  4103. setter(accumulator, iteratee(value), key, object);
  4104. });
  4105. return accumulator;
  4106. }
  4107. /**
  4108. * The base implementation of `_.invoke` without support for individual
  4109. * method arguments.
  4110. *
  4111. * @private
  4112. * @param {Object} object The object to query.
  4113. * @param {Array|string} path The path of the method to invoke.
  4114. * @param {Array} args The arguments to invoke the method with.
  4115. * @returns {*} Returns the result of the invoked method.
  4116. */
  4117. function baseInvoke(object, path, args) {
  4118. path = castPath(path, object);
  4119. object = parent(object, path);
  4120. var func = object == null ? object : object[toKey(last(path))];
  4121. return func == null ? undefined : apply(func, object, args);
  4122. }
  4123. /**
  4124. * The base implementation of `_.isArguments`.
  4125. *
  4126. * @private
  4127. * @param {*} value The value to check.
  4128. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4129. */
  4130. function baseIsArguments(value) {
  4131. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4132. }
  4133. /**
  4134. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4135. *
  4136. * @private
  4137. * @param {*} value The value to check.
  4138. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4139. */
  4140. function baseIsArrayBuffer(value) {
  4141. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4142. }
  4143. /**
  4144. * The base implementation of `_.isDate` without Node.js optimizations.
  4145. *
  4146. * @private
  4147. * @param {*} value The value to check.
  4148. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4149. */
  4150. function baseIsDate(value) {
  4151. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4152. }
  4153. /**
  4154. * The base implementation of `_.isEqual` which supports partial comparisons
  4155. * and tracks traversed objects.
  4156. *
  4157. * @private
  4158. * @param {*} value The value to compare.
  4159. * @param {*} other The other value to compare.
  4160. * @param {boolean} bitmask The bitmask flags.
  4161. * 1 - Unordered comparison
  4162. * 2 - Partial comparison
  4163. * @param {Function} [customizer] The function to customize comparisons.
  4164. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4165. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4166. */
  4167. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4168. if (value === other) {
  4169. return true;
  4170. }
  4171. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4172. return value !== value && other !== other;
  4173. }
  4174. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4175. }
  4176. /**
  4177. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4178. * deep comparisons and tracks traversed objects enabling objects with circular
  4179. * references to be compared.
  4180. *
  4181. * @private
  4182. * @param {Object} object The object to compare.
  4183. * @param {Object} other The other object to compare.
  4184. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4185. * @param {Function} customizer The function to customize comparisons.
  4186. * @param {Function} equalFunc The function to determine equivalents of values.
  4187. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4188. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4189. */
  4190. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4191. var objIsArr = isArray(object),
  4192. othIsArr = isArray(other),
  4193. objTag = objIsArr ? arrayTag : getTag(object),
  4194. othTag = othIsArr ? arrayTag : getTag(other);
  4195. objTag = objTag == argsTag ? objectTag : objTag;
  4196. othTag = othTag == argsTag ? objectTag : othTag;
  4197. var objIsObj = objTag == objectTag,
  4198. othIsObj = othTag == objectTag,
  4199. isSameTag = objTag == othTag;
  4200. if (isSameTag && isBuffer(object)) {
  4201. if (!isBuffer(other)) {
  4202. return false;
  4203. }
  4204. objIsArr = true;
  4205. objIsObj = false;
  4206. }
  4207. if (isSameTag && !objIsObj) {
  4208. stack || (stack = new Stack);
  4209. return (objIsArr || isTypedArray(object))
  4210. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4211. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4212. }
  4213. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4214. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4215. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4216. if (objIsWrapped || othIsWrapped) {
  4217. var objUnwrapped = objIsWrapped ? object.value() : object,
  4218. othUnwrapped = othIsWrapped ? other.value() : other;
  4219. stack || (stack = new Stack);
  4220. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4221. }
  4222. }
  4223. if (!isSameTag) {
  4224. return false;
  4225. }
  4226. stack || (stack = new Stack);
  4227. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4228. }
  4229. /**
  4230. * The base implementation of `_.isMap` without Node.js optimizations.
  4231. *
  4232. * @private
  4233. * @param {*} value The value to check.
  4234. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4235. */
  4236. function baseIsMap(value) {
  4237. return isObjectLike(value) && getTag(value) == mapTag;
  4238. }
  4239. /**
  4240. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4241. *
  4242. * @private
  4243. * @param {Object} object The object to inspect.
  4244. * @param {Object} source The object of property values to match.
  4245. * @param {Array} matchData The property names, values, and compare flags to match.
  4246. * @param {Function} [customizer] The function to customize comparisons.
  4247. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4248. */
  4249. function baseIsMatch(object, source, matchData, customizer) {
  4250. var index = matchData.length,
  4251. length = index,
  4252. noCustomizer = !customizer;
  4253. if (object == null) {
  4254. return !length;
  4255. }
  4256. object = Object(object);
  4257. while (index--) {
  4258. var data = matchData[index];
  4259. if ((noCustomizer && data[2])
  4260. ? data[1] !== object[data[0]]
  4261. : !(data[0] in object)
  4262. ) {
  4263. return false;
  4264. }
  4265. }
  4266. while (++index < length) {
  4267. data = matchData[index];
  4268. var key = data[0],
  4269. objValue = object[key],
  4270. srcValue = data[1];
  4271. if (noCustomizer && data[2]) {
  4272. if (objValue === undefined && !(key in object)) {
  4273. return false;
  4274. }
  4275. } else {
  4276. var stack = new Stack;
  4277. if (customizer) {
  4278. var result = customizer(objValue, srcValue, key, object, source, stack);
  4279. }
  4280. if (!(result === undefined
  4281. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4282. : result
  4283. )) {
  4284. return false;
  4285. }
  4286. }
  4287. }
  4288. return true;
  4289. }
  4290. /**
  4291. * The base implementation of `_.isNative` without bad shim checks.
  4292. *
  4293. * @private
  4294. * @param {*} value The value to check.
  4295. * @returns {boolean} Returns `true` if `value` is a native function,
  4296. * else `false`.
  4297. */
  4298. function baseIsNative(value) {
  4299. if (!isObject(value) || isMasked(value)) {
  4300. return false;
  4301. }
  4302. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4303. return pattern.test(toSource(value));
  4304. }
  4305. /**
  4306. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4307. *
  4308. * @private
  4309. * @param {*} value The value to check.
  4310. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4311. */
  4312. function baseIsRegExp(value) {
  4313. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4314. }
  4315. /**
  4316. * The base implementation of `_.isSet` without Node.js optimizations.
  4317. *
  4318. * @private
  4319. * @param {*} value The value to check.
  4320. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4321. */
  4322. function baseIsSet(value) {
  4323. return isObjectLike(value) && getTag(value) == setTag;
  4324. }
  4325. /**
  4326. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4327. *
  4328. * @private
  4329. * @param {*} value The value to check.
  4330. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4331. */
  4332. function baseIsTypedArray(value) {
  4333. return isObjectLike(value) &&
  4334. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4335. }
  4336. /**
  4337. * The base implementation of `_.iteratee`.
  4338. *
  4339. * @private
  4340. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4341. * @returns {Function} Returns the iteratee.
  4342. */
  4343. function baseIteratee(value) {
  4344. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4345. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4346. if (typeof value == 'function') {
  4347. return value;
  4348. }
  4349. if (value == null) {
  4350. return identity;
  4351. }
  4352. if (typeof value == 'object') {
  4353. return isArray(value)
  4354. ? baseMatchesProperty(value[0], value[1])
  4355. : baseMatches(value);
  4356. }
  4357. return property(value);
  4358. }
  4359. /**
  4360. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4361. *
  4362. * @private
  4363. * @param {Object} object The object to query.
  4364. * @returns {Array} Returns the array of property names.
  4365. */
  4366. function baseKeys(object) {
  4367. if (!isPrototype(object)) {
  4368. return nativeKeys(object);
  4369. }
  4370. var result = [];
  4371. for (var key in Object(object)) {
  4372. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4373. result.push(key);
  4374. }
  4375. }
  4376. return result;
  4377. }
  4378. /**
  4379. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4380. *
  4381. * @private
  4382. * @param {Object} object The object to query.
  4383. * @returns {Array} Returns the array of property names.
  4384. */
  4385. function baseKeysIn(object) {
  4386. if (!isObject(object)) {
  4387. return nativeKeysIn(object);
  4388. }
  4389. var isProto = isPrototype(object),
  4390. result = [];
  4391. for (var key in object) {
  4392. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4393. result.push(key);
  4394. }
  4395. }
  4396. return result;
  4397. }
  4398. /**
  4399. * The base implementation of `_.lt` which doesn't coerce arguments.
  4400. *
  4401. * @private
  4402. * @param {*} value The value to compare.
  4403. * @param {*} other The other value to compare.
  4404. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4405. * else `false`.
  4406. */
  4407. function baseLt(value, other) {
  4408. return value < other;
  4409. }
  4410. /**
  4411. * The base implementation of `_.map` without support for iteratee shorthands.
  4412. *
  4413. * @private
  4414. * @param {Array|Object} collection The collection to iterate over.
  4415. * @param {Function} iteratee The function invoked per iteration.
  4416. * @returns {Array} Returns the new mapped array.
  4417. */
  4418. function baseMap(collection, iteratee) {
  4419. var index = -1,
  4420. result = isArrayLike(collection) ? Array(collection.length) : [];
  4421. baseEach(collection, function(value, key, collection) {
  4422. result[++index] = iteratee(value, key, collection);
  4423. });
  4424. return result;
  4425. }
  4426. /**
  4427. * The base implementation of `_.matches` which doesn't clone `source`.
  4428. *
  4429. * @private
  4430. * @param {Object} source The object of property values to match.
  4431. * @returns {Function} Returns the new spec function.
  4432. */
  4433. function baseMatches(source) {
  4434. var matchData = getMatchData(source);
  4435. if (matchData.length == 1 && matchData[0][2]) {
  4436. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4437. }
  4438. return function(object) {
  4439. return object === source || baseIsMatch(object, source, matchData);
  4440. };
  4441. }
  4442. /**
  4443. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4444. *
  4445. * @private
  4446. * @param {string} path The path of the property to get.
  4447. * @param {*} srcValue The value to match.
  4448. * @returns {Function} Returns the new spec function.
  4449. */
  4450. function baseMatchesProperty(path, srcValue) {
  4451. if (isKey(path) && isStrictComparable(srcValue)) {
  4452. return matchesStrictComparable(toKey(path), srcValue);
  4453. }
  4454. return function(object) {
  4455. var objValue = get(object, path);
  4456. return (objValue === undefined && objValue === srcValue)
  4457. ? hasIn(object, path)
  4458. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4459. };
  4460. }
  4461. /**
  4462. * The base implementation of `_.merge` without support for multiple sources.
  4463. *
  4464. * @private
  4465. * @param {Object} object The destination object.
  4466. * @param {Object} source The source object.
  4467. * @param {number} srcIndex The index of `source`.
  4468. * @param {Function} [customizer] The function to customize merged values.
  4469. * @param {Object} [stack] Tracks traversed source values and their merged
  4470. * counterparts.
  4471. */
  4472. function baseMerge(object, source, srcIndex, customizer, stack) {
  4473. if (object === source) {
  4474. return;
  4475. }
  4476. baseFor(source, function(srcValue, key) {
  4477. stack || (stack = new Stack);
  4478. if (isObject(srcValue)) {
  4479. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4480. }
  4481. else {
  4482. var newValue = customizer
  4483. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4484. : undefined;
  4485. if (newValue === undefined) {
  4486. newValue = srcValue;
  4487. }
  4488. assignMergeValue(object, key, newValue);
  4489. }
  4490. }, keysIn);
  4491. }
  4492. /**
  4493. * A specialized version of `baseMerge` for arrays and objects which performs
  4494. * deep merges and tracks traversed objects enabling objects with circular
  4495. * references to be merged.
  4496. *
  4497. * @private
  4498. * @param {Object} object The destination object.
  4499. * @param {Object} source The source object.
  4500. * @param {string} key The key of the value to merge.
  4501. * @param {number} srcIndex The index of `source`.
  4502. * @param {Function} mergeFunc The function to merge values.
  4503. * @param {Function} [customizer] The function to customize assigned values.
  4504. * @param {Object} [stack] Tracks traversed source values and their merged
  4505. * counterparts.
  4506. */
  4507. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4508. var objValue = safeGet(object, key),
  4509. srcValue = safeGet(source, key),
  4510. stacked = stack.get(srcValue);
  4511. if (stacked) {
  4512. assignMergeValue(object, key, stacked);
  4513. return;
  4514. }
  4515. var newValue = customizer
  4516. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4517. : undefined;
  4518. var isCommon = newValue === undefined;
  4519. if (isCommon) {
  4520. var isArr = isArray(srcValue),
  4521. isBuff = !isArr && isBuffer(srcValue),
  4522. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4523. newValue = srcValue;
  4524. if (isArr || isBuff || isTyped) {
  4525. if (isArray(objValue)) {
  4526. newValue = objValue;
  4527. }
  4528. else if (isArrayLikeObject(objValue)) {
  4529. newValue = copyArray(objValue);
  4530. }
  4531. else if (isBuff) {
  4532. isCommon = false;
  4533. newValue = cloneBuffer(srcValue, true);
  4534. }
  4535. else if (isTyped) {
  4536. isCommon = false;
  4537. newValue = cloneTypedArray(srcValue, true);
  4538. }
  4539. else {
  4540. newValue = [];
  4541. }
  4542. }
  4543. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4544. newValue = objValue;
  4545. if (isArguments(objValue)) {
  4546. newValue = toPlainObject(objValue);
  4547. }
  4548. else if (!isObject(objValue) || isFunction(objValue)) {
  4549. newValue = initCloneObject(srcValue);
  4550. }
  4551. }
  4552. else {
  4553. isCommon = false;
  4554. }
  4555. }
  4556. if (isCommon) {
  4557. // Recursively merge objects and arrays (susceptible to call stack limits).
  4558. stack.set(srcValue, newValue);
  4559. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4560. stack['delete'](srcValue);
  4561. }
  4562. assignMergeValue(object, key, newValue);
  4563. }
  4564. /**
  4565. * The base implementation of `_.nth` which doesn't coerce arguments.
  4566. *
  4567. * @private
  4568. * @param {Array} array The array to query.
  4569. * @param {number} n The index of the element to return.
  4570. * @returns {*} Returns the nth element of `array`.
  4571. */
  4572. function baseNth(array, n) {
  4573. var length = array.length;
  4574. if (!length) {
  4575. return;
  4576. }
  4577. n += n < 0 ? length : 0;
  4578. return isIndex(n, length) ? array[n] : undefined;
  4579. }
  4580. /**
  4581. * The base implementation of `_.orderBy` without param guards.
  4582. *
  4583. * @private
  4584. * @param {Array|Object} collection The collection to iterate over.
  4585. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4586. * @param {string[]} orders The sort orders of `iteratees`.
  4587. * @returns {Array} Returns the new sorted array.
  4588. */
  4589. function baseOrderBy(collection, iteratees, orders) {
  4590. if (iteratees.length) {
  4591. iteratees = arrayMap(iteratees, function(iteratee) {
  4592. if (isArray(iteratee)) {
  4593. return function(value) {
  4594. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4595. }
  4596. }
  4597. return iteratee;
  4598. });
  4599. } else {
  4600. iteratees = [identity];
  4601. }
  4602. var index = -1;
  4603. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4604. var result = baseMap(collection, function(value, key, collection) {
  4605. var criteria = arrayMap(iteratees, function(iteratee) {
  4606. return iteratee(value);
  4607. });
  4608. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4609. });
  4610. return baseSortBy(result, function(object, other) {
  4611. return compareMultiple(object, other, orders);
  4612. });
  4613. }
  4614. /**
  4615. * The base implementation of `_.pick` without support for individual
  4616. * property identifiers.
  4617. *
  4618. * @private
  4619. * @param {Object} object The source object.
  4620. * @param {string[]} paths The property paths to pick.
  4621. * @returns {Object} Returns the new object.
  4622. */
  4623. function basePick(object, paths) {
  4624. return basePickBy(object, paths, function(value, path) {
  4625. return hasIn(object, path);
  4626. });
  4627. }
  4628. /**
  4629. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4630. *
  4631. * @private
  4632. * @param {Object} object The source object.
  4633. * @param {string[]} paths The property paths to pick.
  4634. * @param {Function} predicate The function invoked per property.
  4635. * @returns {Object} Returns the new object.
  4636. */
  4637. function basePickBy(object, paths, predicate) {
  4638. var index = -1,
  4639. length = paths.length,
  4640. result = {};
  4641. while (++index < length) {
  4642. var path = paths[index],
  4643. value = baseGet(object, path);
  4644. if (predicate(value, path)) {
  4645. baseSet(result, castPath(path, object), value);
  4646. }
  4647. }
  4648. return result;
  4649. }
  4650. /**
  4651. * A specialized version of `baseProperty` which supports deep paths.
  4652. *
  4653. * @private
  4654. * @param {Array|string} path The path of the property to get.
  4655. * @returns {Function} Returns the new accessor function.
  4656. */
  4657. function basePropertyDeep(path) {
  4658. return function(object) {
  4659. return baseGet(object, path);
  4660. };
  4661. }
  4662. /**
  4663. * The base implementation of `_.pullAllBy` without support for iteratee
  4664. * shorthands.
  4665. *
  4666. * @private
  4667. * @param {Array} array The array to modify.
  4668. * @param {Array} values The values to remove.
  4669. * @param {Function} [iteratee] The iteratee invoked per element.
  4670. * @param {Function} [comparator] The comparator invoked per element.
  4671. * @returns {Array} Returns `array`.
  4672. */
  4673. function basePullAll(array, values, iteratee, comparator) {
  4674. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4675. index = -1,
  4676. length = values.length,
  4677. seen = array;
  4678. if (array === values) {
  4679. values = copyArray(values);
  4680. }
  4681. if (iteratee) {
  4682. seen = arrayMap(array, baseUnary(iteratee));
  4683. }
  4684. while (++index < length) {
  4685. var fromIndex = 0,
  4686. value = values[index],
  4687. computed = iteratee ? iteratee(value) : value;
  4688. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4689. if (seen !== array) {
  4690. splice.call(seen, fromIndex, 1);
  4691. }
  4692. splice.call(array, fromIndex, 1);
  4693. }
  4694. }
  4695. return array;
  4696. }
  4697. /**
  4698. * The base implementation of `_.pullAt` without support for individual
  4699. * indexes or capturing the removed elements.
  4700. *
  4701. * @private
  4702. * @param {Array} array The array to modify.
  4703. * @param {number[]} indexes The indexes of elements to remove.
  4704. * @returns {Array} Returns `array`.
  4705. */
  4706. function basePullAt(array, indexes) {
  4707. var length = array ? indexes.length : 0,
  4708. lastIndex = length - 1;
  4709. while (length--) {
  4710. var index = indexes[length];
  4711. if (length == lastIndex || index !== previous) {
  4712. var previous = index;
  4713. if (isIndex(index)) {
  4714. splice.call(array, index, 1);
  4715. } else {
  4716. baseUnset(array, index);
  4717. }
  4718. }
  4719. }
  4720. return array;
  4721. }
  4722. /**
  4723. * The base implementation of `_.random` without support for returning
  4724. * floating-point numbers.
  4725. *
  4726. * @private
  4727. * @param {number} lower The lower bound.
  4728. * @param {number} upper The upper bound.
  4729. * @returns {number} Returns the random number.
  4730. */
  4731. function baseRandom(lower, upper) {
  4732. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4733. }
  4734. /**
  4735. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4736. * coerce arguments.
  4737. *
  4738. * @private
  4739. * @param {number} start The start of the range.
  4740. * @param {number} end The end of the range.
  4741. * @param {number} step The value to increment or decrement by.
  4742. * @param {boolean} [fromRight] Specify iterating from right to left.
  4743. * @returns {Array} Returns the range of numbers.
  4744. */
  4745. function baseRange(start, end, step, fromRight) {
  4746. var index = -1,
  4747. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4748. result = Array(length);
  4749. while (length--) {
  4750. result[fromRight ? length : ++index] = start;
  4751. start += step;
  4752. }
  4753. return result;
  4754. }
  4755. /**
  4756. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4757. *
  4758. * @private
  4759. * @param {string} string The string to repeat.
  4760. * @param {number} n The number of times to repeat the string.
  4761. * @returns {string} Returns the repeated string.
  4762. */
  4763. function baseRepeat(string, n) {
  4764. var result = '';
  4765. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4766. return result;
  4767. }
  4768. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4769. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4770. do {
  4771. if (n % 2) {
  4772. result += string;
  4773. }
  4774. n = nativeFloor(n / 2);
  4775. if (n) {
  4776. string += string;
  4777. }
  4778. } while (n);
  4779. return result;
  4780. }
  4781. /**
  4782. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4783. *
  4784. * @private
  4785. * @param {Function} func The function to apply a rest parameter to.
  4786. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4787. * @returns {Function} Returns the new function.
  4788. */
  4789. function baseRest(func, start) {
  4790. return setToString(overRest(func, start, identity), func + '');
  4791. }
  4792. /**
  4793. * The base implementation of `_.sample`.
  4794. *
  4795. * @private
  4796. * @param {Array|Object} collection The collection to sample.
  4797. * @returns {*} Returns the random element.
  4798. */
  4799. function baseSample(collection) {
  4800. return arraySample(values(collection));
  4801. }
  4802. /**
  4803. * The base implementation of `_.sampleSize` without param guards.
  4804. *
  4805. * @private
  4806. * @param {Array|Object} collection The collection to sample.
  4807. * @param {number} n The number of elements to sample.
  4808. * @returns {Array} Returns the random elements.
  4809. */
  4810. function baseSampleSize(collection, n) {
  4811. var array = values(collection);
  4812. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4813. }
  4814. /**
  4815. * The base implementation of `_.set`.
  4816. *
  4817. * @private
  4818. * @param {Object} object The object to modify.
  4819. * @param {Array|string} path The path of the property to set.
  4820. * @param {*} value The value to set.
  4821. * @param {Function} [customizer] The function to customize path creation.
  4822. * @returns {Object} Returns `object`.
  4823. */
  4824. function baseSet(object, path, value, customizer) {
  4825. if (!isObject(object)) {
  4826. return object;
  4827. }
  4828. path = castPath(path, object);
  4829. var index = -1,
  4830. length = path.length,
  4831. lastIndex = length - 1,
  4832. nested = object;
  4833. while (nested != null && ++index < length) {
  4834. var key = toKey(path[index]),
  4835. newValue = value;
  4836. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4837. return object;
  4838. }
  4839. if (index != lastIndex) {
  4840. var objValue = nested[key];
  4841. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4842. if (newValue === undefined) {
  4843. newValue = isObject(objValue)
  4844. ? objValue
  4845. : (isIndex(path[index + 1]) ? [] : {});
  4846. }
  4847. }
  4848. assignValue(nested, key, newValue);
  4849. nested = nested[key];
  4850. }
  4851. return object;
  4852. }
  4853. /**
  4854. * The base implementation of `setData` without support for hot loop shorting.
  4855. *
  4856. * @private
  4857. * @param {Function} func The function to associate metadata with.
  4858. * @param {*} data The metadata.
  4859. * @returns {Function} Returns `func`.
  4860. */
  4861. var baseSetData = !metaMap ? identity : function(func, data) {
  4862. metaMap.set(func, data);
  4863. return func;
  4864. };
  4865. /**
  4866. * The base implementation of `setToString` without support for hot loop shorting.
  4867. *
  4868. * @private
  4869. * @param {Function} func The function to modify.
  4870. * @param {Function} string The `toString` result.
  4871. * @returns {Function} Returns `func`.
  4872. */
  4873. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4874. return defineProperty(func, 'toString', {
  4875. 'configurable': true,
  4876. 'enumerable': false,
  4877. 'value': constant(string),
  4878. 'writable': true
  4879. });
  4880. };
  4881. /**
  4882. * The base implementation of `_.shuffle`.
  4883. *
  4884. * @private
  4885. * @param {Array|Object} collection The collection to shuffle.
  4886. * @returns {Array} Returns the new shuffled array.
  4887. */
  4888. function baseShuffle(collection) {
  4889. return shuffleSelf(values(collection));
  4890. }
  4891. /**
  4892. * The base implementation of `_.slice` without an iteratee call guard.
  4893. *
  4894. * @private
  4895. * @param {Array} array The array to slice.
  4896. * @param {number} [start=0] The start position.
  4897. * @param {number} [end=array.length] The end position.
  4898. * @returns {Array} Returns the slice of `array`.
  4899. */
  4900. function baseSlice(array, start, end) {
  4901. var index = -1,
  4902. length = array.length;
  4903. if (start < 0) {
  4904. start = -start > length ? 0 : (length + start);
  4905. }
  4906. end = end > length ? length : end;
  4907. if (end < 0) {
  4908. end += length;
  4909. }
  4910. length = start > end ? 0 : ((end - start) >>> 0);
  4911. start >>>= 0;
  4912. var result = Array(length);
  4913. while (++index < length) {
  4914. result[index] = array[index + start];
  4915. }
  4916. return result;
  4917. }
  4918. /**
  4919. * The base implementation of `_.some` without support for iteratee shorthands.
  4920. *
  4921. * @private
  4922. * @param {Array|Object} collection The collection to iterate over.
  4923. * @param {Function} predicate The function invoked per iteration.
  4924. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4925. * else `false`.
  4926. */
  4927. function baseSome(collection, predicate) {
  4928. var result;
  4929. baseEach(collection, function(value, index, collection) {
  4930. result = predicate(value, index, collection);
  4931. return !result;
  4932. });
  4933. return !!result;
  4934. }
  4935. /**
  4936. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4937. * performs a binary search of `array` to determine the index at which `value`
  4938. * should be inserted into `array` in order to maintain its sort order.
  4939. *
  4940. * @private
  4941. * @param {Array} array The sorted array to inspect.
  4942. * @param {*} value The value to evaluate.
  4943. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4944. * @returns {number} Returns the index at which `value` should be inserted
  4945. * into `array`.
  4946. */
  4947. function baseSortedIndex(array, value, retHighest) {
  4948. var low = 0,
  4949. high = array == null ? low : array.length;
  4950. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4951. while (low < high) {
  4952. var mid = (low + high) >>> 1,
  4953. computed = array[mid];
  4954. if (computed !== null && !isSymbol(computed) &&
  4955. (retHighest ? (computed <= value) : (computed < value))) {
  4956. low = mid + 1;
  4957. } else {
  4958. high = mid;
  4959. }
  4960. }
  4961. return high;
  4962. }
  4963. return baseSortedIndexBy(array, value, identity, retHighest);
  4964. }
  4965. /**
  4966. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4967. * which invokes `iteratee` for `value` and each element of `array` to compute
  4968. * their sort ranking. The iteratee is invoked with one argument; (value).
  4969. *
  4970. * @private
  4971. * @param {Array} array The sorted array to inspect.
  4972. * @param {*} value The value to evaluate.
  4973. * @param {Function} iteratee The iteratee invoked per element.
  4974. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4975. * @returns {number} Returns the index at which `value` should be inserted
  4976. * into `array`.
  4977. */
  4978. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4979. var low = 0,
  4980. high = array == null ? 0 : array.length;
  4981. if (high === 0) {
  4982. return 0;
  4983. }
  4984. value = iteratee(value);
  4985. var valIsNaN = value !== value,
  4986. valIsNull = value === null,
  4987. valIsSymbol = isSymbol(value),
  4988. valIsUndefined = value === undefined;
  4989. while (low < high) {
  4990. var mid = nativeFloor((low + high) / 2),
  4991. computed = iteratee(array[mid]),
  4992. othIsDefined = computed !== undefined,
  4993. othIsNull = computed === null,
  4994. othIsReflexive = computed === computed,
  4995. othIsSymbol = isSymbol(computed);
  4996. if (valIsNaN) {
  4997. var setLow = retHighest || othIsReflexive;
  4998. } else if (valIsUndefined) {
  4999. setLow = othIsReflexive && (retHighest || othIsDefined);
  5000. } else if (valIsNull) {
  5001. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5002. } else if (valIsSymbol) {
  5003. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5004. } else if (othIsNull || othIsSymbol) {
  5005. setLow = false;
  5006. } else {
  5007. setLow = retHighest ? (computed <= value) : (computed < value);
  5008. }
  5009. if (setLow) {
  5010. low = mid + 1;
  5011. } else {
  5012. high = mid;
  5013. }
  5014. }
  5015. return nativeMin(high, MAX_ARRAY_INDEX);
  5016. }
  5017. /**
  5018. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5019. * support for iteratee shorthands.
  5020. *
  5021. * @private
  5022. * @param {Array} array The array to inspect.
  5023. * @param {Function} [iteratee] The iteratee invoked per element.
  5024. * @returns {Array} Returns the new duplicate free array.
  5025. */
  5026. function baseSortedUniq(array, iteratee) {
  5027. var index = -1,
  5028. length = array.length,
  5029. resIndex = 0,
  5030. result = [];
  5031. while (++index < length) {
  5032. var value = array[index],
  5033. computed = iteratee ? iteratee(value) : value;
  5034. if (!index || !eq(computed, seen)) {
  5035. var seen = computed;
  5036. result[resIndex++] = value === 0 ? 0 : value;
  5037. }
  5038. }
  5039. return result;
  5040. }
  5041. /**
  5042. * The base implementation of `_.toNumber` which doesn't ensure correct
  5043. * conversions of binary, hexadecimal, or octal string values.
  5044. *
  5045. * @private
  5046. * @param {*} value The value to process.
  5047. * @returns {number} Returns the number.
  5048. */
  5049. function baseToNumber(value) {
  5050. if (typeof value == 'number') {
  5051. return value;
  5052. }
  5053. if (isSymbol(value)) {
  5054. return NAN;
  5055. }
  5056. return +value;
  5057. }
  5058. /**
  5059. * The base implementation of `_.toString` which doesn't convert nullish
  5060. * values to empty strings.
  5061. *
  5062. * @private
  5063. * @param {*} value The value to process.
  5064. * @returns {string} Returns the string.
  5065. */
  5066. function baseToString(value) {
  5067. // Exit early for strings to avoid a performance hit in some environments.
  5068. if (typeof value == 'string') {
  5069. return value;
  5070. }
  5071. if (isArray(value)) {
  5072. // Recursively convert values (susceptible to call stack limits).
  5073. return arrayMap(value, baseToString) + '';
  5074. }
  5075. if (isSymbol(value)) {
  5076. return symbolToString ? symbolToString.call(value) : '';
  5077. }
  5078. var result = (value + '');
  5079. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5080. }
  5081. /**
  5082. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5083. *
  5084. * @private
  5085. * @param {Array} array The array to inspect.
  5086. * @param {Function} [iteratee] The iteratee invoked per element.
  5087. * @param {Function} [comparator] The comparator invoked per element.
  5088. * @returns {Array} Returns the new duplicate free array.
  5089. */
  5090. function baseUniq(array, iteratee, comparator) {
  5091. var index = -1,
  5092. includes = arrayIncludes,
  5093. length = array.length,
  5094. isCommon = true,
  5095. result = [],
  5096. seen = result;
  5097. if (comparator) {
  5098. isCommon = false;
  5099. includes = arrayIncludesWith;
  5100. }
  5101. else if (length >= LARGE_ARRAY_SIZE) {
  5102. var set = iteratee ? null : createSet(array);
  5103. if (set) {
  5104. return setToArray(set);
  5105. }
  5106. isCommon = false;
  5107. includes = cacheHas;
  5108. seen = new SetCache;
  5109. }
  5110. else {
  5111. seen = iteratee ? [] : result;
  5112. }
  5113. outer:
  5114. while (++index < length) {
  5115. var value = array[index],
  5116. computed = iteratee ? iteratee(value) : value;
  5117. value = (comparator || value !== 0) ? value : 0;
  5118. if (isCommon && computed === computed) {
  5119. var seenIndex = seen.length;
  5120. while (seenIndex--) {
  5121. if (seen[seenIndex] === computed) {
  5122. continue outer;
  5123. }
  5124. }
  5125. if (iteratee) {
  5126. seen.push(computed);
  5127. }
  5128. result.push(value);
  5129. }
  5130. else if (!includes(seen, computed, comparator)) {
  5131. if (seen !== result) {
  5132. seen.push(computed);
  5133. }
  5134. result.push(value);
  5135. }
  5136. }
  5137. return result;
  5138. }
  5139. /**
  5140. * The base implementation of `_.unset`.
  5141. *
  5142. * @private
  5143. * @param {Object} object The object to modify.
  5144. * @param {Array|string} path The property path to unset.
  5145. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5146. */
  5147. function baseUnset(object, path) {
  5148. path = castPath(path, object);
  5149. object = parent(object, path);
  5150. return object == null || delete object[toKey(last(path))];
  5151. }
  5152. /**
  5153. * The base implementation of `_.update`.
  5154. *
  5155. * @private
  5156. * @param {Object} object The object to modify.
  5157. * @param {Array|string} path The path of the property to update.
  5158. * @param {Function} updater The function to produce the updated value.
  5159. * @param {Function} [customizer] The function to customize path creation.
  5160. * @returns {Object} Returns `object`.
  5161. */
  5162. function baseUpdate(object, path, updater, customizer) {
  5163. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5164. }
  5165. /**
  5166. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5167. * without support for iteratee shorthands.
  5168. *
  5169. * @private
  5170. * @param {Array} array The array to query.
  5171. * @param {Function} predicate The function invoked per iteration.
  5172. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5173. * @param {boolean} [fromRight] Specify iterating from right to left.
  5174. * @returns {Array} Returns the slice of `array`.
  5175. */
  5176. function baseWhile(array, predicate, isDrop, fromRight) {
  5177. var length = array.length,
  5178. index = fromRight ? length : -1;
  5179. while ((fromRight ? index-- : ++index < length) &&
  5180. predicate(array[index], index, array)) {}
  5181. return isDrop
  5182. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5183. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5184. }
  5185. /**
  5186. * The base implementation of `wrapperValue` which returns the result of
  5187. * performing a sequence of actions on the unwrapped `value`, where each
  5188. * successive action is supplied the return value of the previous.
  5189. *
  5190. * @private
  5191. * @param {*} value The unwrapped value.
  5192. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5193. * @returns {*} Returns the resolved value.
  5194. */
  5195. function baseWrapperValue(value, actions) {
  5196. var result = value;
  5197. if (result instanceof LazyWrapper) {
  5198. result = result.value();
  5199. }
  5200. return arrayReduce(actions, function(result, action) {
  5201. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5202. }, result);
  5203. }
  5204. /**
  5205. * The base implementation of methods like `_.xor`, without support for
  5206. * iteratee shorthands, that accepts an array of arrays to inspect.
  5207. *
  5208. * @private
  5209. * @param {Array} arrays The arrays to inspect.
  5210. * @param {Function} [iteratee] The iteratee invoked per element.
  5211. * @param {Function} [comparator] The comparator invoked per element.
  5212. * @returns {Array} Returns the new array of values.
  5213. */
  5214. function baseXor(arrays, iteratee, comparator) {
  5215. var length = arrays.length;
  5216. if (length < 2) {
  5217. return length ? baseUniq(arrays[0]) : [];
  5218. }
  5219. var index = -1,
  5220. result = Array(length);
  5221. while (++index < length) {
  5222. var array = arrays[index],
  5223. othIndex = -1;
  5224. while (++othIndex < length) {
  5225. if (othIndex != index) {
  5226. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5227. }
  5228. }
  5229. }
  5230. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5231. }
  5232. /**
  5233. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5234. *
  5235. * @private
  5236. * @param {Array} props The property identifiers.
  5237. * @param {Array} values The property values.
  5238. * @param {Function} assignFunc The function to assign values.
  5239. * @returns {Object} Returns the new object.
  5240. */
  5241. function baseZipObject(props, values, assignFunc) {
  5242. var index = -1,
  5243. length = props.length,
  5244. valsLength = values.length,
  5245. result = {};
  5246. while (++index < length) {
  5247. var value = index < valsLength ? values[index] : undefined;
  5248. assignFunc(result, props[index], value);
  5249. }
  5250. return result;
  5251. }
  5252. /**
  5253. * Casts `value` to an empty array if it's not an array like object.
  5254. *
  5255. * @private
  5256. * @param {*} value The value to inspect.
  5257. * @returns {Array|Object} Returns the cast array-like object.
  5258. */
  5259. function castArrayLikeObject(value) {
  5260. return isArrayLikeObject(value) ? value : [];
  5261. }
  5262. /**
  5263. * Casts `value` to `identity` if it's not a function.
  5264. *
  5265. * @private
  5266. * @param {*} value The value to inspect.
  5267. * @returns {Function} Returns cast function.
  5268. */
  5269. function castFunction(value) {
  5270. return typeof value == 'function' ? value : identity;
  5271. }
  5272. /**
  5273. * Casts `value` to a path array if it's not one.
  5274. *
  5275. * @private
  5276. * @param {*} value The value to inspect.
  5277. * @param {Object} [object] The object to query keys on.
  5278. * @returns {Array} Returns the cast property path array.
  5279. */
  5280. function castPath(value, object) {
  5281. if (isArray(value)) {
  5282. return value;
  5283. }
  5284. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5285. }
  5286. /**
  5287. * A `baseRest` alias which can be replaced with `identity` by module
  5288. * replacement plugins.
  5289. *
  5290. * @private
  5291. * @type {Function}
  5292. * @param {Function} func The function to apply a rest parameter to.
  5293. * @returns {Function} Returns the new function.
  5294. */
  5295. var castRest = baseRest;
  5296. /**
  5297. * Casts `array` to a slice if it's needed.
  5298. *
  5299. * @private
  5300. * @param {Array} array The array to inspect.
  5301. * @param {number} start The start position.
  5302. * @param {number} [end=array.length] The end position.
  5303. * @returns {Array} Returns the cast slice.
  5304. */
  5305. function castSlice(array, start, end) {
  5306. var length = array.length;
  5307. end = end === undefined ? length : end;
  5308. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5309. }
  5310. /**
  5311. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5312. *
  5313. * @private
  5314. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5315. */
  5316. var clearTimeout = ctxClearTimeout || function(id) {
  5317. return root.clearTimeout(id);
  5318. };
  5319. /**
  5320. * Creates a clone of `buffer`.
  5321. *
  5322. * @private
  5323. * @param {Buffer} buffer The buffer to clone.
  5324. * @param {boolean} [isDeep] Specify a deep clone.
  5325. * @returns {Buffer} Returns the cloned buffer.
  5326. */
  5327. function cloneBuffer(buffer, isDeep) {
  5328. if (isDeep) {
  5329. return buffer.slice();
  5330. }
  5331. var length = buffer.length,
  5332. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5333. buffer.copy(result);
  5334. return result;
  5335. }
  5336. /**
  5337. * Creates a clone of `arrayBuffer`.
  5338. *
  5339. * @private
  5340. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5341. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5342. */
  5343. function cloneArrayBuffer(arrayBuffer) {
  5344. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5345. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5346. return result;
  5347. }
  5348. /**
  5349. * Creates a clone of `dataView`.
  5350. *
  5351. * @private
  5352. * @param {Object} dataView The data view to clone.
  5353. * @param {boolean} [isDeep] Specify a deep clone.
  5354. * @returns {Object} Returns the cloned data view.
  5355. */
  5356. function cloneDataView(dataView, isDeep) {
  5357. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5358. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5359. }
  5360. /**
  5361. * Creates a clone of `regexp`.
  5362. *
  5363. * @private
  5364. * @param {Object} regexp The regexp to clone.
  5365. * @returns {Object} Returns the cloned regexp.
  5366. */
  5367. function cloneRegExp(regexp) {
  5368. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5369. result.lastIndex = regexp.lastIndex;
  5370. return result;
  5371. }
  5372. /**
  5373. * Creates a clone of the `symbol` object.
  5374. *
  5375. * @private
  5376. * @param {Object} symbol The symbol object to clone.
  5377. * @returns {Object} Returns the cloned symbol object.
  5378. */
  5379. function cloneSymbol(symbol) {
  5380. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5381. }
  5382. /**
  5383. * Creates a clone of `typedArray`.
  5384. *
  5385. * @private
  5386. * @param {Object} typedArray The typed array to clone.
  5387. * @param {boolean} [isDeep] Specify a deep clone.
  5388. * @returns {Object} Returns the cloned typed array.
  5389. */
  5390. function cloneTypedArray(typedArray, isDeep) {
  5391. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5392. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5393. }
  5394. /**
  5395. * Compares values to sort them in ascending order.
  5396. *
  5397. * @private
  5398. * @param {*} value The value to compare.
  5399. * @param {*} other The other value to compare.
  5400. * @returns {number} Returns the sort order indicator for `value`.
  5401. */
  5402. function compareAscending(value, other) {
  5403. if (value !== other) {
  5404. var valIsDefined = value !== undefined,
  5405. valIsNull = value === null,
  5406. valIsReflexive = value === value,
  5407. valIsSymbol = isSymbol(value);
  5408. var othIsDefined = other !== undefined,
  5409. othIsNull = other === null,
  5410. othIsReflexive = other === other,
  5411. othIsSymbol = isSymbol(other);
  5412. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5413. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5414. (valIsNull && othIsDefined && othIsReflexive) ||
  5415. (!valIsDefined && othIsReflexive) ||
  5416. !valIsReflexive) {
  5417. return 1;
  5418. }
  5419. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5420. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5421. (othIsNull && valIsDefined && valIsReflexive) ||
  5422. (!othIsDefined && valIsReflexive) ||
  5423. !othIsReflexive) {
  5424. return -1;
  5425. }
  5426. }
  5427. return 0;
  5428. }
  5429. /**
  5430. * Used by `_.orderBy` to compare multiple properties of a value to another
  5431. * and stable sort them.
  5432. *
  5433. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5434. * specify an order of "desc" for descending or "asc" for ascending sort order
  5435. * of corresponding values.
  5436. *
  5437. * @private
  5438. * @param {Object} object The object to compare.
  5439. * @param {Object} other The other object to compare.
  5440. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5441. * @returns {number} Returns the sort order indicator for `object`.
  5442. */
  5443. function compareMultiple(object, other, orders) {
  5444. var index = -1,
  5445. objCriteria = object.criteria,
  5446. othCriteria = other.criteria,
  5447. length = objCriteria.length,
  5448. ordersLength = orders.length;
  5449. while (++index < length) {
  5450. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5451. if (result) {
  5452. if (index >= ordersLength) {
  5453. return result;
  5454. }
  5455. var order = orders[index];
  5456. return result * (order == 'desc' ? -1 : 1);
  5457. }
  5458. }
  5459. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5460. // that causes it, under certain circumstances, to provide the same value for
  5461. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5462. // for more details.
  5463. //
  5464. // This also ensures a stable sort in V8 and other engines.
  5465. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5466. return object.index - other.index;
  5467. }
  5468. /**
  5469. * Creates an array that is the composition of partially applied arguments,
  5470. * placeholders, and provided arguments into a single array of arguments.
  5471. *
  5472. * @private
  5473. * @param {Array} args The provided arguments.
  5474. * @param {Array} partials The arguments to prepend to those provided.
  5475. * @param {Array} holders The `partials` placeholder indexes.
  5476. * @params {boolean} [isCurried] Specify composing for a curried function.
  5477. * @returns {Array} Returns the new array of composed arguments.
  5478. */
  5479. function composeArgs(args, partials, holders, isCurried) {
  5480. var argsIndex = -1,
  5481. argsLength = args.length,
  5482. holdersLength = holders.length,
  5483. leftIndex = -1,
  5484. leftLength = partials.length,
  5485. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5486. result = Array(leftLength + rangeLength),
  5487. isUncurried = !isCurried;
  5488. while (++leftIndex < leftLength) {
  5489. result[leftIndex] = partials[leftIndex];
  5490. }
  5491. while (++argsIndex < holdersLength) {
  5492. if (isUncurried || argsIndex < argsLength) {
  5493. result[holders[argsIndex]] = args[argsIndex];
  5494. }
  5495. }
  5496. while (rangeLength--) {
  5497. result[leftIndex++] = args[argsIndex++];
  5498. }
  5499. return result;
  5500. }
  5501. /**
  5502. * This function is like `composeArgs` except that the arguments composition
  5503. * is tailored for `_.partialRight`.
  5504. *
  5505. * @private
  5506. * @param {Array} args The provided arguments.
  5507. * @param {Array} partials The arguments to append to those provided.
  5508. * @param {Array} holders The `partials` placeholder indexes.
  5509. * @params {boolean} [isCurried] Specify composing for a curried function.
  5510. * @returns {Array} Returns the new array of composed arguments.
  5511. */
  5512. function composeArgsRight(args, partials, holders, isCurried) {
  5513. var argsIndex = -1,
  5514. argsLength = args.length,
  5515. holdersIndex = -1,
  5516. holdersLength = holders.length,
  5517. rightIndex = -1,
  5518. rightLength = partials.length,
  5519. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5520. result = Array(rangeLength + rightLength),
  5521. isUncurried = !isCurried;
  5522. while (++argsIndex < rangeLength) {
  5523. result[argsIndex] = args[argsIndex];
  5524. }
  5525. var offset = argsIndex;
  5526. while (++rightIndex < rightLength) {
  5527. result[offset + rightIndex] = partials[rightIndex];
  5528. }
  5529. while (++holdersIndex < holdersLength) {
  5530. if (isUncurried || argsIndex < argsLength) {
  5531. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5532. }
  5533. }
  5534. return result;
  5535. }
  5536. /**
  5537. * Copies the values of `source` to `array`.
  5538. *
  5539. * @private
  5540. * @param {Array} source The array to copy values from.
  5541. * @param {Array} [array=[]] The array to copy values to.
  5542. * @returns {Array} Returns `array`.
  5543. */
  5544. function copyArray(source, array) {
  5545. var index = -1,
  5546. length = source.length;
  5547. array || (array = Array(length));
  5548. while (++index < length) {
  5549. array[index] = source[index];
  5550. }
  5551. return array;
  5552. }
  5553. /**
  5554. * Copies properties of `source` to `object`.
  5555. *
  5556. * @private
  5557. * @param {Object} source The object to copy properties from.
  5558. * @param {Array} props The property identifiers to copy.
  5559. * @param {Object} [object={}] The object to copy properties to.
  5560. * @param {Function} [customizer] The function to customize copied values.
  5561. * @returns {Object} Returns `object`.
  5562. */
  5563. function copyObject(source, props, object, customizer) {
  5564. var isNew = !object;
  5565. object || (object = {});
  5566. var index = -1,
  5567. length = props.length;
  5568. while (++index < length) {
  5569. var key = props[index];
  5570. var newValue = customizer
  5571. ? customizer(object[key], source[key], key, object, source)
  5572. : undefined;
  5573. if (newValue === undefined) {
  5574. newValue = source[key];
  5575. }
  5576. if (isNew) {
  5577. baseAssignValue(object, key, newValue);
  5578. } else {
  5579. assignValue(object, key, newValue);
  5580. }
  5581. }
  5582. return object;
  5583. }
  5584. /**
  5585. * Copies own symbols of `source` to `object`.
  5586. *
  5587. * @private
  5588. * @param {Object} source The object to copy symbols from.
  5589. * @param {Object} [object={}] The object to copy symbols to.
  5590. * @returns {Object} Returns `object`.
  5591. */
  5592. function copySymbols(source, object) {
  5593. return copyObject(source, getSymbols(source), object);
  5594. }
  5595. /**
  5596. * Copies own and inherited symbols of `source` to `object`.
  5597. *
  5598. * @private
  5599. * @param {Object} source The object to copy symbols from.
  5600. * @param {Object} [object={}] The object to copy symbols to.
  5601. * @returns {Object} Returns `object`.
  5602. */
  5603. function copySymbolsIn(source, object) {
  5604. return copyObject(source, getSymbolsIn(source), object);
  5605. }
  5606. /**
  5607. * Creates a function like `_.groupBy`.
  5608. *
  5609. * @private
  5610. * @param {Function} setter The function to set accumulator values.
  5611. * @param {Function} [initializer] The accumulator object initializer.
  5612. * @returns {Function} Returns the new aggregator function.
  5613. */
  5614. function createAggregator(setter, initializer) {
  5615. return function(collection, iteratee) {
  5616. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5617. accumulator = initializer ? initializer() : {};
  5618. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5619. };
  5620. }
  5621. /**
  5622. * Creates a function like `_.assign`.
  5623. *
  5624. * @private
  5625. * @param {Function} assigner The function to assign values.
  5626. * @returns {Function} Returns the new assigner function.
  5627. */
  5628. function createAssigner(assigner) {
  5629. return baseRest(function(object, sources) {
  5630. var index = -1,
  5631. length = sources.length,
  5632. customizer = length > 1 ? sources[length - 1] : undefined,
  5633. guard = length > 2 ? sources[2] : undefined;
  5634. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5635. ? (length--, customizer)
  5636. : undefined;
  5637. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5638. customizer = length < 3 ? undefined : customizer;
  5639. length = 1;
  5640. }
  5641. object = Object(object);
  5642. while (++index < length) {
  5643. var source = sources[index];
  5644. if (source) {
  5645. assigner(object, source, index, customizer);
  5646. }
  5647. }
  5648. return object;
  5649. });
  5650. }
  5651. /**
  5652. * Creates a `baseEach` or `baseEachRight` function.
  5653. *
  5654. * @private
  5655. * @param {Function} eachFunc The function to iterate over a collection.
  5656. * @param {boolean} [fromRight] Specify iterating from right to left.
  5657. * @returns {Function} Returns the new base function.
  5658. */
  5659. function createBaseEach(eachFunc, fromRight) {
  5660. return function(collection, iteratee) {
  5661. if (collection == null) {
  5662. return collection;
  5663. }
  5664. if (!isArrayLike(collection)) {
  5665. return eachFunc(collection, iteratee);
  5666. }
  5667. var length = collection.length,
  5668. index = fromRight ? length : -1,
  5669. iterable = Object(collection);
  5670. while ((fromRight ? index-- : ++index < length)) {
  5671. if (iteratee(iterable[index], index, iterable) === false) {
  5672. break;
  5673. }
  5674. }
  5675. return collection;
  5676. };
  5677. }
  5678. /**
  5679. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5680. *
  5681. * @private
  5682. * @param {boolean} [fromRight] Specify iterating from right to left.
  5683. * @returns {Function} Returns the new base function.
  5684. */
  5685. function createBaseFor(fromRight) {
  5686. return function(object, iteratee, keysFunc) {
  5687. var index = -1,
  5688. iterable = Object(object),
  5689. props = keysFunc(object),
  5690. length = props.length;
  5691. while (length--) {
  5692. var key = props[fromRight ? length : ++index];
  5693. if (iteratee(iterable[key], key, iterable) === false) {
  5694. break;
  5695. }
  5696. }
  5697. return object;
  5698. };
  5699. }
  5700. /**
  5701. * Creates a function that wraps `func` to invoke it with the optional `this`
  5702. * binding of `thisArg`.
  5703. *
  5704. * @private
  5705. * @param {Function} func The function to wrap.
  5706. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5707. * @param {*} [thisArg] The `this` binding of `func`.
  5708. * @returns {Function} Returns the new wrapped function.
  5709. */
  5710. function createBind(func, bitmask, thisArg) {
  5711. var isBind = bitmask & WRAP_BIND_FLAG,
  5712. Ctor = createCtor(func);
  5713. function wrapper() {
  5714. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5715. return fn.apply(isBind ? thisArg : this, arguments);
  5716. }
  5717. return wrapper;
  5718. }
  5719. /**
  5720. * Creates a function like `_.lowerFirst`.
  5721. *
  5722. * @private
  5723. * @param {string} methodName The name of the `String` case method to use.
  5724. * @returns {Function} Returns the new case function.
  5725. */
  5726. function createCaseFirst(methodName) {
  5727. return function(string) {
  5728. string = toString(string);
  5729. var strSymbols = hasUnicode(string)
  5730. ? stringToArray(string)
  5731. : undefined;
  5732. var chr = strSymbols
  5733. ? strSymbols[0]
  5734. : string.charAt(0);
  5735. var trailing = strSymbols
  5736. ? castSlice(strSymbols, 1).join('')
  5737. : string.slice(1);
  5738. return chr[methodName]() + trailing;
  5739. };
  5740. }
  5741. /**
  5742. * Creates a function like `_.camelCase`.
  5743. *
  5744. * @private
  5745. * @param {Function} callback The function to combine each word.
  5746. * @returns {Function} Returns the new compounder function.
  5747. */
  5748. function createCompounder(callback) {
  5749. return function(string) {
  5750. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5751. };
  5752. }
  5753. /**
  5754. * Creates a function that produces an instance of `Ctor` regardless of
  5755. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5756. *
  5757. * @private
  5758. * @param {Function} Ctor The constructor to wrap.
  5759. * @returns {Function} Returns the new wrapped function.
  5760. */
  5761. function createCtor(Ctor) {
  5762. return function() {
  5763. // Use a `switch` statement to work with class constructors. See
  5764. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5765. // for more details.
  5766. var args = arguments;
  5767. switch (args.length) {
  5768. case 0: return new Ctor;
  5769. case 1: return new Ctor(args[0]);
  5770. case 2: return new Ctor(args[0], args[1]);
  5771. case 3: return new Ctor(args[0], args[1], args[2]);
  5772. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5773. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5774. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5775. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5776. }
  5777. var thisBinding = baseCreate(Ctor.prototype),
  5778. result = Ctor.apply(thisBinding, args);
  5779. // Mimic the constructor's `return` behavior.
  5780. // See https://es5.github.io/#x13.2.2 for more details.
  5781. return isObject(result) ? result : thisBinding;
  5782. };
  5783. }
  5784. /**
  5785. * Creates a function that wraps `func` to enable currying.
  5786. *
  5787. * @private
  5788. * @param {Function} func The function to wrap.
  5789. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5790. * @param {number} arity The arity of `func`.
  5791. * @returns {Function} Returns the new wrapped function.
  5792. */
  5793. function createCurry(func, bitmask, arity) {
  5794. var Ctor = createCtor(func);
  5795. function wrapper() {
  5796. var length = arguments.length,
  5797. args = Array(length),
  5798. index = length,
  5799. placeholder = getHolder(wrapper);
  5800. while (index--) {
  5801. args[index] = arguments[index];
  5802. }
  5803. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5804. ? []
  5805. : replaceHolders(args, placeholder);
  5806. length -= holders.length;
  5807. if (length < arity) {
  5808. return createRecurry(
  5809. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5810. args, holders, undefined, undefined, arity - length);
  5811. }
  5812. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5813. return apply(fn, this, args);
  5814. }
  5815. return wrapper;
  5816. }
  5817. /**
  5818. * Creates a `_.find` or `_.findLast` function.
  5819. *
  5820. * @private
  5821. * @param {Function} findIndexFunc The function to find the collection index.
  5822. * @returns {Function} Returns the new find function.
  5823. */
  5824. function createFind(findIndexFunc) {
  5825. return function(collection, predicate, fromIndex) {
  5826. var iterable = Object(collection);
  5827. if (!isArrayLike(collection)) {
  5828. var iteratee = getIteratee(predicate, 3);
  5829. collection = keys(collection);
  5830. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5831. }
  5832. var index = findIndexFunc(collection, predicate, fromIndex);
  5833. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5834. };
  5835. }
  5836. /**
  5837. * Creates a `_.flow` or `_.flowRight` function.
  5838. *
  5839. * @private
  5840. * @param {boolean} [fromRight] Specify iterating from right to left.
  5841. * @returns {Function} Returns the new flow function.
  5842. */
  5843. function createFlow(fromRight) {
  5844. return flatRest(function(funcs) {
  5845. var length = funcs.length,
  5846. index = length,
  5847. prereq = LodashWrapper.prototype.thru;
  5848. if (fromRight) {
  5849. funcs.reverse();
  5850. }
  5851. while (index--) {
  5852. var func = funcs[index];
  5853. if (typeof func != 'function') {
  5854. throw new TypeError(FUNC_ERROR_TEXT);
  5855. }
  5856. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5857. var wrapper = new LodashWrapper([], true);
  5858. }
  5859. }
  5860. index = wrapper ? index : length;
  5861. while (++index < length) {
  5862. func = funcs[index];
  5863. var funcName = getFuncName(func),
  5864. data = funcName == 'wrapper' ? getData(func) : undefined;
  5865. if (data && isLaziable(data[0]) &&
  5866. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5867. !data[4].length && data[9] == 1
  5868. ) {
  5869. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5870. } else {
  5871. wrapper = (func.length == 1 && isLaziable(func))
  5872. ? wrapper[funcName]()
  5873. : wrapper.thru(func);
  5874. }
  5875. }
  5876. return function() {
  5877. var args = arguments,
  5878. value = args[0];
  5879. if (wrapper && args.length == 1 && isArray(value)) {
  5880. return wrapper.plant(value).value();
  5881. }
  5882. var index = 0,
  5883. result = length ? funcs[index].apply(this, args) : value;
  5884. while (++index < length) {
  5885. result = funcs[index].call(this, result);
  5886. }
  5887. return result;
  5888. };
  5889. });
  5890. }
  5891. /**
  5892. * Creates a function that wraps `func` to invoke it with optional `this`
  5893. * binding of `thisArg`, partial application, and currying.
  5894. *
  5895. * @private
  5896. * @param {Function|string} func The function or method name to wrap.
  5897. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5898. * @param {*} [thisArg] The `this` binding of `func`.
  5899. * @param {Array} [partials] The arguments to prepend to those provided to
  5900. * the new function.
  5901. * @param {Array} [holders] The `partials` placeholder indexes.
  5902. * @param {Array} [partialsRight] The arguments to append to those provided
  5903. * to the new function.
  5904. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5905. * @param {Array} [argPos] The argument positions of the new function.
  5906. * @param {number} [ary] The arity cap of `func`.
  5907. * @param {number} [arity] The arity of `func`.
  5908. * @returns {Function} Returns the new wrapped function.
  5909. */
  5910. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5911. var isAry = bitmask & WRAP_ARY_FLAG,
  5912. isBind = bitmask & WRAP_BIND_FLAG,
  5913. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5914. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5915. isFlip = bitmask & WRAP_FLIP_FLAG,
  5916. Ctor = isBindKey ? undefined : createCtor(func);
  5917. function wrapper() {
  5918. var length = arguments.length,
  5919. args = Array(length),
  5920. index = length;
  5921. while (index--) {
  5922. args[index] = arguments[index];
  5923. }
  5924. if (isCurried) {
  5925. var placeholder = getHolder(wrapper),
  5926. holdersCount = countHolders(args, placeholder);
  5927. }
  5928. if (partials) {
  5929. args = composeArgs(args, partials, holders, isCurried);
  5930. }
  5931. if (partialsRight) {
  5932. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5933. }
  5934. length -= holdersCount;
  5935. if (isCurried && length < arity) {
  5936. var newHolders = replaceHolders(args, placeholder);
  5937. return createRecurry(
  5938. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5939. args, newHolders, argPos, ary, arity - length
  5940. );
  5941. }
  5942. var thisBinding = isBind ? thisArg : this,
  5943. fn = isBindKey ? thisBinding[func] : func;
  5944. length = args.length;
  5945. if (argPos) {
  5946. args = reorder(args, argPos);
  5947. } else if (isFlip && length > 1) {
  5948. args.reverse();
  5949. }
  5950. if (isAry && ary < length) {
  5951. args.length = ary;
  5952. }
  5953. if (this && this !== root && this instanceof wrapper) {
  5954. fn = Ctor || createCtor(fn);
  5955. }
  5956. return fn.apply(thisBinding, args);
  5957. }
  5958. return wrapper;
  5959. }
  5960. /**
  5961. * Creates a function like `_.invertBy`.
  5962. *
  5963. * @private
  5964. * @param {Function} setter The function to set accumulator values.
  5965. * @param {Function} toIteratee The function to resolve iteratees.
  5966. * @returns {Function} Returns the new inverter function.
  5967. */
  5968. function createInverter(setter, toIteratee) {
  5969. return function(object, iteratee) {
  5970. return baseInverter(object, setter, toIteratee(iteratee), {});
  5971. };
  5972. }
  5973. /**
  5974. * Creates a function that performs a mathematical operation on two values.
  5975. *
  5976. * @private
  5977. * @param {Function} operator The function to perform the operation.
  5978. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5979. * @returns {Function} Returns the new mathematical operation function.
  5980. */
  5981. function createMathOperation(operator, defaultValue) {
  5982. return function(value, other) {
  5983. var result;
  5984. if (value === undefined && other === undefined) {
  5985. return defaultValue;
  5986. }
  5987. if (value !== undefined) {
  5988. result = value;
  5989. }
  5990. if (other !== undefined) {
  5991. if (result === undefined) {
  5992. return other;
  5993. }
  5994. if (typeof value == 'string' || typeof other == 'string') {
  5995. value = baseToString(value);
  5996. other = baseToString(other);
  5997. } else {
  5998. value = baseToNumber(value);
  5999. other = baseToNumber(other);
  6000. }
  6001. result = operator(value, other);
  6002. }
  6003. return result;
  6004. };
  6005. }
  6006. /**
  6007. * Creates a function like `_.over`.
  6008. *
  6009. * @private
  6010. * @param {Function} arrayFunc The function to iterate over iteratees.
  6011. * @returns {Function} Returns the new over function.
  6012. */
  6013. function createOver(arrayFunc) {
  6014. return flatRest(function(iteratees) {
  6015. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6016. return baseRest(function(args) {
  6017. var thisArg = this;
  6018. return arrayFunc(iteratees, function(iteratee) {
  6019. return apply(iteratee, thisArg, args);
  6020. });
  6021. });
  6022. });
  6023. }
  6024. /**
  6025. * Creates the padding for `string` based on `length`. The `chars` string
  6026. * is truncated if the number of characters exceeds `length`.
  6027. *
  6028. * @private
  6029. * @param {number} length The padding length.
  6030. * @param {string} [chars=' '] The string used as padding.
  6031. * @returns {string} Returns the padding for `string`.
  6032. */
  6033. function createPadding(length, chars) {
  6034. chars = chars === undefined ? ' ' : baseToString(chars);
  6035. var charsLength = chars.length;
  6036. if (charsLength < 2) {
  6037. return charsLength ? baseRepeat(chars, length) : chars;
  6038. }
  6039. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6040. return hasUnicode(chars)
  6041. ? castSlice(stringToArray(result), 0, length).join('')
  6042. : result.slice(0, length);
  6043. }
  6044. /**
  6045. * Creates a function that wraps `func` to invoke it with the `this` binding
  6046. * of `thisArg` and `partials` prepended to the arguments it receives.
  6047. *
  6048. * @private
  6049. * @param {Function} func The function to wrap.
  6050. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6051. * @param {*} thisArg The `this` binding of `func`.
  6052. * @param {Array} partials The arguments to prepend to those provided to
  6053. * the new function.
  6054. * @returns {Function} Returns the new wrapped function.
  6055. */
  6056. function createPartial(func, bitmask, thisArg, partials) {
  6057. var isBind = bitmask & WRAP_BIND_FLAG,
  6058. Ctor = createCtor(func);
  6059. function wrapper() {
  6060. var argsIndex = -1,
  6061. argsLength = arguments.length,
  6062. leftIndex = -1,
  6063. leftLength = partials.length,
  6064. args = Array(leftLength + argsLength),
  6065. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6066. while (++leftIndex < leftLength) {
  6067. args[leftIndex] = partials[leftIndex];
  6068. }
  6069. while (argsLength--) {
  6070. args[leftIndex++] = arguments[++argsIndex];
  6071. }
  6072. return apply(fn, isBind ? thisArg : this, args);
  6073. }
  6074. return wrapper;
  6075. }
  6076. /**
  6077. * Creates a `_.range` or `_.rangeRight` function.
  6078. *
  6079. * @private
  6080. * @param {boolean} [fromRight] Specify iterating from right to left.
  6081. * @returns {Function} Returns the new range function.
  6082. */
  6083. function createRange(fromRight) {
  6084. return function(start, end, step) {
  6085. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6086. end = step = undefined;
  6087. }
  6088. // Ensure the sign of `-0` is preserved.
  6089. start = toFinite(start);
  6090. if (end === undefined) {
  6091. end = start;
  6092. start = 0;
  6093. } else {
  6094. end = toFinite(end);
  6095. }
  6096. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6097. return baseRange(start, end, step, fromRight);
  6098. };
  6099. }
  6100. /**
  6101. * Creates a function that performs a relational operation on two values.
  6102. *
  6103. * @private
  6104. * @param {Function} operator The function to perform the operation.
  6105. * @returns {Function} Returns the new relational operation function.
  6106. */
  6107. function createRelationalOperation(operator) {
  6108. return function(value, other) {
  6109. if (!(typeof value == 'string' && typeof other == 'string')) {
  6110. value = toNumber(value);
  6111. other = toNumber(other);
  6112. }
  6113. return operator(value, other);
  6114. };
  6115. }
  6116. /**
  6117. * Creates a function that wraps `func` to continue currying.
  6118. *
  6119. * @private
  6120. * @param {Function} func The function to wrap.
  6121. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6122. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6123. * @param {*} placeholder The placeholder value.
  6124. * @param {*} [thisArg] The `this` binding of `func`.
  6125. * @param {Array} [partials] The arguments to prepend to those provided to
  6126. * the new function.
  6127. * @param {Array} [holders] The `partials` placeholder indexes.
  6128. * @param {Array} [argPos] The argument positions of the new function.
  6129. * @param {number} [ary] The arity cap of `func`.
  6130. * @param {number} [arity] The arity of `func`.
  6131. * @returns {Function} Returns the new wrapped function.
  6132. */
  6133. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6134. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6135. newHolders = isCurry ? holders : undefined,
  6136. newHoldersRight = isCurry ? undefined : holders,
  6137. newPartials = isCurry ? partials : undefined,
  6138. newPartialsRight = isCurry ? undefined : partials;
  6139. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6140. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6141. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6142. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6143. }
  6144. var newData = [
  6145. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6146. newHoldersRight, argPos, ary, arity
  6147. ];
  6148. var result = wrapFunc.apply(undefined, newData);
  6149. if (isLaziable(func)) {
  6150. setData(result, newData);
  6151. }
  6152. result.placeholder = placeholder;
  6153. return setWrapToString(result, func, bitmask);
  6154. }
  6155. /**
  6156. * Creates a function like `_.round`.
  6157. *
  6158. * @private
  6159. * @param {string} methodName The name of the `Math` method to use when rounding.
  6160. * @returns {Function} Returns the new round function.
  6161. */
  6162. function createRound(methodName) {
  6163. var func = Math[methodName];
  6164. return function(number, precision) {
  6165. number = toNumber(number);
  6166. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6167. if (precision && nativeIsFinite(number)) {
  6168. // Shift with exponential notation to avoid floating-point issues.
  6169. // See [MDN](https://mdn.io/round#Examples) for more details.
  6170. var pair = (toString(number) + 'e').split('e'),
  6171. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6172. pair = (toString(value) + 'e').split('e');
  6173. return +(pair[0] + 'e' + (+pair[1] - precision));
  6174. }
  6175. return func(number);
  6176. };
  6177. }
  6178. /**
  6179. * Creates a set object of `values`.
  6180. *
  6181. * @private
  6182. * @param {Array} values The values to add to the set.
  6183. * @returns {Object} Returns the new set.
  6184. */
  6185. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6186. return new Set(values);
  6187. };
  6188. /**
  6189. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6190. *
  6191. * @private
  6192. * @param {Function} keysFunc The function to get the keys of a given object.
  6193. * @returns {Function} Returns the new pairs function.
  6194. */
  6195. function createToPairs(keysFunc) {
  6196. return function(object) {
  6197. var tag = getTag(object);
  6198. if (tag == mapTag) {
  6199. return mapToArray(object);
  6200. }
  6201. if (tag == setTag) {
  6202. return setToPairs(object);
  6203. }
  6204. return baseToPairs(object, keysFunc(object));
  6205. };
  6206. }
  6207. /**
  6208. * Creates a function that either curries or invokes `func` with optional
  6209. * `this` binding and partially applied arguments.
  6210. *
  6211. * @private
  6212. * @param {Function|string} func The function or method name to wrap.
  6213. * @param {number} bitmask The bitmask flags.
  6214. * 1 - `_.bind`
  6215. * 2 - `_.bindKey`
  6216. * 4 - `_.curry` or `_.curryRight` of a bound function
  6217. * 8 - `_.curry`
  6218. * 16 - `_.curryRight`
  6219. * 32 - `_.partial`
  6220. * 64 - `_.partialRight`
  6221. * 128 - `_.rearg`
  6222. * 256 - `_.ary`
  6223. * 512 - `_.flip`
  6224. * @param {*} [thisArg] The `this` binding of `func`.
  6225. * @param {Array} [partials] The arguments to be partially applied.
  6226. * @param {Array} [holders] The `partials` placeholder indexes.
  6227. * @param {Array} [argPos] The argument positions of the new function.
  6228. * @param {number} [ary] The arity cap of `func`.
  6229. * @param {number} [arity] The arity of `func`.
  6230. * @returns {Function} Returns the new wrapped function.
  6231. */
  6232. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6233. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6234. if (!isBindKey && typeof func != 'function') {
  6235. throw new TypeError(FUNC_ERROR_TEXT);
  6236. }
  6237. var length = partials ? partials.length : 0;
  6238. if (!length) {
  6239. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6240. partials = holders = undefined;
  6241. }
  6242. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6243. arity = arity === undefined ? arity : toInteger(arity);
  6244. length -= holders ? holders.length : 0;
  6245. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6246. var partialsRight = partials,
  6247. holdersRight = holders;
  6248. partials = holders = undefined;
  6249. }
  6250. var data = isBindKey ? undefined : getData(func);
  6251. var newData = [
  6252. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6253. argPos, ary, arity
  6254. ];
  6255. if (data) {
  6256. mergeData(newData, data);
  6257. }
  6258. func = newData[0];
  6259. bitmask = newData[1];
  6260. thisArg = newData[2];
  6261. partials = newData[3];
  6262. holders = newData[4];
  6263. arity = newData[9] = newData[9] === undefined
  6264. ? (isBindKey ? 0 : func.length)
  6265. : nativeMax(newData[9] - length, 0);
  6266. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6267. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6268. }
  6269. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6270. var result = createBind(func, bitmask, thisArg);
  6271. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6272. result = createCurry(func, bitmask, arity);
  6273. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6274. result = createPartial(func, bitmask, thisArg, partials);
  6275. } else {
  6276. result = createHybrid.apply(undefined, newData);
  6277. }
  6278. var setter = data ? baseSetData : setData;
  6279. return setWrapToString(setter(result, newData), func, bitmask);
  6280. }
  6281. /**
  6282. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6283. * of source objects to the destination object for all destination properties
  6284. * that resolve to `undefined`.
  6285. *
  6286. * @private
  6287. * @param {*} objValue The destination value.
  6288. * @param {*} srcValue The source value.
  6289. * @param {string} key The key of the property to assign.
  6290. * @param {Object} object The parent object of `objValue`.
  6291. * @returns {*} Returns the value to assign.
  6292. */
  6293. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6294. if (objValue === undefined ||
  6295. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6296. return srcValue;
  6297. }
  6298. return objValue;
  6299. }
  6300. /**
  6301. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6302. * objects into destination objects that are passed thru.
  6303. *
  6304. * @private
  6305. * @param {*} objValue The destination value.
  6306. * @param {*} srcValue The source value.
  6307. * @param {string} key The key of the property to merge.
  6308. * @param {Object} object The parent object of `objValue`.
  6309. * @param {Object} source The parent object of `srcValue`.
  6310. * @param {Object} [stack] Tracks traversed source values and their merged
  6311. * counterparts.
  6312. * @returns {*} Returns the value to assign.
  6313. */
  6314. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6315. if (isObject(objValue) && isObject(srcValue)) {
  6316. // Recursively merge objects and arrays (susceptible to call stack limits).
  6317. stack.set(srcValue, objValue);
  6318. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6319. stack['delete'](srcValue);
  6320. }
  6321. return objValue;
  6322. }
  6323. /**
  6324. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6325. * objects.
  6326. *
  6327. * @private
  6328. * @param {*} value The value to inspect.
  6329. * @param {string} key The key of the property to inspect.
  6330. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6331. */
  6332. function customOmitClone(value) {
  6333. return isPlainObject(value) ? undefined : value;
  6334. }
  6335. /**
  6336. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6337. * partial deep comparisons.
  6338. *
  6339. * @private
  6340. * @param {Array} array The array to compare.
  6341. * @param {Array} other The other array to compare.
  6342. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6343. * @param {Function} customizer The function to customize comparisons.
  6344. * @param {Function} equalFunc The function to determine equivalents of values.
  6345. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6346. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6347. */
  6348. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6349. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6350. arrLength = array.length,
  6351. othLength = other.length;
  6352. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6353. return false;
  6354. }
  6355. // Check that cyclic values are equal.
  6356. var arrStacked = stack.get(array);
  6357. var othStacked = stack.get(other);
  6358. if (arrStacked && othStacked) {
  6359. return arrStacked == other && othStacked == array;
  6360. }
  6361. var index = -1,
  6362. result = true,
  6363. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6364. stack.set(array, other);
  6365. stack.set(other, array);
  6366. // Ignore non-index properties.
  6367. while (++index < arrLength) {
  6368. var arrValue = array[index],
  6369. othValue = other[index];
  6370. if (customizer) {
  6371. var compared = isPartial
  6372. ? customizer(othValue, arrValue, index, other, array, stack)
  6373. : customizer(arrValue, othValue, index, array, other, stack);
  6374. }
  6375. if (compared !== undefined) {
  6376. if (compared) {
  6377. continue;
  6378. }
  6379. result = false;
  6380. break;
  6381. }
  6382. // Recursively compare arrays (susceptible to call stack limits).
  6383. if (seen) {
  6384. if (!arraySome(other, function(othValue, othIndex) {
  6385. if (!cacheHas(seen, othIndex) &&
  6386. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6387. return seen.push(othIndex);
  6388. }
  6389. })) {
  6390. result = false;
  6391. break;
  6392. }
  6393. } else if (!(
  6394. arrValue === othValue ||
  6395. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6396. )) {
  6397. result = false;
  6398. break;
  6399. }
  6400. }
  6401. stack['delete'](array);
  6402. stack['delete'](other);
  6403. return result;
  6404. }
  6405. /**
  6406. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6407. * the same `toStringTag`.
  6408. *
  6409. * **Note:** This function only supports comparing values with tags of
  6410. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6411. *
  6412. * @private
  6413. * @param {Object} object The object to compare.
  6414. * @param {Object} other The other object to compare.
  6415. * @param {string} tag The `toStringTag` of the objects to compare.
  6416. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6417. * @param {Function} customizer The function to customize comparisons.
  6418. * @param {Function} equalFunc The function to determine equivalents of values.
  6419. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6420. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6421. */
  6422. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6423. switch (tag) {
  6424. case dataViewTag:
  6425. if ((object.byteLength != other.byteLength) ||
  6426. (object.byteOffset != other.byteOffset)) {
  6427. return false;
  6428. }
  6429. object = object.buffer;
  6430. other = other.buffer;
  6431. case arrayBufferTag:
  6432. if ((object.byteLength != other.byteLength) ||
  6433. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6434. return false;
  6435. }
  6436. return true;
  6437. case boolTag:
  6438. case dateTag:
  6439. case numberTag:
  6440. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6441. // Invalid dates are coerced to `NaN`.
  6442. return eq(+object, +other);
  6443. case errorTag:
  6444. return object.name == other.name && object.message == other.message;
  6445. case regexpTag:
  6446. case stringTag:
  6447. // Coerce regexes to strings and treat strings, primitives and objects,
  6448. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6449. // for more details.
  6450. return object == (other + '');
  6451. case mapTag:
  6452. var convert = mapToArray;
  6453. case setTag:
  6454. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6455. convert || (convert = setToArray);
  6456. if (object.size != other.size && !isPartial) {
  6457. return false;
  6458. }
  6459. // Assume cyclic values are equal.
  6460. var stacked = stack.get(object);
  6461. if (stacked) {
  6462. return stacked == other;
  6463. }
  6464. bitmask |= COMPARE_UNORDERED_FLAG;
  6465. // Recursively compare objects (susceptible to call stack limits).
  6466. stack.set(object, other);
  6467. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6468. stack['delete'](object);
  6469. return result;
  6470. case symbolTag:
  6471. if (symbolValueOf) {
  6472. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6473. }
  6474. }
  6475. return false;
  6476. }
  6477. /**
  6478. * A specialized version of `baseIsEqualDeep` for objects with support for
  6479. * partial deep comparisons.
  6480. *
  6481. * @private
  6482. * @param {Object} object The object to compare.
  6483. * @param {Object} other The other object to compare.
  6484. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6485. * @param {Function} customizer The function to customize comparisons.
  6486. * @param {Function} equalFunc The function to determine equivalents of values.
  6487. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6488. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6489. */
  6490. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6491. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6492. objProps = getAllKeys(object),
  6493. objLength = objProps.length,
  6494. othProps = getAllKeys(other),
  6495. othLength = othProps.length;
  6496. if (objLength != othLength && !isPartial) {
  6497. return false;
  6498. }
  6499. var index = objLength;
  6500. while (index--) {
  6501. var key = objProps[index];
  6502. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6503. return false;
  6504. }
  6505. }
  6506. // Check that cyclic values are equal.
  6507. var objStacked = stack.get(object);
  6508. var othStacked = stack.get(other);
  6509. if (objStacked && othStacked) {
  6510. return objStacked == other && othStacked == object;
  6511. }
  6512. var result = true;
  6513. stack.set(object, other);
  6514. stack.set(other, object);
  6515. var skipCtor = isPartial;
  6516. while (++index < objLength) {
  6517. key = objProps[index];
  6518. var objValue = object[key],
  6519. othValue = other[key];
  6520. if (customizer) {
  6521. var compared = isPartial
  6522. ? customizer(othValue, objValue, key, other, object, stack)
  6523. : customizer(objValue, othValue, key, object, other, stack);
  6524. }
  6525. // Recursively compare objects (susceptible to call stack limits).
  6526. if (!(compared === undefined
  6527. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6528. : compared
  6529. )) {
  6530. result = false;
  6531. break;
  6532. }
  6533. skipCtor || (skipCtor = key == 'constructor');
  6534. }
  6535. if (result && !skipCtor) {
  6536. var objCtor = object.constructor,
  6537. othCtor = other.constructor;
  6538. // Non `Object` object instances with different constructors are not equal.
  6539. if (objCtor != othCtor &&
  6540. ('constructor' in object && 'constructor' in other) &&
  6541. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6542. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6543. result = false;
  6544. }
  6545. }
  6546. stack['delete'](object);
  6547. stack['delete'](other);
  6548. return result;
  6549. }
  6550. /**
  6551. * A specialized version of `baseRest` which flattens the rest array.
  6552. *
  6553. * @private
  6554. * @param {Function} func The function to apply a rest parameter to.
  6555. * @returns {Function} Returns the new function.
  6556. */
  6557. function flatRest(func) {
  6558. return setToString(overRest(func, undefined, flatten), func + '');
  6559. }
  6560. /**
  6561. * Creates an array of own enumerable property names and symbols of `object`.
  6562. *
  6563. * @private
  6564. * @param {Object} object The object to query.
  6565. * @returns {Array} Returns the array of property names and symbols.
  6566. */
  6567. function getAllKeys(object) {
  6568. return baseGetAllKeys(object, keys, getSymbols);
  6569. }
  6570. /**
  6571. * Creates an array of own and inherited enumerable property names and
  6572. * symbols of `object`.
  6573. *
  6574. * @private
  6575. * @param {Object} object The object to query.
  6576. * @returns {Array} Returns the array of property names and symbols.
  6577. */
  6578. function getAllKeysIn(object) {
  6579. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6580. }
  6581. /**
  6582. * Gets metadata for `func`.
  6583. *
  6584. * @private
  6585. * @param {Function} func The function to query.
  6586. * @returns {*} Returns the metadata for `func`.
  6587. */
  6588. var getData = !metaMap ? noop : function(func) {
  6589. return metaMap.get(func);
  6590. };
  6591. /**
  6592. * Gets the name of `func`.
  6593. *
  6594. * @private
  6595. * @param {Function} func The function to query.
  6596. * @returns {string} Returns the function name.
  6597. */
  6598. function getFuncName(func) {
  6599. var result = (func.name + ''),
  6600. array = realNames[result],
  6601. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6602. while (length--) {
  6603. var data = array[length],
  6604. otherFunc = data.func;
  6605. if (otherFunc == null || otherFunc == func) {
  6606. return data.name;
  6607. }
  6608. }
  6609. return result;
  6610. }
  6611. /**
  6612. * Gets the argument placeholder value for `func`.
  6613. *
  6614. * @private
  6615. * @param {Function} func The function to inspect.
  6616. * @returns {*} Returns the placeholder value.
  6617. */
  6618. function getHolder(func) {
  6619. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6620. return object.placeholder;
  6621. }
  6622. /**
  6623. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6624. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6625. * If arguments are provided, the chosen function is invoked with them and
  6626. * its result is returned.
  6627. *
  6628. * @private
  6629. * @param {*} [value] The value to convert to an iteratee.
  6630. * @param {number} [arity] The arity of the created iteratee.
  6631. * @returns {Function} Returns the chosen function or its result.
  6632. */
  6633. function getIteratee() {
  6634. var result = lodash.iteratee || iteratee;
  6635. result = result === iteratee ? baseIteratee : result;
  6636. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6637. }
  6638. /**
  6639. * Gets the data for `map`.
  6640. *
  6641. * @private
  6642. * @param {Object} map The map to query.
  6643. * @param {string} key The reference key.
  6644. * @returns {*} Returns the map data.
  6645. */
  6646. function getMapData(map, key) {
  6647. var data = map.__data__;
  6648. return isKeyable(key)
  6649. ? data[typeof key == 'string' ? 'string' : 'hash']
  6650. : data.map;
  6651. }
  6652. /**
  6653. * Gets the property names, values, and compare flags of `object`.
  6654. *
  6655. * @private
  6656. * @param {Object} object The object to query.
  6657. * @returns {Array} Returns the match data of `object`.
  6658. */
  6659. function getMatchData(object) {
  6660. var result = keys(object),
  6661. length = result.length;
  6662. while (length--) {
  6663. var key = result[length],
  6664. value = object[key];
  6665. result[length] = [key, value, isStrictComparable(value)];
  6666. }
  6667. return result;
  6668. }
  6669. /**
  6670. * Gets the native function at `key` of `object`.
  6671. *
  6672. * @private
  6673. * @param {Object} object The object to query.
  6674. * @param {string} key The key of the method to get.
  6675. * @returns {*} Returns the function if it's native, else `undefined`.
  6676. */
  6677. function getNative(object, key) {
  6678. var value = getValue(object, key);
  6679. return baseIsNative(value) ? value : undefined;
  6680. }
  6681. /**
  6682. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6683. *
  6684. * @private
  6685. * @param {*} value The value to query.
  6686. * @returns {string} Returns the raw `toStringTag`.
  6687. */
  6688. function getRawTag(value) {
  6689. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6690. tag = value[symToStringTag];
  6691. try {
  6692. value[symToStringTag] = undefined;
  6693. var unmasked = true;
  6694. } catch (e) {}
  6695. var result = nativeObjectToString.call(value);
  6696. if (unmasked) {
  6697. if (isOwn) {
  6698. value[symToStringTag] = tag;
  6699. } else {
  6700. delete value[symToStringTag];
  6701. }
  6702. }
  6703. return result;
  6704. }
  6705. /**
  6706. * Creates an array of the own enumerable symbols of `object`.
  6707. *
  6708. * @private
  6709. * @param {Object} object The object to query.
  6710. * @returns {Array} Returns the array of symbols.
  6711. */
  6712. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6713. if (object == null) {
  6714. return [];
  6715. }
  6716. object = Object(object);
  6717. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6718. return propertyIsEnumerable.call(object, symbol);
  6719. });
  6720. };
  6721. /**
  6722. * Creates an array of the own and inherited enumerable symbols of `object`.
  6723. *
  6724. * @private
  6725. * @param {Object} object The object to query.
  6726. * @returns {Array} Returns the array of symbols.
  6727. */
  6728. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6729. var result = [];
  6730. while (object) {
  6731. arrayPush(result, getSymbols(object));
  6732. object = getPrototype(object);
  6733. }
  6734. return result;
  6735. };
  6736. /**
  6737. * Gets the `toStringTag` of `value`.
  6738. *
  6739. * @private
  6740. * @param {*} value The value to query.
  6741. * @returns {string} Returns the `toStringTag`.
  6742. */
  6743. var getTag = baseGetTag;
  6744. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6745. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6746. (Map && getTag(new Map) != mapTag) ||
  6747. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6748. (Set && getTag(new Set) != setTag) ||
  6749. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6750. getTag = function(value) {
  6751. var result = baseGetTag(value),
  6752. Ctor = result == objectTag ? value.constructor : undefined,
  6753. ctorString = Ctor ? toSource(Ctor) : '';
  6754. if (ctorString) {
  6755. switch (ctorString) {
  6756. case dataViewCtorString: return dataViewTag;
  6757. case mapCtorString: return mapTag;
  6758. case promiseCtorString: return promiseTag;
  6759. case setCtorString: return setTag;
  6760. case weakMapCtorString: return weakMapTag;
  6761. }
  6762. }
  6763. return result;
  6764. };
  6765. }
  6766. /**
  6767. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6768. *
  6769. * @private
  6770. * @param {number} start The start of the view.
  6771. * @param {number} end The end of the view.
  6772. * @param {Array} transforms The transformations to apply to the view.
  6773. * @returns {Object} Returns an object containing the `start` and `end`
  6774. * positions of the view.
  6775. */
  6776. function getView(start, end, transforms) {
  6777. var index = -1,
  6778. length = transforms.length;
  6779. while (++index < length) {
  6780. var data = transforms[index],
  6781. size = data.size;
  6782. switch (data.type) {
  6783. case 'drop': start += size; break;
  6784. case 'dropRight': end -= size; break;
  6785. case 'take': end = nativeMin(end, start + size); break;
  6786. case 'takeRight': start = nativeMax(start, end - size); break;
  6787. }
  6788. }
  6789. return { 'start': start, 'end': end };
  6790. }
  6791. /**
  6792. * Extracts wrapper details from the `source` body comment.
  6793. *
  6794. * @private
  6795. * @param {string} source The source to inspect.
  6796. * @returns {Array} Returns the wrapper details.
  6797. */
  6798. function getWrapDetails(source) {
  6799. var match = source.match(reWrapDetails);
  6800. return match ? match[1].split(reSplitDetails) : [];
  6801. }
  6802. /**
  6803. * Checks if `path` exists on `object`.
  6804. *
  6805. * @private
  6806. * @param {Object} object The object to query.
  6807. * @param {Array|string} path The path to check.
  6808. * @param {Function} hasFunc The function to check properties.
  6809. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6810. */
  6811. function hasPath(object, path, hasFunc) {
  6812. path = castPath(path, object);
  6813. var index = -1,
  6814. length = path.length,
  6815. result = false;
  6816. while (++index < length) {
  6817. var key = toKey(path[index]);
  6818. if (!(result = object != null && hasFunc(object, key))) {
  6819. break;
  6820. }
  6821. object = object[key];
  6822. }
  6823. if (result || ++index != length) {
  6824. return result;
  6825. }
  6826. length = object == null ? 0 : object.length;
  6827. return !!length && isLength(length) && isIndex(key, length) &&
  6828. (isArray(object) || isArguments(object));
  6829. }
  6830. /**
  6831. * Initializes an array clone.
  6832. *
  6833. * @private
  6834. * @param {Array} array The array to clone.
  6835. * @returns {Array} Returns the initialized clone.
  6836. */
  6837. function initCloneArray(array) {
  6838. var length = array.length,
  6839. result = new array.constructor(length);
  6840. // Add properties assigned by `RegExp#exec`.
  6841. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6842. result.index = array.index;
  6843. result.input = array.input;
  6844. }
  6845. return result;
  6846. }
  6847. /**
  6848. * Initializes an object clone.
  6849. *
  6850. * @private
  6851. * @param {Object} object The object to clone.
  6852. * @returns {Object} Returns the initialized clone.
  6853. */
  6854. function initCloneObject(object) {
  6855. return (typeof object.constructor == 'function' && !isPrototype(object))
  6856. ? baseCreate(getPrototype(object))
  6857. : {};
  6858. }
  6859. /**
  6860. * Initializes an object clone based on its `toStringTag`.
  6861. *
  6862. * **Note:** This function only supports cloning values with tags of
  6863. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6864. *
  6865. * @private
  6866. * @param {Object} object The object to clone.
  6867. * @param {string} tag The `toStringTag` of the object to clone.
  6868. * @param {boolean} [isDeep] Specify a deep clone.
  6869. * @returns {Object} Returns the initialized clone.
  6870. */
  6871. function initCloneByTag(object, tag, isDeep) {
  6872. var Ctor = object.constructor;
  6873. switch (tag) {
  6874. case arrayBufferTag:
  6875. return cloneArrayBuffer(object);
  6876. case boolTag:
  6877. case dateTag:
  6878. return new Ctor(+object);
  6879. case dataViewTag:
  6880. return cloneDataView(object, isDeep);
  6881. case float32Tag: case float64Tag:
  6882. case int8Tag: case int16Tag: case int32Tag:
  6883. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6884. return cloneTypedArray(object, isDeep);
  6885. case mapTag:
  6886. return new Ctor;
  6887. case numberTag:
  6888. case stringTag:
  6889. return new Ctor(object);
  6890. case regexpTag:
  6891. return cloneRegExp(object);
  6892. case setTag:
  6893. return new Ctor;
  6894. case symbolTag:
  6895. return cloneSymbol(object);
  6896. }
  6897. }
  6898. /**
  6899. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6900. *
  6901. * @private
  6902. * @param {string} source The source to modify.
  6903. * @returns {Array} details The details to insert.
  6904. * @returns {string} Returns the modified source.
  6905. */
  6906. function insertWrapDetails(source, details) {
  6907. var length = details.length;
  6908. if (!length) {
  6909. return source;
  6910. }
  6911. var lastIndex = length - 1;
  6912. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6913. details = details.join(length > 2 ? ', ' : ' ');
  6914. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6915. }
  6916. /**
  6917. * Checks if `value` is a flattenable `arguments` object or array.
  6918. *
  6919. * @private
  6920. * @param {*} value The value to check.
  6921. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6922. */
  6923. function isFlattenable(value) {
  6924. return isArray(value) || isArguments(value) ||
  6925. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6926. }
  6927. /**
  6928. * Checks if `value` is a valid array-like index.
  6929. *
  6930. * @private
  6931. * @param {*} value The value to check.
  6932. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6933. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6934. */
  6935. function isIndex(value, length) {
  6936. var type = typeof value;
  6937. length = length == null ? MAX_SAFE_INTEGER : length;
  6938. return !!length &&
  6939. (type == 'number' ||
  6940. (type != 'symbol' && reIsUint.test(value))) &&
  6941. (value > -1 && value % 1 == 0 && value < length);
  6942. }
  6943. /**
  6944. * Checks if the given arguments are from an iteratee call.
  6945. *
  6946. * @private
  6947. * @param {*} value The potential iteratee value argument.
  6948. * @param {*} index The potential iteratee index or key argument.
  6949. * @param {*} object The potential iteratee object argument.
  6950. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6951. * else `false`.
  6952. */
  6953. function isIterateeCall(value, index, object) {
  6954. if (!isObject(object)) {
  6955. return false;
  6956. }
  6957. var type = typeof index;
  6958. if (type == 'number'
  6959. ? (isArrayLike(object) && isIndex(index, object.length))
  6960. : (type == 'string' && index in object)
  6961. ) {
  6962. return eq(object[index], value);
  6963. }
  6964. return false;
  6965. }
  6966. /**
  6967. * Checks if `value` is a property name and not a property path.
  6968. *
  6969. * @private
  6970. * @param {*} value The value to check.
  6971. * @param {Object} [object] The object to query keys on.
  6972. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6973. */
  6974. function isKey(value, object) {
  6975. if (isArray(value)) {
  6976. return false;
  6977. }
  6978. var type = typeof value;
  6979. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6980. value == null || isSymbol(value)) {
  6981. return true;
  6982. }
  6983. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6984. (object != null && value in Object(object));
  6985. }
  6986. /**
  6987. * Checks if `value` is suitable for use as unique object key.
  6988. *
  6989. * @private
  6990. * @param {*} value The value to check.
  6991. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6992. */
  6993. function isKeyable(value) {
  6994. var type = typeof value;
  6995. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6996. ? (value !== '__proto__')
  6997. : (value === null);
  6998. }
  6999. /**
  7000. * Checks if `func` has a lazy counterpart.
  7001. *
  7002. * @private
  7003. * @param {Function} func The function to check.
  7004. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7005. * else `false`.
  7006. */
  7007. function isLaziable(func) {
  7008. var funcName = getFuncName(func),
  7009. other = lodash[funcName];
  7010. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7011. return false;
  7012. }
  7013. if (func === other) {
  7014. return true;
  7015. }
  7016. var data = getData(other);
  7017. return !!data && func === data[0];
  7018. }
  7019. /**
  7020. * Checks if `func` has its source masked.
  7021. *
  7022. * @private
  7023. * @param {Function} func The function to check.
  7024. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7025. */
  7026. function isMasked(func) {
  7027. return !!maskSrcKey && (maskSrcKey in func);
  7028. }
  7029. /**
  7030. * Checks if `func` is capable of being masked.
  7031. *
  7032. * @private
  7033. * @param {*} value The value to check.
  7034. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7035. */
  7036. var isMaskable = coreJsData ? isFunction : stubFalse;
  7037. /**
  7038. * Checks if `value` is likely a prototype object.
  7039. *
  7040. * @private
  7041. * @param {*} value The value to check.
  7042. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7043. */
  7044. function isPrototype(value) {
  7045. var Ctor = value && value.constructor,
  7046. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7047. return value === proto;
  7048. }
  7049. /**
  7050. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7051. *
  7052. * @private
  7053. * @param {*} value The value to check.
  7054. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7055. * equality comparisons, else `false`.
  7056. */
  7057. function isStrictComparable(value) {
  7058. return value === value && !isObject(value);
  7059. }
  7060. /**
  7061. * A specialized version of `matchesProperty` for source values suitable
  7062. * for strict equality comparisons, i.e. `===`.
  7063. *
  7064. * @private
  7065. * @param {string} key The key of the property to get.
  7066. * @param {*} srcValue The value to match.
  7067. * @returns {Function} Returns the new spec function.
  7068. */
  7069. function matchesStrictComparable(key, srcValue) {
  7070. return function(object) {
  7071. if (object == null) {
  7072. return false;
  7073. }
  7074. return object[key] === srcValue &&
  7075. (srcValue !== undefined || (key in Object(object)));
  7076. };
  7077. }
  7078. /**
  7079. * A specialized version of `_.memoize` which clears the memoized function's
  7080. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7081. *
  7082. * @private
  7083. * @param {Function} func The function to have its output memoized.
  7084. * @returns {Function} Returns the new memoized function.
  7085. */
  7086. function memoizeCapped(func) {
  7087. var result = memoize(func, function(key) {
  7088. if (cache.size === MAX_MEMOIZE_SIZE) {
  7089. cache.clear();
  7090. }
  7091. return key;
  7092. });
  7093. var cache = result.cache;
  7094. return result;
  7095. }
  7096. /**
  7097. * Merges the function metadata of `source` into `data`.
  7098. *
  7099. * Merging metadata reduces the number of wrappers used to invoke a function.
  7100. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7101. * may be applied regardless of execution order. Methods like `_.ary` and
  7102. * `_.rearg` modify function arguments, making the order in which they are
  7103. * executed important, preventing the merging of metadata. However, we make
  7104. * an exception for a safe combined case where curried functions have `_.ary`
  7105. * and or `_.rearg` applied.
  7106. *
  7107. * @private
  7108. * @param {Array} data The destination metadata.
  7109. * @param {Array} source The source metadata.
  7110. * @returns {Array} Returns `data`.
  7111. */
  7112. function mergeData(data, source) {
  7113. var bitmask = data[1],
  7114. srcBitmask = source[1],
  7115. newBitmask = bitmask | srcBitmask,
  7116. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7117. var isCombo =
  7118. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7119. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7120. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7121. // Exit early if metadata can't be merged.
  7122. if (!(isCommon || isCombo)) {
  7123. return data;
  7124. }
  7125. // Use source `thisArg` if available.
  7126. if (srcBitmask & WRAP_BIND_FLAG) {
  7127. data[2] = source[2];
  7128. // Set when currying a bound function.
  7129. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7130. }
  7131. // Compose partial arguments.
  7132. var value = source[3];
  7133. if (value) {
  7134. var partials = data[3];
  7135. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7136. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7137. }
  7138. // Compose partial right arguments.
  7139. value = source[5];
  7140. if (value) {
  7141. partials = data[5];
  7142. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7143. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7144. }
  7145. // Use source `argPos` if available.
  7146. value = source[7];
  7147. if (value) {
  7148. data[7] = value;
  7149. }
  7150. // Use source `ary` if it's smaller.
  7151. if (srcBitmask & WRAP_ARY_FLAG) {
  7152. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7153. }
  7154. // Use source `arity` if one is not provided.
  7155. if (data[9] == null) {
  7156. data[9] = source[9];
  7157. }
  7158. // Use source `func` and merge bitmasks.
  7159. data[0] = source[0];
  7160. data[1] = newBitmask;
  7161. return data;
  7162. }
  7163. /**
  7164. * This function is like
  7165. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7166. * except that it includes inherited enumerable properties.
  7167. *
  7168. * @private
  7169. * @param {Object} object The object to query.
  7170. * @returns {Array} Returns the array of property names.
  7171. */
  7172. function nativeKeysIn(object) {
  7173. var result = [];
  7174. if (object != null) {
  7175. for (var key in Object(object)) {
  7176. result.push(key);
  7177. }
  7178. }
  7179. return result;
  7180. }
  7181. /**
  7182. * Converts `value` to a string using `Object.prototype.toString`.
  7183. *
  7184. * @private
  7185. * @param {*} value The value to convert.
  7186. * @returns {string} Returns the converted string.
  7187. */
  7188. function objectToString(value) {
  7189. return nativeObjectToString.call(value);
  7190. }
  7191. /**
  7192. * A specialized version of `baseRest` which transforms the rest array.
  7193. *
  7194. * @private
  7195. * @param {Function} func The function to apply a rest parameter to.
  7196. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7197. * @param {Function} transform The rest array transform.
  7198. * @returns {Function} Returns the new function.
  7199. */
  7200. function overRest(func, start, transform) {
  7201. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7202. return function() {
  7203. var args = arguments,
  7204. index = -1,
  7205. length = nativeMax(args.length - start, 0),
  7206. array = Array(length);
  7207. while (++index < length) {
  7208. array[index] = args[start + index];
  7209. }
  7210. index = -1;
  7211. var otherArgs = Array(start + 1);
  7212. while (++index < start) {
  7213. otherArgs[index] = args[index];
  7214. }
  7215. otherArgs[start] = transform(array);
  7216. return apply(func, this, otherArgs);
  7217. };
  7218. }
  7219. /**
  7220. * Gets the parent value at `path` of `object`.
  7221. *
  7222. * @private
  7223. * @param {Object} object The object to query.
  7224. * @param {Array} path The path to get the parent value of.
  7225. * @returns {*} Returns the parent value.
  7226. */
  7227. function parent(object, path) {
  7228. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7229. }
  7230. /**
  7231. * Reorder `array` according to the specified indexes where the element at
  7232. * the first index is assigned as the first element, the element at
  7233. * the second index is assigned as the second element, and so on.
  7234. *
  7235. * @private
  7236. * @param {Array} array The array to reorder.
  7237. * @param {Array} indexes The arranged array indexes.
  7238. * @returns {Array} Returns `array`.
  7239. */
  7240. function reorder(array, indexes) {
  7241. var arrLength = array.length,
  7242. length = nativeMin(indexes.length, arrLength),
  7243. oldArray = copyArray(array);
  7244. while (length--) {
  7245. var index = indexes[length];
  7246. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7247. }
  7248. return array;
  7249. }
  7250. /**
  7251. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7252. *
  7253. * @private
  7254. * @param {Object} object The object to query.
  7255. * @param {string} key The key of the property to get.
  7256. * @returns {*} Returns the property value.
  7257. */
  7258. function safeGet(object, key) {
  7259. if (key === 'constructor' && typeof object[key] === 'function') {
  7260. return;
  7261. }
  7262. if (key == '__proto__') {
  7263. return;
  7264. }
  7265. return object[key];
  7266. }
  7267. /**
  7268. * Sets metadata for `func`.
  7269. *
  7270. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7271. * period of time, it will trip its breaker and transition to an identity
  7272. * function to avoid garbage collection pauses in V8. See
  7273. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7274. * for more details.
  7275. *
  7276. * @private
  7277. * @param {Function} func The function to associate metadata with.
  7278. * @param {*} data The metadata.
  7279. * @returns {Function} Returns `func`.
  7280. */
  7281. var setData = shortOut(baseSetData);
  7282. /**
  7283. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7284. *
  7285. * @private
  7286. * @param {Function} func The function to delay.
  7287. * @param {number} wait The number of milliseconds to delay invocation.
  7288. * @returns {number|Object} Returns the timer id or timeout object.
  7289. */
  7290. var setTimeout = ctxSetTimeout || function(func, wait) {
  7291. return root.setTimeout(func, wait);
  7292. };
  7293. /**
  7294. * Sets the `toString` method of `func` to return `string`.
  7295. *
  7296. * @private
  7297. * @param {Function} func The function to modify.
  7298. * @param {Function} string The `toString` result.
  7299. * @returns {Function} Returns `func`.
  7300. */
  7301. var setToString = shortOut(baseSetToString);
  7302. /**
  7303. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7304. * with wrapper details in a comment at the top of the source body.
  7305. *
  7306. * @private
  7307. * @param {Function} wrapper The function to modify.
  7308. * @param {Function} reference The reference function.
  7309. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7310. * @returns {Function} Returns `wrapper`.
  7311. */
  7312. function setWrapToString(wrapper, reference, bitmask) {
  7313. var source = (reference + '');
  7314. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7315. }
  7316. /**
  7317. * Creates a function that'll short out and invoke `identity` instead
  7318. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7319. * milliseconds.
  7320. *
  7321. * @private
  7322. * @param {Function} func The function to restrict.
  7323. * @returns {Function} Returns the new shortable function.
  7324. */
  7325. function shortOut(func) {
  7326. var count = 0,
  7327. lastCalled = 0;
  7328. return function() {
  7329. var stamp = nativeNow(),
  7330. remaining = HOT_SPAN - (stamp - lastCalled);
  7331. lastCalled = stamp;
  7332. if (remaining > 0) {
  7333. if (++count >= HOT_COUNT) {
  7334. return arguments[0];
  7335. }
  7336. } else {
  7337. count = 0;
  7338. }
  7339. return func.apply(undefined, arguments);
  7340. };
  7341. }
  7342. /**
  7343. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7344. *
  7345. * @private
  7346. * @param {Array} array The array to shuffle.
  7347. * @param {number} [size=array.length] The size of `array`.
  7348. * @returns {Array} Returns `array`.
  7349. */
  7350. function shuffleSelf(array, size) {
  7351. var index = -1,
  7352. length = array.length,
  7353. lastIndex = length - 1;
  7354. size = size === undefined ? length : size;
  7355. while (++index < size) {
  7356. var rand = baseRandom(index, lastIndex),
  7357. value = array[rand];
  7358. array[rand] = array[index];
  7359. array[index] = value;
  7360. }
  7361. array.length = size;
  7362. return array;
  7363. }
  7364. /**
  7365. * Converts `string` to a property path array.
  7366. *
  7367. * @private
  7368. * @param {string} string The string to convert.
  7369. * @returns {Array} Returns the property path array.
  7370. */
  7371. var stringToPath = memoizeCapped(function(string) {
  7372. var result = [];
  7373. if (string.charCodeAt(0) === 46 /* . */) {
  7374. result.push('');
  7375. }
  7376. string.replace(rePropName, function(match, number, quote, subString) {
  7377. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7378. });
  7379. return result;
  7380. });
  7381. /**
  7382. * Converts `value` to a string key if it's not a string or symbol.
  7383. *
  7384. * @private
  7385. * @param {*} value The value to inspect.
  7386. * @returns {string|symbol} Returns the key.
  7387. */
  7388. function toKey(value) {
  7389. if (typeof value == 'string' || isSymbol(value)) {
  7390. return value;
  7391. }
  7392. var result = (value + '');
  7393. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7394. }
  7395. /**
  7396. * Converts `func` to its source code.
  7397. *
  7398. * @private
  7399. * @param {Function} func The function to convert.
  7400. * @returns {string} Returns the source code.
  7401. */
  7402. function toSource(func) {
  7403. if (func != null) {
  7404. try {
  7405. return funcToString.call(func);
  7406. } catch (e) {}
  7407. try {
  7408. return (func + '');
  7409. } catch (e) {}
  7410. }
  7411. return '';
  7412. }
  7413. /**
  7414. * Updates wrapper `details` based on `bitmask` flags.
  7415. *
  7416. * @private
  7417. * @returns {Array} details The details to modify.
  7418. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7419. * @returns {Array} Returns `details`.
  7420. */
  7421. function updateWrapDetails(details, bitmask) {
  7422. arrayEach(wrapFlags, function(pair) {
  7423. var value = '_.' + pair[0];
  7424. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7425. details.push(value);
  7426. }
  7427. });
  7428. return details.sort();
  7429. }
  7430. /**
  7431. * Creates a clone of `wrapper`.
  7432. *
  7433. * @private
  7434. * @param {Object} wrapper The wrapper to clone.
  7435. * @returns {Object} Returns the cloned wrapper.
  7436. */
  7437. function wrapperClone(wrapper) {
  7438. if (wrapper instanceof LazyWrapper) {
  7439. return wrapper.clone();
  7440. }
  7441. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7442. result.__actions__ = copyArray(wrapper.__actions__);
  7443. result.__index__ = wrapper.__index__;
  7444. result.__values__ = wrapper.__values__;
  7445. return result;
  7446. }
  7447. /*------------------------------------------------------------------------*/
  7448. /**
  7449. * Creates an array of elements split into groups the length of `size`.
  7450. * If `array` can't be split evenly, the final chunk will be the remaining
  7451. * elements.
  7452. *
  7453. * @static
  7454. * @memberOf _
  7455. * @since 3.0.0
  7456. * @category Array
  7457. * @param {Array} array The array to process.
  7458. * @param {number} [size=1] The length of each chunk
  7459. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7460. * @returns {Array} Returns the new array of chunks.
  7461. * @example
  7462. *
  7463. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7464. * // => [['a', 'b'], ['c', 'd']]
  7465. *
  7466. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7467. * // => [['a', 'b', 'c'], ['d']]
  7468. */
  7469. function chunk(array, size, guard) {
  7470. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7471. size = 1;
  7472. } else {
  7473. size = nativeMax(toInteger(size), 0);
  7474. }
  7475. var length = array == null ? 0 : array.length;
  7476. if (!length || size < 1) {
  7477. return [];
  7478. }
  7479. var index = 0,
  7480. resIndex = 0,
  7481. result = Array(nativeCeil(length / size));
  7482. while (index < length) {
  7483. result[resIndex++] = baseSlice(array, index, (index += size));
  7484. }
  7485. return result;
  7486. }
  7487. /**
  7488. * Creates an array with all falsey values removed. The values `false`, `null`,
  7489. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7490. *
  7491. * @static
  7492. * @memberOf _
  7493. * @since 0.1.0
  7494. * @category Array
  7495. * @param {Array} array The array to compact.
  7496. * @returns {Array} Returns the new array of filtered values.
  7497. * @example
  7498. *
  7499. * _.compact([0, 1, false, 2, '', 3]);
  7500. * // => [1, 2, 3]
  7501. */
  7502. function compact(array) {
  7503. var index = -1,
  7504. length = array == null ? 0 : array.length,
  7505. resIndex = 0,
  7506. result = [];
  7507. while (++index < length) {
  7508. var value = array[index];
  7509. if (value) {
  7510. result[resIndex++] = value;
  7511. }
  7512. }
  7513. return result;
  7514. }
  7515. /**
  7516. * Creates a new array concatenating `array` with any additional arrays
  7517. * and/or values.
  7518. *
  7519. * @static
  7520. * @memberOf _
  7521. * @since 4.0.0
  7522. * @category Array
  7523. * @param {Array} array The array to concatenate.
  7524. * @param {...*} [values] The values to concatenate.
  7525. * @returns {Array} Returns the new concatenated array.
  7526. * @example
  7527. *
  7528. * var array = [1];
  7529. * var other = _.concat(array, 2, [3], [[4]]);
  7530. *
  7531. * console.log(other);
  7532. * // => [1, 2, 3, [4]]
  7533. *
  7534. * console.log(array);
  7535. * // => [1]
  7536. */
  7537. function concat() {
  7538. var length = arguments.length;
  7539. if (!length) {
  7540. return [];
  7541. }
  7542. var args = Array(length - 1),
  7543. array = arguments[0],
  7544. index = length;
  7545. while (index--) {
  7546. args[index - 1] = arguments[index];
  7547. }
  7548. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7549. }
  7550. /**
  7551. * Creates an array of `array` values not included in the other given arrays
  7552. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7553. * for equality comparisons. The order and references of result values are
  7554. * determined by the first array.
  7555. *
  7556. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7557. *
  7558. * @static
  7559. * @memberOf _
  7560. * @since 0.1.0
  7561. * @category Array
  7562. * @param {Array} array The array to inspect.
  7563. * @param {...Array} [values] The values to exclude.
  7564. * @returns {Array} Returns the new array of filtered values.
  7565. * @see _.without, _.xor
  7566. * @example
  7567. *
  7568. * _.difference([2, 1], [2, 3]);
  7569. * // => [1]
  7570. */
  7571. var difference = baseRest(function(array, values) {
  7572. return isArrayLikeObject(array)
  7573. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7574. : [];
  7575. });
  7576. /**
  7577. * This method is like `_.difference` except that it accepts `iteratee` which
  7578. * is invoked for each element of `array` and `values` to generate the criterion
  7579. * by which they're compared. The order and references of result values are
  7580. * determined by the first array. The iteratee is invoked with one argument:
  7581. * (value).
  7582. *
  7583. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7584. *
  7585. * @static
  7586. * @memberOf _
  7587. * @since 4.0.0
  7588. * @category Array
  7589. * @param {Array} array The array to inspect.
  7590. * @param {...Array} [values] The values to exclude.
  7591. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7592. * @returns {Array} Returns the new array of filtered values.
  7593. * @example
  7594. *
  7595. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7596. * // => [1.2]
  7597. *
  7598. * // The `_.property` iteratee shorthand.
  7599. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7600. * // => [{ 'x': 2 }]
  7601. */
  7602. var differenceBy = baseRest(function(array, values) {
  7603. var iteratee = last(values);
  7604. if (isArrayLikeObject(iteratee)) {
  7605. iteratee = undefined;
  7606. }
  7607. return isArrayLikeObject(array)
  7608. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7609. : [];
  7610. });
  7611. /**
  7612. * This method is like `_.difference` except that it accepts `comparator`
  7613. * which is invoked to compare elements of `array` to `values`. The order and
  7614. * references of result values are determined by the first array. The comparator
  7615. * is invoked with two arguments: (arrVal, othVal).
  7616. *
  7617. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7618. *
  7619. * @static
  7620. * @memberOf _
  7621. * @since 4.0.0
  7622. * @category Array
  7623. * @param {Array} array The array to inspect.
  7624. * @param {...Array} [values] The values to exclude.
  7625. * @param {Function} [comparator] The comparator invoked per element.
  7626. * @returns {Array} Returns the new array of filtered values.
  7627. * @example
  7628. *
  7629. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7630. *
  7631. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7632. * // => [{ 'x': 2, 'y': 1 }]
  7633. */
  7634. var differenceWith = baseRest(function(array, values) {
  7635. var comparator = last(values);
  7636. if (isArrayLikeObject(comparator)) {
  7637. comparator = undefined;
  7638. }
  7639. return isArrayLikeObject(array)
  7640. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7641. : [];
  7642. });
  7643. /**
  7644. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7645. *
  7646. * @static
  7647. * @memberOf _
  7648. * @since 0.5.0
  7649. * @category Array
  7650. * @param {Array} array The array to query.
  7651. * @param {number} [n=1] The number of elements to drop.
  7652. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7653. * @returns {Array} Returns the slice of `array`.
  7654. * @example
  7655. *
  7656. * _.drop([1, 2, 3]);
  7657. * // => [2, 3]
  7658. *
  7659. * _.drop([1, 2, 3], 2);
  7660. * // => [3]
  7661. *
  7662. * _.drop([1, 2, 3], 5);
  7663. * // => []
  7664. *
  7665. * _.drop([1, 2, 3], 0);
  7666. * // => [1, 2, 3]
  7667. */
  7668. function drop(array, n, guard) {
  7669. var length = array == null ? 0 : array.length;
  7670. if (!length) {
  7671. return [];
  7672. }
  7673. n = (guard || n === undefined) ? 1 : toInteger(n);
  7674. return baseSlice(array, n < 0 ? 0 : n, length);
  7675. }
  7676. /**
  7677. * Creates a slice of `array` with `n` elements dropped from the end.
  7678. *
  7679. * @static
  7680. * @memberOf _
  7681. * @since 3.0.0
  7682. * @category Array
  7683. * @param {Array} array The array to query.
  7684. * @param {number} [n=1] The number of elements to drop.
  7685. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7686. * @returns {Array} Returns the slice of `array`.
  7687. * @example
  7688. *
  7689. * _.dropRight([1, 2, 3]);
  7690. * // => [1, 2]
  7691. *
  7692. * _.dropRight([1, 2, 3], 2);
  7693. * // => [1]
  7694. *
  7695. * _.dropRight([1, 2, 3], 5);
  7696. * // => []
  7697. *
  7698. * _.dropRight([1, 2, 3], 0);
  7699. * // => [1, 2, 3]
  7700. */
  7701. function dropRight(array, n, guard) {
  7702. var length = array == null ? 0 : array.length;
  7703. if (!length) {
  7704. return [];
  7705. }
  7706. n = (guard || n === undefined) ? 1 : toInteger(n);
  7707. n = length - n;
  7708. return baseSlice(array, 0, n < 0 ? 0 : n);
  7709. }
  7710. /**
  7711. * Creates a slice of `array` excluding elements dropped from the end.
  7712. * Elements are dropped until `predicate` returns falsey. The predicate is
  7713. * invoked with three arguments: (value, index, array).
  7714. *
  7715. * @static
  7716. * @memberOf _
  7717. * @since 3.0.0
  7718. * @category Array
  7719. * @param {Array} array The array to query.
  7720. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7721. * @returns {Array} Returns the slice of `array`.
  7722. * @example
  7723. *
  7724. * var users = [
  7725. * { 'user': 'barney', 'active': true },
  7726. * { 'user': 'fred', 'active': false },
  7727. * { 'user': 'pebbles', 'active': false }
  7728. * ];
  7729. *
  7730. * _.dropRightWhile(users, function(o) { return !o.active; });
  7731. * // => objects for ['barney']
  7732. *
  7733. * // The `_.matches` iteratee shorthand.
  7734. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7735. * // => objects for ['barney', 'fred']
  7736. *
  7737. * // The `_.matchesProperty` iteratee shorthand.
  7738. * _.dropRightWhile(users, ['active', false]);
  7739. * // => objects for ['barney']
  7740. *
  7741. * // The `_.property` iteratee shorthand.
  7742. * _.dropRightWhile(users, 'active');
  7743. * // => objects for ['barney', 'fred', 'pebbles']
  7744. */
  7745. function dropRightWhile(array, predicate) {
  7746. return (array && array.length)
  7747. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7748. : [];
  7749. }
  7750. /**
  7751. * Creates a slice of `array` excluding elements dropped from the beginning.
  7752. * Elements are dropped until `predicate` returns falsey. The predicate is
  7753. * invoked with three arguments: (value, index, array).
  7754. *
  7755. * @static
  7756. * @memberOf _
  7757. * @since 3.0.0
  7758. * @category Array
  7759. * @param {Array} array The array to query.
  7760. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7761. * @returns {Array} Returns the slice of `array`.
  7762. * @example
  7763. *
  7764. * var users = [
  7765. * { 'user': 'barney', 'active': false },
  7766. * { 'user': 'fred', 'active': false },
  7767. * { 'user': 'pebbles', 'active': true }
  7768. * ];
  7769. *
  7770. * _.dropWhile(users, function(o) { return !o.active; });
  7771. * // => objects for ['pebbles']
  7772. *
  7773. * // The `_.matches` iteratee shorthand.
  7774. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7775. * // => objects for ['fred', 'pebbles']
  7776. *
  7777. * // The `_.matchesProperty` iteratee shorthand.
  7778. * _.dropWhile(users, ['active', false]);
  7779. * // => objects for ['pebbles']
  7780. *
  7781. * // The `_.property` iteratee shorthand.
  7782. * _.dropWhile(users, 'active');
  7783. * // => objects for ['barney', 'fred', 'pebbles']
  7784. */
  7785. function dropWhile(array, predicate) {
  7786. return (array && array.length)
  7787. ? baseWhile(array, getIteratee(predicate, 3), true)
  7788. : [];
  7789. }
  7790. /**
  7791. * Fills elements of `array` with `value` from `start` up to, but not
  7792. * including, `end`.
  7793. *
  7794. * **Note:** This method mutates `array`.
  7795. *
  7796. * @static
  7797. * @memberOf _
  7798. * @since 3.2.0
  7799. * @category Array
  7800. * @param {Array} array The array to fill.
  7801. * @param {*} value The value to fill `array` with.
  7802. * @param {number} [start=0] The start position.
  7803. * @param {number} [end=array.length] The end position.
  7804. * @returns {Array} Returns `array`.
  7805. * @example
  7806. *
  7807. * var array = [1, 2, 3];
  7808. *
  7809. * _.fill(array, 'a');
  7810. * console.log(array);
  7811. * // => ['a', 'a', 'a']
  7812. *
  7813. * _.fill(Array(3), 2);
  7814. * // => [2, 2, 2]
  7815. *
  7816. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7817. * // => [4, '*', '*', 10]
  7818. */
  7819. function fill(array, value, start, end) {
  7820. var length = array == null ? 0 : array.length;
  7821. if (!length) {
  7822. return [];
  7823. }
  7824. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7825. start = 0;
  7826. end = length;
  7827. }
  7828. return baseFill(array, value, start, end);
  7829. }
  7830. /**
  7831. * This method is like `_.find` except that it returns the index of the first
  7832. * element `predicate` returns truthy for instead of the element itself.
  7833. *
  7834. * @static
  7835. * @memberOf _
  7836. * @since 1.1.0
  7837. * @category Array
  7838. * @param {Array} array The array to inspect.
  7839. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7840. * @param {number} [fromIndex=0] The index to search from.
  7841. * @returns {number} Returns the index of the found element, else `-1`.
  7842. * @example
  7843. *
  7844. * var users = [
  7845. * { 'user': 'barney', 'active': false },
  7846. * { 'user': 'fred', 'active': false },
  7847. * { 'user': 'pebbles', 'active': true }
  7848. * ];
  7849. *
  7850. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7851. * // => 0
  7852. *
  7853. * // The `_.matches` iteratee shorthand.
  7854. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7855. * // => 1
  7856. *
  7857. * // The `_.matchesProperty` iteratee shorthand.
  7858. * _.findIndex(users, ['active', false]);
  7859. * // => 0
  7860. *
  7861. * // The `_.property` iteratee shorthand.
  7862. * _.findIndex(users, 'active');
  7863. * // => 2
  7864. */
  7865. function findIndex(array, predicate, fromIndex) {
  7866. var length = array == null ? 0 : array.length;
  7867. if (!length) {
  7868. return -1;
  7869. }
  7870. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7871. if (index < 0) {
  7872. index = nativeMax(length + index, 0);
  7873. }
  7874. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7875. }
  7876. /**
  7877. * This method is like `_.findIndex` except that it iterates over elements
  7878. * of `collection` from right to left.
  7879. *
  7880. * @static
  7881. * @memberOf _
  7882. * @since 2.0.0
  7883. * @category Array
  7884. * @param {Array} array The array to inspect.
  7885. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7886. * @param {number} [fromIndex=array.length-1] The index to search from.
  7887. * @returns {number} Returns the index of the found element, else `-1`.
  7888. * @example
  7889. *
  7890. * var users = [
  7891. * { 'user': 'barney', 'active': true },
  7892. * { 'user': 'fred', 'active': false },
  7893. * { 'user': 'pebbles', 'active': false }
  7894. * ];
  7895. *
  7896. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7897. * // => 2
  7898. *
  7899. * // The `_.matches` iteratee shorthand.
  7900. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7901. * // => 0
  7902. *
  7903. * // The `_.matchesProperty` iteratee shorthand.
  7904. * _.findLastIndex(users, ['active', false]);
  7905. * // => 2
  7906. *
  7907. * // The `_.property` iteratee shorthand.
  7908. * _.findLastIndex(users, 'active');
  7909. * // => 0
  7910. */
  7911. function findLastIndex(array, predicate, fromIndex) {
  7912. var length = array == null ? 0 : array.length;
  7913. if (!length) {
  7914. return -1;
  7915. }
  7916. var index = length - 1;
  7917. if (fromIndex !== undefined) {
  7918. index = toInteger(fromIndex);
  7919. index = fromIndex < 0
  7920. ? nativeMax(length + index, 0)
  7921. : nativeMin(index, length - 1);
  7922. }
  7923. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7924. }
  7925. /**
  7926. * Flattens `array` a single level deep.
  7927. *
  7928. * @static
  7929. * @memberOf _
  7930. * @since 0.1.0
  7931. * @category Array
  7932. * @param {Array} array The array to flatten.
  7933. * @returns {Array} Returns the new flattened array.
  7934. * @example
  7935. *
  7936. * _.flatten([1, [2, [3, [4]], 5]]);
  7937. * // => [1, 2, [3, [4]], 5]
  7938. */
  7939. function flatten(array) {
  7940. var length = array == null ? 0 : array.length;
  7941. return length ? baseFlatten(array, 1) : [];
  7942. }
  7943. /**
  7944. * Recursively flattens `array`.
  7945. *
  7946. * @static
  7947. * @memberOf _
  7948. * @since 3.0.0
  7949. * @category Array
  7950. * @param {Array} array The array to flatten.
  7951. * @returns {Array} Returns the new flattened array.
  7952. * @example
  7953. *
  7954. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7955. * // => [1, 2, 3, 4, 5]
  7956. */
  7957. function flattenDeep(array) {
  7958. var length = array == null ? 0 : array.length;
  7959. return length ? baseFlatten(array, INFINITY) : [];
  7960. }
  7961. /**
  7962. * Recursively flatten `array` up to `depth` times.
  7963. *
  7964. * @static
  7965. * @memberOf _
  7966. * @since 4.4.0
  7967. * @category Array
  7968. * @param {Array} array The array to flatten.
  7969. * @param {number} [depth=1] The maximum recursion depth.
  7970. * @returns {Array} Returns the new flattened array.
  7971. * @example
  7972. *
  7973. * var array = [1, [2, [3, [4]], 5]];
  7974. *
  7975. * _.flattenDepth(array, 1);
  7976. * // => [1, 2, [3, [4]], 5]
  7977. *
  7978. * _.flattenDepth(array, 2);
  7979. * // => [1, 2, 3, [4], 5]
  7980. */
  7981. function flattenDepth(array, depth) {
  7982. var length = array == null ? 0 : array.length;
  7983. if (!length) {
  7984. return [];
  7985. }
  7986. depth = depth === undefined ? 1 : toInteger(depth);
  7987. return baseFlatten(array, depth);
  7988. }
  7989. /**
  7990. * The inverse of `_.toPairs`; this method returns an object composed
  7991. * from key-value `pairs`.
  7992. *
  7993. * @static
  7994. * @memberOf _
  7995. * @since 4.0.0
  7996. * @category Array
  7997. * @param {Array} pairs The key-value pairs.
  7998. * @returns {Object} Returns the new object.
  7999. * @example
  8000. *
  8001. * _.fromPairs([['a', 1], ['b', 2]]);
  8002. * // => { 'a': 1, 'b': 2 }
  8003. */
  8004. function fromPairs(pairs) {
  8005. var index = -1,
  8006. length = pairs == null ? 0 : pairs.length,
  8007. result = {};
  8008. while (++index < length) {
  8009. var pair = pairs[index];
  8010. result[pair[0]] = pair[1];
  8011. }
  8012. return result;
  8013. }
  8014. /**
  8015. * Gets the first element of `array`.
  8016. *
  8017. * @static
  8018. * @memberOf _
  8019. * @since 0.1.0
  8020. * @alias first
  8021. * @category Array
  8022. * @param {Array} array The array to query.
  8023. * @returns {*} Returns the first element of `array`.
  8024. * @example
  8025. *
  8026. * _.head([1, 2, 3]);
  8027. * // => 1
  8028. *
  8029. * _.head([]);
  8030. * // => undefined
  8031. */
  8032. function head(array) {
  8033. return (array && array.length) ? array[0] : undefined;
  8034. }
  8035. /**
  8036. * Gets the index at which the first occurrence of `value` is found in `array`
  8037. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8038. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8039. * offset from the end of `array`.
  8040. *
  8041. * @static
  8042. * @memberOf _
  8043. * @since 0.1.0
  8044. * @category Array
  8045. * @param {Array} array The array to inspect.
  8046. * @param {*} value The value to search for.
  8047. * @param {number} [fromIndex=0] The index to search from.
  8048. * @returns {number} Returns the index of the matched value, else `-1`.
  8049. * @example
  8050. *
  8051. * _.indexOf([1, 2, 1, 2], 2);
  8052. * // => 1
  8053. *
  8054. * // Search from the `fromIndex`.
  8055. * _.indexOf([1, 2, 1, 2], 2, 2);
  8056. * // => 3
  8057. */
  8058. function indexOf(array, value, fromIndex) {
  8059. var length = array == null ? 0 : array.length;
  8060. if (!length) {
  8061. return -1;
  8062. }
  8063. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8064. if (index < 0) {
  8065. index = nativeMax(length + index, 0);
  8066. }
  8067. return baseIndexOf(array, value, index);
  8068. }
  8069. /**
  8070. * Gets all but the last element of `array`.
  8071. *
  8072. * @static
  8073. * @memberOf _
  8074. * @since 0.1.0
  8075. * @category Array
  8076. * @param {Array} array The array to query.
  8077. * @returns {Array} Returns the slice of `array`.
  8078. * @example
  8079. *
  8080. * _.initial([1, 2, 3]);
  8081. * // => [1, 2]
  8082. */
  8083. function initial(array) {
  8084. var length = array == null ? 0 : array.length;
  8085. return length ? baseSlice(array, 0, -1) : [];
  8086. }
  8087. /**
  8088. * Creates an array of unique values that are included in all given arrays
  8089. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8090. * for equality comparisons. The order and references of result values are
  8091. * determined by the first array.
  8092. *
  8093. * @static
  8094. * @memberOf _
  8095. * @since 0.1.0
  8096. * @category Array
  8097. * @param {...Array} [arrays] The arrays to inspect.
  8098. * @returns {Array} Returns the new array of intersecting values.
  8099. * @example
  8100. *
  8101. * _.intersection([2, 1], [2, 3]);
  8102. * // => [2]
  8103. */
  8104. var intersection = baseRest(function(arrays) {
  8105. var mapped = arrayMap(arrays, castArrayLikeObject);
  8106. return (mapped.length && mapped[0] === arrays[0])
  8107. ? baseIntersection(mapped)
  8108. : [];
  8109. });
  8110. /**
  8111. * This method is like `_.intersection` except that it accepts `iteratee`
  8112. * which is invoked for each element of each `arrays` to generate the criterion
  8113. * by which they're compared. The order and references of result values are
  8114. * determined by the first array. The iteratee is invoked with one argument:
  8115. * (value).
  8116. *
  8117. * @static
  8118. * @memberOf _
  8119. * @since 4.0.0
  8120. * @category Array
  8121. * @param {...Array} [arrays] The arrays to inspect.
  8122. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8123. * @returns {Array} Returns the new array of intersecting values.
  8124. * @example
  8125. *
  8126. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8127. * // => [2.1]
  8128. *
  8129. * // The `_.property` iteratee shorthand.
  8130. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8131. * // => [{ 'x': 1 }]
  8132. */
  8133. var intersectionBy = baseRest(function(arrays) {
  8134. var iteratee = last(arrays),
  8135. mapped = arrayMap(arrays, castArrayLikeObject);
  8136. if (iteratee === last(mapped)) {
  8137. iteratee = undefined;
  8138. } else {
  8139. mapped.pop();
  8140. }
  8141. return (mapped.length && mapped[0] === arrays[0])
  8142. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8143. : [];
  8144. });
  8145. /**
  8146. * This method is like `_.intersection` except that it accepts `comparator`
  8147. * which is invoked to compare elements of `arrays`. The order and references
  8148. * of result values are determined by the first array. The comparator is
  8149. * invoked with two arguments: (arrVal, othVal).
  8150. *
  8151. * @static
  8152. * @memberOf _
  8153. * @since 4.0.0
  8154. * @category Array
  8155. * @param {...Array} [arrays] The arrays to inspect.
  8156. * @param {Function} [comparator] The comparator invoked per element.
  8157. * @returns {Array} Returns the new array of intersecting values.
  8158. * @example
  8159. *
  8160. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8161. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8162. *
  8163. * _.intersectionWith(objects, others, _.isEqual);
  8164. * // => [{ 'x': 1, 'y': 2 }]
  8165. */
  8166. var intersectionWith = baseRest(function(arrays) {
  8167. var comparator = last(arrays),
  8168. mapped = arrayMap(arrays, castArrayLikeObject);
  8169. comparator = typeof comparator == 'function' ? comparator : undefined;
  8170. if (comparator) {
  8171. mapped.pop();
  8172. }
  8173. return (mapped.length && mapped[0] === arrays[0])
  8174. ? baseIntersection(mapped, undefined, comparator)
  8175. : [];
  8176. });
  8177. /**
  8178. * Converts all elements in `array` into a string separated by `separator`.
  8179. *
  8180. * @static
  8181. * @memberOf _
  8182. * @since 4.0.0
  8183. * @category Array
  8184. * @param {Array} array The array to convert.
  8185. * @param {string} [separator=','] The element separator.
  8186. * @returns {string} Returns the joined string.
  8187. * @example
  8188. *
  8189. * _.join(['a', 'b', 'c'], '~');
  8190. * // => 'a~b~c'
  8191. */
  8192. function join(array, separator) {
  8193. return array == null ? '' : nativeJoin.call(array, separator);
  8194. }
  8195. /**
  8196. * Gets the last element of `array`.
  8197. *
  8198. * @static
  8199. * @memberOf _
  8200. * @since 0.1.0
  8201. * @category Array
  8202. * @param {Array} array The array to query.
  8203. * @returns {*} Returns the last element of `array`.
  8204. * @example
  8205. *
  8206. * _.last([1, 2, 3]);
  8207. * // => 3
  8208. */
  8209. function last(array) {
  8210. var length = array == null ? 0 : array.length;
  8211. return length ? array[length - 1] : undefined;
  8212. }
  8213. /**
  8214. * This method is like `_.indexOf` except that it iterates over elements of
  8215. * `array` from right to left.
  8216. *
  8217. * @static
  8218. * @memberOf _
  8219. * @since 0.1.0
  8220. * @category Array
  8221. * @param {Array} array The array to inspect.
  8222. * @param {*} value The value to search for.
  8223. * @param {number} [fromIndex=array.length-1] The index to search from.
  8224. * @returns {number} Returns the index of the matched value, else `-1`.
  8225. * @example
  8226. *
  8227. * _.lastIndexOf([1, 2, 1, 2], 2);
  8228. * // => 3
  8229. *
  8230. * // Search from the `fromIndex`.
  8231. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8232. * // => 1
  8233. */
  8234. function lastIndexOf(array, value, fromIndex) {
  8235. var length = array == null ? 0 : array.length;
  8236. if (!length) {
  8237. return -1;
  8238. }
  8239. var index = length;
  8240. if (fromIndex !== undefined) {
  8241. index = toInteger(fromIndex);
  8242. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8243. }
  8244. return value === value
  8245. ? strictLastIndexOf(array, value, index)
  8246. : baseFindIndex(array, baseIsNaN, index, true);
  8247. }
  8248. /**
  8249. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8250. * element from the end is returned.
  8251. *
  8252. * @static
  8253. * @memberOf _
  8254. * @since 4.11.0
  8255. * @category Array
  8256. * @param {Array} array The array to query.
  8257. * @param {number} [n=0] The index of the element to return.
  8258. * @returns {*} Returns the nth element of `array`.
  8259. * @example
  8260. *
  8261. * var array = ['a', 'b', 'c', 'd'];
  8262. *
  8263. * _.nth(array, 1);
  8264. * // => 'b'
  8265. *
  8266. * _.nth(array, -2);
  8267. * // => 'c';
  8268. */
  8269. function nth(array, n) {
  8270. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8271. }
  8272. /**
  8273. * Removes all given values from `array` using
  8274. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8275. * for equality comparisons.
  8276. *
  8277. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8278. * to remove elements from an array by predicate.
  8279. *
  8280. * @static
  8281. * @memberOf _
  8282. * @since 2.0.0
  8283. * @category Array
  8284. * @param {Array} array The array to modify.
  8285. * @param {...*} [values] The values to remove.
  8286. * @returns {Array} Returns `array`.
  8287. * @example
  8288. *
  8289. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8290. *
  8291. * _.pull(array, 'a', 'c');
  8292. * console.log(array);
  8293. * // => ['b', 'b']
  8294. */
  8295. var pull = baseRest(pullAll);
  8296. /**
  8297. * This method is like `_.pull` except that it accepts an array of values to remove.
  8298. *
  8299. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8300. *
  8301. * @static
  8302. * @memberOf _
  8303. * @since 4.0.0
  8304. * @category Array
  8305. * @param {Array} array The array to modify.
  8306. * @param {Array} values The values to remove.
  8307. * @returns {Array} Returns `array`.
  8308. * @example
  8309. *
  8310. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8311. *
  8312. * _.pullAll(array, ['a', 'c']);
  8313. * console.log(array);
  8314. * // => ['b', 'b']
  8315. */
  8316. function pullAll(array, values) {
  8317. return (array && array.length && values && values.length)
  8318. ? basePullAll(array, values)
  8319. : array;
  8320. }
  8321. /**
  8322. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8323. * invoked for each element of `array` and `values` to generate the criterion
  8324. * by which they're compared. The iteratee is invoked with one argument: (value).
  8325. *
  8326. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8327. *
  8328. * @static
  8329. * @memberOf _
  8330. * @since 4.0.0
  8331. * @category Array
  8332. * @param {Array} array The array to modify.
  8333. * @param {Array} values The values to remove.
  8334. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8335. * @returns {Array} Returns `array`.
  8336. * @example
  8337. *
  8338. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8339. *
  8340. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8341. * console.log(array);
  8342. * // => [{ 'x': 2 }]
  8343. */
  8344. function pullAllBy(array, values, iteratee) {
  8345. return (array && array.length && values && values.length)
  8346. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8347. : array;
  8348. }
  8349. /**
  8350. * This method is like `_.pullAll` except that it accepts `comparator` which
  8351. * is invoked to compare elements of `array` to `values`. The comparator is
  8352. * invoked with two arguments: (arrVal, othVal).
  8353. *
  8354. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8355. *
  8356. * @static
  8357. * @memberOf _
  8358. * @since 4.6.0
  8359. * @category Array
  8360. * @param {Array} array The array to modify.
  8361. * @param {Array} values The values to remove.
  8362. * @param {Function} [comparator] The comparator invoked per element.
  8363. * @returns {Array} Returns `array`.
  8364. * @example
  8365. *
  8366. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8367. *
  8368. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8369. * console.log(array);
  8370. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8371. */
  8372. function pullAllWith(array, values, comparator) {
  8373. return (array && array.length && values && values.length)
  8374. ? basePullAll(array, values, undefined, comparator)
  8375. : array;
  8376. }
  8377. /**
  8378. * Removes elements from `array` corresponding to `indexes` and returns an
  8379. * array of removed elements.
  8380. *
  8381. * **Note:** Unlike `_.at`, this method mutates `array`.
  8382. *
  8383. * @static
  8384. * @memberOf _
  8385. * @since 3.0.0
  8386. * @category Array
  8387. * @param {Array} array The array to modify.
  8388. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8389. * @returns {Array} Returns the new array of removed elements.
  8390. * @example
  8391. *
  8392. * var array = ['a', 'b', 'c', 'd'];
  8393. * var pulled = _.pullAt(array, [1, 3]);
  8394. *
  8395. * console.log(array);
  8396. * // => ['a', 'c']
  8397. *
  8398. * console.log(pulled);
  8399. * // => ['b', 'd']
  8400. */
  8401. var pullAt = flatRest(function(array, indexes) {
  8402. var length = array == null ? 0 : array.length,
  8403. result = baseAt(array, indexes);
  8404. basePullAt(array, arrayMap(indexes, function(index) {
  8405. return isIndex(index, length) ? +index : index;
  8406. }).sort(compareAscending));
  8407. return result;
  8408. });
  8409. /**
  8410. * Removes all elements from `array` that `predicate` returns truthy for
  8411. * and returns an array of the removed elements. The predicate is invoked
  8412. * with three arguments: (value, index, array).
  8413. *
  8414. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8415. * to pull elements from an array by value.
  8416. *
  8417. * @static
  8418. * @memberOf _
  8419. * @since 2.0.0
  8420. * @category Array
  8421. * @param {Array} array The array to modify.
  8422. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8423. * @returns {Array} Returns the new array of removed elements.
  8424. * @example
  8425. *
  8426. * var array = [1, 2, 3, 4];
  8427. * var evens = _.remove(array, function(n) {
  8428. * return n % 2 == 0;
  8429. * });
  8430. *
  8431. * console.log(array);
  8432. * // => [1, 3]
  8433. *
  8434. * console.log(evens);
  8435. * // => [2, 4]
  8436. */
  8437. function remove(array, predicate) {
  8438. var result = [];
  8439. if (!(array && array.length)) {
  8440. return result;
  8441. }
  8442. var index = -1,
  8443. indexes = [],
  8444. length = array.length;
  8445. predicate = getIteratee(predicate, 3);
  8446. while (++index < length) {
  8447. var value = array[index];
  8448. if (predicate(value, index, array)) {
  8449. result.push(value);
  8450. indexes.push(index);
  8451. }
  8452. }
  8453. basePullAt(array, indexes);
  8454. return result;
  8455. }
  8456. /**
  8457. * Reverses `array` so that the first element becomes the last, the second
  8458. * element becomes the second to last, and so on.
  8459. *
  8460. * **Note:** This method mutates `array` and is based on
  8461. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8462. *
  8463. * @static
  8464. * @memberOf _
  8465. * @since 4.0.0
  8466. * @category Array
  8467. * @param {Array} array The array to modify.
  8468. * @returns {Array} Returns `array`.
  8469. * @example
  8470. *
  8471. * var array = [1, 2, 3];
  8472. *
  8473. * _.reverse(array);
  8474. * // => [3, 2, 1]
  8475. *
  8476. * console.log(array);
  8477. * // => [3, 2, 1]
  8478. */
  8479. function reverse(array) {
  8480. return array == null ? array : nativeReverse.call(array);
  8481. }
  8482. /**
  8483. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8484. *
  8485. * **Note:** This method is used instead of
  8486. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8487. * returned.
  8488. *
  8489. * @static
  8490. * @memberOf _
  8491. * @since 3.0.0
  8492. * @category Array
  8493. * @param {Array} array The array to slice.
  8494. * @param {number} [start=0] The start position.
  8495. * @param {number} [end=array.length] The end position.
  8496. * @returns {Array} Returns the slice of `array`.
  8497. */
  8498. function slice(array, start, end) {
  8499. var length = array == null ? 0 : array.length;
  8500. if (!length) {
  8501. return [];
  8502. }
  8503. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8504. start = 0;
  8505. end = length;
  8506. }
  8507. else {
  8508. start = start == null ? 0 : toInteger(start);
  8509. end = end === undefined ? length : toInteger(end);
  8510. }
  8511. return baseSlice(array, start, end);
  8512. }
  8513. /**
  8514. * Uses a binary search to determine the lowest index at which `value`
  8515. * should be inserted into `array` in order to maintain its sort order.
  8516. *
  8517. * @static
  8518. * @memberOf _
  8519. * @since 0.1.0
  8520. * @category Array
  8521. * @param {Array} array The sorted array to inspect.
  8522. * @param {*} value The value to evaluate.
  8523. * @returns {number} Returns the index at which `value` should be inserted
  8524. * into `array`.
  8525. * @example
  8526. *
  8527. * _.sortedIndex([30, 50], 40);
  8528. * // => 1
  8529. */
  8530. function sortedIndex(array, value) {
  8531. return baseSortedIndex(array, value);
  8532. }
  8533. /**
  8534. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8535. * which is invoked for `value` and each element of `array` to compute their
  8536. * sort ranking. The iteratee is invoked with one argument: (value).
  8537. *
  8538. * @static
  8539. * @memberOf _
  8540. * @since 4.0.0
  8541. * @category Array
  8542. * @param {Array} array The sorted array to inspect.
  8543. * @param {*} value The value to evaluate.
  8544. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8545. * @returns {number} Returns the index at which `value` should be inserted
  8546. * into `array`.
  8547. * @example
  8548. *
  8549. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8550. *
  8551. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8552. * // => 0
  8553. *
  8554. * // The `_.property` iteratee shorthand.
  8555. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8556. * // => 0
  8557. */
  8558. function sortedIndexBy(array, value, iteratee) {
  8559. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8560. }
  8561. /**
  8562. * This method is like `_.indexOf` except that it performs a binary
  8563. * search on a sorted `array`.
  8564. *
  8565. * @static
  8566. * @memberOf _
  8567. * @since 4.0.0
  8568. * @category Array
  8569. * @param {Array} array The array to inspect.
  8570. * @param {*} value The value to search for.
  8571. * @returns {number} Returns the index of the matched value, else `-1`.
  8572. * @example
  8573. *
  8574. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8575. * // => 1
  8576. */
  8577. function sortedIndexOf(array, value) {
  8578. var length = array == null ? 0 : array.length;
  8579. if (length) {
  8580. var index = baseSortedIndex(array, value);
  8581. if (index < length && eq(array[index], value)) {
  8582. return index;
  8583. }
  8584. }
  8585. return -1;
  8586. }
  8587. /**
  8588. * This method is like `_.sortedIndex` except that it returns the highest
  8589. * index at which `value` should be inserted into `array` in order to
  8590. * maintain its sort order.
  8591. *
  8592. * @static
  8593. * @memberOf _
  8594. * @since 3.0.0
  8595. * @category Array
  8596. * @param {Array} array The sorted array to inspect.
  8597. * @param {*} value The value to evaluate.
  8598. * @returns {number} Returns the index at which `value` should be inserted
  8599. * into `array`.
  8600. * @example
  8601. *
  8602. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8603. * // => 4
  8604. */
  8605. function sortedLastIndex(array, value) {
  8606. return baseSortedIndex(array, value, true);
  8607. }
  8608. /**
  8609. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8610. * which is invoked for `value` and each element of `array` to compute their
  8611. * sort ranking. The iteratee is invoked with one argument: (value).
  8612. *
  8613. * @static
  8614. * @memberOf _
  8615. * @since 4.0.0
  8616. * @category Array
  8617. * @param {Array} array The sorted array to inspect.
  8618. * @param {*} value The value to evaluate.
  8619. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8620. * @returns {number} Returns the index at which `value` should be inserted
  8621. * into `array`.
  8622. * @example
  8623. *
  8624. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8625. *
  8626. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8627. * // => 1
  8628. *
  8629. * // The `_.property` iteratee shorthand.
  8630. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8631. * // => 1
  8632. */
  8633. function sortedLastIndexBy(array, value, iteratee) {
  8634. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8635. }
  8636. /**
  8637. * This method is like `_.lastIndexOf` except that it performs a binary
  8638. * search on a sorted `array`.
  8639. *
  8640. * @static
  8641. * @memberOf _
  8642. * @since 4.0.0
  8643. * @category Array
  8644. * @param {Array} array The array to inspect.
  8645. * @param {*} value The value to search for.
  8646. * @returns {number} Returns the index of the matched value, else `-1`.
  8647. * @example
  8648. *
  8649. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8650. * // => 3
  8651. */
  8652. function sortedLastIndexOf(array, value) {
  8653. var length = array == null ? 0 : array.length;
  8654. if (length) {
  8655. var index = baseSortedIndex(array, value, true) - 1;
  8656. if (eq(array[index], value)) {
  8657. return index;
  8658. }
  8659. }
  8660. return -1;
  8661. }
  8662. /**
  8663. * This method is like `_.uniq` except that it's designed and optimized
  8664. * for sorted arrays.
  8665. *
  8666. * @static
  8667. * @memberOf _
  8668. * @since 4.0.0
  8669. * @category Array
  8670. * @param {Array} array The array to inspect.
  8671. * @returns {Array} Returns the new duplicate free array.
  8672. * @example
  8673. *
  8674. * _.sortedUniq([1, 1, 2]);
  8675. * // => [1, 2]
  8676. */
  8677. function sortedUniq(array) {
  8678. return (array && array.length)
  8679. ? baseSortedUniq(array)
  8680. : [];
  8681. }
  8682. /**
  8683. * This method is like `_.uniqBy` except that it's designed and optimized
  8684. * for sorted arrays.
  8685. *
  8686. * @static
  8687. * @memberOf _
  8688. * @since 4.0.0
  8689. * @category Array
  8690. * @param {Array} array The array to inspect.
  8691. * @param {Function} [iteratee] The iteratee invoked per element.
  8692. * @returns {Array} Returns the new duplicate free array.
  8693. * @example
  8694. *
  8695. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8696. * // => [1.1, 2.3]
  8697. */
  8698. function sortedUniqBy(array, iteratee) {
  8699. return (array && array.length)
  8700. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8701. : [];
  8702. }
  8703. /**
  8704. * Gets all but the first element of `array`.
  8705. *
  8706. * @static
  8707. * @memberOf _
  8708. * @since 4.0.0
  8709. * @category Array
  8710. * @param {Array} array The array to query.
  8711. * @returns {Array} Returns the slice of `array`.
  8712. * @example
  8713. *
  8714. * _.tail([1, 2, 3]);
  8715. * // => [2, 3]
  8716. */
  8717. function tail(array) {
  8718. var length = array == null ? 0 : array.length;
  8719. return length ? baseSlice(array, 1, length) : [];
  8720. }
  8721. /**
  8722. * Creates a slice of `array` with `n` elements taken from the beginning.
  8723. *
  8724. * @static
  8725. * @memberOf _
  8726. * @since 0.1.0
  8727. * @category Array
  8728. * @param {Array} array The array to query.
  8729. * @param {number} [n=1] The number of elements to take.
  8730. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8731. * @returns {Array} Returns the slice of `array`.
  8732. * @example
  8733. *
  8734. * _.take([1, 2, 3]);
  8735. * // => [1]
  8736. *
  8737. * _.take([1, 2, 3], 2);
  8738. * // => [1, 2]
  8739. *
  8740. * _.take([1, 2, 3], 5);
  8741. * // => [1, 2, 3]
  8742. *
  8743. * _.take([1, 2, 3], 0);
  8744. * // => []
  8745. */
  8746. function take(array, n, guard) {
  8747. if (!(array && array.length)) {
  8748. return [];
  8749. }
  8750. n = (guard || n === undefined) ? 1 : toInteger(n);
  8751. return baseSlice(array, 0, n < 0 ? 0 : n);
  8752. }
  8753. /**
  8754. * Creates a slice of `array` with `n` elements taken from the end.
  8755. *
  8756. * @static
  8757. * @memberOf _
  8758. * @since 3.0.0
  8759. * @category Array
  8760. * @param {Array} array The array to query.
  8761. * @param {number} [n=1] The number of elements to take.
  8762. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8763. * @returns {Array} Returns the slice of `array`.
  8764. * @example
  8765. *
  8766. * _.takeRight([1, 2, 3]);
  8767. * // => [3]
  8768. *
  8769. * _.takeRight([1, 2, 3], 2);
  8770. * // => [2, 3]
  8771. *
  8772. * _.takeRight([1, 2, 3], 5);
  8773. * // => [1, 2, 3]
  8774. *
  8775. * _.takeRight([1, 2, 3], 0);
  8776. * // => []
  8777. */
  8778. function takeRight(array, n, guard) {
  8779. var length = array == null ? 0 : array.length;
  8780. if (!length) {
  8781. return [];
  8782. }
  8783. n = (guard || n === undefined) ? 1 : toInteger(n);
  8784. n = length - n;
  8785. return baseSlice(array, n < 0 ? 0 : n, length);
  8786. }
  8787. /**
  8788. * Creates a slice of `array` with elements taken from the end. Elements are
  8789. * taken until `predicate` returns falsey. The predicate is invoked with
  8790. * three arguments: (value, index, array).
  8791. *
  8792. * @static
  8793. * @memberOf _
  8794. * @since 3.0.0
  8795. * @category Array
  8796. * @param {Array} array The array to query.
  8797. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8798. * @returns {Array} Returns the slice of `array`.
  8799. * @example
  8800. *
  8801. * var users = [
  8802. * { 'user': 'barney', 'active': true },
  8803. * { 'user': 'fred', 'active': false },
  8804. * { 'user': 'pebbles', 'active': false }
  8805. * ];
  8806. *
  8807. * _.takeRightWhile(users, function(o) { return !o.active; });
  8808. * // => objects for ['fred', 'pebbles']
  8809. *
  8810. * // The `_.matches` iteratee shorthand.
  8811. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8812. * // => objects for ['pebbles']
  8813. *
  8814. * // The `_.matchesProperty` iteratee shorthand.
  8815. * _.takeRightWhile(users, ['active', false]);
  8816. * // => objects for ['fred', 'pebbles']
  8817. *
  8818. * // The `_.property` iteratee shorthand.
  8819. * _.takeRightWhile(users, 'active');
  8820. * // => []
  8821. */
  8822. function takeRightWhile(array, predicate) {
  8823. return (array && array.length)
  8824. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8825. : [];
  8826. }
  8827. /**
  8828. * Creates a slice of `array` with elements taken from the beginning. Elements
  8829. * are taken until `predicate` returns falsey. The predicate is invoked with
  8830. * three arguments: (value, index, array).
  8831. *
  8832. * @static
  8833. * @memberOf _
  8834. * @since 3.0.0
  8835. * @category Array
  8836. * @param {Array} array The array to query.
  8837. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8838. * @returns {Array} Returns the slice of `array`.
  8839. * @example
  8840. *
  8841. * var users = [
  8842. * { 'user': 'barney', 'active': false },
  8843. * { 'user': 'fred', 'active': false },
  8844. * { 'user': 'pebbles', 'active': true }
  8845. * ];
  8846. *
  8847. * _.takeWhile(users, function(o) { return !o.active; });
  8848. * // => objects for ['barney', 'fred']
  8849. *
  8850. * // The `_.matches` iteratee shorthand.
  8851. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8852. * // => objects for ['barney']
  8853. *
  8854. * // The `_.matchesProperty` iteratee shorthand.
  8855. * _.takeWhile(users, ['active', false]);
  8856. * // => objects for ['barney', 'fred']
  8857. *
  8858. * // The `_.property` iteratee shorthand.
  8859. * _.takeWhile(users, 'active');
  8860. * // => []
  8861. */
  8862. function takeWhile(array, predicate) {
  8863. return (array && array.length)
  8864. ? baseWhile(array, getIteratee(predicate, 3))
  8865. : [];
  8866. }
  8867. /**
  8868. * Creates an array of unique values, in order, from all given arrays using
  8869. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8870. * for equality comparisons.
  8871. *
  8872. * @static
  8873. * @memberOf _
  8874. * @since 0.1.0
  8875. * @category Array
  8876. * @param {...Array} [arrays] The arrays to inspect.
  8877. * @returns {Array} Returns the new array of combined values.
  8878. * @example
  8879. *
  8880. * _.union([2], [1, 2]);
  8881. * // => [2, 1]
  8882. */
  8883. var union = baseRest(function(arrays) {
  8884. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8885. });
  8886. /**
  8887. * This method is like `_.union` except that it accepts `iteratee` which is
  8888. * invoked for each element of each `arrays` to generate the criterion by
  8889. * which uniqueness is computed. Result values are chosen from the first
  8890. * array in which the value occurs. The iteratee is invoked with one argument:
  8891. * (value).
  8892. *
  8893. * @static
  8894. * @memberOf _
  8895. * @since 4.0.0
  8896. * @category Array
  8897. * @param {...Array} [arrays] The arrays to inspect.
  8898. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8899. * @returns {Array} Returns the new array of combined values.
  8900. * @example
  8901. *
  8902. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8903. * // => [2.1, 1.2]
  8904. *
  8905. * // The `_.property` iteratee shorthand.
  8906. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8907. * // => [{ 'x': 1 }, { 'x': 2 }]
  8908. */
  8909. var unionBy = baseRest(function(arrays) {
  8910. var iteratee = last(arrays);
  8911. if (isArrayLikeObject(iteratee)) {
  8912. iteratee = undefined;
  8913. }
  8914. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8915. });
  8916. /**
  8917. * This method is like `_.union` except that it accepts `comparator` which
  8918. * is invoked to compare elements of `arrays`. Result values are chosen from
  8919. * the first array in which the value occurs. The comparator is invoked
  8920. * with two arguments: (arrVal, othVal).
  8921. *
  8922. * @static
  8923. * @memberOf _
  8924. * @since 4.0.0
  8925. * @category Array
  8926. * @param {...Array} [arrays] The arrays to inspect.
  8927. * @param {Function} [comparator] The comparator invoked per element.
  8928. * @returns {Array} Returns the new array of combined values.
  8929. * @example
  8930. *
  8931. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8932. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8933. *
  8934. * _.unionWith(objects, others, _.isEqual);
  8935. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8936. */
  8937. var unionWith = baseRest(function(arrays) {
  8938. var comparator = last(arrays);
  8939. comparator = typeof comparator == 'function' ? comparator : undefined;
  8940. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8941. });
  8942. /**
  8943. * Creates a duplicate-free version of an array, using
  8944. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8945. * for equality comparisons, in which only the first occurrence of each element
  8946. * is kept. The order of result values is determined by the order they occur
  8947. * in the array.
  8948. *
  8949. * @static
  8950. * @memberOf _
  8951. * @since 0.1.0
  8952. * @category Array
  8953. * @param {Array} array The array to inspect.
  8954. * @returns {Array} Returns the new duplicate free array.
  8955. * @example
  8956. *
  8957. * _.uniq([2, 1, 2]);
  8958. * // => [2, 1]
  8959. */
  8960. function uniq(array) {
  8961. return (array && array.length) ? baseUniq(array) : [];
  8962. }
  8963. /**
  8964. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8965. * invoked for each element in `array` to generate the criterion by which
  8966. * uniqueness is computed. The order of result values is determined by the
  8967. * order they occur in the array. The iteratee is invoked with one argument:
  8968. * (value).
  8969. *
  8970. * @static
  8971. * @memberOf _
  8972. * @since 4.0.0
  8973. * @category Array
  8974. * @param {Array} array The array to inspect.
  8975. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8976. * @returns {Array} Returns the new duplicate free array.
  8977. * @example
  8978. *
  8979. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8980. * // => [2.1, 1.2]
  8981. *
  8982. * // The `_.property` iteratee shorthand.
  8983. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8984. * // => [{ 'x': 1 }, { 'x': 2 }]
  8985. */
  8986. function uniqBy(array, iteratee) {
  8987. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8988. }
  8989. /**
  8990. * This method is like `_.uniq` except that it accepts `comparator` which
  8991. * is invoked to compare elements of `array`. The order of result values is
  8992. * determined by the order they occur in the array.The comparator is invoked
  8993. * with two arguments: (arrVal, othVal).
  8994. *
  8995. * @static
  8996. * @memberOf _
  8997. * @since 4.0.0
  8998. * @category Array
  8999. * @param {Array} array The array to inspect.
  9000. * @param {Function} [comparator] The comparator invoked per element.
  9001. * @returns {Array} Returns the new duplicate free array.
  9002. * @example
  9003. *
  9004. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9005. *
  9006. * _.uniqWith(objects, _.isEqual);
  9007. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9008. */
  9009. function uniqWith(array, comparator) {
  9010. comparator = typeof comparator == 'function' ? comparator : undefined;
  9011. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9012. }
  9013. /**
  9014. * This method is like `_.zip` except that it accepts an array of grouped
  9015. * elements and creates an array regrouping the elements to their pre-zip
  9016. * configuration.
  9017. *
  9018. * @static
  9019. * @memberOf _
  9020. * @since 1.2.0
  9021. * @category Array
  9022. * @param {Array} array The array of grouped elements to process.
  9023. * @returns {Array} Returns the new array of regrouped elements.
  9024. * @example
  9025. *
  9026. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9027. * // => [['a', 1, true], ['b', 2, false]]
  9028. *
  9029. * _.unzip(zipped);
  9030. * // => [['a', 'b'], [1, 2], [true, false]]
  9031. */
  9032. function unzip(array) {
  9033. if (!(array && array.length)) {
  9034. return [];
  9035. }
  9036. var length = 0;
  9037. array = arrayFilter(array, function(group) {
  9038. if (isArrayLikeObject(group)) {
  9039. length = nativeMax(group.length, length);
  9040. return true;
  9041. }
  9042. });
  9043. return baseTimes(length, function(index) {
  9044. return arrayMap(array, baseProperty(index));
  9045. });
  9046. }
  9047. /**
  9048. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9049. * how regrouped values should be combined. The iteratee is invoked with the
  9050. * elements of each group: (...group).
  9051. *
  9052. * @static
  9053. * @memberOf _
  9054. * @since 3.8.0
  9055. * @category Array
  9056. * @param {Array} array The array of grouped elements to process.
  9057. * @param {Function} [iteratee=_.identity] The function to combine
  9058. * regrouped values.
  9059. * @returns {Array} Returns the new array of regrouped elements.
  9060. * @example
  9061. *
  9062. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9063. * // => [[1, 10, 100], [2, 20, 200]]
  9064. *
  9065. * _.unzipWith(zipped, _.add);
  9066. * // => [3, 30, 300]
  9067. */
  9068. function unzipWith(array, iteratee) {
  9069. if (!(array && array.length)) {
  9070. return [];
  9071. }
  9072. var result = unzip(array);
  9073. if (iteratee == null) {
  9074. return result;
  9075. }
  9076. return arrayMap(result, function(group) {
  9077. return apply(iteratee, undefined, group);
  9078. });
  9079. }
  9080. /**
  9081. * Creates an array excluding all given values using
  9082. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9083. * for equality comparisons.
  9084. *
  9085. * **Note:** Unlike `_.pull`, this method returns a new array.
  9086. *
  9087. * @static
  9088. * @memberOf _
  9089. * @since 0.1.0
  9090. * @category Array
  9091. * @param {Array} array The array to inspect.
  9092. * @param {...*} [values] The values to exclude.
  9093. * @returns {Array} Returns the new array of filtered values.
  9094. * @see _.difference, _.xor
  9095. * @example
  9096. *
  9097. * _.without([2, 1, 2, 3], 1, 2);
  9098. * // => [3]
  9099. */
  9100. var without = baseRest(function(array, values) {
  9101. return isArrayLikeObject(array)
  9102. ? baseDifference(array, values)
  9103. : [];
  9104. });
  9105. /**
  9106. * Creates an array of unique values that is the
  9107. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9108. * of the given arrays. The order of result values is determined by the order
  9109. * they occur in the arrays.
  9110. *
  9111. * @static
  9112. * @memberOf _
  9113. * @since 2.4.0
  9114. * @category Array
  9115. * @param {...Array} [arrays] The arrays to inspect.
  9116. * @returns {Array} Returns the new array of filtered values.
  9117. * @see _.difference, _.without
  9118. * @example
  9119. *
  9120. * _.xor([2, 1], [2, 3]);
  9121. * // => [1, 3]
  9122. */
  9123. var xor = baseRest(function(arrays) {
  9124. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9125. });
  9126. /**
  9127. * This method is like `_.xor` except that it accepts `iteratee` which is
  9128. * invoked for each element of each `arrays` to generate the criterion by
  9129. * which by which they're compared. The order of result values is determined
  9130. * by the order they occur in the arrays. The iteratee is invoked with one
  9131. * argument: (value).
  9132. *
  9133. * @static
  9134. * @memberOf _
  9135. * @since 4.0.0
  9136. * @category Array
  9137. * @param {...Array} [arrays] The arrays to inspect.
  9138. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9139. * @returns {Array} Returns the new array of filtered values.
  9140. * @example
  9141. *
  9142. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9143. * // => [1.2, 3.4]
  9144. *
  9145. * // The `_.property` iteratee shorthand.
  9146. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9147. * // => [{ 'x': 2 }]
  9148. */
  9149. var xorBy = baseRest(function(arrays) {
  9150. var iteratee = last(arrays);
  9151. if (isArrayLikeObject(iteratee)) {
  9152. iteratee = undefined;
  9153. }
  9154. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9155. });
  9156. /**
  9157. * This method is like `_.xor` except that it accepts `comparator` which is
  9158. * invoked to compare elements of `arrays`. The order of result values is
  9159. * determined by the order they occur in the arrays. The comparator is invoked
  9160. * with two arguments: (arrVal, othVal).
  9161. *
  9162. * @static
  9163. * @memberOf _
  9164. * @since 4.0.0
  9165. * @category Array
  9166. * @param {...Array} [arrays] The arrays to inspect.
  9167. * @param {Function} [comparator] The comparator invoked per element.
  9168. * @returns {Array} Returns the new array of filtered values.
  9169. * @example
  9170. *
  9171. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9172. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9173. *
  9174. * _.xorWith(objects, others, _.isEqual);
  9175. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9176. */
  9177. var xorWith = baseRest(function(arrays) {
  9178. var comparator = last(arrays);
  9179. comparator = typeof comparator == 'function' ? comparator : undefined;
  9180. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9181. });
  9182. /**
  9183. * Creates an array of grouped elements, the first of which contains the
  9184. * first elements of the given arrays, the second of which contains the
  9185. * second elements of the given arrays, and so on.
  9186. *
  9187. * @static
  9188. * @memberOf _
  9189. * @since 0.1.0
  9190. * @category Array
  9191. * @param {...Array} [arrays] The arrays to process.
  9192. * @returns {Array} Returns the new array of grouped elements.
  9193. * @example
  9194. *
  9195. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9196. * // => [['a', 1, true], ['b', 2, false]]
  9197. */
  9198. var zip = baseRest(unzip);
  9199. /**
  9200. * This method is like `_.fromPairs` except that it accepts two arrays,
  9201. * one of property identifiers and one of corresponding values.
  9202. *
  9203. * @static
  9204. * @memberOf _
  9205. * @since 0.4.0
  9206. * @category Array
  9207. * @param {Array} [props=[]] The property identifiers.
  9208. * @param {Array} [values=[]] The property values.
  9209. * @returns {Object} Returns the new object.
  9210. * @example
  9211. *
  9212. * _.zipObject(['a', 'b'], [1, 2]);
  9213. * // => { 'a': 1, 'b': 2 }
  9214. */
  9215. function zipObject(props, values) {
  9216. return baseZipObject(props || [], values || [], assignValue);
  9217. }
  9218. /**
  9219. * This method is like `_.zipObject` except that it supports property paths.
  9220. *
  9221. * @static
  9222. * @memberOf _
  9223. * @since 4.1.0
  9224. * @category Array
  9225. * @param {Array} [props=[]] The property identifiers.
  9226. * @param {Array} [values=[]] The property values.
  9227. * @returns {Object} Returns the new object.
  9228. * @example
  9229. *
  9230. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9231. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9232. */
  9233. function zipObjectDeep(props, values) {
  9234. return baseZipObject(props || [], values || [], baseSet);
  9235. }
  9236. /**
  9237. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9238. * how grouped values should be combined. The iteratee is invoked with the
  9239. * elements of each group: (...group).
  9240. *
  9241. * @static
  9242. * @memberOf _
  9243. * @since 3.8.0
  9244. * @category Array
  9245. * @param {...Array} [arrays] The arrays to process.
  9246. * @param {Function} [iteratee=_.identity] The function to combine
  9247. * grouped values.
  9248. * @returns {Array} Returns the new array of grouped elements.
  9249. * @example
  9250. *
  9251. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9252. * return a + b + c;
  9253. * });
  9254. * // => [111, 222]
  9255. */
  9256. var zipWith = baseRest(function(arrays) {
  9257. var length = arrays.length,
  9258. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9259. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9260. return unzipWith(arrays, iteratee);
  9261. });
  9262. /*------------------------------------------------------------------------*/
  9263. /**
  9264. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9265. * chain sequences enabled. The result of such sequences must be unwrapped
  9266. * with `_#value`.
  9267. *
  9268. * @static
  9269. * @memberOf _
  9270. * @since 1.3.0
  9271. * @category Seq
  9272. * @param {*} value The value to wrap.
  9273. * @returns {Object} Returns the new `lodash` wrapper instance.
  9274. * @example
  9275. *
  9276. * var users = [
  9277. * { 'user': 'barney', 'age': 36 },
  9278. * { 'user': 'fred', 'age': 40 },
  9279. * { 'user': 'pebbles', 'age': 1 }
  9280. * ];
  9281. *
  9282. * var youngest = _
  9283. * .chain(users)
  9284. * .sortBy('age')
  9285. * .map(function(o) {
  9286. * return o.user + ' is ' + o.age;
  9287. * })
  9288. * .head()
  9289. * .value();
  9290. * // => 'pebbles is 1'
  9291. */
  9292. function chain(value) {
  9293. var result = lodash(value);
  9294. result.__chain__ = true;
  9295. return result;
  9296. }
  9297. /**
  9298. * This method invokes `interceptor` and returns `value`. The interceptor
  9299. * is invoked with one argument; (value). The purpose of this method is to
  9300. * "tap into" a method chain sequence in order to modify intermediate results.
  9301. *
  9302. * @static
  9303. * @memberOf _
  9304. * @since 0.1.0
  9305. * @category Seq
  9306. * @param {*} value The value to provide to `interceptor`.
  9307. * @param {Function} interceptor The function to invoke.
  9308. * @returns {*} Returns `value`.
  9309. * @example
  9310. *
  9311. * _([1, 2, 3])
  9312. * .tap(function(array) {
  9313. * // Mutate input array.
  9314. * array.pop();
  9315. * })
  9316. * .reverse()
  9317. * .value();
  9318. * // => [2, 1]
  9319. */
  9320. function tap(value, interceptor) {
  9321. interceptor(value);
  9322. return value;
  9323. }
  9324. /**
  9325. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9326. * The purpose of this method is to "pass thru" values replacing intermediate
  9327. * results in a method chain sequence.
  9328. *
  9329. * @static
  9330. * @memberOf _
  9331. * @since 3.0.0
  9332. * @category Seq
  9333. * @param {*} value The value to provide to `interceptor`.
  9334. * @param {Function} interceptor The function to invoke.
  9335. * @returns {*} Returns the result of `interceptor`.
  9336. * @example
  9337. *
  9338. * _(' abc ')
  9339. * .chain()
  9340. * .trim()
  9341. * .thru(function(value) {
  9342. * return [value];
  9343. * })
  9344. * .value();
  9345. * // => ['abc']
  9346. */
  9347. function thru(value, interceptor) {
  9348. return interceptor(value);
  9349. }
  9350. /**
  9351. * This method is the wrapper version of `_.at`.
  9352. *
  9353. * @name at
  9354. * @memberOf _
  9355. * @since 1.0.0
  9356. * @category Seq
  9357. * @param {...(string|string[])} [paths] The property paths to pick.
  9358. * @returns {Object} Returns the new `lodash` wrapper instance.
  9359. * @example
  9360. *
  9361. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9362. *
  9363. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9364. * // => [3, 4]
  9365. */
  9366. var wrapperAt = flatRest(function(paths) {
  9367. var length = paths.length,
  9368. start = length ? paths[0] : 0,
  9369. value = this.__wrapped__,
  9370. interceptor = function(object) { return baseAt(object, paths); };
  9371. if (length > 1 || this.__actions__.length ||
  9372. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9373. return this.thru(interceptor);
  9374. }
  9375. value = value.slice(start, +start + (length ? 1 : 0));
  9376. value.__actions__.push({
  9377. 'func': thru,
  9378. 'args': [interceptor],
  9379. 'thisArg': undefined
  9380. });
  9381. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9382. if (length && !array.length) {
  9383. array.push(undefined);
  9384. }
  9385. return array;
  9386. });
  9387. });
  9388. /**
  9389. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9390. *
  9391. * @name chain
  9392. * @memberOf _
  9393. * @since 0.1.0
  9394. * @category Seq
  9395. * @returns {Object} Returns the new `lodash` wrapper instance.
  9396. * @example
  9397. *
  9398. * var users = [
  9399. * { 'user': 'barney', 'age': 36 },
  9400. * { 'user': 'fred', 'age': 40 }
  9401. * ];
  9402. *
  9403. * // A sequence without explicit chaining.
  9404. * _(users).head();
  9405. * // => { 'user': 'barney', 'age': 36 }
  9406. *
  9407. * // A sequence with explicit chaining.
  9408. * _(users)
  9409. * .chain()
  9410. * .head()
  9411. * .pick('user')
  9412. * .value();
  9413. * // => { 'user': 'barney' }
  9414. */
  9415. function wrapperChain() {
  9416. return chain(this);
  9417. }
  9418. /**
  9419. * Executes the chain sequence and returns the wrapped result.
  9420. *
  9421. * @name commit
  9422. * @memberOf _
  9423. * @since 3.2.0
  9424. * @category Seq
  9425. * @returns {Object} Returns the new `lodash` wrapper instance.
  9426. * @example
  9427. *
  9428. * var array = [1, 2];
  9429. * var wrapped = _(array).push(3);
  9430. *
  9431. * console.log(array);
  9432. * // => [1, 2]
  9433. *
  9434. * wrapped = wrapped.commit();
  9435. * console.log(array);
  9436. * // => [1, 2, 3]
  9437. *
  9438. * wrapped.last();
  9439. * // => 3
  9440. *
  9441. * console.log(array);
  9442. * // => [1, 2, 3]
  9443. */
  9444. function wrapperCommit() {
  9445. return new LodashWrapper(this.value(), this.__chain__);
  9446. }
  9447. /**
  9448. * Gets the next value on a wrapped object following the
  9449. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9450. *
  9451. * @name next
  9452. * @memberOf _
  9453. * @since 4.0.0
  9454. * @category Seq
  9455. * @returns {Object} Returns the next iterator value.
  9456. * @example
  9457. *
  9458. * var wrapped = _([1, 2]);
  9459. *
  9460. * wrapped.next();
  9461. * // => { 'done': false, 'value': 1 }
  9462. *
  9463. * wrapped.next();
  9464. * // => { 'done': false, 'value': 2 }
  9465. *
  9466. * wrapped.next();
  9467. * // => { 'done': true, 'value': undefined }
  9468. */
  9469. function wrapperNext() {
  9470. if (this.__values__ === undefined) {
  9471. this.__values__ = toArray(this.value());
  9472. }
  9473. var done = this.__index__ >= this.__values__.length,
  9474. value = done ? undefined : this.__values__[this.__index__++];
  9475. return { 'done': done, 'value': value };
  9476. }
  9477. /**
  9478. * Enables the wrapper to be iterable.
  9479. *
  9480. * @name Symbol.iterator
  9481. * @memberOf _
  9482. * @since 4.0.0
  9483. * @category Seq
  9484. * @returns {Object} Returns the wrapper object.
  9485. * @example
  9486. *
  9487. * var wrapped = _([1, 2]);
  9488. *
  9489. * wrapped[Symbol.iterator]() === wrapped;
  9490. * // => true
  9491. *
  9492. * Array.from(wrapped);
  9493. * // => [1, 2]
  9494. */
  9495. function wrapperToIterator() {
  9496. return this;
  9497. }
  9498. /**
  9499. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9500. *
  9501. * @name plant
  9502. * @memberOf _
  9503. * @since 3.2.0
  9504. * @category Seq
  9505. * @param {*} value The value to plant.
  9506. * @returns {Object} Returns the new `lodash` wrapper instance.
  9507. * @example
  9508. *
  9509. * function square(n) {
  9510. * return n * n;
  9511. * }
  9512. *
  9513. * var wrapped = _([1, 2]).map(square);
  9514. * var other = wrapped.plant([3, 4]);
  9515. *
  9516. * other.value();
  9517. * // => [9, 16]
  9518. *
  9519. * wrapped.value();
  9520. * // => [1, 4]
  9521. */
  9522. function wrapperPlant(value) {
  9523. var result,
  9524. parent = this;
  9525. while (parent instanceof baseLodash) {
  9526. var clone = wrapperClone(parent);
  9527. clone.__index__ = 0;
  9528. clone.__values__ = undefined;
  9529. if (result) {
  9530. previous.__wrapped__ = clone;
  9531. } else {
  9532. result = clone;
  9533. }
  9534. var previous = clone;
  9535. parent = parent.__wrapped__;
  9536. }
  9537. previous.__wrapped__ = value;
  9538. return result;
  9539. }
  9540. /**
  9541. * This method is the wrapper version of `_.reverse`.
  9542. *
  9543. * **Note:** This method mutates the wrapped array.
  9544. *
  9545. * @name reverse
  9546. * @memberOf _
  9547. * @since 0.1.0
  9548. * @category Seq
  9549. * @returns {Object} Returns the new `lodash` wrapper instance.
  9550. * @example
  9551. *
  9552. * var array = [1, 2, 3];
  9553. *
  9554. * _(array).reverse().value()
  9555. * // => [3, 2, 1]
  9556. *
  9557. * console.log(array);
  9558. * // => [3, 2, 1]
  9559. */
  9560. function wrapperReverse() {
  9561. var value = this.__wrapped__;
  9562. if (value instanceof LazyWrapper) {
  9563. var wrapped = value;
  9564. if (this.__actions__.length) {
  9565. wrapped = new LazyWrapper(this);
  9566. }
  9567. wrapped = wrapped.reverse();
  9568. wrapped.__actions__.push({
  9569. 'func': thru,
  9570. 'args': [reverse],
  9571. 'thisArg': undefined
  9572. });
  9573. return new LodashWrapper(wrapped, this.__chain__);
  9574. }
  9575. return this.thru(reverse);
  9576. }
  9577. /**
  9578. * Executes the chain sequence to resolve the unwrapped value.
  9579. *
  9580. * @name value
  9581. * @memberOf _
  9582. * @since 0.1.0
  9583. * @alias toJSON, valueOf
  9584. * @category Seq
  9585. * @returns {*} Returns the resolved unwrapped value.
  9586. * @example
  9587. *
  9588. * _([1, 2, 3]).value();
  9589. * // => [1, 2, 3]
  9590. */
  9591. function wrapperValue() {
  9592. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9593. }
  9594. /*------------------------------------------------------------------------*/
  9595. /**
  9596. * Creates an object composed of keys generated from the results of running
  9597. * each element of `collection` thru `iteratee`. The corresponding value of
  9598. * each key is the number of times the key was returned by `iteratee`. The
  9599. * iteratee is invoked with one argument: (value).
  9600. *
  9601. * @static
  9602. * @memberOf _
  9603. * @since 0.5.0
  9604. * @category Collection
  9605. * @param {Array|Object} collection The collection to iterate over.
  9606. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9607. * @returns {Object} Returns the composed aggregate object.
  9608. * @example
  9609. *
  9610. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9611. * // => { '4': 1, '6': 2 }
  9612. *
  9613. * // The `_.property` iteratee shorthand.
  9614. * _.countBy(['one', 'two', 'three'], 'length');
  9615. * // => { '3': 2, '5': 1 }
  9616. */
  9617. var countBy = createAggregator(function(result, value, key) {
  9618. if (hasOwnProperty.call(result, key)) {
  9619. ++result[key];
  9620. } else {
  9621. baseAssignValue(result, key, 1);
  9622. }
  9623. });
  9624. /**
  9625. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9626. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9627. * invoked with three arguments: (value, index|key, collection).
  9628. *
  9629. * **Note:** This method returns `true` for
  9630. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9631. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9632. * elements of empty collections.
  9633. *
  9634. * @static
  9635. * @memberOf _
  9636. * @since 0.1.0
  9637. * @category Collection
  9638. * @param {Array|Object} collection The collection to iterate over.
  9639. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9640. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9641. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9642. * else `false`.
  9643. * @example
  9644. *
  9645. * _.every([true, 1, null, 'yes'], Boolean);
  9646. * // => false
  9647. *
  9648. * var users = [
  9649. * { 'user': 'barney', 'age': 36, 'active': false },
  9650. * { 'user': 'fred', 'age': 40, 'active': false }
  9651. * ];
  9652. *
  9653. * // The `_.matches` iteratee shorthand.
  9654. * _.every(users, { 'user': 'barney', 'active': false });
  9655. * // => false
  9656. *
  9657. * // The `_.matchesProperty` iteratee shorthand.
  9658. * _.every(users, ['active', false]);
  9659. * // => true
  9660. *
  9661. * // The `_.property` iteratee shorthand.
  9662. * _.every(users, 'active');
  9663. * // => false
  9664. */
  9665. function every(collection, predicate, guard) {
  9666. var func = isArray(collection) ? arrayEvery : baseEvery;
  9667. if (guard && isIterateeCall(collection, predicate, guard)) {
  9668. predicate = undefined;
  9669. }
  9670. return func(collection, getIteratee(predicate, 3));
  9671. }
  9672. /**
  9673. * Iterates over elements of `collection`, returning an array of all elements
  9674. * `predicate` returns truthy for. The predicate is invoked with three
  9675. * arguments: (value, index|key, collection).
  9676. *
  9677. * **Note:** Unlike `_.remove`, this method returns a new array.
  9678. *
  9679. * @static
  9680. * @memberOf _
  9681. * @since 0.1.0
  9682. * @category Collection
  9683. * @param {Array|Object} collection The collection to iterate over.
  9684. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9685. * @returns {Array} Returns the new filtered array.
  9686. * @see _.reject
  9687. * @example
  9688. *
  9689. * var users = [
  9690. * { 'user': 'barney', 'age': 36, 'active': true },
  9691. * { 'user': 'fred', 'age': 40, 'active': false }
  9692. * ];
  9693. *
  9694. * _.filter(users, function(o) { return !o.active; });
  9695. * // => objects for ['fred']
  9696. *
  9697. * // The `_.matches` iteratee shorthand.
  9698. * _.filter(users, { 'age': 36, 'active': true });
  9699. * // => objects for ['barney']
  9700. *
  9701. * // The `_.matchesProperty` iteratee shorthand.
  9702. * _.filter(users, ['active', false]);
  9703. * // => objects for ['fred']
  9704. *
  9705. * // The `_.property` iteratee shorthand.
  9706. * _.filter(users, 'active');
  9707. * // => objects for ['barney']
  9708. *
  9709. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9710. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9711. * // => objects for ['fred', 'barney']
  9712. */
  9713. function filter(collection, predicate) {
  9714. var func = isArray(collection) ? arrayFilter : baseFilter;
  9715. return func(collection, getIteratee(predicate, 3));
  9716. }
  9717. /**
  9718. * Iterates over elements of `collection`, returning the first element
  9719. * `predicate` returns truthy for. The predicate is invoked with three
  9720. * arguments: (value, index|key, collection).
  9721. *
  9722. * @static
  9723. * @memberOf _
  9724. * @since 0.1.0
  9725. * @category Collection
  9726. * @param {Array|Object} collection The collection to inspect.
  9727. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9728. * @param {number} [fromIndex=0] The index to search from.
  9729. * @returns {*} Returns the matched element, else `undefined`.
  9730. * @example
  9731. *
  9732. * var users = [
  9733. * { 'user': 'barney', 'age': 36, 'active': true },
  9734. * { 'user': 'fred', 'age': 40, 'active': false },
  9735. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9736. * ];
  9737. *
  9738. * _.find(users, function(o) { return o.age < 40; });
  9739. * // => object for 'barney'
  9740. *
  9741. * // The `_.matches` iteratee shorthand.
  9742. * _.find(users, { 'age': 1, 'active': true });
  9743. * // => object for 'pebbles'
  9744. *
  9745. * // The `_.matchesProperty` iteratee shorthand.
  9746. * _.find(users, ['active', false]);
  9747. * // => object for 'fred'
  9748. *
  9749. * // The `_.property` iteratee shorthand.
  9750. * _.find(users, 'active');
  9751. * // => object for 'barney'
  9752. */
  9753. var find = createFind(findIndex);
  9754. /**
  9755. * This method is like `_.find` except that it iterates over elements of
  9756. * `collection` from right to left.
  9757. *
  9758. * @static
  9759. * @memberOf _
  9760. * @since 2.0.0
  9761. * @category Collection
  9762. * @param {Array|Object} collection The collection to inspect.
  9763. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9764. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9765. * @returns {*} Returns the matched element, else `undefined`.
  9766. * @example
  9767. *
  9768. * _.findLast([1, 2, 3, 4], function(n) {
  9769. * return n % 2 == 1;
  9770. * });
  9771. * // => 3
  9772. */
  9773. var findLast = createFind(findLastIndex);
  9774. /**
  9775. * Creates a flattened array of values by running each element in `collection`
  9776. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9777. * with three arguments: (value, index|key, collection).
  9778. *
  9779. * @static
  9780. * @memberOf _
  9781. * @since 4.0.0
  9782. * @category Collection
  9783. * @param {Array|Object} collection The collection to iterate over.
  9784. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9785. * @returns {Array} Returns the new flattened array.
  9786. * @example
  9787. *
  9788. * function duplicate(n) {
  9789. * return [n, n];
  9790. * }
  9791. *
  9792. * _.flatMap([1, 2], duplicate);
  9793. * // => [1, 1, 2, 2]
  9794. */
  9795. function flatMap(collection, iteratee) {
  9796. return baseFlatten(map(collection, iteratee), 1);
  9797. }
  9798. /**
  9799. * This method is like `_.flatMap` except that it recursively flattens the
  9800. * mapped results.
  9801. *
  9802. * @static
  9803. * @memberOf _
  9804. * @since 4.7.0
  9805. * @category Collection
  9806. * @param {Array|Object} collection The collection to iterate over.
  9807. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9808. * @returns {Array} Returns the new flattened array.
  9809. * @example
  9810. *
  9811. * function duplicate(n) {
  9812. * return [[[n, n]]];
  9813. * }
  9814. *
  9815. * _.flatMapDeep([1, 2], duplicate);
  9816. * // => [1, 1, 2, 2]
  9817. */
  9818. function flatMapDeep(collection, iteratee) {
  9819. return baseFlatten(map(collection, iteratee), INFINITY);
  9820. }
  9821. /**
  9822. * This method is like `_.flatMap` except that it recursively flattens the
  9823. * mapped results up to `depth` times.
  9824. *
  9825. * @static
  9826. * @memberOf _
  9827. * @since 4.7.0
  9828. * @category Collection
  9829. * @param {Array|Object} collection The collection to iterate over.
  9830. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9831. * @param {number} [depth=1] The maximum recursion depth.
  9832. * @returns {Array} Returns the new flattened array.
  9833. * @example
  9834. *
  9835. * function duplicate(n) {
  9836. * return [[[n, n]]];
  9837. * }
  9838. *
  9839. * _.flatMapDepth([1, 2], duplicate, 2);
  9840. * // => [[1, 1], [2, 2]]
  9841. */
  9842. function flatMapDepth(collection, iteratee, depth) {
  9843. depth = depth === undefined ? 1 : toInteger(depth);
  9844. return baseFlatten(map(collection, iteratee), depth);
  9845. }
  9846. /**
  9847. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9848. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9849. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9850. *
  9851. * **Note:** As with other "Collections" methods, objects with a "length"
  9852. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9853. * or `_.forOwn` for object iteration.
  9854. *
  9855. * @static
  9856. * @memberOf _
  9857. * @since 0.1.0
  9858. * @alias each
  9859. * @category Collection
  9860. * @param {Array|Object} collection The collection to iterate over.
  9861. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9862. * @returns {Array|Object} Returns `collection`.
  9863. * @see _.forEachRight
  9864. * @example
  9865. *
  9866. * _.forEach([1, 2], function(value) {
  9867. * console.log(value);
  9868. * });
  9869. * // => Logs `1` then `2`.
  9870. *
  9871. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9872. * console.log(key);
  9873. * });
  9874. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9875. */
  9876. function forEach(collection, iteratee) {
  9877. var func = isArray(collection) ? arrayEach : baseEach;
  9878. return func(collection, getIteratee(iteratee, 3));
  9879. }
  9880. /**
  9881. * This method is like `_.forEach` except that it iterates over elements of
  9882. * `collection` from right to left.
  9883. *
  9884. * @static
  9885. * @memberOf _
  9886. * @since 2.0.0
  9887. * @alias eachRight
  9888. * @category Collection
  9889. * @param {Array|Object} collection The collection to iterate over.
  9890. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9891. * @returns {Array|Object} Returns `collection`.
  9892. * @see _.forEach
  9893. * @example
  9894. *
  9895. * _.forEachRight([1, 2], function(value) {
  9896. * console.log(value);
  9897. * });
  9898. * // => Logs `2` then `1`.
  9899. */
  9900. function forEachRight(collection, iteratee) {
  9901. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9902. return func(collection, getIteratee(iteratee, 3));
  9903. }
  9904. /**
  9905. * Creates an object composed of keys generated from the results of running
  9906. * each element of `collection` thru `iteratee`. The order of grouped values
  9907. * is determined by the order they occur in `collection`. The corresponding
  9908. * value of each key is an array of elements responsible for generating the
  9909. * key. The iteratee is invoked with one argument: (value).
  9910. *
  9911. * @static
  9912. * @memberOf _
  9913. * @since 0.1.0
  9914. * @category Collection
  9915. * @param {Array|Object} collection The collection to iterate over.
  9916. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9917. * @returns {Object} Returns the composed aggregate object.
  9918. * @example
  9919. *
  9920. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9921. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9922. *
  9923. * // The `_.property` iteratee shorthand.
  9924. * _.groupBy(['one', 'two', 'three'], 'length');
  9925. * // => { '3': ['one', 'two'], '5': ['three'] }
  9926. */
  9927. var groupBy = createAggregator(function(result, value, key) {
  9928. if (hasOwnProperty.call(result, key)) {
  9929. result[key].push(value);
  9930. } else {
  9931. baseAssignValue(result, key, [value]);
  9932. }
  9933. });
  9934. /**
  9935. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9936. * checked for a substring of `value`, otherwise
  9937. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9938. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9939. * the offset from the end of `collection`.
  9940. *
  9941. * @static
  9942. * @memberOf _
  9943. * @since 0.1.0
  9944. * @category Collection
  9945. * @param {Array|Object|string} collection The collection to inspect.
  9946. * @param {*} value The value to search for.
  9947. * @param {number} [fromIndex=0] The index to search from.
  9948. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9949. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9950. * @example
  9951. *
  9952. * _.includes([1, 2, 3], 1);
  9953. * // => true
  9954. *
  9955. * _.includes([1, 2, 3], 1, 2);
  9956. * // => false
  9957. *
  9958. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9959. * // => true
  9960. *
  9961. * _.includes('abcd', 'bc');
  9962. * // => true
  9963. */
  9964. function includes(collection, value, fromIndex, guard) {
  9965. collection = isArrayLike(collection) ? collection : values(collection);
  9966. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9967. var length = collection.length;
  9968. if (fromIndex < 0) {
  9969. fromIndex = nativeMax(length + fromIndex, 0);
  9970. }
  9971. return isString(collection)
  9972. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9973. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9974. }
  9975. /**
  9976. * Invokes the method at `path` of each element in `collection`, returning
  9977. * an array of the results of each invoked method. Any additional arguments
  9978. * are provided to each invoked method. If `path` is a function, it's invoked
  9979. * for, and `this` bound to, each element in `collection`.
  9980. *
  9981. * @static
  9982. * @memberOf _
  9983. * @since 4.0.0
  9984. * @category Collection
  9985. * @param {Array|Object} collection The collection to iterate over.
  9986. * @param {Array|Function|string} path The path of the method to invoke or
  9987. * the function invoked per iteration.
  9988. * @param {...*} [args] The arguments to invoke each method with.
  9989. * @returns {Array} Returns the array of results.
  9990. * @example
  9991. *
  9992. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9993. * // => [[1, 5, 7], [1, 2, 3]]
  9994. *
  9995. * _.invokeMap([123, 456], String.prototype.split, '');
  9996. * // => [['1', '2', '3'], ['4', '5', '6']]
  9997. */
  9998. var invokeMap = baseRest(function(collection, path, args) {
  9999. var index = -1,
  10000. isFunc = typeof path == 'function',
  10001. result = isArrayLike(collection) ? Array(collection.length) : [];
  10002. baseEach(collection, function(value) {
  10003. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10004. });
  10005. return result;
  10006. });
  10007. /**
  10008. * Creates an object composed of keys generated from the results of running
  10009. * each element of `collection` thru `iteratee`. The corresponding value of
  10010. * each key is the last element responsible for generating the key. The
  10011. * iteratee is invoked with one argument: (value).
  10012. *
  10013. * @static
  10014. * @memberOf _
  10015. * @since 4.0.0
  10016. * @category Collection
  10017. * @param {Array|Object} collection The collection to iterate over.
  10018. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10019. * @returns {Object} Returns the composed aggregate object.
  10020. * @example
  10021. *
  10022. * var array = [
  10023. * { 'dir': 'left', 'code': 97 },
  10024. * { 'dir': 'right', 'code': 100 }
  10025. * ];
  10026. *
  10027. * _.keyBy(array, function(o) {
  10028. * return String.fromCharCode(o.code);
  10029. * });
  10030. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10031. *
  10032. * _.keyBy(array, 'dir');
  10033. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10034. */
  10035. var keyBy = createAggregator(function(result, value, key) {
  10036. baseAssignValue(result, key, value);
  10037. });
  10038. /**
  10039. * Creates an array of values by running each element in `collection` thru
  10040. * `iteratee`. The iteratee is invoked with three arguments:
  10041. * (value, index|key, collection).
  10042. *
  10043. * Many lodash methods are guarded to work as iteratees for methods like
  10044. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10045. *
  10046. * The guarded methods are:
  10047. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10048. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10049. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10050. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10051. *
  10052. * @static
  10053. * @memberOf _
  10054. * @since 0.1.0
  10055. * @category Collection
  10056. * @param {Array|Object} collection The collection to iterate over.
  10057. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10058. * @returns {Array} Returns the new mapped array.
  10059. * @example
  10060. *
  10061. * function square(n) {
  10062. * return n * n;
  10063. * }
  10064. *
  10065. * _.map([4, 8], square);
  10066. * // => [16, 64]
  10067. *
  10068. * _.map({ 'a': 4, 'b': 8 }, square);
  10069. * // => [16, 64] (iteration order is not guaranteed)
  10070. *
  10071. * var users = [
  10072. * { 'user': 'barney' },
  10073. * { 'user': 'fred' }
  10074. * ];
  10075. *
  10076. * // The `_.property` iteratee shorthand.
  10077. * _.map(users, 'user');
  10078. * // => ['barney', 'fred']
  10079. */
  10080. function map(collection, iteratee) {
  10081. var func = isArray(collection) ? arrayMap : baseMap;
  10082. return func(collection, getIteratee(iteratee, 3));
  10083. }
  10084. /**
  10085. * This method is like `_.sortBy` except that it allows specifying the sort
  10086. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10087. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10088. * descending or "asc" for ascending sort order of corresponding values.
  10089. *
  10090. * @static
  10091. * @memberOf _
  10092. * @since 4.0.0
  10093. * @category Collection
  10094. * @param {Array|Object} collection The collection to iterate over.
  10095. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10096. * The iteratees to sort by.
  10097. * @param {string[]} [orders] The sort orders of `iteratees`.
  10098. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10099. * @returns {Array} Returns the new sorted array.
  10100. * @example
  10101. *
  10102. * var users = [
  10103. * { 'user': 'fred', 'age': 48 },
  10104. * { 'user': 'barney', 'age': 34 },
  10105. * { 'user': 'fred', 'age': 40 },
  10106. * { 'user': 'barney', 'age': 36 }
  10107. * ];
  10108. *
  10109. * // Sort by `user` in ascending order and by `age` in descending order.
  10110. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10111. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10112. */
  10113. function orderBy(collection, iteratees, orders, guard) {
  10114. if (collection == null) {
  10115. return [];
  10116. }
  10117. if (!isArray(iteratees)) {
  10118. iteratees = iteratees == null ? [] : [iteratees];
  10119. }
  10120. orders = guard ? undefined : orders;
  10121. if (!isArray(orders)) {
  10122. orders = orders == null ? [] : [orders];
  10123. }
  10124. return baseOrderBy(collection, iteratees, orders);
  10125. }
  10126. /**
  10127. * Creates an array of elements split into two groups, the first of which
  10128. * contains elements `predicate` returns truthy for, the second of which
  10129. * contains elements `predicate` returns falsey for. The predicate is
  10130. * invoked with one argument: (value).
  10131. *
  10132. * @static
  10133. * @memberOf _
  10134. * @since 3.0.0
  10135. * @category Collection
  10136. * @param {Array|Object} collection The collection to iterate over.
  10137. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10138. * @returns {Array} Returns the array of grouped elements.
  10139. * @example
  10140. *
  10141. * var users = [
  10142. * { 'user': 'barney', 'age': 36, 'active': false },
  10143. * { 'user': 'fred', 'age': 40, 'active': true },
  10144. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10145. * ];
  10146. *
  10147. * _.partition(users, function(o) { return o.active; });
  10148. * // => objects for [['fred'], ['barney', 'pebbles']]
  10149. *
  10150. * // The `_.matches` iteratee shorthand.
  10151. * _.partition(users, { 'age': 1, 'active': false });
  10152. * // => objects for [['pebbles'], ['barney', 'fred']]
  10153. *
  10154. * // The `_.matchesProperty` iteratee shorthand.
  10155. * _.partition(users, ['active', false]);
  10156. * // => objects for [['barney', 'pebbles'], ['fred']]
  10157. *
  10158. * // The `_.property` iteratee shorthand.
  10159. * _.partition(users, 'active');
  10160. * // => objects for [['fred'], ['barney', 'pebbles']]
  10161. */
  10162. var partition = createAggregator(function(result, value, key) {
  10163. result[key ? 0 : 1].push(value);
  10164. }, function() { return [[], []]; });
  10165. /**
  10166. * Reduces `collection` to a value which is the accumulated result of running
  10167. * each element in `collection` thru `iteratee`, where each successive
  10168. * invocation is supplied the return value of the previous. If `accumulator`
  10169. * is not given, the first element of `collection` is used as the initial
  10170. * value. The iteratee is invoked with four arguments:
  10171. * (accumulator, value, index|key, collection).
  10172. *
  10173. * Many lodash methods are guarded to work as iteratees for methods like
  10174. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10175. *
  10176. * The guarded methods are:
  10177. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10178. * and `sortBy`
  10179. *
  10180. * @static
  10181. * @memberOf _
  10182. * @since 0.1.0
  10183. * @category Collection
  10184. * @param {Array|Object} collection The collection to iterate over.
  10185. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10186. * @param {*} [accumulator] The initial value.
  10187. * @returns {*} Returns the accumulated value.
  10188. * @see _.reduceRight
  10189. * @example
  10190. *
  10191. * _.reduce([1, 2], function(sum, n) {
  10192. * return sum + n;
  10193. * }, 0);
  10194. * // => 3
  10195. *
  10196. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10197. * (result[value] || (result[value] = [])).push(key);
  10198. * return result;
  10199. * }, {});
  10200. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10201. */
  10202. function reduce(collection, iteratee, accumulator) {
  10203. var func = isArray(collection) ? arrayReduce : baseReduce,
  10204. initAccum = arguments.length < 3;
  10205. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10206. }
  10207. /**
  10208. * This method is like `_.reduce` except that it iterates over elements of
  10209. * `collection` from right to left.
  10210. *
  10211. * @static
  10212. * @memberOf _
  10213. * @since 0.1.0
  10214. * @category Collection
  10215. * @param {Array|Object} collection The collection to iterate over.
  10216. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10217. * @param {*} [accumulator] The initial value.
  10218. * @returns {*} Returns the accumulated value.
  10219. * @see _.reduce
  10220. * @example
  10221. *
  10222. * var array = [[0, 1], [2, 3], [4, 5]];
  10223. *
  10224. * _.reduceRight(array, function(flattened, other) {
  10225. * return flattened.concat(other);
  10226. * }, []);
  10227. * // => [4, 5, 2, 3, 0, 1]
  10228. */
  10229. function reduceRight(collection, iteratee, accumulator) {
  10230. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10231. initAccum = arguments.length < 3;
  10232. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10233. }
  10234. /**
  10235. * The opposite of `_.filter`; this method returns the elements of `collection`
  10236. * that `predicate` does **not** return truthy for.
  10237. *
  10238. * @static
  10239. * @memberOf _
  10240. * @since 0.1.0
  10241. * @category Collection
  10242. * @param {Array|Object} collection The collection to iterate over.
  10243. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10244. * @returns {Array} Returns the new filtered array.
  10245. * @see _.filter
  10246. * @example
  10247. *
  10248. * var users = [
  10249. * { 'user': 'barney', 'age': 36, 'active': false },
  10250. * { 'user': 'fred', 'age': 40, 'active': true }
  10251. * ];
  10252. *
  10253. * _.reject(users, function(o) { return !o.active; });
  10254. * // => objects for ['fred']
  10255. *
  10256. * // The `_.matches` iteratee shorthand.
  10257. * _.reject(users, { 'age': 40, 'active': true });
  10258. * // => objects for ['barney']
  10259. *
  10260. * // The `_.matchesProperty` iteratee shorthand.
  10261. * _.reject(users, ['active', false]);
  10262. * // => objects for ['fred']
  10263. *
  10264. * // The `_.property` iteratee shorthand.
  10265. * _.reject(users, 'active');
  10266. * // => objects for ['barney']
  10267. */
  10268. function reject(collection, predicate) {
  10269. var func = isArray(collection) ? arrayFilter : baseFilter;
  10270. return func(collection, negate(getIteratee(predicate, 3)));
  10271. }
  10272. /**
  10273. * Gets a random element from `collection`.
  10274. *
  10275. * @static
  10276. * @memberOf _
  10277. * @since 2.0.0
  10278. * @category Collection
  10279. * @param {Array|Object} collection The collection to sample.
  10280. * @returns {*} Returns the random element.
  10281. * @example
  10282. *
  10283. * _.sample([1, 2, 3, 4]);
  10284. * // => 2
  10285. */
  10286. function sample(collection) {
  10287. var func = isArray(collection) ? arraySample : baseSample;
  10288. return func(collection);
  10289. }
  10290. /**
  10291. * Gets `n` random elements at unique keys from `collection` up to the
  10292. * size of `collection`.
  10293. *
  10294. * @static
  10295. * @memberOf _
  10296. * @since 4.0.0
  10297. * @category Collection
  10298. * @param {Array|Object} collection The collection to sample.
  10299. * @param {number} [n=1] The number of elements to sample.
  10300. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10301. * @returns {Array} Returns the random elements.
  10302. * @example
  10303. *
  10304. * _.sampleSize([1, 2, 3], 2);
  10305. * // => [3, 1]
  10306. *
  10307. * _.sampleSize([1, 2, 3], 4);
  10308. * // => [2, 3, 1]
  10309. */
  10310. function sampleSize(collection, n, guard) {
  10311. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10312. n = 1;
  10313. } else {
  10314. n = toInteger(n);
  10315. }
  10316. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10317. return func(collection, n);
  10318. }
  10319. /**
  10320. * Creates an array of shuffled values, using a version of the
  10321. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10322. *
  10323. * @static
  10324. * @memberOf _
  10325. * @since 0.1.0
  10326. * @category Collection
  10327. * @param {Array|Object} collection The collection to shuffle.
  10328. * @returns {Array} Returns the new shuffled array.
  10329. * @example
  10330. *
  10331. * _.shuffle([1, 2, 3, 4]);
  10332. * // => [4, 1, 3, 2]
  10333. */
  10334. function shuffle(collection) {
  10335. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10336. return func(collection);
  10337. }
  10338. /**
  10339. * Gets the size of `collection` by returning its length for array-like
  10340. * values or the number of own enumerable string keyed properties for objects.
  10341. *
  10342. * @static
  10343. * @memberOf _
  10344. * @since 0.1.0
  10345. * @category Collection
  10346. * @param {Array|Object|string} collection The collection to inspect.
  10347. * @returns {number} Returns the collection size.
  10348. * @example
  10349. *
  10350. * _.size([1, 2, 3]);
  10351. * // => 3
  10352. *
  10353. * _.size({ 'a': 1, 'b': 2 });
  10354. * // => 2
  10355. *
  10356. * _.size('pebbles');
  10357. * // => 7
  10358. */
  10359. function size(collection) {
  10360. if (collection == null) {
  10361. return 0;
  10362. }
  10363. if (isArrayLike(collection)) {
  10364. return isString(collection) ? stringSize(collection) : collection.length;
  10365. }
  10366. var tag = getTag(collection);
  10367. if (tag == mapTag || tag == setTag) {
  10368. return collection.size;
  10369. }
  10370. return baseKeys(collection).length;
  10371. }
  10372. /**
  10373. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10374. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10375. * invoked with three arguments: (value, index|key, collection).
  10376. *
  10377. * @static
  10378. * @memberOf _
  10379. * @since 0.1.0
  10380. * @category Collection
  10381. * @param {Array|Object} collection The collection to iterate over.
  10382. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10383. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10384. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10385. * else `false`.
  10386. * @example
  10387. *
  10388. * _.some([null, 0, 'yes', false], Boolean);
  10389. * // => true
  10390. *
  10391. * var users = [
  10392. * { 'user': 'barney', 'active': true },
  10393. * { 'user': 'fred', 'active': false }
  10394. * ];
  10395. *
  10396. * // The `_.matches` iteratee shorthand.
  10397. * _.some(users, { 'user': 'barney', 'active': false });
  10398. * // => false
  10399. *
  10400. * // The `_.matchesProperty` iteratee shorthand.
  10401. * _.some(users, ['active', false]);
  10402. * // => true
  10403. *
  10404. * // The `_.property` iteratee shorthand.
  10405. * _.some(users, 'active');
  10406. * // => true
  10407. */
  10408. function some(collection, predicate, guard) {
  10409. var func = isArray(collection) ? arraySome : baseSome;
  10410. if (guard && isIterateeCall(collection, predicate, guard)) {
  10411. predicate = undefined;
  10412. }
  10413. return func(collection, getIteratee(predicate, 3));
  10414. }
  10415. /**
  10416. * Creates an array of elements, sorted in ascending order by the results of
  10417. * running each element in a collection thru each iteratee. This method
  10418. * performs a stable sort, that is, it preserves the original sort order of
  10419. * equal elements. The iteratees are invoked with one argument: (value).
  10420. *
  10421. * @static
  10422. * @memberOf _
  10423. * @since 0.1.0
  10424. * @category Collection
  10425. * @param {Array|Object} collection The collection to iterate over.
  10426. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10427. * The iteratees to sort by.
  10428. * @returns {Array} Returns the new sorted array.
  10429. * @example
  10430. *
  10431. * var users = [
  10432. * { 'user': 'fred', 'age': 48 },
  10433. * { 'user': 'barney', 'age': 36 },
  10434. * { 'user': 'fred', 'age': 30 },
  10435. * { 'user': 'barney', 'age': 34 }
  10436. * ];
  10437. *
  10438. * _.sortBy(users, [function(o) { return o.user; }]);
  10439. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10440. *
  10441. * _.sortBy(users, ['user', 'age']);
  10442. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10443. */
  10444. var sortBy = baseRest(function(collection, iteratees) {
  10445. if (collection == null) {
  10446. return [];
  10447. }
  10448. var length = iteratees.length;
  10449. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10450. iteratees = [];
  10451. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10452. iteratees = [iteratees[0]];
  10453. }
  10454. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10455. });
  10456. /*------------------------------------------------------------------------*/
  10457. /**
  10458. * Gets the timestamp of the number of milliseconds that have elapsed since
  10459. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10460. *
  10461. * @static
  10462. * @memberOf _
  10463. * @since 2.4.0
  10464. * @category Date
  10465. * @returns {number} Returns the timestamp.
  10466. * @example
  10467. *
  10468. * _.defer(function(stamp) {
  10469. * console.log(_.now() - stamp);
  10470. * }, _.now());
  10471. * // => Logs the number of milliseconds it took for the deferred invocation.
  10472. */
  10473. var now = ctxNow || function() {
  10474. return root.Date.now();
  10475. };
  10476. /*------------------------------------------------------------------------*/
  10477. /**
  10478. * The opposite of `_.before`; this method creates a function that invokes
  10479. * `func` once it's called `n` or more times.
  10480. *
  10481. * @static
  10482. * @memberOf _
  10483. * @since 0.1.0
  10484. * @category Function
  10485. * @param {number} n The number of calls before `func` is invoked.
  10486. * @param {Function} func The function to restrict.
  10487. * @returns {Function} Returns the new restricted function.
  10488. * @example
  10489. *
  10490. * var saves = ['profile', 'settings'];
  10491. *
  10492. * var done = _.after(saves.length, function() {
  10493. * console.log('done saving!');
  10494. * });
  10495. *
  10496. * _.forEach(saves, function(type) {
  10497. * asyncSave({ 'type': type, 'complete': done });
  10498. * });
  10499. * // => Logs 'done saving!' after the two async saves have completed.
  10500. */
  10501. function after(n, func) {
  10502. if (typeof func != 'function') {
  10503. throw new TypeError(FUNC_ERROR_TEXT);
  10504. }
  10505. n = toInteger(n);
  10506. return function() {
  10507. if (--n < 1) {
  10508. return func.apply(this, arguments);
  10509. }
  10510. };
  10511. }
  10512. /**
  10513. * Creates a function that invokes `func`, with up to `n` arguments,
  10514. * ignoring any additional arguments.
  10515. *
  10516. * @static
  10517. * @memberOf _
  10518. * @since 3.0.0
  10519. * @category Function
  10520. * @param {Function} func The function to cap arguments for.
  10521. * @param {number} [n=func.length] The arity cap.
  10522. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10523. * @returns {Function} Returns the new capped function.
  10524. * @example
  10525. *
  10526. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10527. * // => [6, 8, 10]
  10528. */
  10529. function ary(func, n, guard) {
  10530. n = guard ? undefined : n;
  10531. n = (func && n == null) ? func.length : n;
  10532. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10533. }
  10534. /**
  10535. * Creates a function that invokes `func`, with the `this` binding and arguments
  10536. * of the created function, while it's called less than `n` times. Subsequent
  10537. * calls to the created function return the result of the last `func` invocation.
  10538. *
  10539. * @static
  10540. * @memberOf _
  10541. * @since 3.0.0
  10542. * @category Function
  10543. * @param {number} n The number of calls at which `func` is no longer invoked.
  10544. * @param {Function} func The function to restrict.
  10545. * @returns {Function} Returns the new restricted function.
  10546. * @example
  10547. *
  10548. * jQuery(element).on('click', _.before(5, addContactToList));
  10549. * // => Allows adding up to 4 contacts to the list.
  10550. */
  10551. function before(n, func) {
  10552. var result;
  10553. if (typeof func != 'function') {
  10554. throw new TypeError(FUNC_ERROR_TEXT);
  10555. }
  10556. n = toInteger(n);
  10557. return function() {
  10558. if (--n > 0) {
  10559. result = func.apply(this, arguments);
  10560. }
  10561. if (n <= 1) {
  10562. func = undefined;
  10563. }
  10564. return result;
  10565. };
  10566. }
  10567. /**
  10568. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10569. * and `partials` prepended to the arguments it receives.
  10570. *
  10571. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10572. * may be used as a placeholder for partially applied arguments.
  10573. *
  10574. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10575. * property of bound functions.
  10576. *
  10577. * @static
  10578. * @memberOf _
  10579. * @since 0.1.0
  10580. * @category Function
  10581. * @param {Function} func The function to bind.
  10582. * @param {*} thisArg The `this` binding of `func`.
  10583. * @param {...*} [partials] The arguments to be partially applied.
  10584. * @returns {Function} Returns the new bound function.
  10585. * @example
  10586. *
  10587. * function greet(greeting, punctuation) {
  10588. * return greeting + ' ' + this.user + punctuation;
  10589. * }
  10590. *
  10591. * var object = { 'user': 'fred' };
  10592. *
  10593. * var bound = _.bind(greet, object, 'hi');
  10594. * bound('!');
  10595. * // => 'hi fred!'
  10596. *
  10597. * // Bound with placeholders.
  10598. * var bound = _.bind(greet, object, _, '!');
  10599. * bound('hi');
  10600. * // => 'hi fred!'
  10601. */
  10602. var bind = baseRest(function(func, thisArg, partials) {
  10603. var bitmask = WRAP_BIND_FLAG;
  10604. if (partials.length) {
  10605. var holders = replaceHolders(partials, getHolder(bind));
  10606. bitmask |= WRAP_PARTIAL_FLAG;
  10607. }
  10608. return createWrap(func, bitmask, thisArg, partials, holders);
  10609. });
  10610. /**
  10611. * Creates a function that invokes the method at `object[key]` with `partials`
  10612. * prepended to the arguments it receives.
  10613. *
  10614. * This method differs from `_.bind` by allowing bound functions to reference
  10615. * methods that may be redefined or don't yet exist. See
  10616. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10617. * for more details.
  10618. *
  10619. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10620. * builds, may be used as a placeholder for partially applied arguments.
  10621. *
  10622. * @static
  10623. * @memberOf _
  10624. * @since 0.10.0
  10625. * @category Function
  10626. * @param {Object} object The object to invoke the method on.
  10627. * @param {string} key The key of the method.
  10628. * @param {...*} [partials] The arguments to be partially applied.
  10629. * @returns {Function} Returns the new bound function.
  10630. * @example
  10631. *
  10632. * var object = {
  10633. * 'user': 'fred',
  10634. * 'greet': function(greeting, punctuation) {
  10635. * return greeting + ' ' + this.user + punctuation;
  10636. * }
  10637. * };
  10638. *
  10639. * var bound = _.bindKey(object, 'greet', 'hi');
  10640. * bound('!');
  10641. * // => 'hi fred!'
  10642. *
  10643. * object.greet = function(greeting, punctuation) {
  10644. * return greeting + 'ya ' + this.user + punctuation;
  10645. * };
  10646. *
  10647. * bound('!');
  10648. * // => 'hiya fred!'
  10649. *
  10650. * // Bound with placeholders.
  10651. * var bound = _.bindKey(object, 'greet', _, '!');
  10652. * bound('hi');
  10653. * // => 'hiya fred!'
  10654. */
  10655. var bindKey = baseRest(function(object, key, partials) {
  10656. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10657. if (partials.length) {
  10658. var holders = replaceHolders(partials, getHolder(bindKey));
  10659. bitmask |= WRAP_PARTIAL_FLAG;
  10660. }
  10661. return createWrap(key, bitmask, object, partials, holders);
  10662. });
  10663. /**
  10664. * Creates a function that accepts arguments of `func` and either invokes
  10665. * `func` returning its result, if at least `arity` number of arguments have
  10666. * been provided, or returns a function that accepts the remaining `func`
  10667. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10668. * is not sufficient.
  10669. *
  10670. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10671. * may be used as a placeholder for provided arguments.
  10672. *
  10673. * **Note:** This method doesn't set the "length" property of curried functions.
  10674. *
  10675. * @static
  10676. * @memberOf _
  10677. * @since 2.0.0
  10678. * @category Function
  10679. * @param {Function} func The function to curry.
  10680. * @param {number} [arity=func.length] The arity of `func`.
  10681. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10682. * @returns {Function} Returns the new curried function.
  10683. * @example
  10684. *
  10685. * var abc = function(a, b, c) {
  10686. * return [a, b, c];
  10687. * };
  10688. *
  10689. * var curried = _.curry(abc);
  10690. *
  10691. * curried(1)(2)(3);
  10692. * // => [1, 2, 3]
  10693. *
  10694. * curried(1, 2)(3);
  10695. * // => [1, 2, 3]
  10696. *
  10697. * curried(1, 2, 3);
  10698. * // => [1, 2, 3]
  10699. *
  10700. * // Curried with placeholders.
  10701. * curried(1)(_, 3)(2);
  10702. * // => [1, 2, 3]
  10703. */
  10704. function curry(func, arity, guard) {
  10705. arity = guard ? undefined : arity;
  10706. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10707. result.placeholder = curry.placeholder;
  10708. return result;
  10709. }
  10710. /**
  10711. * This method is like `_.curry` except that arguments are applied to `func`
  10712. * in the manner of `_.partialRight` instead of `_.partial`.
  10713. *
  10714. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10715. * builds, may be used as a placeholder for provided arguments.
  10716. *
  10717. * **Note:** This method doesn't set the "length" property of curried functions.
  10718. *
  10719. * @static
  10720. * @memberOf _
  10721. * @since 3.0.0
  10722. * @category Function
  10723. * @param {Function} func The function to curry.
  10724. * @param {number} [arity=func.length] The arity of `func`.
  10725. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10726. * @returns {Function} Returns the new curried function.
  10727. * @example
  10728. *
  10729. * var abc = function(a, b, c) {
  10730. * return [a, b, c];
  10731. * };
  10732. *
  10733. * var curried = _.curryRight(abc);
  10734. *
  10735. * curried(3)(2)(1);
  10736. * // => [1, 2, 3]
  10737. *
  10738. * curried(2, 3)(1);
  10739. * // => [1, 2, 3]
  10740. *
  10741. * curried(1, 2, 3);
  10742. * // => [1, 2, 3]
  10743. *
  10744. * // Curried with placeholders.
  10745. * curried(3)(1, _)(2);
  10746. * // => [1, 2, 3]
  10747. */
  10748. function curryRight(func, arity, guard) {
  10749. arity = guard ? undefined : arity;
  10750. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10751. result.placeholder = curryRight.placeholder;
  10752. return result;
  10753. }
  10754. /**
  10755. * Creates a debounced function that delays invoking `func` until after `wait`
  10756. * milliseconds have elapsed since the last time the debounced function was
  10757. * invoked. The debounced function comes with a `cancel` method to cancel
  10758. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10759. * Provide `options` to indicate whether `func` should be invoked on the
  10760. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10761. * with the last arguments provided to the debounced function. Subsequent
  10762. * calls to the debounced function return the result of the last `func`
  10763. * invocation.
  10764. *
  10765. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10766. * invoked on the trailing edge of the timeout only if the debounced function
  10767. * is invoked more than once during the `wait` timeout.
  10768. *
  10769. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10770. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10771. *
  10772. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10773. * for details over the differences between `_.debounce` and `_.throttle`.
  10774. *
  10775. * @static
  10776. * @memberOf _
  10777. * @since 0.1.0
  10778. * @category Function
  10779. * @param {Function} func The function to debounce.
  10780. * @param {number} [wait=0] The number of milliseconds to delay.
  10781. * @param {Object} [options={}] The options object.
  10782. * @param {boolean} [options.leading=false]
  10783. * Specify invoking on the leading edge of the timeout.
  10784. * @param {number} [options.maxWait]
  10785. * The maximum time `func` is allowed to be delayed before it's invoked.
  10786. * @param {boolean} [options.trailing=true]
  10787. * Specify invoking on the trailing edge of the timeout.
  10788. * @returns {Function} Returns the new debounced function.
  10789. * @example
  10790. *
  10791. * // Avoid costly calculations while the window size is in flux.
  10792. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10793. *
  10794. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10795. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10796. * 'leading': true,
  10797. * 'trailing': false
  10798. * }));
  10799. *
  10800. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10801. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10802. * var source = new EventSource('/stream');
  10803. * jQuery(source).on('message', debounced);
  10804. *
  10805. * // Cancel the trailing debounced invocation.
  10806. * jQuery(window).on('popstate', debounced.cancel);
  10807. */
  10808. function debounce(func, wait, options) {
  10809. var lastArgs,
  10810. lastThis,
  10811. maxWait,
  10812. result,
  10813. timerId,
  10814. lastCallTime,
  10815. lastInvokeTime = 0,
  10816. leading = false,
  10817. maxing = false,
  10818. trailing = true;
  10819. if (typeof func != 'function') {
  10820. throw new TypeError(FUNC_ERROR_TEXT);
  10821. }
  10822. wait = toNumber(wait) || 0;
  10823. if (isObject(options)) {
  10824. leading = !!options.leading;
  10825. maxing = 'maxWait' in options;
  10826. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10827. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10828. }
  10829. function invokeFunc(time) {
  10830. var args = lastArgs,
  10831. thisArg = lastThis;
  10832. lastArgs = lastThis = undefined;
  10833. lastInvokeTime = time;
  10834. result = func.apply(thisArg, args);
  10835. return result;
  10836. }
  10837. function leadingEdge(time) {
  10838. // Reset any `maxWait` timer.
  10839. lastInvokeTime = time;
  10840. // Start the timer for the trailing edge.
  10841. timerId = setTimeout(timerExpired, wait);
  10842. // Invoke the leading edge.
  10843. return leading ? invokeFunc(time) : result;
  10844. }
  10845. function remainingWait(time) {
  10846. var timeSinceLastCall = time - lastCallTime,
  10847. timeSinceLastInvoke = time - lastInvokeTime,
  10848. timeWaiting = wait - timeSinceLastCall;
  10849. return maxing
  10850. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10851. : timeWaiting;
  10852. }
  10853. function shouldInvoke(time) {
  10854. var timeSinceLastCall = time - lastCallTime,
  10855. timeSinceLastInvoke = time - lastInvokeTime;
  10856. // Either this is the first call, activity has stopped and we're at the
  10857. // trailing edge, the system time has gone backwards and we're treating
  10858. // it as the trailing edge, or we've hit the `maxWait` limit.
  10859. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10860. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10861. }
  10862. function timerExpired() {
  10863. var time = now();
  10864. if (shouldInvoke(time)) {
  10865. return trailingEdge(time);
  10866. }
  10867. // Restart the timer.
  10868. timerId = setTimeout(timerExpired, remainingWait(time));
  10869. }
  10870. function trailingEdge(time) {
  10871. timerId = undefined;
  10872. // Only invoke if we have `lastArgs` which means `func` has been
  10873. // debounced at least once.
  10874. if (trailing && lastArgs) {
  10875. return invokeFunc(time);
  10876. }
  10877. lastArgs = lastThis = undefined;
  10878. return result;
  10879. }
  10880. function cancel() {
  10881. if (timerId !== undefined) {
  10882. clearTimeout(timerId);
  10883. }
  10884. lastInvokeTime = 0;
  10885. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10886. }
  10887. function flush() {
  10888. return timerId === undefined ? result : trailingEdge(now());
  10889. }
  10890. function debounced() {
  10891. var time = now(),
  10892. isInvoking = shouldInvoke(time);
  10893. lastArgs = arguments;
  10894. lastThis = this;
  10895. lastCallTime = time;
  10896. if (isInvoking) {
  10897. if (timerId === undefined) {
  10898. return leadingEdge(lastCallTime);
  10899. }
  10900. if (maxing) {
  10901. // Handle invocations in a tight loop.
  10902. clearTimeout(timerId);
  10903. timerId = setTimeout(timerExpired, wait);
  10904. return invokeFunc(lastCallTime);
  10905. }
  10906. }
  10907. if (timerId === undefined) {
  10908. timerId = setTimeout(timerExpired, wait);
  10909. }
  10910. return result;
  10911. }
  10912. debounced.cancel = cancel;
  10913. debounced.flush = flush;
  10914. return debounced;
  10915. }
  10916. /**
  10917. * Defers invoking the `func` until the current call stack has cleared. Any
  10918. * additional arguments are provided to `func` when it's invoked.
  10919. *
  10920. * @static
  10921. * @memberOf _
  10922. * @since 0.1.0
  10923. * @category Function
  10924. * @param {Function} func The function to defer.
  10925. * @param {...*} [args] The arguments to invoke `func` with.
  10926. * @returns {number} Returns the timer id.
  10927. * @example
  10928. *
  10929. * _.defer(function(text) {
  10930. * console.log(text);
  10931. * }, 'deferred');
  10932. * // => Logs 'deferred' after one millisecond.
  10933. */
  10934. var defer = baseRest(function(func, args) {
  10935. return baseDelay(func, 1, args);
  10936. });
  10937. /**
  10938. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10939. * provided to `func` when it's invoked.
  10940. *
  10941. * @static
  10942. * @memberOf _
  10943. * @since 0.1.0
  10944. * @category Function
  10945. * @param {Function} func The function to delay.
  10946. * @param {number} wait The number of milliseconds to delay invocation.
  10947. * @param {...*} [args] The arguments to invoke `func` with.
  10948. * @returns {number} Returns the timer id.
  10949. * @example
  10950. *
  10951. * _.delay(function(text) {
  10952. * console.log(text);
  10953. * }, 1000, 'later');
  10954. * // => Logs 'later' after one second.
  10955. */
  10956. var delay = baseRest(function(func, wait, args) {
  10957. return baseDelay(func, toNumber(wait) || 0, args);
  10958. });
  10959. /**
  10960. * Creates a function that invokes `func` with arguments reversed.
  10961. *
  10962. * @static
  10963. * @memberOf _
  10964. * @since 4.0.0
  10965. * @category Function
  10966. * @param {Function} func The function to flip arguments for.
  10967. * @returns {Function} Returns the new flipped function.
  10968. * @example
  10969. *
  10970. * var flipped = _.flip(function() {
  10971. * return _.toArray(arguments);
  10972. * });
  10973. *
  10974. * flipped('a', 'b', 'c', 'd');
  10975. * // => ['d', 'c', 'b', 'a']
  10976. */
  10977. function flip(func) {
  10978. return createWrap(func, WRAP_FLIP_FLAG);
  10979. }
  10980. /**
  10981. * Creates a function that memoizes the result of `func`. If `resolver` is
  10982. * provided, it determines the cache key for storing the result based on the
  10983. * arguments provided to the memoized function. By default, the first argument
  10984. * provided to the memoized function is used as the map cache key. The `func`
  10985. * is invoked with the `this` binding of the memoized function.
  10986. *
  10987. * **Note:** The cache is exposed as the `cache` property on the memoized
  10988. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10989. * constructor with one whose instances implement the
  10990. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10991. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10992. *
  10993. * @static
  10994. * @memberOf _
  10995. * @since 0.1.0
  10996. * @category Function
  10997. * @param {Function} func The function to have its output memoized.
  10998. * @param {Function} [resolver] The function to resolve the cache key.
  10999. * @returns {Function} Returns the new memoized function.
  11000. * @example
  11001. *
  11002. * var object = { 'a': 1, 'b': 2 };
  11003. * var other = { 'c': 3, 'd': 4 };
  11004. *
  11005. * var values = _.memoize(_.values);
  11006. * values(object);
  11007. * // => [1, 2]
  11008. *
  11009. * values(other);
  11010. * // => [3, 4]
  11011. *
  11012. * object.a = 2;
  11013. * values(object);
  11014. * // => [1, 2]
  11015. *
  11016. * // Modify the result cache.
  11017. * values.cache.set(object, ['a', 'b']);
  11018. * values(object);
  11019. * // => ['a', 'b']
  11020. *
  11021. * // Replace `_.memoize.Cache`.
  11022. * _.memoize.Cache = WeakMap;
  11023. */
  11024. function memoize(func, resolver) {
  11025. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11026. throw new TypeError(FUNC_ERROR_TEXT);
  11027. }
  11028. var memoized = function() {
  11029. var args = arguments,
  11030. key = resolver ? resolver.apply(this, args) : args[0],
  11031. cache = memoized.cache;
  11032. if (cache.has(key)) {
  11033. return cache.get(key);
  11034. }
  11035. var result = func.apply(this, args);
  11036. memoized.cache = cache.set(key, result) || cache;
  11037. return result;
  11038. };
  11039. memoized.cache = new (memoize.Cache || MapCache);
  11040. return memoized;
  11041. }
  11042. // Expose `MapCache`.
  11043. memoize.Cache = MapCache;
  11044. /**
  11045. * Creates a function that negates the result of the predicate `func`. The
  11046. * `func` predicate is invoked with the `this` binding and arguments of the
  11047. * created function.
  11048. *
  11049. * @static
  11050. * @memberOf _
  11051. * @since 3.0.0
  11052. * @category Function
  11053. * @param {Function} predicate The predicate to negate.
  11054. * @returns {Function} Returns the new negated function.
  11055. * @example
  11056. *
  11057. * function isEven(n) {
  11058. * return n % 2 == 0;
  11059. * }
  11060. *
  11061. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11062. * // => [1, 3, 5]
  11063. */
  11064. function negate(predicate) {
  11065. if (typeof predicate != 'function') {
  11066. throw new TypeError(FUNC_ERROR_TEXT);
  11067. }
  11068. return function() {
  11069. var args = arguments;
  11070. switch (args.length) {
  11071. case 0: return !predicate.call(this);
  11072. case 1: return !predicate.call(this, args[0]);
  11073. case 2: return !predicate.call(this, args[0], args[1]);
  11074. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11075. }
  11076. return !predicate.apply(this, args);
  11077. };
  11078. }
  11079. /**
  11080. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11081. * to the function return the value of the first invocation. The `func` is
  11082. * invoked with the `this` binding and arguments of the created function.
  11083. *
  11084. * @static
  11085. * @memberOf _
  11086. * @since 0.1.0
  11087. * @category Function
  11088. * @param {Function} func The function to restrict.
  11089. * @returns {Function} Returns the new restricted function.
  11090. * @example
  11091. *
  11092. * var initialize = _.once(createApplication);
  11093. * initialize();
  11094. * initialize();
  11095. * // => `createApplication` is invoked once
  11096. */
  11097. function once(func) {
  11098. return before(2, func);
  11099. }
  11100. /**
  11101. * Creates a function that invokes `func` with its arguments transformed.
  11102. *
  11103. * @static
  11104. * @since 4.0.0
  11105. * @memberOf _
  11106. * @category Function
  11107. * @param {Function} func The function to wrap.
  11108. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11109. * The argument transforms.
  11110. * @returns {Function} Returns the new function.
  11111. * @example
  11112. *
  11113. * function doubled(n) {
  11114. * return n * 2;
  11115. * }
  11116. *
  11117. * function square(n) {
  11118. * return n * n;
  11119. * }
  11120. *
  11121. * var func = _.overArgs(function(x, y) {
  11122. * return [x, y];
  11123. * }, [square, doubled]);
  11124. *
  11125. * func(9, 3);
  11126. * // => [81, 6]
  11127. *
  11128. * func(10, 5);
  11129. * // => [100, 10]
  11130. */
  11131. var overArgs = castRest(function(func, transforms) {
  11132. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11133. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11134. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11135. var funcsLength = transforms.length;
  11136. return baseRest(function(args) {
  11137. var index = -1,
  11138. length = nativeMin(args.length, funcsLength);
  11139. while (++index < length) {
  11140. args[index] = transforms[index].call(this, args[index]);
  11141. }
  11142. return apply(func, this, args);
  11143. });
  11144. });
  11145. /**
  11146. * Creates a function that invokes `func` with `partials` prepended to the
  11147. * arguments it receives. This method is like `_.bind` except it does **not**
  11148. * alter the `this` binding.
  11149. *
  11150. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11151. * builds, may be used as a placeholder for partially applied arguments.
  11152. *
  11153. * **Note:** This method doesn't set the "length" property of partially
  11154. * applied functions.
  11155. *
  11156. * @static
  11157. * @memberOf _
  11158. * @since 0.2.0
  11159. * @category Function
  11160. * @param {Function} func The function to partially apply arguments to.
  11161. * @param {...*} [partials] The arguments to be partially applied.
  11162. * @returns {Function} Returns the new partially applied function.
  11163. * @example
  11164. *
  11165. * function greet(greeting, name) {
  11166. * return greeting + ' ' + name;
  11167. * }
  11168. *
  11169. * var sayHelloTo = _.partial(greet, 'hello');
  11170. * sayHelloTo('fred');
  11171. * // => 'hello fred'
  11172. *
  11173. * // Partially applied with placeholders.
  11174. * var greetFred = _.partial(greet, _, 'fred');
  11175. * greetFred('hi');
  11176. * // => 'hi fred'
  11177. */
  11178. var partial = baseRest(function(func, partials) {
  11179. var holders = replaceHolders(partials, getHolder(partial));
  11180. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11181. });
  11182. /**
  11183. * This method is like `_.partial` except that partially applied arguments
  11184. * are appended to the arguments it receives.
  11185. *
  11186. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11187. * builds, may be used as a placeholder for partially applied arguments.
  11188. *
  11189. * **Note:** This method doesn't set the "length" property of partially
  11190. * applied functions.
  11191. *
  11192. * @static
  11193. * @memberOf _
  11194. * @since 1.0.0
  11195. * @category Function
  11196. * @param {Function} func The function to partially apply arguments to.
  11197. * @param {...*} [partials] The arguments to be partially applied.
  11198. * @returns {Function} Returns the new partially applied function.
  11199. * @example
  11200. *
  11201. * function greet(greeting, name) {
  11202. * return greeting + ' ' + name;
  11203. * }
  11204. *
  11205. * var greetFred = _.partialRight(greet, 'fred');
  11206. * greetFred('hi');
  11207. * // => 'hi fred'
  11208. *
  11209. * // Partially applied with placeholders.
  11210. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11211. * sayHelloTo('fred');
  11212. * // => 'hello fred'
  11213. */
  11214. var partialRight = baseRest(function(func, partials) {
  11215. var holders = replaceHolders(partials, getHolder(partialRight));
  11216. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11217. });
  11218. /**
  11219. * Creates a function that invokes `func` with arguments arranged according
  11220. * to the specified `indexes` where the argument value at the first index is
  11221. * provided as the first argument, the argument value at the second index is
  11222. * provided as the second argument, and so on.
  11223. *
  11224. * @static
  11225. * @memberOf _
  11226. * @since 3.0.0
  11227. * @category Function
  11228. * @param {Function} func The function to rearrange arguments for.
  11229. * @param {...(number|number[])} indexes The arranged argument indexes.
  11230. * @returns {Function} Returns the new function.
  11231. * @example
  11232. *
  11233. * var rearged = _.rearg(function(a, b, c) {
  11234. * return [a, b, c];
  11235. * }, [2, 0, 1]);
  11236. *
  11237. * rearged('b', 'c', 'a')
  11238. * // => ['a', 'b', 'c']
  11239. */
  11240. var rearg = flatRest(function(func, indexes) {
  11241. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11242. });
  11243. /**
  11244. * Creates a function that invokes `func` with the `this` binding of the
  11245. * created function and arguments from `start` and beyond provided as
  11246. * an array.
  11247. *
  11248. * **Note:** This method is based on the
  11249. * [rest parameter](https://mdn.io/rest_parameters).
  11250. *
  11251. * @static
  11252. * @memberOf _
  11253. * @since 4.0.0
  11254. * @category Function
  11255. * @param {Function} func The function to apply a rest parameter to.
  11256. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11257. * @returns {Function} Returns the new function.
  11258. * @example
  11259. *
  11260. * var say = _.rest(function(what, names) {
  11261. * return what + ' ' + _.initial(names).join(', ') +
  11262. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11263. * });
  11264. *
  11265. * say('hello', 'fred', 'barney', 'pebbles');
  11266. * // => 'hello fred, barney, & pebbles'
  11267. */
  11268. function rest(func, start) {
  11269. if (typeof func != 'function') {
  11270. throw new TypeError(FUNC_ERROR_TEXT);
  11271. }
  11272. start = start === undefined ? start : toInteger(start);
  11273. return baseRest(func, start);
  11274. }
  11275. /**
  11276. * Creates a function that invokes `func` with the `this` binding of the
  11277. * create function and an array of arguments much like
  11278. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11279. *
  11280. * **Note:** This method is based on the
  11281. * [spread operator](https://mdn.io/spread_operator).
  11282. *
  11283. * @static
  11284. * @memberOf _
  11285. * @since 3.2.0
  11286. * @category Function
  11287. * @param {Function} func The function to spread arguments over.
  11288. * @param {number} [start=0] The start position of the spread.
  11289. * @returns {Function} Returns the new function.
  11290. * @example
  11291. *
  11292. * var say = _.spread(function(who, what) {
  11293. * return who + ' says ' + what;
  11294. * });
  11295. *
  11296. * say(['fred', 'hello']);
  11297. * // => 'fred says hello'
  11298. *
  11299. * var numbers = Promise.all([
  11300. * Promise.resolve(40),
  11301. * Promise.resolve(36)
  11302. * ]);
  11303. *
  11304. * numbers.then(_.spread(function(x, y) {
  11305. * return x + y;
  11306. * }));
  11307. * // => a Promise of 76
  11308. */
  11309. function spread(func, start) {
  11310. if (typeof func != 'function') {
  11311. throw new TypeError(FUNC_ERROR_TEXT);
  11312. }
  11313. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11314. return baseRest(function(args) {
  11315. var array = args[start],
  11316. otherArgs = castSlice(args, 0, start);
  11317. if (array) {
  11318. arrayPush(otherArgs, array);
  11319. }
  11320. return apply(func, this, otherArgs);
  11321. });
  11322. }
  11323. /**
  11324. * Creates a throttled function that only invokes `func` at most once per
  11325. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11326. * method to cancel delayed `func` invocations and a `flush` method to
  11327. * immediately invoke them. Provide `options` to indicate whether `func`
  11328. * should be invoked on the leading and/or trailing edge of the `wait`
  11329. * timeout. The `func` is invoked with the last arguments provided to the
  11330. * throttled function. Subsequent calls to the throttled function return the
  11331. * result of the last `func` invocation.
  11332. *
  11333. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11334. * invoked on the trailing edge of the timeout only if the throttled function
  11335. * is invoked more than once during the `wait` timeout.
  11336. *
  11337. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11338. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11339. *
  11340. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11341. * for details over the differences between `_.throttle` and `_.debounce`.
  11342. *
  11343. * @static
  11344. * @memberOf _
  11345. * @since 0.1.0
  11346. * @category Function
  11347. * @param {Function} func The function to throttle.
  11348. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11349. * @param {Object} [options={}] The options object.
  11350. * @param {boolean} [options.leading=true]
  11351. * Specify invoking on the leading edge of the timeout.
  11352. * @param {boolean} [options.trailing=true]
  11353. * Specify invoking on the trailing edge of the timeout.
  11354. * @returns {Function} Returns the new throttled function.
  11355. * @example
  11356. *
  11357. * // Avoid excessively updating the position while scrolling.
  11358. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11359. *
  11360. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11361. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11362. * jQuery(element).on('click', throttled);
  11363. *
  11364. * // Cancel the trailing throttled invocation.
  11365. * jQuery(window).on('popstate', throttled.cancel);
  11366. */
  11367. function throttle(func, wait, options) {
  11368. var leading = true,
  11369. trailing = true;
  11370. if (typeof func != 'function') {
  11371. throw new TypeError(FUNC_ERROR_TEXT);
  11372. }
  11373. if (isObject(options)) {
  11374. leading = 'leading' in options ? !!options.leading : leading;
  11375. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11376. }
  11377. return debounce(func, wait, {
  11378. 'leading': leading,
  11379. 'maxWait': wait,
  11380. 'trailing': trailing
  11381. });
  11382. }
  11383. /**
  11384. * Creates a function that accepts up to one argument, ignoring any
  11385. * additional arguments.
  11386. *
  11387. * @static
  11388. * @memberOf _
  11389. * @since 4.0.0
  11390. * @category Function
  11391. * @param {Function} func The function to cap arguments for.
  11392. * @returns {Function} Returns the new capped function.
  11393. * @example
  11394. *
  11395. * _.map(['6', '8', '10'], _.unary(parseInt));
  11396. * // => [6, 8, 10]
  11397. */
  11398. function unary(func) {
  11399. return ary(func, 1);
  11400. }
  11401. /**
  11402. * Creates a function that provides `value` to `wrapper` as its first
  11403. * argument. Any additional arguments provided to the function are appended
  11404. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11405. * binding of the created function.
  11406. *
  11407. * @static
  11408. * @memberOf _
  11409. * @since 0.1.0
  11410. * @category Function
  11411. * @param {*} value The value to wrap.
  11412. * @param {Function} [wrapper=identity] The wrapper function.
  11413. * @returns {Function} Returns the new function.
  11414. * @example
  11415. *
  11416. * var p = _.wrap(_.escape, function(func, text) {
  11417. * return '<p>' + func(text) + '</p>';
  11418. * });
  11419. *
  11420. * p('fred, barney, & pebbles');
  11421. * // => '<p>fred, barney, &amp; pebbles</p>'
  11422. */
  11423. function wrap(value, wrapper) {
  11424. return partial(castFunction(wrapper), value);
  11425. }
  11426. /*------------------------------------------------------------------------*/
  11427. /**
  11428. * Casts `value` as an array if it's not one.
  11429. *
  11430. * @static
  11431. * @memberOf _
  11432. * @since 4.4.0
  11433. * @category Lang
  11434. * @param {*} value The value to inspect.
  11435. * @returns {Array} Returns the cast array.
  11436. * @example
  11437. *
  11438. * _.castArray(1);
  11439. * // => [1]
  11440. *
  11441. * _.castArray({ 'a': 1 });
  11442. * // => [{ 'a': 1 }]
  11443. *
  11444. * _.castArray('abc');
  11445. * // => ['abc']
  11446. *
  11447. * _.castArray(null);
  11448. * // => [null]
  11449. *
  11450. * _.castArray(undefined);
  11451. * // => [undefined]
  11452. *
  11453. * _.castArray();
  11454. * // => []
  11455. *
  11456. * var array = [1, 2, 3];
  11457. * console.log(_.castArray(array) === array);
  11458. * // => true
  11459. */
  11460. function castArray() {
  11461. if (!arguments.length) {
  11462. return [];
  11463. }
  11464. var value = arguments[0];
  11465. return isArray(value) ? value : [value];
  11466. }
  11467. /**
  11468. * Creates a shallow clone of `value`.
  11469. *
  11470. * **Note:** This method is loosely based on the
  11471. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11472. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11473. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11474. * arrays. The own enumerable properties of `arguments` objects are cloned
  11475. * as plain objects. An empty object is returned for uncloneable values such
  11476. * as error objects, functions, DOM nodes, and WeakMaps.
  11477. *
  11478. * @static
  11479. * @memberOf _
  11480. * @since 0.1.0
  11481. * @category Lang
  11482. * @param {*} value The value to clone.
  11483. * @returns {*} Returns the cloned value.
  11484. * @see _.cloneDeep
  11485. * @example
  11486. *
  11487. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11488. *
  11489. * var shallow = _.clone(objects);
  11490. * console.log(shallow[0] === objects[0]);
  11491. * // => true
  11492. */
  11493. function clone(value) {
  11494. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11495. }
  11496. /**
  11497. * This method is like `_.clone` except that it accepts `customizer` which
  11498. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11499. * cloning is handled by the method instead. The `customizer` is invoked with
  11500. * up to four arguments; (value [, index|key, object, stack]).
  11501. *
  11502. * @static
  11503. * @memberOf _
  11504. * @since 4.0.0
  11505. * @category Lang
  11506. * @param {*} value The value to clone.
  11507. * @param {Function} [customizer] The function to customize cloning.
  11508. * @returns {*} Returns the cloned value.
  11509. * @see _.cloneDeepWith
  11510. * @example
  11511. *
  11512. * function customizer(value) {
  11513. * if (_.isElement(value)) {
  11514. * return value.cloneNode(false);
  11515. * }
  11516. * }
  11517. *
  11518. * var el = _.cloneWith(document.body, customizer);
  11519. *
  11520. * console.log(el === document.body);
  11521. * // => false
  11522. * console.log(el.nodeName);
  11523. * // => 'BODY'
  11524. * console.log(el.childNodes.length);
  11525. * // => 0
  11526. */
  11527. function cloneWith(value, customizer) {
  11528. customizer = typeof customizer == 'function' ? customizer : undefined;
  11529. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11530. }
  11531. /**
  11532. * This method is like `_.clone` except that it recursively clones `value`.
  11533. *
  11534. * @static
  11535. * @memberOf _
  11536. * @since 1.0.0
  11537. * @category Lang
  11538. * @param {*} value The value to recursively clone.
  11539. * @returns {*} Returns the deep cloned value.
  11540. * @see _.clone
  11541. * @example
  11542. *
  11543. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11544. *
  11545. * var deep = _.cloneDeep(objects);
  11546. * console.log(deep[0] === objects[0]);
  11547. * // => false
  11548. */
  11549. function cloneDeep(value) {
  11550. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11551. }
  11552. /**
  11553. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11554. *
  11555. * @static
  11556. * @memberOf _
  11557. * @since 4.0.0
  11558. * @category Lang
  11559. * @param {*} value The value to recursively clone.
  11560. * @param {Function} [customizer] The function to customize cloning.
  11561. * @returns {*} Returns the deep cloned value.
  11562. * @see _.cloneWith
  11563. * @example
  11564. *
  11565. * function customizer(value) {
  11566. * if (_.isElement(value)) {
  11567. * return value.cloneNode(true);
  11568. * }
  11569. * }
  11570. *
  11571. * var el = _.cloneDeepWith(document.body, customizer);
  11572. *
  11573. * console.log(el === document.body);
  11574. * // => false
  11575. * console.log(el.nodeName);
  11576. * // => 'BODY'
  11577. * console.log(el.childNodes.length);
  11578. * // => 20
  11579. */
  11580. function cloneDeepWith(value, customizer) {
  11581. customizer = typeof customizer == 'function' ? customizer : undefined;
  11582. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11583. }
  11584. /**
  11585. * Checks if `object` conforms to `source` by invoking the predicate
  11586. * properties of `source` with the corresponding property values of `object`.
  11587. *
  11588. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11589. * partially applied.
  11590. *
  11591. * @static
  11592. * @memberOf _
  11593. * @since 4.14.0
  11594. * @category Lang
  11595. * @param {Object} object The object to inspect.
  11596. * @param {Object} source The object of property predicates to conform to.
  11597. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11598. * @example
  11599. *
  11600. * var object = { 'a': 1, 'b': 2 };
  11601. *
  11602. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11603. * // => true
  11604. *
  11605. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11606. * // => false
  11607. */
  11608. function conformsTo(object, source) {
  11609. return source == null || baseConformsTo(object, source, keys(source));
  11610. }
  11611. /**
  11612. * Performs a
  11613. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11614. * comparison between two values to determine if they are equivalent.
  11615. *
  11616. * @static
  11617. * @memberOf _
  11618. * @since 4.0.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 the values are equivalent, else `false`.
  11623. * @example
  11624. *
  11625. * var object = { 'a': 1 };
  11626. * var other = { 'a': 1 };
  11627. *
  11628. * _.eq(object, object);
  11629. * // => true
  11630. *
  11631. * _.eq(object, other);
  11632. * // => false
  11633. *
  11634. * _.eq('a', 'a');
  11635. * // => true
  11636. *
  11637. * _.eq('a', Object('a'));
  11638. * // => false
  11639. *
  11640. * _.eq(NaN, NaN);
  11641. * // => true
  11642. */
  11643. function eq(value, other) {
  11644. return value === other || (value !== value && other !== other);
  11645. }
  11646. /**
  11647. * Checks if `value` is greater than `other`.
  11648. *
  11649. * @static
  11650. * @memberOf _
  11651. * @since 3.9.0
  11652. * @category Lang
  11653. * @param {*} value The value to compare.
  11654. * @param {*} other The other value to compare.
  11655. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11656. * else `false`.
  11657. * @see _.lt
  11658. * @example
  11659. *
  11660. * _.gt(3, 1);
  11661. * // => true
  11662. *
  11663. * _.gt(3, 3);
  11664. * // => false
  11665. *
  11666. * _.gt(1, 3);
  11667. * // => false
  11668. */
  11669. var gt = createRelationalOperation(baseGt);
  11670. /**
  11671. * Checks if `value` is greater than or equal to `other`.
  11672. *
  11673. * @static
  11674. * @memberOf _
  11675. * @since 3.9.0
  11676. * @category Lang
  11677. * @param {*} value The value to compare.
  11678. * @param {*} other The other value to compare.
  11679. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11680. * `other`, else `false`.
  11681. * @see _.lte
  11682. * @example
  11683. *
  11684. * _.gte(3, 1);
  11685. * // => true
  11686. *
  11687. * _.gte(3, 3);
  11688. * // => true
  11689. *
  11690. * _.gte(1, 3);
  11691. * // => false
  11692. */
  11693. var gte = createRelationalOperation(function(value, other) {
  11694. return value >= other;
  11695. });
  11696. /**
  11697. * Checks if `value` is likely an `arguments` object.
  11698. *
  11699. * @static
  11700. * @memberOf _
  11701. * @since 0.1.0
  11702. * @category Lang
  11703. * @param {*} value The value to check.
  11704. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11705. * else `false`.
  11706. * @example
  11707. *
  11708. * _.isArguments(function() { return arguments; }());
  11709. * // => true
  11710. *
  11711. * _.isArguments([1, 2, 3]);
  11712. * // => false
  11713. */
  11714. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11715. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11716. !propertyIsEnumerable.call(value, 'callee');
  11717. };
  11718. /**
  11719. * Checks if `value` is classified as an `Array` object.
  11720. *
  11721. * @static
  11722. * @memberOf _
  11723. * @since 0.1.0
  11724. * @category Lang
  11725. * @param {*} value The value to check.
  11726. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11727. * @example
  11728. *
  11729. * _.isArray([1, 2, 3]);
  11730. * // => true
  11731. *
  11732. * _.isArray(document.body.children);
  11733. * // => false
  11734. *
  11735. * _.isArray('abc');
  11736. * // => false
  11737. *
  11738. * _.isArray(_.noop);
  11739. * // => false
  11740. */
  11741. var isArray = Array.isArray;
  11742. /**
  11743. * Checks if `value` is classified as an `ArrayBuffer` object.
  11744. *
  11745. * @static
  11746. * @memberOf _
  11747. * @since 4.3.0
  11748. * @category Lang
  11749. * @param {*} value The value to check.
  11750. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11751. * @example
  11752. *
  11753. * _.isArrayBuffer(new ArrayBuffer(2));
  11754. * // => true
  11755. *
  11756. * _.isArrayBuffer(new Array(2));
  11757. * // => false
  11758. */
  11759. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11760. /**
  11761. * Checks if `value` is array-like. A value is considered array-like if it's
  11762. * not a function and has a `value.length` that's an integer greater than or
  11763. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11764. *
  11765. * @static
  11766. * @memberOf _
  11767. * @since 4.0.0
  11768. * @category Lang
  11769. * @param {*} value The value to check.
  11770. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11771. * @example
  11772. *
  11773. * _.isArrayLike([1, 2, 3]);
  11774. * // => true
  11775. *
  11776. * _.isArrayLike(document.body.children);
  11777. * // => true
  11778. *
  11779. * _.isArrayLike('abc');
  11780. * // => true
  11781. *
  11782. * _.isArrayLike(_.noop);
  11783. * // => false
  11784. */
  11785. function isArrayLike(value) {
  11786. return value != null && isLength(value.length) && !isFunction(value);
  11787. }
  11788. /**
  11789. * This method is like `_.isArrayLike` except that it also checks if `value`
  11790. * is an object.
  11791. *
  11792. * @static
  11793. * @memberOf _
  11794. * @since 4.0.0
  11795. * @category Lang
  11796. * @param {*} value The value to check.
  11797. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11798. * else `false`.
  11799. * @example
  11800. *
  11801. * _.isArrayLikeObject([1, 2, 3]);
  11802. * // => true
  11803. *
  11804. * _.isArrayLikeObject(document.body.children);
  11805. * // => true
  11806. *
  11807. * _.isArrayLikeObject('abc');
  11808. * // => false
  11809. *
  11810. * _.isArrayLikeObject(_.noop);
  11811. * // => false
  11812. */
  11813. function isArrayLikeObject(value) {
  11814. return isObjectLike(value) && isArrayLike(value);
  11815. }
  11816. /**
  11817. * Checks if `value` is classified as a boolean primitive or object.
  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 boolean, else `false`.
  11825. * @example
  11826. *
  11827. * _.isBoolean(false);
  11828. * // => true
  11829. *
  11830. * _.isBoolean(null);
  11831. * // => false
  11832. */
  11833. function isBoolean(value) {
  11834. return value === true || value === false ||
  11835. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11836. }
  11837. /**
  11838. * Checks if `value` is a buffer.
  11839. *
  11840. * @static
  11841. * @memberOf _
  11842. * @since 4.3.0
  11843. * @category Lang
  11844. * @param {*} value The value to check.
  11845. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11846. * @example
  11847. *
  11848. * _.isBuffer(new Buffer(2));
  11849. * // => true
  11850. *
  11851. * _.isBuffer(new Uint8Array(2));
  11852. * // => false
  11853. */
  11854. var isBuffer = nativeIsBuffer || stubFalse;
  11855. /**
  11856. * Checks if `value` is classified as a `Date` object.
  11857. *
  11858. * @static
  11859. * @memberOf _
  11860. * @since 0.1.0
  11861. * @category Lang
  11862. * @param {*} value The value to check.
  11863. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11864. * @example
  11865. *
  11866. * _.isDate(new Date);
  11867. * // => true
  11868. *
  11869. * _.isDate('Mon April 23 2012');
  11870. * // => false
  11871. */
  11872. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11873. /**
  11874. * Checks if `value` is likely a DOM element.
  11875. *
  11876. * @static
  11877. * @memberOf _
  11878. * @since 0.1.0
  11879. * @category Lang
  11880. * @param {*} value The value to check.
  11881. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11882. * @example
  11883. *
  11884. * _.isElement(document.body);
  11885. * // => true
  11886. *
  11887. * _.isElement('<body>');
  11888. * // => false
  11889. */
  11890. function isElement(value) {
  11891. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11892. }
  11893. /**
  11894. * Checks if `value` is an empty object, collection, map, or set.
  11895. *
  11896. * Objects are considered empty if they have no own enumerable string keyed
  11897. * properties.
  11898. *
  11899. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11900. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11901. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11902. *
  11903. * @static
  11904. * @memberOf _
  11905. * @since 0.1.0
  11906. * @category Lang
  11907. * @param {*} value The value to check.
  11908. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11909. * @example
  11910. *
  11911. * _.isEmpty(null);
  11912. * // => true
  11913. *
  11914. * _.isEmpty(true);
  11915. * // => true
  11916. *
  11917. * _.isEmpty(1);
  11918. * // => true
  11919. *
  11920. * _.isEmpty([1, 2, 3]);
  11921. * // => false
  11922. *
  11923. * _.isEmpty({ 'a': 1 });
  11924. * // => false
  11925. */
  11926. function isEmpty(value) {
  11927. if (value == null) {
  11928. return true;
  11929. }
  11930. if (isArrayLike(value) &&
  11931. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11932. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11933. return !value.length;
  11934. }
  11935. var tag = getTag(value);
  11936. if (tag == mapTag || tag == setTag) {
  11937. return !value.size;
  11938. }
  11939. if (isPrototype(value)) {
  11940. return !baseKeys(value).length;
  11941. }
  11942. for (var key in value) {
  11943. if (hasOwnProperty.call(value, key)) {
  11944. return false;
  11945. }
  11946. }
  11947. return true;
  11948. }
  11949. /**
  11950. * Performs a deep comparison between two values to determine if they are
  11951. * equivalent.
  11952. *
  11953. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11954. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11955. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11956. * by their own, not inherited, enumerable properties. Functions and DOM
  11957. * nodes are compared by strict equality, i.e. `===`.
  11958. *
  11959. * @static
  11960. * @memberOf _
  11961. * @since 0.1.0
  11962. * @category Lang
  11963. * @param {*} value The value to compare.
  11964. * @param {*} other The other value to compare.
  11965. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11966. * @example
  11967. *
  11968. * var object = { 'a': 1 };
  11969. * var other = { 'a': 1 };
  11970. *
  11971. * _.isEqual(object, other);
  11972. * // => true
  11973. *
  11974. * object === other;
  11975. * // => false
  11976. */
  11977. function isEqual(value, other) {
  11978. return baseIsEqual(value, other);
  11979. }
  11980. /**
  11981. * This method is like `_.isEqual` except that it accepts `customizer` which
  11982. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11983. * are handled by the method instead. The `customizer` is invoked with up to
  11984. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11985. *
  11986. * @static
  11987. * @memberOf _
  11988. * @since 4.0.0
  11989. * @category Lang
  11990. * @param {*} value The value to compare.
  11991. * @param {*} other The other value to compare.
  11992. * @param {Function} [customizer] The function to customize comparisons.
  11993. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11994. * @example
  11995. *
  11996. * function isGreeting(value) {
  11997. * return /^h(?:i|ello)$/.test(value);
  11998. * }
  11999. *
  12000. * function customizer(objValue, othValue) {
  12001. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12002. * return true;
  12003. * }
  12004. * }
  12005. *
  12006. * var array = ['hello', 'goodbye'];
  12007. * var other = ['hi', 'goodbye'];
  12008. *
  12009. * _.isEqualWith(array, other, customizer);
  12010. * // => true
  12011. */
  12012. function isEqualWith(value, other, customizer) {
  12013. customizer = typeof customizer == 'function' ? customizer : undefined;
  12014. var result = customizer ? customizer(value, other) : undefined;
  12015. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12016. }
  12017. /**
  12018. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12019. * `SyntaxError`, `TypeError`, or `URIError` object.
  12020. *
  12021. * @static
  12022. * @memberOf _
  12023. * @since 3.0.0
  12024. * @category Lang
  12025. * @param {*} value The value to check.
  12026. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12027. * @example
  12028. *
  12029. * _.isError(new Error);
  12030. * // => true
  12031. *
  12032. * _.isError(Error);
  12033. * // => false
  12034. */
  12035. function isError(value) {
  12036. if (!isObjectLike(value)) {
  12037. return false;
  12038. }
  12039. var tag = baseGetTag(value);
  12040. return tag == errorTag || tag == domExcTag ||
  12041. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12042. }
  12043. /**
  12044. * Checks if `value` is a finite primitive number.
  12045. *
  12046. * **Note:** This method is based on
  12047. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12048. *
  12049. * @static
  12050. * @memberOf _
  12051. * @since 0.1.0
  12052. * @category Lang
  12053. * @param {*} value The value to check.
  12054. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12055. * @example
  12056. *
  12057. * _.isFinite(3);
  12058. * // => true
  12059. *
  12060. * _.isFinite(Number.MIN_VALUE);
  12061. * // => true
  12062. *
  12063. * _.isFinite(Infinity);
  12064. * // => false
  12065. *
  12066. * _.isFinite('3');
  12067. * // => false
  12068. */
  12069. function isFinite(value) {
  12070. return typeof value == 'number' && nativeIsFinite(value);
  12071. }
  12072. /**
  12073. * Checks if `value` is classified as a `Function` object.
  12074. *
  12075. * @static
  12076. * @memberOf _
  12077. * @since 0.1.0
  12078. * @category Lang
  12079. * @param {*} value The value to check.
  12080. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12081. * @example
  12082. *
  12083. * _.isFunction(_);
  12084. * // => true
  12085. *
  12086. * _.isFunction(/abc/);
  12087. * // => false
  12088. */
  12089. function isFunction(value) {
  12090. if (!isObject(value)) {
  12091. return false;
  12092. }
  12093. // The use of `Object#toString` avoids issues with the `typeof` operator
  12094. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12095. var tag = baseGetTag(value);
  12096. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12097. }
  12098. /**
  12099. * Checks if `value` is an integer.
  12100. *
  12101. * **Note:** This method is based on
  12102. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12103. *
  12104. * @static
  12105. * @memberOf _
  12106. * @since 4.0.0
  12107. * @category Lang
  12108. * @param {*} value The value to check.
  12109. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12110. * @example
  12111. *
  12112. * _.isInteger(3);
  12113. * // => true
  12114. *
  12115. * _.isInteger(Number.MIN_VALUE);
  12116. * // => false
  12117. *
  12118. * _.isInteger(Infinity);
  12119. * // => false
  12120. *
  12121. * _.isInteger('3');
  12122. * // => false
  12123. */
  12124. function isInteger(value) {
  12125. return typeof value == 'number' && value == toInteger(value);
  12126. }
  12127. /**
  12128. * Checks if `value` is a valid array-like length.
  12129. *
  12130. * **Note:** This method is loosely based on
  12131. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  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 a valid length, else `false`.
  12139. * @example
  12140. *
  12141. * _.isLength(3);
  12142. * // => true
  12143. *
  12144. * _.isLength(Number.MIN_VALUE);
  12145. * // => false
  12146. *
  12147. * _.isLength(Infinity);
  12148. * // => false
  12149. *
  12150. * _.isLength('3');
  12151. * // => false
  12152. */
  12153. function isLength(value) {
  12154. return typeof value == 'number' &&
  12155. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12156. }
  12157. /**
  12158. * Checks if `value` is the
  12159. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12160. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12161. *
  12162. * @static
  12163. * @memberOf _
  12164. * @since 0.1.0
  12165. * @category Lang
  12166. * @param {*} value The value to check.
  12167. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12168. * @example
  12169. *
  12170. * _.isObject({});
  12171. * // => true
  12172. *
  12173. * _.isObject([1, 2, 3]);
  12174. * // => true
  12175. *
  12176. * _.isObject(_.noop);
  12177. * // => true
  12178. *
  12179. * _.isObject(null);
  12180. * // => false
  12181. */
  12182. function isObject(value) {
  12183. var type = typeof value;
  12184. return value != null && (type == 'object' || type == 'function');
  12185. }
  12186. /**
  12187. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12188. * and has a `typeof` result of "object".
  12189. *
  12190. * @static
  12191. * @memberOf _
  12192. * @since 4.0.0
  12193. * @category Lang
  12194. * @param {*} value The value to check.
  12195. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12196. * @example
  12197. *
  12198. * _.isObjectLike({});
  12199. * // => true
  12200. *
  12201. * _.isObjectLike([1, 2, 3]);
  12202. * // => true
  12203. *
  12204. * _.isObjectLike(_.noop);
  12205. * // => false
  12206. *
  12207. * _.isObjectLike(null);
  12208. * // => false
  12209. */
  12210. function isObjectLike(value) {
  12211. return value != null && typeof value == 'object';
  12212. }
  12213. /**
  12214. * Checks if `value` is classified as a `Map` object.
  12215. *
  12216. * @static
  12217. * @memberOf _
  12218. * @since 4.3.0
  12219. * @category Lang
  12220. * @param {*} value The value to check.
  12221. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12222. * @example
  12223. *
  12224. * _.isMap(new Map);
  12225. * // => true
  12226. *
  12227. * _.isMap(new WeakMap);
  12228. * // => false
  12229. */
  12230. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12231. /**
  12232. * Performs a partial deep comparison between `object` and `source` to
  12233. * determine if `object` contains equivalent property values.
  12234. *
  12235. * **Note:** This method is equivalent to `_.matches` when `source` is
  12236. * partially applied.
  12237. *
  12238. * Partial comparisons will match empty array and empty object `source`
  12239. * values against any array or object value, respectively. See `_.isEqual`
  12240. * for a list of supported value comparisons.
  12241. *
  12242. * @static
  12243. * @memberOf _
  12244. * @since 3.0.0
  12245. * @category Lang
  12246. * @param {Object} object The object to inspect.
  12247. * @param {Object} source The object of property values to match.
  12248. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12249. * @example
  12250. *
  12251. * var object = { 'a': 1, 'b': 2 };
  12252. *
  12253. * _.isMatch(object, { 'b': 2 });
  12254. * // => true
  12255. *
  12256. * _.isMatch(object, { 'b': 1 });
  12257. * // => false
  12258. */
  12259. function isMatch(object, source) {
  12260. return object === source || baseIsMatch(object, source, getMatchData(source));
  12261. }
  12262. /**
  12263. * This method is like `_.isMatch` except that it accepts `customizer` which
  12264. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12265. * are handled by the method instead. The `customizer` is invoked with five
  12266. * arguments: (objValue, srcValue, index|key, object, source).
  12267. *
  12268. * @static
  12269. * @memberOf _
  12270. * @since 4.0.0
  12271. * @category Lang
  12272. * @param {Object} object The object to inspect.
  12273. * @param {Object} source The object of property values to match.
  12274. * @param {Function} [customizer] The function to customize comparisons.
  12275. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12276. * @example
  12277. *
  12278. * function isGreeting(value) {
  12279. * return /^h(?:i|ello)$/.test(value);
  12280. * }
  12281. *
  12282. * function customizer(objValue, srcValue) {
  12283. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12284. * return true;
  12285. * }
  12286. * }
  12287. *
  12288. * var object = { 'greeting': 'hello' };
  12289. * var source = { 'greeting': 'hi' };
  12290. *
  12291. * _.isMatchWith(object, source, customizer);
  12292. * // => true
  12293. */
  12294. function isMatchWith(object, source, customizer) {
  12295. customizer = typeof customizer == 'function' ? customizer : undefined;
  12296. return baseIsMatch(object, source, getMatchData(source), customizer);
  12297. }
  12298. /**
  12299. * Checks if `value` is `NaN`.
  12300. *
  12301. * **Note:** This method is based on
  12302. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12303. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12304. * `undefined` and other non-number values.
  12305. *
  12306. * @static
  12307. * @memberOf _
  12308. * @since 0.1.0
  12309. * @category Lang
  12310. * @param {*} value The value to check.
  12311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12312. * @example
  12313. *
  12314. * _.isNaN(NaN);
  12315. * // => true
  12316. *
  12317. * _.isNaN(new Number(NaN));
  12318. * // => true
  12319. *
  12320. * isNaN(undefined);
  12321. * // => true
  12322. *
  12323. * _.isNaN(undefined);
  12324. * // => false
  12325. */
  12326. function isNaN(value) {
  12327. // An `NaN` primitive is the only value that is not equal to itself.
  12328. // Perform the `toStringTag` check first to avoid errors with some
  12329. // ActiveX objects in IE.
  12330. return isNumber(value) && value != +value;
  12331. }
  12332. /**
  12333. * Checks if `value` is a pristine native function.
  12334. *
  12335. * **Note:** This method can't reliably detect native functions in the presence
  12336. * of the core-js package because core-js circumvents this kind of detection.
  12337. * Despite multiple requests, the core-js maintainer has made it clear: any
  12338. * attempt to fix the detection will be obstructed. As a result, we're left
  12339. * with little choice but to throw an error. Unfortunately, this also affects
  12340. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12341. * which rely on core-js.
  12342. *
  12343. * @static
  12344. * @memberOf _
  12345. * @since 3.0.0
  12346. * @category Lang
  12347. * @param {*} value The value to check.
  12348. * @returns {boolean} Returns `true` if `value` is a native function,
  12349. * else `false`.
  12350. * @example
  12351. *
  12352. * _.isNative(Array.prototype.push);
  12353. * // => true
  12354. *
  12355. * _.isNative(_);
  12356. * // => false
  12357. */
  12358. function isNative(value) {
  12359. if (isMaskable(value)) {
  12360. throw new Error(CORE_ERROR_TEXT);
  12361. }
  12362. return baseIsNative(value);
  12363. }
  12364. /**
  12365. * Checks if `value` is `null`.
  12366. *
  12367. * @static
  12368. * @memberOf _
  12369. * @since 0.1.0
  12370. * @category Lang
  12371. * @param {*} value The value to check.
  12372. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12373. * @example
  12374. *
  12375. * _.isNull(null);
  12376. * // => true
  12377. *
  12378. * _.isNull(void 0);
  12379. * // => false
  12380. */
  12381. function isNull(value) {
  12382. return value === null;
  12383. }
  12384. /**
  12385. * Checks if `value` is `null` or `undefined`.
  12386. *
  12387. * @static
  12388. * @memberOf _
  12389. * @since 4.0.0
  12390. * @category Lang
  12391. * @param {*} value The value to check.
  12392. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12393. * @example
  12394. *
  12395. * _.isNil(null);
  12396. * // => true
  12397. *
  12398. * _.isNil(void 0);
  12399. * // => true
  12400. *
  12401. * _.isNil(NaN);
  12402. * // => false
  12403. */
  12404. function isNil(value) {
  12405. return value == null;
  12406. }
  12407. /**
  12408. * Checks if `value` is classified as a `Number` primitive or object.
  12409. *
  12410. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12411. * classified as numbers, use the `_.isFinite` method.
  12412. *
  12413. * @static
  12414. * @memberOf _
  12415. * @since 0.1.0
  12416. * @category Lang
  12417. * @param {*} value The value to check.
  12418. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12419. * @example
  12420. *
  12421. * _.isNumber(3);
  12422. * // => true
  12423. *
  12424. * _.isNumber(Number.MIN_VALUE);
  12425. * // => true
  12426. *
  12427. * _.isNumber(Infinity);
  12428. * // => true
  12429. *
  12430. * _.isNumber('3');
  12431. * // => false
  12432. */
  12433. function isNumber(value) {
  12434. return typeof value == 'number' ||
  12435. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12436. }
  12437. /**
  12438. * Checks if `value` is a plain object, that is, an object created by the
  12439. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12440. *
  12441. * @static
  12442. * @memberOf _
  12443. * @since 0.8.0
  12444. * @category Lang
  12445. * @param {*} value The value to check.
  12446. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12447. * @example
  12448. *
  12449. * function Foo() {
  12450. * this.a = 1;
  12451. * }
  12452. *
  12453. * _.isPlainObject(new Foo);
  12454. * // => false
  12455. *
  12456. * _.isPlainObject([1, 2, 3]);
  12457. * // => false
  12458. *
  12459. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12460. * // => true
  12461. *
  12462. * _.isPlainObject(Object.create(null));
  12463. * // => true
  12464. */
  12465. function isPlainObject(value) {
  12466. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12467. return false;
  12468. }
  12469. var proto = getPrototype(value);
  12470. if (proto === null) {
  12471. return true;
  12472. }
  12473. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12474. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12475. funcToString.call(Ctor) == objectCtorString;
  12476. }
  12477. /**
  12478. * Checks if `value` is classified as a `RegExp` object.
  12479. *
  12480. * @static
  12481. * @memberOf _
  12482. * @since 0.1.0
  12483. * @category Lang
  12484. * @param {*} value The value to check.
  12485. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12486. * @example
  12487. *
  12488. * _.isRegExp(/abc/);
  12489. * // => true
  12490. *
  12491. * _.isRegExp('/abc/');
  12492. * // => false
  12493. */
  12494. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12495. /**
  12496. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12497. * double precision number which isn't the result of a rounded unsafe integer.
  12498. *
  12499. * **Note:** This method is based on
  12500. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12501. *
  12502. * @static
  12503. * @memberOf _
  12504. * @since 4.0.0
  12505. * @category Lang
  12506. * @param {*} value The value to check.
  12507. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12508. * @example
  12509. *
  12510. * _.isSafeInteger(3);
  12511. * // => true
  12512. *
  12513. * _.isSafeInteger(Number.MIN_VALUE);
  12514. * // => false
  12515. *
  12516. * _.isSafeInteger(Infinity);
  12517. * // => false
  12518. *
  12519. * _.isSafeInteger('3');
  12520. * // => false
  12521. */
  12522. function isSafeInteger(value) {
  12523. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12524. }
  12525. /**
  12526. * Checks if `value` is classified as a `Set` object.
  12527. *
  12528. * @static
  12529. * @memberOf _
  12530. * @since 4.3.0
  12531. * @category Lang
  12532. * @param {*} value The value to check.
  12533. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12534. * @example
  12535. *
  12536. * _.isSet(new Set);
  12537. * // => true
  12538. *
  12539. * _.isSet(new WeakSet);
  12540. * // => false
  12541. */
  12542. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12543. /**
  12544. * Checks if `value` is classified as a `String` primitive or object.
  12545. *
  12546. * @static
  12547. * @since 0.1.0
  12548. * @memberOf _
  12549. * @category Lang
  12550. * @param {*} value The value to check.
  12551. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12552. * @example
  12553. *
  12554. * _.isString('abc');
  12555. * // => true
  12556. *
  12557. * _.isString(1);
  12558. * // => false
  12559. */
  12560. function isString(value) {
  12561. return typeof value == 'string' ||
  12562. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12563. }
  12564. /**
  12565. * Checks if `value` is classified as a `Symbol` primitive or object.
  12566. *
  12567. * @static
  12568. * @memberOf _
  12569. * @since 4.0.0
  12570. * @category Lang
  12571. * @param {*} value The value to check.
  12572. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12573. * @example
  12574. *
  12575. * _.isSymbol(Symbol.iterator);
  12576. * // => true
  12577. *
  12578. * _.isSymbol('abc');
  12579. * // => false
  12580. */
  12581. function isSymbol(value) {
  12582. return typeof value == 'symbol' ||
  12583. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12584. }
  12585. /**
  12586. * Checks if `value` is classified as a typed array.
  12587. *
  12588. * @static
  12589. * @memberOf _
  12590. * @since 3.0.0
  12591. * @category Lang
  12592. * @param {*} value The value to check.
  12593. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12594. * @example
  12595. *
  12596. * _.isTypedArray(new Uint8Array);
  12597. * // => true
  12598. *
  12599. * _.isTypedArray([]);
  12600. * // => false
  12601. */
  12602. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12603. /**
  12604. * Checks if `value` is `undefined`.
  12605. *
  12606. * @static
  12607. * @since 0.1.0
  12608. * @memberOf _
  12609. * @category Lang
  12610. * @param {*} value The value to check.
  12611. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12612. * @example
  12613. *
  12614. * _.isUndefined(void 0);
  12615. * // => true
  12616. *
  12617. * _.isUndefined(null);
  12618. * // => false
  12619. */
  12620. function isUndefined(value) {
  12621. return value === undefined;
  12622. }
  12623. /**
  12624. * Checks if `value` is classified as a `WeakMap` object.
  12625. *
  12626. * @static
  12627. * @memberOf _
  12628. * @since 4.3.0
  12629. * @category Lang
  12630. * @param {*} value The value to check.
  12631. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12632. * @example
  12633. *
  12634. * _.isWeakMap(new WeakMap);
  12635. * // => true
  12636. *
  12637. * _.isWeakMap(new Map);
  12638. * // => false
  12639. */
  12640. function isWeakMap(value) {
  12641. return isObjectLike(value) && getTag(value) == weakMapTag;
  12642. }
  12643. /**
  12644. * Checks if `value` is classified as a `WeakSet` object.
  12645. *
  12646. * @static
  12647. * @memberOf _
  12648. * @since 4.3.0
  12649. * @category Lang
  12650. * @param {*} value The value to check.
  12651. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12652. * @example
  12653. *
  12654. * _.isWeakSet(new WeakSet);
  12655. * // => true
  12656. *
  12657. * _.isWeakSet(new Set);
  12658. * // => false
  12659. */
  12660. function isWeakSet(value) {
  12661. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12662. }
  12663. /**
  12664. * Checks if `value` is less than `other`.
  12665. *
  12666. * @static
  12667. * @memberOf _
  12668. * @since 3.9.0
  12669. * @category Lang
  12670. * @param {*} value The value to compare.
  12671. * @param {*} other The other value to compare.
  12672. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12673. * else `false`.
  12674. * @see _.gt
  12675. * @example
  12676. *
  12677. * _.lt(1, 3);
  12678. * // => true
  12679. *
  12680. * _.lt(3, 3);
  12681. * // => false
  12682. *
  12683. * _.lt(3, 1);
  12684. * // => false
  12685. */
  12686. var lt = createRelationalOperation(baseLt);
  12687. /**
  12688. * Checks if `value` is less than or equal to `other`.
  12689. *
  12690. * @static
  12691. * @memberOf _
  12692. * @since 3.9.0
  12693. * @category Lang
  12694. * @param {*} value The value to compare.
  12695. * @param {*} other The other value to compare.
  12696. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12697. * `other`, else `false`.
  12698. * @see _.gte
  12699. * @example
  12700. *
  12701. * _.lte(1, 3);
  12702. * // => true
  12703. *
  12704. * _.lte(3, 3);
  12705. * // => true
  12706. *
  12707. * _.lte(3, 1);
  12708. * // => false
  12709. */
  12710. var lte = createRelationalOperation(function(value, other) {
  12711. return value <= other;
  12712. });
  12713. /**
  12714. * Converts `value` to an array.
  12715. *
  12716. * @static
  12717. * @since 0.1.0
  12718. * @memberOf _
  12719. * @category Lang
  12720. * @param {*} value The value to convert.
  12721. * @returns {Array} Returns the converted array.
  12722. * @example
  12723. *
  12724. * _.toArray({ 'a': 1, 'b': 2 });
  12725. * // => [1, 2]
  12726. *
  12727. * _.toArray('abc');
  12728. * // => ['a', 'b', 'c']
  12729. *
  12730. * _.toArray(1);
  12731. * // => []
  12732. *
  12733. * _.toArray(null);
  12734. * // => []
  12735. */
  12736. function toArray(value) {
  12737. if (!value) {
  12738. return [];
  12739. }
  12740. if (isArrayLike(value)) {
  12741. return isString(value) ? stringToArray(value) : copyArray(value);
  12742. }
  12743. if (symIterator && value[symIterator]) {
  12744. return iteratorToArray(value[symIterator]());
  12745. }
  12746. var tag = getTag(value),
  12747. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12748. return func(value);
  12749. }
  12750. /**
  12751. * Converts `value` to a finite number.
  12752. *
  12753. * @static
  12754. * @memberOf _
  12755. * @since 4.12.0
  12756. * @category Lang
  12757. * @param {*} value The value to convert.
  12758. * @returns {number} Returns the converted number.
  12759. * @example
  12760. *
  12761. * _.toFinite(3.2);
  12762. * // => 3.2
  12763. *
  12764. * _.toFinite(Number.MIN_VALUE);
  12765. * // => 5e-324
  12766. *
  12767. * _.toFinite(Infinity);
  12768. * // => 1.7976931348623157e+308
  12769. *
  12770. * _.toFinite('3.2');
  12771. * // => 3.2
  12772. */
  12773. function toFinite(value) {
  12774. if (!value) {
  12775. return value === 0 ? value : 0;
  12776. }
  12777. value = toNumber(value);
  12778. if (value === INFINITY || value === -INFINITY) {
  12779. var sign = (value < 0 ? -1 : 1);
  12780. return sign * MAX_INTEGER;
  12781. }
  12782. return value === value ? value : 0;
  12783. }
  12784. /**
  12785. * Converts `value` to an integer.
  12786. *
  12787. * **Note:** This method is loosely based on
  12788. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12789. *
  12790. * @static
  12791. * @memberOf _
  12792. * @since 4.0.0
  12793. * @category Lang
  12794. * @param {*} value The value to convert.
  12795. * @returns {number} Returns the converted integer.
  12796. * @example
  12797. *
  12798. * _.toInteger(3.2);
  12799. * // => 3
  12800. *
  12801. * _.toInteger(Number.MIN_VALUE);
  12802. * // => 0
  12803. *
  12804. * _.toInteger(Infinity);
  12805. * // => 1.7976931348623157e+308
  12806. *
  12807. * _.toInteger('3.2');
  12808. * // => 3
  12809. */
  12810. function toInteger(value) {
  12811. var result = toFinite(value),
  12812. remainder = result % 1;
  12813. return result === result ? (remainder ? result - remainder : result) : 0;
  12814. }
  12815. /**
  12816. * Converts `value` to an integer suitable for use as the length of an
  12817. * array-like object.
  12818. *
  12819. * **Note:** This method is based on
  12820. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12821. *
  12822. * @static
  12823. * @memberOf _
  12824. * @since 4.0.0
  12825. * @category Lang
  12826. * @param {*} value The value to convert.
  12827. * @returns {number} Returns the converted integer.
  12828. * @example
  12829. *
  12830. * _.toLength(3.2);
  12831. * // => 3
  12832. *
  12833. * _.toLength(Number.MIN_VALUE);
  12834. * // => 0
  12835. *
  12836. * _.toLength(Infinity);
  12837. * // => 4294967295
  12838. *
  12839. * _.toLength('3.2');
  12840. * // => 3
  12841. */
  12842. function toLength(value) {
  12843. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12844. }
  12845. /**
  12846. * Converts `value` to a number.
  12847. *
  12848. * @static
  12849. * @memberOf _
  12850. * @since 4.0.0
  12851. * @category Lang
  12852. * @param {*} value The value to process.
  12853. * @returns {number} Returns the number.
  12854. * @example
  12855. *
  12856. * _.toNumber(3.2);
  12857. * // => 3.2
  12858. *
  12859. * _.toNumber(Number.MIN_VALUE);
  12860. * // => 5e-324
  12861. *
  12862. * _.toNumber(Infinity);
  12863. * // => Infinity
  12864. *
  12865. * _.toNumber('3.2');
  12866. * // => 3.2
  12867. */
  12868. function toNumber(value) {
  12869. if (typeof value == 'number') {
  12870. return value;
  12871. }
  12872. if (isSymbol(value)) {
  12873. return NAN;
  12874. }
  12875. if (isObject(value)) {
  12876. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12877. value = isObject(other) ? (other + '') : other;
  12878. }
  12879. if (typeof value != 'string') {
  12880. return value === 0 ? value : +value;
  12881. }
  12882. value = baseTrim(value);
  12883. var isBinary = reIsBinary.test(value);
  12884. return (isBinary || reIsOctal.test(value))
  12885. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12886. : (reIsBadHex.test(value) ? NAN : +value);
  12887. }
  12888. /**
  12889. * Converts `value` to a plain object flattening inherited enumerable string
  12890. * keyed properties of `value` to own properties of the plain object.
  12891. *
  12892. * @static
  12893. * @memberOf _
  12894. * @since 3.0.0
  12895. * @category Lang
  12896. * @param {*} value The value to convert.
  12897. * @returns {Object} Returns the converted plain object.
  12898. * @example
  12899. *
  12900. * function Foo() {
  12901. * this.b = 2;
  12902. * }
  12903. *
  12904. * Foo.prototype.c = 3;
  12905. *
  12906. * _.assign({ 'a': 1 }, new Foo);
  12907. * // => { 'a': 1, 'b': 2 }
  12908. *
  12909. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12910. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12911. */
  12912. function toPlainObject(value) {
  12913. return copyObject(value, keysIn(value));
  12914. }
  12915. /**
  12916. * Converts `value` to a safe integer. A safe integer can be compared and
  12917. * represented correctly.
  12918. *
  12919. * @static
  12920. * @memberOf _
  12921. * @since 4.0.0
  12922. * @category Lang
  12923. * @param {*} value The value to convert.
  12924. * @returns {number} Returns the converted integer.
  12925. * @example
  12926. *
  12927. * _.toSafeInteger(3.2);
  12928. * // => 3
  12929. *
  12930. * _.toSafeInteger(Number.MIN_VALUE);
  12931. * // => 0
  12932. *
  12933. * _.toSafeInteger(Infinity);
  12934. * // => 9007199254740991
  12935. *
  12936. * _.toSafeInteger('3.2');
  12937. * // => 3
  12938. */
  12939. function toSafeInteger(value) {
  12940. return value
  12941. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12942. : (value === 0 ? value : 0);
  12943. }
  12944. /**
  12945. * Converts `value` to a string. An empty string is returned for `null`
  12946. * and `undefined` values. The sign of `-0` is preserved.
  12947. *
  12948. * @static
  12949. * @memberOf _
  12950. * @since 4.0.0
  12951. * @category Lang
  12952. * @param {*} value The value to convert.
  12953. * @returns {string} Returns the converted string.
  12954. * @example
  12955. *
  12956. * _.toString(null);
  12957. * // => ''
  12958. *
  12959. * _.toString(-0);
  12960. * // => '-0'
  12961. *
  12962. * _.toString([1, 2, 3]);
  12963. * // => '1,2,3'
  12964. */
  12965. function toString(value) {
  12966. return value == null ? '' : baseToString(value);
  12967. }
  12968. /*------------------------------------------------------------------------*/
  12969. /**
  12970. * Assigns own enumerable string keyed properties of source objects to the
  12971. * destination object. Source objects are applied from left to right.
  12972. * Subsequent sources overwrite property assignments of previous sources.
  12973. *
  12974. * **Note:** This method mutates `object` and is loosely based on
  12975. * [`Object.assign`](https://mdn.io/Object/assign).
  12976. *
  12977. * @static
  12978. * @memberOf _
  12979. * @since 0.10.0
  12980. * @category Object
  12981. * @param {Object} object The destination object.
  12982. * @param {...Object} [sources] The source objects.
  12983. * @returns {Object} Returns `object`.
  12984. * @see _.assignIn
  12985. * @example
  12986. *
  12987. * function Foo() {
  12988. * this.a = 1;
  12989. * }
  12990. *
  12991. * function Bar() {
  12992. * this.c = 3;
  12993. * }
  12994. *
  12995. * Foo.prototype.b = 2;
  12996. * Bar.prototype.d = 4;
  12997. *
  12998. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12999. * // => { 'a': 1, 'c': 3 }
  13000. */
  13001. var assign = createAssigner(function(object, source) {
  13002. if (isPrototype(source) || isArrayLike(source)) {
  13003. copyObject(source, keys(source), object);
  13004. return;
  13005. }
  13006. for (var key in source) {
  13007. if (hasOwnProperty.call(source, key)) {
  13008. assignValue(object, key, source[key]);
  13009. }
  13010. }
  13011. });
  13012. /**
  13013. * This method is like `_.assign` except that it iterates over own and
  13014. * inherited source properties.
  13015. *
  13016. * **Note:** This method mutates `object`.
  13017. *
  13018. * @static
  13019. * @memberOf _
  13020. * @since 4.0.0
  13021. * @alias extend
  13022. * @category Object
  13023. * @param {Object} object The destination object.
  13024. * @param {...Object} [sources] The source objects.
  13025. * @returns {Object} Returns `object`.
  13026. * @see _.assign
  13027. * @example
  13028. *
  13029. * function Foo() {
  13030. * this.a = 1;
  13031. * }
  13032. *
  13033. * function Bar() {
  13034. * this.c = 3;
  13035. * }
  13036. *
  13037. * Foo.prototype.b = 2;
  13038. * Bar.prototype.d = 4;
  13039. *
  13040. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13041. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13042. */
  13043. var assignIn = createAssigner(function(object, source) {
  13044. copyObject(source, keysIn(source), object);
  13045. });
  13046. /**
  13047. * This method is like `_.assignIn` except that it accepts `customizer`
  13048. * which is invoked to produce the assigned values. If `customizer` returns
  13049. * `undefined`, assignment is handled by the method instead. The `customizer`
  13050. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13051. *
  13052. * **Note:** This method mutates `object`.
  13053. *
  13054. * @static
  13055. * @memberOf _
  13056. * @since 4.0.0
  13057. * @alias extendWith
  13058. * @category Object
  13059. * @param {Object} object The destination object.
  13060. * @param {...Object} sources The source objects.
  13061. * @param {Function} [customizer] The function to customize assigned values.
  13062. * @returns {Object} Returns `object`.
  13063. * @see _.assignWith
  13064. * @example
  13065. *
  13066. * function customizer(objValue, srcValue) {
  13067. * return _.isUndefined(objValue) ? srcValue : objValue;
  13068. * }
  13069. *
  13070. * var defaults = _.partialRight(_.assignInWith, customizer);
  13071. *
  13072. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13073. * // => { 'a': 1, 'b': 2 }
  13074. */
  13075. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13076. copyObject(source, keysIn(source), object, customizer);
  13077. });
  13078. /**
  13079. * This method is like `_.assign` except that it accepts `customizer`
  13080. * which is invoked to produce the assigned values. If `customizer` returns
  13081. * `undefined`, assignment is handled by the method instead. The `customizer`
  13082. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13083. *
  13084. * **Note:** This method mutates `object`.
  13085. *
  13086. * @static
  13087. * @memberOf _
  13088. * @since 4.0.0
  13089. * @category Object
  13090. * @param {Object} object The destination object.
  13091. * @param {...Object} sources The source objects.
  13092. * @param {Function} [customizer] The function to customize assigned values.
  13093. * @returns {Object} Returns `object`.
  13094. * @see _.assignInWith
  13095. * @example
  13096. *
  13097. * function customizer(objValue, srcValue) {
  13098. * return _.isUndefined(objValue) ? srcValue : objValue;
  13099. * }
  13100. *
  13101. * var defaults = _.partialRight(_.assignWith, customizer);
  13102. *
  13103. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13104. * // => { 'a': 1, 'b': 2 }
  13105. */
  13106. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13107. copyObject(source, keys(source), object, customizer);
  13108. });
  13109. /**
  13110. * Creates an array of values corresponding to `paths` of `object`.
  13111. *
  13112. * @static
  13113. * @memberOf _
  13114. * @since 1.0.0
  13115. * @category Object
  13116. * @param {Object} object The object to iterate over.
  13117. * @param {...(string|string[])} [paths] The property paths to pick.
  13118. * @returns {Array} Returns the picked values.
  13119. * @example
  13120. *
  13121. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13122. *
  13123. * _.at(object, ['a[0].b.c', 'a[1]']);
  13124. * // => [3, 4]
  13125. */
  13126. var at = flatRest(baseAt);
  13127. /**
  13128. * Creates an object that inherits from the `prototype` object. If a
  13129. * `properties` object is given, its own enumerable string keyed properties
  13130. * are assigned to the created object.
  13131. *
  13132. * @static
  13133. * @memberOf _
  13134. * @since 2.3.0
  13135. * @category Object
  13136. * @param {Object} prototype The object to inherit from.
  13137. * @param {Object} [properties] The properties to assign to the object.
  13138. * @returns {Object} Returns the new object.
  13139. * @example
  13140. *
  13141. * function Shape() {
  13142. * this.x = 0;
  13143. * this.y = 0;
  13144. * }
  13145. *
  13146. * function Circle() {
  13147. * Shape.call(this);
  13148. * }
  13149. *
  13150. * Circle.prototype = _.create(Shape.prototype, {
  13151. * 'constructor': Circle
  13152. * });
  13153. *
  13154. * var circle = new Circle;
  13155. * circle instanceof Circle;
  13156. * // => true
  13157. *
  13158. * circle instanceof Shape;
  13159. * // => true
  13160. */
  13161. function create(prototype, properties) {
  13162. var result = baseCreate(prototype);
  13163. return properties == null ? result : baseAssign(result, properties);
  13164. }
  13165. /**
  13166. * Assigns own and inherited enumerable string keyed properties of source
  13167. * objects to the destination object for all destination properties that
  13168. * resolve to `undefined`. Source objects are applied from left to right.
  13169. * Once a property is set, additional values of the same property are ignored.
  13170. *
  13171. * **Note:** This method mutates `object`.
  13172. *
  13173. * @static
  13174. * @since 0.1.0
  13175. * @memberOf _
  13176. * @category Object
  13177. * @param {Object} object The destination object.
  13178. * @param {...Object} [sources] The source objects.
  13179. * @returns {Object} Returns `object`.
  13180. * @see _.defaultsDeep
  13181. * @example
  13182. *
  13183. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13184. * // => { 'a': 1, 'b': 2 }
  13185. */
  13186. var defaults = baseRest(function(object, sources) {
  13187. object = Object(object);
  13188. var index = -1;
  13189. var length = sources.length;
  13190. var guard = length > 2 ? sources[2] : undefined;
  13191. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13192. length = 1;
  13193. }
  13194. while (++index < length) {
  13195. var source = sources[index];
  13196. var props = keysIn(source);
  13197. var propsIndex = -1;
  13198. var propsLength = props.length;
  13199. while (++propsIndex < propsLength) {
  13200. var key = props[propsIndex];
  13201. var value = object[key];
  13202. if (value === undefined ||
  13203. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13204. object[key] = source[key];
  13205. }
  13206. }
  13207. }
  13208. return object;
  13209. });
  13210. /**
  13211. * This method is like `_.defaults` except that it recursively assigns
  13212. * default properties.
  13213. *
  13214. * **Note:** This method mutates `object`.
  13215. *
  13216. * @static
  13217. * @memberOf _
  13218. * @since 3.10.0
  13219. * @category Object
  13220. * @param {Object} object The destination object.
  13221. * @param {...Object} [sources] The source objects.
  13222. * @returns {Object} Returns `object`.
  13223. * @see _.defaults
  13224. * @example
  13225. *
  13226. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13227. * // => { 'a': { 'b': 2, 'c': 3 } }
  13228. */
  13229. var defaultsDeep = baseRest(function(args) {
  13230. args.push(undefined, customDefaultsMerge);
  13231. return apply(mergeWith, undefined, args);
  13232. });
  13233. /**
  13234. * This method is like `_.find` except that it returns the key of the first
  13235. * element `predicate` returns truthy for instead of the element itself.
  13236. *
  13237. * @static
  13238. * @memberOf _
  13239. * @since 1.1.0
  13240. * @category Object
  13241. * @param {Object} object The object to inspect.
  13242. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13243. * @returns {string|undefined} Returns the key of the matched element,
  13244. * else `undefined`.
  13245. * @example
  13246. *
  13247. * var users = {
  13248. * 'barney': { 'age': 36, 'active': true },
  13249. * 'fred': { 'age': 40, 'active': false },
  13250. * 'pebbles': { 'age': 1, 'active': true }
  13251. * };
  13252. *
  13253. * _.findKey(users, function(o) { return o.age < 40; });
  13254. * // => 'barney' (iteration order is not guaranteed)
  13255. *
  13256. * // The `_.matches` iteratee shorthand.
  13257. * _.findKey(users, { 'age': 1, 'active': true });
  13258. * // => 'pebbles'
  13259. *
  13260. * // The `_.matchesProperty` iteratee shorthand.
  13261. * _.findKey(users, ['active', false]);
  13262. * // => 'fred'
  13263. *
  13264. * // The `_.property` iteratee shorthand.
  13265. * _.findKey(users, 'active');
  13266. * // => 'barney'
  13267. */
  13268. function findKey(object, predicate) {
  13269. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13270. }
  13271. /**
  13272. * This method is like `_.findKey` except that it iterates over elements of
  13273. * a collection in the opposite order.
  13274. *
  13275. * @static
  13276. * @memberOf _
  13277. * @since 2.0.0
  13278. * @category Object
  13279. * @param {Object} object The object to inspect.
  13280. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13281. * @returns {string|undefined} Returns the key of the matched element,
  13282. * else `undefined`.
  13283. * @example
  13284. *
  13285. * var users = {
  13286. * 'barney': { 'age': 36, 'active': true },
  13287. * 'fred': { 'age': 40, 'active': false },
  13288. * 'pebbles': { 'age': 1, 'active': true }
  13289. * };
  13290. *
  13291. * _.findLastKey(users, function(o) { return o.age < 40; });
  13292. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13293. *
  13294. * // The `_.matches` iteratee shorthand.
  13295. * _.findLastKey(users, { 'age': 36, 'active': true });
  13296. * // => 'barney'
  13297. *
  13298. * // The `_.matchesProperty` iteratee shorthand.
  13299. * _.findLastKey(users, ['active', false]);
  13300. * // => 'fred'
  13301. *
  13302. * // The `_.property` iteratee shorthand.
  13303. * _.findLastKey(users, 'active');
  13304. * // => 'pebbles'
  13305. */
  13306. function findLastKey(object, predicate) {
  13307. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13308. }
  13309. /**
  13310. * Iterates over own and inherited enumerable string keyed properties of an
  13311. * object and invokes `iteratee` for each property. The iteratee is invoked
  13312. * with three arguments: (value, key, object). Iteratee functions may exit
  13313. * iteration early by explicitly returning `false`.
  13314. *
  13315. * @static
  13316. * @memberOf _
  13317. * @since 0.3.0
  13318. * @category Object
  13319. * @param {Object} object The object to iterate over.
  13320. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13321. * @returns {Object} Returns `object`.
  13322. * @see _.forInRight
  13323. * @example
  13324. *
  13325. * function Foo() {
  13326. * this.a = 1;
  13327. * this.b = 2;
  13328. * }
  13329. *
  13330. * Foo.prototype.c = 3;
  13331. *
  13332. * _.forIn(new Foo, function(value, key) {
  13333. * console.log(key);
  13334. * });
  13335. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13336. */
  13337. function forIn(object, iteratee) {
  13338. return object == null
  13339. ? object
  13340. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13341. }
  13342. /**
  13343. * This method is like `_.forIn` except that it iterates over properties of
  13344. * `object` in the opposite order.
  13345. *
  13346. * @static
  13347. * @memberOf _
  13348. * @since 2.0.0
  13349. * @category Object
  13350. * @param {Object} object The object to iterate over.
  13351. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13352. * @returns {Object} Returns `object`.
  13353. * @see _.forIn
  13354. * @example
  13355. *
  13356. * function Foo() {
  13357. * this.a = 1;
  13358. * this.b = 2;
  13359. * }
  13360. *
  13361. * Foo.prototype.c = 3;
  13362. *
  13363. * _.forInRight(new Foo, function(value, key) {
  13364. * console.log(key);
  13365. * });
  13366. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13367. */
  13368. function forInRight(object, iteratee) {
  13369. return object == null
  13370. ? object
  13371. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13372. }
  13373. /**
  13374. * Iterates over own enumerable string keyed properties of an object and
  13375. * invokes `iteratee` for each property. The iteratee is invoked with three
  13376. * arguments: (value, key, object). Iteratee functions may exit iteration
  13377. * early by explicitly returning `false`.
  13378. *
  13379. * @static
  13380. * @memberOf _
  13381. * @since 0.3.0
  13382. * @category Object
  13383. * @param {Object} object The object to iterate over.
  13384. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13385. * @returns {Object} Returns `object`.
  13386. * @see _.forOwnRight
  13387. * @example
  13388. *
  13389. * function Foo() {
  13390. * this.a = 1;
  13391. * this.b = 2;
  13392. * }
  13393. *
  13394. * Foo.prototype.c = 3;
  13395. *
  13396. * _.forOwn(new Foo, function(value, key) {
  13397. * console.log(key);
  13398. * });
  13399. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13400. */
  13401. function forOwn(object, iteratee) {
  13402. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13403. }
  13404. /**
  13405. * This method is like `_.forOwn` except that it iterates over properties of
  13406. * `object` in the opposite order.
  13407. *
  13408. * @static
  13409. * @memberOf _
  13410. * @since 2.0.0
  13411. * @category Object
  13412. * @param {Object} object The object to iterate over.
  13413. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13414. * @returns {Object} Returns `object`.
  13415. * @see _.forOwn
  13416. * @example
  13417. *
  13418. * function Foo() {
  13419. * this.a = 1;
  13420. * this.b = 2;
  13421. * }
  13422. *
  13423. * Foo.prototype.c = 3;
  13424. *
  13425. * _.forOwnRight(new Foo, function(value, key) {
  13426. * console.log(key);
  13427. * });
  13428. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13429. */
  13430. function forOwnRight(object, iteratee) {
  13431. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13432. }
  13433. /**
  13434. * Creates an array of function property names from own enumerable properties
  13435. * of `object`.
  13436. *
  13437. * @static
  13438. * @since 0.1.0
  13439. * @memberOf _
  13440. * @category Object
  13441. * @param {Object} object The object to inspect.
  13442. * @returns {Array} Returns the function names.
  13443. * @see _.functionsIn
  13444. * @example
  13445. *
  13446. * function Foo() {
  13447. * this.a = _.constant('a');
  13448. * this.b = _.constant('b');
  13449. * }
  13450. *
  13451. * Foo.prototype.c = _.constant('c');
  13452. *
  13453. * _.functions(new Foo);
  13454. * // => ['a', 'b']
  13455. */
  13456. function functions(object) {
  13457. return object == null ? [] : baseFunctions(object, keys(object));
  13458. }
  13459. /**
  13460. * Creates an array of function property names from own and inherited
  13461. * enumerable properties of `object`.
  13462. *
  13463. * @static
  13464. * @memberOf _
  13465. * @since 4.0.0
  13466. * @category Object
  13467. * @param {Object} object The object to inspect.
  13468. * @returns {Array} Returns the function names.
  13469. * @see _.functions
  13470. * @example
  13471. *
  13472. * function Foo() {
  13473. * this.a = _.constant('a');
  13474. * this.b = _.constant('b');
  13475. * }
  13476. *
  13477. * Foo.prototype.c = _.constant('c');
  13478. *
  13479. * _.functionsIn(new Foo);
  13480. * // => ['a', 'b', 'c']
  13481. */
  13482. function functionsIn(object) {
  13483. return object == null ? [] : baseFunctions(object, keysIn(object));
  13484. }
  13485. /**
  13486. * Gets the value at `path` of `object`. If the resolved value is
  13487. * `undefined`, the `defaultValue` is returned in its place.
  13488. *
  13489. * @static
  13490. * @memberOf _
  13491. * @since 3.7.0
  13492. * @category Object
  13493. * @param {Object} object The object to query.
  13494. * @param {Array|string} path The path of the property to get.
  13495. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13496. * @returns {*} Returns the resolved value.
  13497. * @example
  13498. *
  13499. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13500. *
  13501. * _.get(object, 'a[0].b.c');
  13502. * // => 3
  13503. *
  13504. * _.get(object, ['a', '0', 'b', 'c']);
  13505. * // => 3
  13506. *
  13507. * _.get(object, 'a.b.c', 'default');
  13508. * // => 'default'
  13509. */
  13510. function get(object, path, defaultValue) {
  13511. var result = object == null ? undefined : baseGet(object, path);
  13512. return result === undefined ? defaultValue : result;
  13513. }
  13514. /**
  13515. * Checks if `path` is a direct property of `object`.
  13516. *
  13517. * @static
  13518. * @since 0.1.0
  13519. * @memberOf _
  13520. * @category Object
  13521. * @param {Object} object The object to query.
  13522. * @param {Array|string} path The path to check.
  13523. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13524. * @example
  13525. *
  13526. * var object = { 'a': { 'b': 2 } };
  13527. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13528. *
  13529. * _.has(object, 'a');
  13530. * // => true
  13531. *
  13532. * _.has(object, 'a.b');
  13533. * // => true
  13534. *
  13535. * _.has(object, ['a', 'b']);
  13536. * // => true
  13537. *
  13538. * _.has(other, 'a');
  13539. * // => false
  13540. */
  13541. function has(object, path) {
  13542. return object != null && hasPath(object, path, baseHas);
  13543. }
  13544. /**
  13545. * Checks if `path` is a direct or inherited property of `object`.
  13546. *
  13547. * @static
  13548. * @memberOf _
  13549. * @since 4.0.0
  13550. * @category Object
  13551. * @param {Object} object The object to query.
  13552. * @param {Array|string} path The path to check.
  13553. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13554. * @example
  13555. *
  13556. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13557. *
  13558. * _.hasIn(object, 'a');
  13559. * // => true
  13560. *
  13561. * _.hasIn(object, 'a.b');
  13562. * // => true
  13563. *
  13564. * _.hasIn(object, ['a', 'b']);
  13565. * // => true
  13566. *
  13567. * _.hasIn(object, 'b');
  13568. * // => false
  13569. */
  13570. function hasIn(object, path) {
  13571. return object != null && hasPath(object, path, baseHasIn);
  13572. }
  13573. /**
  13574. * Creates an object composed of the inverted keys and values of `object`.
  13575. * If `object` contains duplicate values, subsequent values overwrite
  13576. * property assignments of previous values.
  13577. *
  13578. * @static
  13579. * @memberOf _
  13580. * @since 0.7.0
  13581. * @category Object
  13582. * @param {Object} object The object to invert.
  13583. * @returns {Object} Returns the new inverted object.
  13584. * @example
  13585. *
  13586. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13587. *
  13588. * _.invert(object);
  13589. * // => { '1': 'c', '2': 'b' }
  13590. */
  13591. var invert = createInverter(function(result, value, key) {
  13592. if (value != null &&
  13593. typeof value.toString != 'function') {
  13594. value = nativeObjectToString.call(value);
  13595. }
  13596. result[value] = key;
  13597. }, constant(identity));
  13598. /**
  13599. * This method is like `_.invert` except that the inverted object is generated
  13600. * from the results of running each element of `object` thru `iteratee`. The
  13601. * corresponding inverted value of each inverted key is an array of keys
  13602. * responsible for generating the inverted value. The iteratee is invoked
  13603. * with one argument: (value).
  13604. *
  13605. * @static
  13606. * @memberOf _
  13607. * @since 4.1.0
  13608. * @category Object
  13609. * @param {Object} object The object to invert.
  13610. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13611. * @returns {Object} Returns the new inverted object.
  13612. * @example
  13613. *
  13614. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13615. *
  13616. * _.invertBy(object);
  13617. * // => { '1': ['a', 'c'], '2': ['b'] }
  13618. *
  13619. * _.invertBy(object, function(value) {
  13620. * return 'group' + value;
  13621. * });
  13622. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13623. */
  13624. var invertBy = createInverter(function(result, value, key) {
  13625. if (value != null &&
  13626. typeof value.toString != 'function') {
  13627. value = nativeObjectToString.call(value);
  13628. }
  13629. if (hasOwnProperty.call(result, value)) {
  13630. result[value].push(key);
  13631. } else {
  13632. result[value] = [key];
  13633. }
  13634. }, getIteratee);
  13635. /**
  13636. * Invokes the method at `path` of `object`.
  13637. *
  13638. * @static
  13639. * @memberOf _
  13640. * @since 4.0.0
  13641. * @category Object
  13642. * @param {Object} object The object to query.
  13643. * @param {Array|string} path The path of the method to invoke.
  13644. * @param {...*} [args] The arguments to invoke the method with.
  13645. * @returns {*} Returns the result of the invoked method.
  13646. * @example
  13647. *
  13648. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13649. *
  13650. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13651. * // => [2, 3]
  13652. */
  13653. var invoke = baseRest(baseInvoke);
  13654. /**
  13655. * Creates an array of the own enumerable property names of `object`.
  13656. *
  13657. * **Note:** Non-object values are coerced to objects. See the
  13658. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13659. * for more details.
  13660. *
  13661. * @static
  13662. * @since 0.1.0
  13663. * @memberOf _
  13664. * @category Object
  13665. * @param {Object} object The object to query.
  13666. * @returns {Array} Returns the array of property names.
  13667. * @example
  13668. *
  13669. * function Foo() {
  13670. * this.a = 1;
  13671. * this.b = 2;
  13672. * }
  13673. *
  13674. * Foo.prototype.c = 3;
  13675. *
  13676. * _.keys(new Foo);
  13677. * // => ['a', 'b'] (iteration order is not guaranteed)
  13678. *
  13679. * _.keys('hi');
  13680. * // => ['0', '1']
  13681. */
  13682. function keys(object) {
  13683. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13684. }
  13685. /**
  13686. * Creates an array of the own and inherited enumerable property names of `object`.
  13687. *
  13688. * **Note:** Non-object values are coerced to objects.
  13689. *
  13690. * @static
  13691. * @memberOf _
  13692. * @since 3.0.0
  13693. * @category Object
  13694. * @param {Object} object The object to query.
  13695. * @returns {Array} Returns the array of property names.
  13696. * @example
  13697. *
  13698. * function Foo() {
  13699. * this.a = 1;
  13700. * this.b = 2;
  13701. * }
  13702. *
  13703. * Foo.prototype.c = 3;
  13704. *
  13705. * _.keysIn(new Foo);
  13706. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13707. */
  13708. function keysIn(object) {
  13709. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13710. }
  13711. /**
  13712. * The opposite of `_.mapValues`; this method creates an object with the
  13713. * same values as `object` and keys generated by running each own enumerable
  13714. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13715. * with three arguments: (value, key, object).
  13716. *
  13717. * @static
  13718. * @memberOf _
  13719. * @since 3.8.0
  13720. * @category Object
  13721. * @param {Object} object The object to iterate over.
  13722. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13723. * @returns {Object} Returns the new mapped object.
  13724. * @see _.mapValues
  13725. * @example
  13726. *
  13727. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13728. * return key + value;
  13729. * });
  13730. * // => { 'a1': 1, 'b2': 2 }
  13731. */
  13732. function mapKeys(object, iteratee) {
  13733. var result = {};
  13734. iteratee = getIteratee(iteratee, 3);
  13735. baseForOwn(object, function(value, key, object) {
  13736. baseAssignValue(result, iteratee(value, key, object), value);
  13737. });
  13738. return result;
  13739. }
  13740. /**
  13741. * Creates an object with the same keys as `object` and values generated
  13742. * by running each own enumerable string keyed property of `object` thru
  13743. * `iteratee`. The iteratee is invoked with three arguments:
  13744. * (value, key, object).
  13745. *
  13746. * @static
  13747. * @memberOf _
  13748. * @since 2.4.0
  13749. * @category Object
  13750. * @param {Object} object The object to iterate over.
  13751. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13752. * @returns {Object} Returns the new mapped object.
  13753. * @see _.mapKeys
  13754. * @example
  13755. *
  13756. * var users = {
  13757. * 'fred': { 'user': 'fred', 'age': 40 },
  13758. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13759. * };
  13760. *
  13761. * _.mapValues(users, function(o) { return o.age; });
  13762. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13763. *
  13764. * // The `_.property` iteratee shorthand.
  13765. * _.mapValues(users, 'age');
  13766. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13767. */
  13768. function mapValues(object, iteratee) {
  13769. var result = {};
  13770. iteratee = getIteratee(iteratee, 3);
  13771. baseForOwn(object, function(value, key, object) {
  13772. baseAssignValue(result, key, iteratee(value, key, object));
  13773. });
  13774. return result;
  13775. }
  13776. /**
  13777. * This method is like `_.assign` except that it recursively merges own and
  13778. * inherited enumerable string keyed properties of source objects into the
  13779. * destination object. Source properties that resolve to `undefined` are
  13780. * skipped if a destination value exists. Array and plain object properties
  13781. * are merged recursively. Other objects and value types are overridden by
  13782. * assignment. Source objects are applied from left to right. Subsequent
  13783. * sources overwrite property assignments of previous sources.
  13784. *
  13785. * **Note:** This method mutates `object`.
  13786. *
  13787. * @static
  13788. * @memberOf _
  13789. * @since 0.5.0
  13790. * @category Object
  13791. * @param {Object} object The destination object.
  13792. * @param {...Object} [sources] The source objects.
  13793. * @returns {Object} Returns `object`.
  13794. * @example
  13795. *
  13796. * var object = {
  13797. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13798. * };
  13799. *
  13800. * var other = {
  13801. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13802. * };
  13803. *
  13804. * _.merge(object, other);
  13805. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13806. */
  13807. var merge = createAssigner(function(object, source, srcIndex) {
  13808. baseMerge(object, source, srcIndex);
  13809. });
  13810. /**
  13811. * This method is like `_.merge` except that it accepts `customizer` which
  13812. * is invoked to produce the merged values of the destination and source
  13813. * properties. If `customizer` returns `undefined`, merging is handled by the
  13814. * method instead. The `customizer` is invoked with six arguments:
  13815. * (objValue, srcValue, key, object, source, stack).
  13816. *
  13817. * **Note:** This method mutates `object`.
  13818. *
  13819. * @static
  13820. * @memberOf _
  13821. * @since 4.0.0
  13822. * @category Object
  13823. * @param {Object} object The destination object.
  13824. * @param {...Object} sources The source objects.
  13825. * @param {Function} customizer The function to customize assigned values.
  13826. * @returns {Object} Returns `object`.
  13827. * @example
  13828. *
  13829. * function customizer(objValue, srcValue) {
  13830. * if (_.isArray(objValue)) {
  13831. * return objValue.concat(srcValue);
  13832. * }
  13833. * }
  13834. *
  13835. * var object = { 'a': [1], 'b': [2] };
  13836. * var other = { 'a': [3], 'b': [4] };
  13837. *
  13838. * _.mergeWith(object, other, customizer);
  13839. * // => { 'a': [1, 3], 'b': [2, 4] }
  13840. */
  13841. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13842. baseMerge(object, source, srcIndex, customizer);
  13843. });
  13844. /**
  13845. * The opposite of `_.pick`; this method creates an object composed of the
  13846. * own and inherited enumerable property paths of `object` that are not omitted.
  13847. *
  13848. * **Note:** This method is considerably slower than `_.pick`.
  13849. *
  13850. * @static
  13851. * @since 0.1.0
  13852. * @memberOf _
  13853. * @category Object
  13854. * @param {Object} object The source object.
  13855. * @param {...(string|string[])} [paths] The property paths to omit.
  13856. * @returns {Object} Returns the new object.
  13857. * @example
  13858. *
  13859. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13860. *
  13861. * _.omit(object, ['a', 'c']);
  13862. * // => { 'b': '2' }
  13863. */
  13864. var omit = flatRest(function(object, paths) {
  13865. var result = {};
  13866. if (object == null) {
  13867. return result;
  13868. }
  13869. var isDeep = false;
  13870. paths = arrayMap(paths, function(path) {
  13871. path = castPath(path, object);
  13872. isDeep || (isDeep = path.length > 1);
  13873. return path;
  13874. });
  13875. copyObject(object, getAllKeysIn(object), result);
  13876. if (isDeep) {
  13877. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13878. }
  13879. var length = paths.length;
  13880. while (length--) {
  13881. baseUnset(result, paths[length]);
  13882. }
  13883. return result;
  13884. });
  13885. /**
  13886. * The opposite of `_.pickBy`; this method creates an object composed of
  13887. * the own and inherited enumerable string keyed properties of `object` that
  13888. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13889. * arguments: (value, key).
  13890. *
  13891. * @static
  13892. * @memberOf _
  13893. * @since 4.0.0
  13894. * @category Object
  13895. * @param {Object} object The source object.
  13896. * @param {Function} [predicate=_.identity] The function invoked per property.
  13897. * @returns {Object} Returns the new object.
  13898. * @example
  13899. *
  13900. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13901. *
  13902. * _.omitBy(object, _.isNumber);
  13903. * // => { 'b': '2' }
  13904. */
  13905. function omitBy(object, predicate) {
  13906. return pickBy(object, negate(getIteratee(predicate)));
  13907. }
  13908. /**
  13909. * Creates an object composed of the picked `object` properties.
  13910. *
  13911. * @static
  13912. * @since 0.1.0
  13913. * @memberOf _
  13914. * @category Object
  13915. * @param {Object} object The source object.
  13916. * @param {...(string|string[])} [paths] The property paths to pick.
  13917. * @returns {Object} Returns the new object.
  13918. * @example
  13919. *
  13920. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13921. *
  13922. * _.pick(object, ['a', 'c']);
  13923. * // => { 'a': 1, 'c': 3 }
  13924. */
  13925. var pick = flatRest(function(object, paths) {
  13926. return object == null ? {} : basePick(object, paths);
  13927. });
  13928. /**
  13929. * Creates an object composed of the `object` properties `predicate` returns
  13930. * truthy for. The predicate is invoked with two arguments: (value, key).
  13931. *
  13932. * @static
  13933. * @memberOf _
  13934. * @since 4.0.0
  13935. * @category Object
  13936. * @param {Object} object The source object.
  13937. * @param {Function} [predicate=_.identity] The function invoked per property.
  13938. * @returns {Object} Returns the new object.
  13939. * @example
  13940. *
  13941. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13942. *
  13943. * _.pickBy(object, _.isNumber);
  13944. * // => { 'a': 1, 'c': 3 }
  13945. */
  13946. function pickBy(object, predicate) {
  13947. if (object == null) {
  13948. return {};
  13949. }
  13950. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13951. return [prop];
  13952. });
  13953. predicate = getIteratee(predicate);
  13954. return basePickBy(object, props, function(value, path) {
  13955. return predicate(value, path[0]);
  13956. });
  13957. }
  13958. /**
  13959. * This method is like `_.get` except that if the resolved value is a
  13960. * function it's invoked with the `this` binding of its parent object and
  13961. * its result is returned.
  13962. *
  13963. * @static
  13964. * @since 0.1.0
  13965. * @memberOf _
  13966. * @category Object
  13967. * @param {Object} object The object to query.
  13968. * @param {Array|string} path The path of the property to resolve.
  13969. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13970. * @returns {*} Returns the resolved value.
  13971. * @example
  13972. *
  13973. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13974. *
  13975. * _.result(object, 'a[0].b.c1');
  13976. * // => 3
  13977. *
  13978. * _.result(object, 'a[0].b.c2');
  13979. * // => 4
  13980. *
  13981. * _.result(object, 'a[0].b.c3', 'default');
  13982. * // => 'default'
  13983. *
  13984. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13985. * // => 'default'
  13986. */
  13987. function result(object, path, defaultValue) {
  13988. path = castPath(path, object);
  13989. var index = -1,
  13990. length = path.length;
  13991. // Ensure the loop is entered when path is empty.
  13992. if (!length) {
  13993. length = 1;
  13994. object = undefined;
  13995. }
  13996. while (++index < length) {
  13997. var value = object == null ? undefined : object[toKey(path[index])];
  13998. if (value === undefined) {
  13999. index = length;
  14000. value = defaultValue;
  14001. }
  14002. object = isFunction(value) ? value.call(object) : value;
  14003. }
  14004. return object;
  14005. }
  14006. /**
  14007. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14008. * it's created. Arrays are created for missing index properties while objects
  14009. * are created for all other missing properties. Use `_.setWith` to customize
  14010. * `path` creation.
  14011. *
  14012. * **Note:** This method mutates `object`.
  14013. *
  14014. * @static
  14015. * @memberOf _
  14016. * @since 3.7.0
  14017. * @category Object
  14018. * @param {Object} object The object to modify.
  14019. * @param {Array|string} path The path of the property to set.
  14020. * @param {*} value The value to set.
  14021. * @returns {Object} Returns `object`.
  14022. * @example
  14023. *
  14024. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14025. *
  14026. * _.set(object, 'a[0].b.c', 4);
  14027. * console.log(object.a[0].b.c);
  14028. * // => 4
  14029. *
  14030. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14031. * console.log(object.x[0].y.z);
  14032. * // => 5
  14033. */
  14034. function set(object, path, value) {
  14035. return object == null ? object : baseSet(object, path, value);
  14036. }
  14037. /**
  14038. * This method is like `_.set` except that it accepts `customizer` which is
  14039. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14040. * path creation is handled by the method instead. The `customizer` is invoked
  14041. * with three arguments: (nsValue, key, nsObject).
  14042. *
  14043. * **Note:** This method mutates `object`.
  14044. *
  14045. * @static
  14046. * @memberOf _
  14047. * @since 4.0.0
  14048. * @category Object
  14049. * @param {Object} object The object to modify.
  14050. * @param {Array|string} path The path of the property to set.
  14051. * @param {*} value The value to set.
  14052. * @param {Function} [customizer] The function to customize assigned values.
  14053. * @returns {Object} Returns `object`.
  14054. * @example
  14055. *
  14056. * var object = {};
  14057. *
  14058. * _.setWith(object, '[0][1]', 'a', Object);
  14059. * // => { '0': { '1': 'a' } }
  14060. */
  14061. function setWith(object, path, value, customizer) {
  14062. customizer = typeof customizer == 'function' ? customizer : undefined;
  14063. return object == null ? object : baseSet(object, path, value, customizer);
  14064. }
  14065. /**
  14066. * Creates an array of own enumerable string keyed-value pairs for `object`
  14067. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14068. * entries are returned.
  14069. *
  14070. * @static
  14071. * @memberOf _
  14072. * @since 4.0.0
  14073. * @alias entries
  14074. * @category Object
  14075. * @param {Object} object The object to query.
  14076. * @returns {Array} Returns the key-value pairs.
  14077. * @example
  14078. *
  14079. * function Foo() {
  14080. * this.a = 1;
  14081. * this.b = 2;
  14082. * }
  14083. *
  14084. * Foo.prototype.c = 3;
  14085. *
  14086. * _.toPairs(new Foo);
  14087. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14088. */
  14089. var toPairs = createToPairs(keys);
  14090. /**
  14091. * Creates an array of own and inherited enumerable string keyed-value pairs
  14092. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14093. * or set, its entries are returned.
  14094. *
  14095. * @static
  14096. * @memberOf _
  14097. * @since 4.0.0
  14098. * @alias entriesIn
  14099. * @category Object
  14100. * @param {Object} object The object to query.
  14101. * @returns {Array} Returns the key-value pairs.
  14102. * @example
  14103. *
  14104. * function Foo() {
  14105. * this.a = 1;
  14106. * this.b = 2;
  14107. * }
  14108. *
  14109. * Foo.prototype.c = 3;
  14110. *
  14111. * _.toPairsIn(new Foo);
  14112. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14113. */
  14114. var toPairsIn = createToPairs(keysIn);
  14115. /**
  14116. * An alternative to `_.reduce`; this method transforms `object` to a new
  14117. * `accumulator` object which is the result of running each of its own
  14118. * enumerable string keyed properties thru `iteratee`, with each invocation
  14119. * potentially mutating the `accumulator` object. If `accumulator` is not
  14120. * provided, a new object with the same `[[Prototype]]` will be used. The
  14121. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14122. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14123. *
  14124. * @static
  14125. * @memberOf _
  14126. * @since 1.3.0
  14127. * @category Object
  14128. * @param {Object} object The object to iterate over.
  14129. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14130. * @param {*} [accumulator] The custom accumulator value.
  14131. * @returns {*} Returns the accumulated value.
  14132. * @example
  14133. *
  14134. * _.transform([2, 3, 4], function(result, n) {
  14135. * result.push(n *= n);
  14136. * return n % 2 == 0;
  14137. * }, []);
  14138. * // => [4, 9]
  14139. *
  14140. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14141. * (result[value] || (result[value] = [])).push(key);
  14142. * }, {});
  14143. * // => { '1': ['a', 'c'], '2': ['b'] }
  14144. */
  14145. function transform(object, iteratee, accumulator) {
  14146. var isArr = isArray(object),
  14147. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14148. iteratee = getIteratee(iteratee, 4);
  14149. if (accumulator == null) {
  14150. var Ctor = object && object.constructor;
  14151. if (isArrLike) {
  14152. accumulator = isArr ? new Ctor : [];
  14153. }
  14154. else if (isObject(object)) {
  14155. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14156. }
  14157. else {
  14158. accumulator = {};
  14159. }
  14160. }
  14161. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14162. return iteratee(accumulator, value, index, object);
  14163. });
  14164. return accumulator;
  14165. }
  14166. /**
  14167. * Removes the property at `path` of `object`.
  14168. *
  14169. * **Note:** This method mutates `object`.
  14170. *
  14171. * @static
  14172. * @memberOf _
  14173. * @since 4.0.0
  14174. * @category Object
  14175. * @param {Object} object The object to modify.
  14176. * @param {Array|string} path The path of the property to unset.
  14177. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14178. * @example
  14179. *
  14180. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14181. * _.unset(object, 'a[0].b.c');
  14182. * // => true
  14183. *
  14184. * console.log(object);
  14185. * // => { 'a': [{ 'b': {} }] };
  14186. *
  14187. * _.unset(object, ['a', '0', 'b', 'c']);
  14188. * // => true
  14189. *
  14190. * console.log(object);
  14191. * // => { 'a': [{ 'b': {} }] };
  14192. */
  14193. function unset(object, path) {
  14194. return object == null ? true : baseUnset(object, path);
  14195. }
  14196. /**
  14197. * This method is like `_.set` except that accepts `updater` to produce the
  14198. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14199. * is invoked with one argument: (value).
  14200. *
  14201. * **Note:** This method mutates `object`.
  14202. *
  14203. * @static
  14204. * @memberOf _
  14205. * @since 4.6.0
  14206. * @category Object
  14207. * @param {Object} object The object to modify.
  14208. * @param {Array|string} path The path of the property to set.
  14209. * @param {Function} updater The function to produce the updated value.
  14210. * @returns {Object} Returns `object`.
  14211. * @example
  14212. *
  14213. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14214. *
  14215. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14216. * console.log(object.a[0].b.c);
  14217. * // => 9
  14218. *
  14219. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14220. * console.log(object.x[0].y.z);
  14221. * // => 0
  14222. */
  14223. function update(object, path, updater) {
  14224. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14225. }
  14226. /**
  14227. * This method is like `_.update` except that it accepts `customizer` which is
  14228. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14229. * path creation is handled by the method instead. The `customizer` is invoked
  14230. * with three arguments: (nsValue, key, nsObject).
  14231. *
  14232. * **Note:** This method mutates `object`.
  14233. *
  14234. * @static
  14235. * @memberOf _
  14236. * @since 4.6.0
  14237. * @category Object
  14238. * @param {Object} object The object to modify.
  14239. * @param {Array|string} path The path of the property to set.
  14240. * @param {Function} updater The function to produce the updated value.
  14241. * @param {Function} [customizer] The function to customize assigned values.
  14242. * @returns {Object} Returns `object`.
  14243. * @example
  14244. *
  14245. * var object = {};
  14246. *
  14247. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14248. * // => { '0': { '1': 'a' } }
  14249. */
  14250. function updateWith(object, path, updater, customizer) {
  14251. customizer = typeof customizer == 'function' ? customizer : undefined;
  14252. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14253. }
  14254. /**
  14255. * Creates an array of the own enumerable string keyed property values of `object`.
  14256. *
  14257. * **Note:** Non-object values are coerced to objects.
  14258. *
  14259. * @static
  14260. * @since 0.1.0
  14261. * @memberOf _
  14262. * @category Object
  14263. * @param {Object} object The object to query.
  14264. * @returns {Array} Returns the array of property values.
  14265. * @example
  14266. *
  14267. * function Foo() {
  14268. * this.a = 1;
  14269. * this.b = 2;
  14270. * }
  14271. *
  14272. * Foo.prototype.c = 3;
  14273. *
  14274. * _.values(new Foo);
  14275. * // => [1, 2] (iteration order is not guaranteed)
  14276. *
  14277. * _.values('hi');
  14278. * // => ['h', 'i']
  14279. */
  14280. function values(object) {
  14281. return object == null ? [] : baseValues(object, keys(object));
  14282. }
  14283. /**
  14284. * Creates an array of the own and inherited enumerable string keyed property
  14285. * values of `object`.
  14286. *
  14287. * **Note:** Non-object values are coerced to objects.
  14288. *
  14289. * @static
  14290. * @memberOf _
  14291. * @since 3.0.0
  14292. * @category Object
  14293. * @param {Object} object The object to query.
  14294. * @returns {Array} Returns the array of property values.
  14295. * @example
  14296. *
  14297. * function Foo() {
  14298. * this.a = 1;
  14299. * this.b = 2;
  14300. * }
  14301. *
  14302. * Foo.prototype.c = 3;
  14303. *
  14304. * _.valuesIn(new Foo);
  14305. * // => [1, 2, 3] (iteration order is not guaranteed)
  14306. */
  14307. function valuesIn(object) {
  14308. return object == null ? [] : baseValues(object, keysIn(object));
  14309. }
  14310. /*------------------------------------------------------------------------*/
  14311. /**
  14312. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14313. *
  14314. * @static
  14315. * @memberOf _
  14316. * @since 4.0.0
  14317. * @category Number
  14318. * @param {number} number The number to clamp.
  14319. * @param {number} [lower] The lower bound.
  14320. * @param {number} upper The upper bound.
  14321. * @returns {number} Returns the clamped number.
  14322. * @example
  14323. *
  14324. * _.clamp(-10, -5, 5);
  14325. * // => -5
  14326. *
  14327. * _.clamp(10, -5, 5);
  14328. * // => 5
  14329. */
  14330. function clamp(number, lower, upper) {
  14331. if (upper === undefined) {
  14332. upper = lower;
  14333. lower = undefined;
  14334. }
  14335. if (upper !== undefined) {
  14336. upper = toNumber(upper);
  14337. upper = upper === upper ? upper : 0;
  14338. }
  14339. if (lower !== undefined) {
  14340. lower = toNumber(lower);
  14341. lower = lower === lower ? lower : 0;
  14342. }
  14343. return baseClamp(toNumber(number), lower, upper);
  14344. }
  14345. /**
  14346. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14347. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14348. * If `start` is greater than `end` the params are swapped to support
  14349. * negative ranges.
  14350. *
  14351. * @static
  14352. * @memberOf _
  14353. * @since 3.3.0
  14354. * @category Number
  14355. * @param {number} number The number to check.
  14356. * @param {number} [start=0] The start of the range.
  14357. * @param {number} end The end of the range.
  14358. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14359. * @see _.range, _.rangeRight
  14360. * @example
  14361. *
  14362. * _.inRange(3, 2, 4);
  14363. * // => true
  14364. *
  14365. * _.inRange(4, 8);
  14366. * // => true
  14367. *
  14368. * _.inRange(4, 2);
  14369. * // => false
  14370. *
  14371. * _.inRange(2, 2);
  14372. * // => false
  14373. *
  14374. * _.inRange(1.2, 2);
  14375. * // => true
  14376. *
  14377. * _.inRange(5.2, 4);
  14378. * // => false
  14379. *
  14380. * _.inRange(-3, -2, -6);
  14381. * // => true
  14382. */
  14383. function inRange(number, start, end) {
  14384. start = toFinite(start);
  14385. if (end === undefined) {
  14386. end = start;
  14387. start = 0;
  14388. } else {
  14389. end = toFinite(end);
  14390. }
  14391. number = toNumber(number);
  14392. return baseInRange(number, start, end);
  14393. }
  14394. /**
  14395. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14396. * If only one argument is provided a number between `0` and the given number
  14397. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14398. * floats, a floating-point number is returned instead of an integer.
  14399. *
  14400. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14401. * floating-point values which can produce unexpected results.
  14402. *
  14403. * @static
  14404. * @memberOf _
  14405. * @since 0.7.0
  14406. * @category Number
  14407. * @param {number} [lower=0] The lower bound.
  14408. * @param {number} [upper=1] The upper bound.
  14409. * @param {boolean} [floating] Specify returning a floating-point number.
  14410. * @returns {number} Returns the random number.
  14411. * @example
  14412. *
  14413. * _.random(0, 5);
  14414. * // => an integer between 0 and 5
  14415. *
  14416. * _.random(5);
  14417. * // => also an integer between 0 and 5
  14418. *
  14419. * _.random(5, true);
  14420. * // => a floating-point number between 0 and 5
  14421. *
  14422. * _.random(1.2, 5.2);
  14423. * // => a floating-point number between 1.2 and 5.2
  14424. */
  14425. function random(lower, upper, floating) {
  14426. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14427. upper = floating = undefined;
  14428. }
  14429. if (floating === undefined) {
  14430. if (typeof upper == 'boolean') {
  14431. floating = upper;
  14432. upper = undefined;
  14433. }
  14434. else if (typeof lower == 'boolean') {
  14435. floating = lower;
  14436. lower = undefined;
  14437. }
  14438. }
  14439. if (lower === undefined && upper === undefined) {
  14440. lower = 0;
  14441. upper = 1;
  14442. }
  14443. else {
  14444. lower = toFinite(lower);
  14445. if (upper === undefined) {
  14446. upper = lower;
  14447. lower = 0;
  14448. } else {
  14449. upper = toFinite(upper);
  14450. }
  14451. }
  14452. if (lower > upper) {
  14453. var temp = lower;
  14454. lower = upper;
  14455. upper = temp;
  14456. }
  14457. if (floating || lower % 1 || upper % 1) {
  14458. var rand = nativeRandom();
  14459. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14460. }
  14461. return baseRandom(lower, upper);
  14462. }
  14463. /*------------------------------------------------------------------------*/
  14464. /**
  14465. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14466. *
  14467. * @static
  14468. * @memberOf _
  14469. * @since 3.0.0
  14470. * @category String
  14471. * @param {string} [string=''] The string to convert.
  14472. * @returns {string} Returns the camel cased string.
  14473. * @example
  14474. *
  14475. * _.camelCase('Foo Bar');
  14476. * // => 'fooBar'
  14477. *
  14478. * _.camelCase('--foo-bar--');
  14479. * // => 'fooBar'
  14480. *
  14481. * _.camelCase('__FOO_BAR__');
  14482. * // => 'fooBar'
  14483. */
  14484. var camelCase = createCompounder(function(result, word, index) {
  14485. word = word.toLowerCase();
  14486. return result + (index ? capitalize(word) : word);
  14487. });
  14488. /**
  14489. * Converts the first character of `string` to upper case and the remaining
  14490. * to lower case.
  14491. *
  14492. * @static
  14493. * @memberOf _
  14494. * @since 3.0.0
  14495. * @category String
  14496. * @param {string} [string=''] The string to capitalize.
  14497. * @returns {string} Returns the capitalized string.
  14498. * @example
  14499. *
  14500. * _.capitalize('FRED');
  14501. * // => 'Fred'
  14502. */
  14503. function capitalize(string) {
  14504. return upperFirst(toString(string).toLowerCase());
  14505. }
  14506. /**
  14507. * Deburrs `string` by converting
  14508. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14509. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14510. * letters to basic Latin letters and removing
  14511. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14512. *
  14513. * @static
  14514. * @memberOf _
  14515. * @since 3.0.0
  14516. * @category String
  14517. * @param {string} [string=''] The string to deburr.
  14518. * @returns {string} Returns the deburred string.
  14519. * @example
  14520. *
  14521. * _.deburr('déjà vu');
  14522. * // => 'deja vu'
  14523. */
  14524. function deburr(string) {
  14525. string = toString(string);
  14526. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14527. }
  14528. /**
  14529. * Checks if `string` ends with the given target string.
  14530. *
  14531. * @static
  14532. * @memberOf _
  14533. * @since 3.0.0
  14534. * @category String
  14535. * @param {string} [string=''] The string to inspect.
  14536. * @param {string} [target] The string to search for.
  14537. * @param {number} [position=string.length] The position to search up to.
  14538. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14539. * else `false`.
  14540. * @example
  14541. *
  14542. * _.endsWith('abc', 'c');
  14543. * // => true
  14544. *
  14545. * _.endsWith('abc', 'b');
  14546. * // => false
  14547. *
  14548. * _.endsWith('abc', 'b', 2);
  14549. * // => true
  14550. */
  14551. function endsWith(string, target, position) {
  14552. string = toString(string);
  14553. target = baseToString(target);
  14554. var length = string.length;
  14555. position = position === undefined
  14556. ? length
  14557. : baseClamp(toInteger(position), 0, length);
  14558. var end = position;
  14559. position -= target.length;
  14560. return position >= 0 && string.slice(position, end) == target;
  14561. }
  14562. /**
  14563. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14564. * corresponding HTML entities.
  14565. *
  14566. * **Note:** No other characters are escaped. To escape additional
  14567. * characters use a third-party library like [_he_](https://mths.be/he).
  14568. *
  14569. * Though the ">" character is escaped for symmetry, characters like
  14570. * ">" and "/" don't need escaping in HTML and have no special meaning
  14571. * unless they're part of a tag or unquoted attribute value. See
  14572. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14573. * (under "semi-related fun fact") for more details.
  14574. *
  14575. * When working with HTML you should always
  14576. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14577. * XSS vectors.
  14578. *
  14579. * @static
  14580. * @since 0.1.0
  14581. * @memberOf _
  14582. * @category String
  14583. * @param {string} [string=''] The string to escape.
  14584. * @returns {string} Returns the escaped string.
  14585. * @example
  14586. *
  14587. * _.escape('fred, barney, & pebbles');
  14588. * // => 'fred, barney, &amp; pebbles'
  14589. */
  14590. function escape(string) {
  14591. string = toString(string);
  14592. return (string && reHasUnescapedHtml.test(string))
  14593. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14594. : string;
  14595. }
  14596. /**
  14597. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14598. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14599. *
  14600. * @static
  14601. * @memberOf _
  14602. * @since 3.0.0
  14603. * @category String
  14604. * @param {string} [string=''] The string to escape.
  14605. * @returns {string} Returns the escaped string.
  14606. * @example
  14607. *
  14608. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14609. * // => '\[lodash\]\(https://lodash\.com/\)'
  14610. */
  14611. function escapeRegExp(string) {
  14612. string = toString(string);
  14613. return (string && reHasRegExpChar.test(string))
  14614. ? string.replace(reRegExpChar, '\\$&')
  14615. : string;
  14616. }
  14617. /**
  14618. * Converts `string` to
  14619. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14620. *
  14621. * @static
  14622. * @memberOf _
  14623. * @since 3.0.0
  14624. * @category String
  14625. * @param {string} [string=''] The string to convert.
  14626. * @returns {string} Returns the kebab cased string.
  14627. * @example
  14628. *
  14629. * _.kebabCase('Foo Bar');
  14630. * // => 'foo-bar'
  14631. *
  14632. * _.kebabCase('fooBar');
  14633. * // => 'foo-bar'
  14634. *
  14635. * _.kebabCase('__FOO_BAR__');
  14636. * // => 'foo-bar'
  14637. */
  14638. var kebabCase = createCompounder(function(result, word, index) {
  14639. return result + (index ? '-' : '') + word.toLowerCase();
  14640. });
  14641. /**
  14642. * Converts `string`, as space separated words, to lower case.
  14643. *
  14644. * @static
  14645. * @memberOf _
  14646. * @since 4.0.0
  14647. * @category String
  14648. * @param {string} [string=''] The string to convert.
  14649. * @returns {string} Returns the lower cased string.
  14650. * @example
  14651. *
  14652. * _.lowerCase('--Foo-Bar--');
  14653. * // => 'foo bar'
  14654. *
  14655. * _.lowerCase('fooBar');
  14656. * // => 'foo bar'
  14657. *
  14658. * _.lowerCase('__FOO_BAR__');
  14659. * // => 'foo bar'
  14660. */
  14661. var lowerCase = createCompounder(function(result, word, index) {
  14662. return result + (index ? ' ' : '') + word.toLowerCase();
  14663. });
  14664. /**
  14665. * Converts the first character of `string` to lower case.
  14666. *
  14667. * @static
  14668. * @memberOf _
  14669. * @since 4.0.0
  14670. * @category String
  14671. * @param {string} [string=''] The string to convert.
  14672. * @returns {string} Returns the converted string.
  14673. * @example
  14674. *
  14675. * _.lowerFirst('Fred');
  14676. * // => 'fred'
  14677. *
  14678. * _.lowerFirst('FRED');
  14679. * // => 'fRED'
  14680. */
  14681. var lowerFirst = createCaseFirst('toLowerCase');
  14682. /**
  14683. * Pads `string` on the left and right sides if it's shorter than `length`.
  14684. * Padding characters are truncated if they can't be evenly divided by `length`.
  14685. *
  14686. * @static
  14687. * @memberOf _
  14688. * @since 3.0.0
  14689. * @category String
  14690. * @param {string} [string=''] The string to pad.
  14691. * @param {number} [length=0] The padding length.
  14692. * @param {string} [chars=' '] The string used as padding.
  14693. * @returns {string} Returns the padded string.
  14694. * @example
  14695. *
  14696. * _.pad('abc', 8);
  14697. * // => ' abc '
  14698. *
  14699. * _.pad('abc', 8, '_-');
  14700. * // => '_-abc_-_'
  14701. *
  14702. * _.pad('abc', 3);
  14703. * // => 'abc'
  14704. */
  14705. function pad(string, length, chars) {
  14706. string = toString(string);
  14707. length = toInteger(length);
  14708. var strLength = length ? stringSize(string) : 0;
  14709. if (!length || strLength >= length) {
  14710. return string;
  14711. }
  14712. var mid = (length - strLength) / 2;
  14713. return (
  14714. createPadding(nativeFloor(mid), chars) +
  14715. string +
  14716. createPadding(nativeCeil(mid), chars)
  14717. );
  14718. }
  14719. /**
  14720. * Pads `string` on the right side if it's shorter than `length`. Padding
  14721. * characters are truncated if they exceed `length`.
  14722. *
  14723. * @static
  14724. * @memberOf _
  14725. * @since 4.0.0
  14726. * @category String
  14727. * @param {string} [string=''] The string to pad.
  14728. * @param {number} [length=0] The padding length.
  14729. * @param {string} [chars=' '] The string used as padding.
  14730. * @returns {string} Returns the padded string.
  14731. * @example
  14732. *
  14733. * _.padEnd('abc', 6);
  14734. * // => 'abc '
  14735. *
  14736. * _.padEnd('abc', 6, '_-');
  14737. * // => 'abc_-_'
  14738. *
  14739. * _.padEnd('abc', 3);
  14740. * // => 'abc'
  14741. */
  14742. function padEnd(string, length, chars) {
  14743. string = toString(string);
  14744. length = toInteger(length);
  14745. var strLength = length ? stringSize(string) : 0;
  14746. return (length && strLength < length)
  14747. ? (string + createPadding(length - strLength, chars))
  14748. : string;
  14749. }
  14750. /**
  14751. * Pads `string` on the left side if it's shorter than `length`. Padding
  14752. * characters are truncated if they exceed `length`.
  14753. *
  14754. * @static
  14755. * @memberOf _
  14756. * @since 4.0.0
  14757. * @category String
  14758. * @param {string} [string=''] The string to pad.
  14759. * @param {number} [length=0] The padding length.
  14760. * @param {string} [chars=' '] The string used as padding.
  14761. * @returns {string} Returns the padded string.
  14762. * @example
  14763. *
  14764. * _.padStart('abc', 6);
  14765. * // => ' abc'
  14766. *
  14767. * _.padStart('abc', 6, '_-');
  14768. * // => '_-_abc'
  14769. *
  14770. * _.padStart('abc', 3);
  14771. * // => 'abc'
  14772. */
  14773. function padStart(string, length, chars) {
  14774. string = toString(string);
  14775. length = toInteger(length);
  14776. var strLength = length ? stringSize(string) : 0;
  14777. return (length && strLength < length)
  14778. ? (createPadding(length - strLength, chars) + string)
  14779. : string;
  14780. }
  14781. /**
  14782. * Converts `string` to an integer of the specified radix. If `radix` is
  14783. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14784. * hexadecimal, in which case a `radix` of `16` is used.
  14785. *
  14786. * **Note:** This method aligns with the
  14787. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14788. *
  14789. * @static
  14790. * @memberOf _
  14791. * @since 1.1.0
  14792. * @category String
  14793. * @param {string} string The string to convert.
  14794. * @param {number} [radix=10] The radix to interpret `value` by.
  14795. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14796. * @returns {number} Returns the converted integer.
  14797. * @example
  14798. *
  14799. * _.parseInt('08');
  14800. * // => 8
  14801. *
  14802. * _.map(['6', '08', '10'], _.parseInt);
  14803. * // => [6, 8, 10]
  14804. */
  14805. function parseInt(string, radix, guard) {
  14806. if (guard || radix == null) {
  14807. radix = 0;
  14808. } else if (radix) {
  14809. radix = +radix;
  14810. }
  14811. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14812. }
  14813. /**
  14814. * Repeats the given string `n` times.
  14815. *
  14816. * @static
  14817. * @memberOf _
  14818. * @since 3.0.0
  14819. * @category String
  14820. * @param {string} [string=''] The string to repeat.
  14821. * @param {number} [n=1] The number of times to repeat the string.
  14822. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14823. * @returns {string} Returns the repeated string.
  14824. * @example
  14825. *
  14826. * _.repeat('*', 3);
  14827. * // => '***'
  14828. *
  14829. * _.repeat('abc', 2);
  14830. * // => 'abcabc'
  14831. *
  14832. * _.repeat('abc', 0);
  14833. * // => ''
  14834. */
  14835. function repeat(string, n, guard) {
  14836. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14837. n = 1;
  14838. } else {
  14839. n = toInteger(n);
  14840. }
  14841. return baseRepeat(toString(string), n);
  14842. }
  14843. /**
  14844. * Replaces matches for `pattern` in `string` with `replacement`.
  14845. *
  14846. * **Note:** This method is based on
  14847. * [`String#replace`](https://mdn.io/String/replace).
  14848. *
  14849. * @static
  14850. * @memberOf _
  14851. * @since 4.0.0
  14852. * @category String
  14853. * @param {string} [string=''] The string to modify.
  14854. * @param {RegExp|string} pattern The pattern to replace.
  14855. * @param {Function|string} replacement The match replacement.
  14856. * @returns {string} Returns the modified string.
  14857. * @example
  14858. *
  14859. * _.replace('Hi Fred', 'Fred', 'Barney');
  14860. * // => 'Hi Barney'
  14861. */
  14862. function replace() {
  14863. var args = arguments,
  14864. string = toString(args[0]);
  14865. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14866. }
  14867. /**
  14868. * Converts `string` to
  14869. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14870. *
  14871. * @static
  14872. * @memberOf _
  14873. * @since 3.0.0
  14874. * @category String
  14875. * @param {string} [string=''] The string to convert.
  14876. * @returns {string} Returns the snake cased string.
  14877. * @example
  14878. *
  14879. * _.snakeCase('Foo Bar');
  14880. * // => 'foo_bar'
  14881. *
  14882. * _.snakeCase('fooBar');
  14883. * // => 'foo_bar'
  14884. *
  14885. * _.snakeCase('--FOO-BAR--');
  14886. * // => 'foo_bar'
  14887. */
  14888. var snakeCase = createCompounder(function(result, word, index) {
  14889. return result + (index ? '_' : '') + word.toLowerCase();
  14890. });
  14891. /**
  14892. * Splits `string` by `separator`.
  14893. *
  14894. * **Note:** This method is based on
  14895. * [`String#split`](https://mdn.io/String/split).
  14896. *
  14897. * @static
  14898. * @memberOf _
  14899. * @since 4.0.0
  14900. * @category String
  14901. * @param {string} [string=''] The string to split.
  14902. * @param {RegExp|string} separator The separator pattern to split by.
  14903. * @param {number} [limit] The length to truncate results to.
  14904. * @returns {Array} Returns the string segments.
  14905. * @example
  14906. *
  14907. * _.split('a-b-c', '-', 2);
  14908. * // => ['a', 'b']
  14909. */
  14910. function split(string, separator, limit) {
  14911. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14912. separator = limit = undefined;
  14913. }
  14914. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14915. if (!limit) {
  14916. return [];
  14917. }
  14918. string = toString(string);
  14919. if (string && (
  14920. typeof separator == 'string' ||
  14921. (separator != null && !isRegExp(separator))
  14922. )) {
  14923. separator = baseToString(separator);
  14924. if (!separator && hasUnicode(string)) {
  14925. return castSlice(stringToArray(string), 0, limit);
  14926. }
  14927. }
  14928. return string.split(separator, limit);
  14929. }
  14930. /**
  14931. * Converts `string` to
  14932. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14933. *
  14934. * @static
  14935. * @memberOf _
  14936. * @since 3.1.0
  14937. * @category String
  14938. * @param {string} [string=''] The string to convert.
  14939. * @returns {string} Returns the start cased string.
  14940. * @example
  14941. *
  14942. * _.startCase('--foo-bar--');
  14943. * // => 'Foo Bar'
  14944. *
  14945. * _.startCase('fooBar');
  14946. * // => 'Foo Bar'
  14947. *
  14948. * _.startCase('__FOO_BAR__');
  14949. * // => 'FOO BAR'
  14950. */
  14951. var startCase = createCompounder(function(result, word, index) {
  14952. return result + (index ? ' ' : '') + upperFirst(word);
  14953. });
  14954. /**
  14955. * Checks if `string` starts with the given target string.
  14956. *
  14957. * @static
  14958. * @memberOf _
  14959. * @since 3.0.0
  14960. * @category String
  14961. * @param {string} [string=''] The string to inspect.
  14962. * @param {string} [target] The string to search for.
  14963. * @param {number} [position=0] The position to search from.
  14964. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14965. * else `false`.
  14966. * @example
  14967. *
  14968. * _.startsWith('abc', 'a');
  14969. * // => true
  14970. *
  14971. * _.startsWith('abc', 'b');
  14972. * // => false
  14973. *
  14974. * _.startsWith('abc', 'b', 1);
  14975. * // => true
  14976. */
  14977. function startsWith(string, target, position) {
  14978. string = toString(string);
  14979. position = position == null
  14980. ? 0
  14981. : baseClamp(toInteger(position), 0, string.length);
  14982. target = baseToString(target);
  14983. return string.slice(position, position + target.length) == target;
  14984. }
  14985. /**
  14986. * Creates a compiled template function that can interpolate data properties
  14987. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14988. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14989. * properties may be accessed as free variables in the template. If a setting
  14990. * object is given, it takes precedence over `_.templateSettings` values.
  14991. *
  14992. * **Note:** In the development build `_.template` utilizes
  14993. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14994. * for easier debugging.
  14995. *
  14996. * For more information on precompiling templates see
  14997. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14998. *
  14999. * For more information on Chrome extension sandboxes see
  15000. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15001. *
  15002. * @static
  15003. * @since 0.1.0
  15004. * @memberOf _
  15005. * @category String
  15006. * @param {string} [string=''] The template string.
  15007. * @param {Object} [options={}] The options object.
  15008. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15009. * The HTML "escape" delimiter.
  15010. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15011. * The "evaluate" delimiter.
  15012. * @param {Object} [options.imports=_.templateSettings.imports]
  15013. * An object to import into the template as free variables.
  15014. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15015. * The "interpolate" delimiter.
  15016. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15017. * The sourceURL of the compiled template.
  15018. * @param {string} [options.variable='obj']
  15019. * The data object variable name.
  15020. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15021. * @returns {Function} Returns the compiled template function.
  15022. * @example
  15023. *
  15024. * // Use the "interpolate" delimiter to create a compiled template.
  15025. * var compiled = _.template('hello <%= user %>!');
  15026. * compiled({ 'user': 'fred' });
  15027. * // => 'hello fred!'
  15028. *
  15029. * // Use the HTML "escape" delimiter to escape data property values.
  15030. * var compiled = _.template('<b><%- value %></b>');
  15031. * compiled({ 'value': '<script>' });
  15032. * // => '<b>&lt;script&gt;</b>'
  15033. *
  15034. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15035. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15036. * compiled({ 'users': ['fred', 'barney'] });
  15037. * // => '<li>fred</li><li>barney</li>'
  15038. *
  15039. * // Use the internal `print` function in "evaluate" delimiters.
  15040. * var compiled = _.template('<% print("hello " + user); %>!');
  15041. * compiled({ 'user': 'barney' });
  15042. * // => 'hello barney!'
  15043. *
  15044. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15045. * // Disable support by replacing the "interpolate" delimiter.
  15046. * var compiled = _.template('hello ${ user }!');
  15047. * compiled({ 'user': 'pebbles' });
  15048. * // => 'hello pebbles!'
  15049. *
  15050. * // Use backslashes to treat delimiters as plain text.
  15051. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15052. * compiled({ 'value': 'ignored' });
  15053. * // => '<%- value %>'
  15054. *
  15055. * // Use the `imports` option to import `jQuery` as `jq`.
  15056. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15057. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15058. * compiled({ 'users': ['fred', 'barney'] });
  15059. * // => '<li>fred</li><li>barney</li>'
  15060. *
  15061. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15062. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15063. * compiled(data);
  15064. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15065. *
  15066. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15067. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15068. * compiled.source;
  15069. * // => function(data) {
  15070. * // var __t, __p = '';
  15071. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15072. * // return __p;
  15073. * // }
  15074. *
  15075. * // Use custom template delimiters.
  15076. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15077. * var compiled = _.template('hello {{ user }}!');
  15078. * compiled({ 'user': 'mustache' });
  15079. * // => 'hello mustache!'
  15080. *
  15081. * // Use the `source` property to inline compiled templates for meaningful
  15082. * // line numbers in error messages and stack traces.
  15083. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15084. * var JST = {\
  15085. * "main": ' + _.template(mainText).source + '\
  15086. * };\
  15087. * ');
  15088. */
  15089. function template(string, options, guard) {
  15090. // Based on John Resig's `tmpl` implementation
  15091. // (http://ejohn.org/blog/javascript-micro-templating/)
  15092. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15093. var settings = lodash.templateSettings;
  15094. if (guard && isIterateeCall(string, options, guard)) {
  15095. options = undefined;
  15096. }
  15097. string = toString(string);
  15098. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15099. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15100. importsKeys = keys(imports),
  15101. importsValues = baseValues(imports, importsKeys);
  15102. var isEscaping,
  15103. isEvaluating,
  15104. index = 0,
  15105. interpolate = options.interpolate || reNoMatch,
  15106. source = "__p += '";
  15107. // Compile the regexp to match each delimiter.
  15108. var reDelimiters = RegExp(
  15109. (options.escape || reNoMatch).source + '|' +
  15110. interpolate.source + '|' +
  15111. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15112. (options.evaluate || reNoMatch).source + '|$'
  15113. , 'g');
  15114. // Use a sourceURL for easier debugging.
  15115. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15116. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15117. // and escape the comment, thus injecting code that gets evaled.
  15118. var sourceURL = '//# sourceURL=' +
  15119. (hasOwnProperty.call(options, 'sourceURL')
  15120. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15121. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15122. ) + '\n';
  15123. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15124. interpolateValue || (interpolateValue = esTemplateValue);
  15125. // Escape characters that can't be included in string literals.
  15126. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15127. // Replace delimiters with snippets.
  15128. if (escapeValue) {
  15129. isEscaping = true;
  15130. source += "' +\n__e(" + escapeValue + ") +\n'";
  15131. }
  15132. if (evaluateValue) {
  15133. isEvaluating = true;
  15134. source += "';\n" + evaluateValue + ";\n__p += '";
  15135. }
  15136. if (interpolateValue) {
  15137. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15138. }
  15139. index = offset + match.length;
  15140. // The JS engine embedded in Adobe products needs `match` returned in
  15141. // order to produce the correct `offset` value.
  15142. return match;
  15143. });
  15144. source += "';\n";
  15145. // If `variable` is not specified wrap a with-statement around the generated
  15146. // code to add the data object to the top of the scope chain.
  15147. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15148. if (!variable) {
  15149. source = 'with (obj) {\n' + source + '\n}\n';
  15150. }
  15151. // Throw an error if a forbidden character was found in `variable`, to prevent
  15152. // potential command injection attacks.
  15153. else if (reForbiddenIdentifierChars.test(variable)) {
  15154. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15155. }
  15156. // Cleanup code by stripping empty strings.
  15157. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15158. .replace(reEmptyStringMiddle, '$1')
  15159. .replace(reEmptyStringTrailing, '$1;');
  15160. // Frame code as the function body.
  15161. source = 'function(' + (variable || 'obj') + ') {\n' +
  15162. (variable
  15163. ? ''
  15164. : 'obj || (obj = {});\n'
  15165. ) +
  15166. "var __t, __p = ''" +
  15167. (isEscaping
  15168. ? ', __e = _.escape'
  15169. : ''
  15170. ) +
  15171. (isEvaluating
  15172. ? ', __j = Array.prototype.join;\n' +
  15173. "function print() { __p += __j.call(arguments, '') }\n"
  15174. : ';\n'
  15175. ) +
  15176. source +
  15177. 'return __p\n}';
  15178. var result = attempt(function() {
  15179. return Function(importsKeys, sourceURL + 'return ' + source)
  15180. .apply(undefined, importsValues);
  15181. });
  15182. // Provide the compiled function's source by its `toString` method or
  15183. // the `source` property as a convenience for inlining compiled templates.
  15184. result.source = source;
  15185. if (isError(result)) {
  15186. throw result;
  15187. }
  15188. return result;
  15189. }
  15190. /**
  15191. * Converts `string`, as a whole, to lower case just like
  15192. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15193. *
  15194. * @static
  15195. * @memberOf _
  15196. * @since 4.0.0
  15197. * @category String
  15198. * @param {string} [string=''] The string to convert.
  15199. * @returns {string} Returns the lower cased string.
  15200. * @example
  15201. *
  15202. * _.toLower('--Foo-Bar--');
  15203. * // => '--foo-bar--'
  15204. *
  15205. * _.toLower('fooBar');
  15206. * // => 'foobar'
  15207. *
  15208. * _.toLower('__FOO_BAR__');
  15209. * // => '__foo_bar__'
  15210. */
  15211. function toLower(value) {
  15212. return toString(value).toLowerCase();
  15213. }
  15214. /**
  15215. * Converts `string`, as a whole, to upper case just like
  15216. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15217. *
  15218. * @static
  15219. * @memberOf _
  15220. * @since 4.0.0
  15221. * @category String
  15222. * @param {string} [string=''] The string to convert.
  15223. * @returns {string} Returns the upper cased string.
  15224. * @example
  15225. *
  15226. * _.toUpper('--foo-bar--');
  15227. * // => '--FOO-BAR--'
  15228. *
  15229. * _.toUpper('fooBar');
  15230. * // => 'FOOBAR'
  15231. *
  15232. * _.toUpper('__foo_bar__');
  15233. * // => '__FOO_BAR__'
  15234. */
  15235. function toUpper(value) {
  15236. return toString(value).toUpperCase();
  15237. }
  15238. /**
  15239. * Removes leading and trailing whitespace or specified characters from `string`.
  15240. *
  15241. * @static
  15242. * @memberOf _
  15243. * @since 3.0.0
  15244. * @category String
  15245. * @param {string} [string=''] The string to trim.
  15246. * @param {string} [chars=whitespace] The characters to trim.
  15247. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15248. * @returns {string} Returns the trimmed string.
  15249. * @example
  15250. *
  15251. * _.trim(' abc ');
  15252. * // => 'abc'
  15253. *
  15254. * _.trim('-_-abc-_-', '_-');
  15255. * // => 'abc'
  15256. *
  15257. * _.map([' foo ', ' bar '], _.trim);
  15258. * // => ['foo', 'bar']
  15259. */
  15260. function trim(string, chars, guard) {
  15261. string = toString(string);
  15262. if (string && (guard || chars === undefined)) {
  15263. return baseTrim(string);
  15264. }
  15265. if (!string || !(chars = baseToString(chars))) {
  15266. return string;
  15267. }
  15268. var strSymbols = stringToArray(string),
  15269. chrSymbols = stringToArray(chars),
  15270. start = charsStartIndex(strSymbols, chrSymbols),
  15271. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15272. return castSlice(strSymbols, start, end).join('');
  15273. }
  15274. /**
  15275. * Removes trailing whitespace or specified characters from `string`.
  15276. *
  15277. * @static
  15278. * @memberOf _
  15279. * @since 4.0.0
  15280. * @category String
  15281. * @param {string} [string=''] The string to trim.
  15282. * @param {string} [chars=whitespace] The characters to trim.
  15283. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15284. * @returns {string} Returns the trimmed string.
  15285. * @example
  15286. *
  15287. * _.trimEnd(' abc ');
  15288. * // => ' abc'
  15289. *
  15290. * _.trimEnd('-_-abc-_-', '_-');
  15291. * // => '-_-abc'
  15292. */
  15293. function trimEnd(string, chars, guard) {
  15294. string = toString(string);
  15295. if (string && (guard || chars === undefined)) {
  15296. return string.slice(0, trimmedEndIndex(string) + 1);
  15297. }
  15298. if (!string || !(chars = baseToString(chars))) {
  15299. return string;
  15300. }
  15301. var strSymbols = stringToArray(string),
  15302. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15303. return castSlice(strSymbols, 0, end).join('');
  15304. }
  15305. /**
  15306. * Removes leading whitespace or specified characters from `string`.
  15307. *
  15308. * @static
  15309. * @memberOf _
  15310. * @since 4.0.0
  15311. * @category String
  15312. * @param {string} [string=''] The string to trim.
  15313. * @param {string} [chars=whitespace] The characters to trim.
  15314. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15315. * @returns {string} Returns the trimmed string.
  15316. * @example
  15317. *
  15318. * _.trimStart(' abc ');
  15319. * // => 'abc '
  15320. *
  15321. * _.trimStart('-_-abc-_-', '_-');
  15322. * // => 'abc-_-'
  15323. */
  15324. function trimStart(string, chars, guard) {
  15325. string = toString(string);
  15326. if (string && (guard || chars === undefined)) {
  15327. return string.replace(reTrimStart, '');
  15328. }
  15329. if (!string || !(chars = baseToString(chars))) {
  15330. return string;
  15331. }
  15332. var strSymbols = stringToArray(string),
  15333. start = charsStartIndex(strSymbols, stringToArray(chars));
  15334. return castSlice(strSymbols, start).join('');
  15335. }
  15336. /**
  15337. * Truncates `string` if it's longer than the given maximum string length.
  15338. * The last characters of the truncated string are replaced with the omission
  15339. * string which defaults to "...".
  15340. *
  15341. * @static
  15342. * @memberOf _
  15343. * @since 4.0.0
  15344. * @category String
  15345. * @param {string} [string=''] The string to truncate.
  15346. * @param {Object} [options={}] The options object.
  15347. * @param {number} [options.length=30] The maximum string length.
  15348. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15349. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15350. * @returns {string} Returns the truncated string.
  15351. * @example
  15352. *
  15353. * _.truncate('hi-diddly-ho there, neighborino');
  15354. * // => 'hi-diddly-ho there, neighbo...'
  15355. *
  15356. * _.truncate('hi-diddly-ho there, neighborino', {
  15357. * 'length': 24,
  15358. * 'separator': ' '
  15359. * });
  15360. * // => 'hi-diddly-ho there,...'
  15361. *
  15362. * _.truncate('hi-diddly-ho there, neighborino', {
  15363. * 'length': 24,
  15364. * 'separator': /,? +/
  15365. * });
  15366. * // => 'hi-diddly-ho there...'
  15367. *
  15368. * _.truncate('hi-diddly-ho there, neighborino', {
  15369. * 'omission': ' [...]'
  15370. * });
  15371. * // => 'hi-diddly-ho there, neig [...]'
  15372. */
  15373. function truncate(string, options) {
  15374. var length = DEFAULT_TRUNC_LENGTH,
  15375. omission = DEFAULT_TRUNC_OMISSION;
  15376. if (isObject(options)) {
  15377. var separator = 'separator' in options ? options.separator : separator;
  15378. length = 'length' in options ? toInteger(options.length) : length;
  15379. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15380. }
  15381. string = toString(string);
  15382. var strLength = string.length;
  15383. if (hasUnicode(string)) {
  15384. var strSymbols = stringToArray(string);
  15385. strLength = strSymbols.length;
  15386. }
  15387. if (length >= strLength) {
  15388. return string;
  15389. }
  15390. var end = length - stringSize(omission);
  15391. if (end < 1) {
  15392. return omission;
  15393. }
  15394. var result = strSymbols
  15395. ? castSlice(strSymbols, 0, end).join('')
  15396. : string.slice(0, end);
  15397. if (separator === undefined) {
  15398. return result + omission;
  15399. }
  15400. if (strSymbols) {
  15401. end += (result.length - end);
  15402. }
  15403. if (isRegExp(separator)) {
  15404. if (string.slice(end).search(separator)) {
  15405. var match,
  15406. substring = result;
  15407. if (!separator.global) {
  15408. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15409. }
  15410. separator.lastIndex = 0;
  15411. while ((match = separator.exec(substring))) {
  15412. var newEnd = match.index;
  15413. }
  15414. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15415. }
  15416. } else if (string.indexOf(baseToString(separator), end) != end) {
  15417. var index = result.lastIndexOf(separator);
  15418. if (index > -1) {
  15419. result = result.slice(0, index);
  15420. }
  15421. }
  15422. return result + omission;
  15423. }
  15424. /**
  15425. * The inverse of `_.escape`; this method converts the HTML entities
  15426. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15427. * their corresponding characters.
  15428. *
  15429. * **Note:** No other HTML entities are unescaped. To unescape additional
  15430. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15431. *
  15432. * @static
  15433. * @memberOf _
  15434. * @since 0.6.0
  15435. * @category String
  15436. * @param {string} [string=''] The string to unescape.
  15437. * @returns {string} Returns the unescaped string.
  15438. * @example
  15439. *
  15440. * _.unescape('fred, barney, &amp; pebbles');
  15441. * // => 'fred, barney, & pebbles'
  15442. */
  15443. function unescape(string) {
  15444. string = toString(string);
  15445. return (string && reHasEscapedHtml.test(string))
  15446. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15447. : string;
  15448. }
  15449. /**
  15450. * Converts `string`, as space separated words, to upper case.
  15451. *
  15452. * @static
  15453. * @memberOf _
  15454. * @since 4.0.0
  15455. * @category String
  15456. * @param {string} [string=''] The string to convert.
  15457. * @returns {string} Returns the upper cased string.
  15458. * @example
  15459. *
  15460. * _.upperCase('--foo-bar');
  15461. * // => 'FOO BAR'
  15462. *
  15463. * _.upperCase('fooBar');
  15464. * // => 'FOO BAR'
  15465. *
  15466. * _.upperCase('__foo_bar__');
  15467. * // => 'FOO BAR'
  15468. */
  15469. var upperCase = createCompounder(function(result, word, index) {
  15470. return result + (index ? ' ' : '') + word.toUpperCase();
  15471. });
  15472. /**
  15473. * Converts the first character of `string` to upper case.
  15474. *
  15475. * @static
  15476. * @memberOf _
  15477. * @since 4.0.0
  15478. * @category String
  15479. * @param {string} [string=''] The string to convert.
  15480. * @returns {string} Returns the converted string.
  15481. * @example
  15482. *
  15483. * _.upperFirst('fred');
  15484. * // => 'Fred'
  15485. *
  15486. * _.upperFirst('FRED');
  15487. * // => 'FRED'
  15488. */
  15489. var upperFirst = createCaseFirst('toUpperCase');
  15490. /**
  15491. * Splits `string` into an array of its words.
  15492. *
  15493. * @static
  15494. * @memberOf _
  15495. * @since 3.0.0
  15496. * @category String
  15497. * @param {string} [string=''] The string to inspect.
  15498. * @param {RegExp|string} [pattern] The pattern to match words.
  15499. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15500. * @returns {Array} Returns the words of `string`.
  15501. * @example
  15502. *
  15503. * _.words('fred, barney, & pebbles');
  15504. * // => ['fred', 'barney', 'pebbles']
  15505. *
  15506. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15507. * // => ['fred', 'barney', '&', 'pebbles']
  15508. */
  15509. function words(string, pattern, guard) {
  15510. string = toString(string);
  15511. pattern = guard ? undefined : pattern;
  15512. if (pattern === undefined) {
  15513. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15514. }
  15515. return string.match(pattern) || [];
  15516. }
  15517. /*------------------------------------------------------------------------*/
  15518. /**
  15519. * Attempts to invoke `func`, returning either the result or the caught error
  15520. * object. Any additional arguments are provided to `func` when it's invoked.
  15521. *
  15522. * @static
  15523. * @memberOf _
  15524. * @since 3.0.0
  15525. * @category Util
  15526. * @param {Function} func The function to attempt.
  15527. * @param {...*} [args] The arguments to invoke `func` with.
  15528. * @returns {*} Returns the `func` result or error object.
  15529. * @example
  15530. *
  15531. * // Avoid throwing errors for invalid selectors.
  15532. * var elements = _.attempt(function(selector) {
  15533. * return document.querySelectorAll(selector);
  15534. * }, '>_>');
  15535. *
  15536. * if (_.isError(elements)) {
  15537. * elements = [];
  15538. * }
  15539. */
  15540. var attempt = baseRest(function(func, args) {
  15541. try {
  15542. return apply(func, undefined, args);
  15543. } catch (e) {
  15544. return isError(e) ? e : new Error(e);
  15545. }
  15546. });
  15547. /**
  15548. * Binds methods of an object to the object itself, overwriting the existing
  15549. * method.
  15550. *
  15551. * **Note:** This method doesn't set the "length" property of bound functions.
  15552. *
  15553. * @static
  15554. * @since 0.1.0
  15555. * @memberOf _
  15556. * @category Util
  15557. * @param {Object} object The object to bind and assign the bound methods to.
  15558. * @param {...(string|string[])} methodNames The object method names to bind.
  15559. * @returns {Object} Returns `object`.
  15560. * @example
  15561. *
  15562. * var view = {
  15563. * 'label': 'docs',
  15564. * 'click': function() {
  15565. * console.log('clicked ' + this.label);
  15566. * }
  15567. * };
  15568. *
  15569. * _.bindAll(view, ['click']);
  15570. * jQuery(element).on('click', view.click);
  15571. * // => Logs 'clicked docs' when clicked.
  15572. */
  15573. var bindAll = flatRest(function(object, methodNames) {
  15574. arrayEach(methodNames, function(key) {
  15575. key = toKey(key);
  15576. baseAssignValue(object, key, bind(object[key], object));
  15577. });
  15578. return object;
  15579. });
  15580. /**
  15581. * Creates a function that iterates over `pairs` and invokes the corresponding
  15582. * function of the first predicate to return truthy. The predicate-function
  15583. * pairs are invoked with the `this` binding and arguments of the created
  15584. * function.
  15585. *
  15586. * @static
  15587. * @memberOf _
  15588. * @since 4.0.0
  15589. * @category Util
  15590. * @param {Array} pairs The predicate-function pairs.
  15591. * @returns {Function} Returns the new composite function.
  15592. * @example
  15593. *
  15594. * var func = _.cond([
  15595. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15596. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15597. * [_.stubTrue, _.constant('no match')]
  15598. * ]);
  15599. *
  15600. * func({ 'a': 1, 'b': 2 });
  15601. * // => 'matches A'
  15602. *
  15603. * func({ 'a': 0, 'b': 1 });
  15604. * // => 'matches B'
  15605. *
  15606. * func({ 'a': '1', 'b': '2' });
  15607. * // => 'no match'
  15608. */
  15609. function cond(pairs) {
  15610. var length = pairs == null ? 0 : pairs.length,
  15611. toIteratee = getIteratee();
  15612. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15613. if (typeof pair[1] != 'function') {
  15614. throw new TypeError(FUNC_ERROR_TEXT);
  15615. }
  15616. return [toIteratee(pair[0]), pair[1]];
  15617. });
  15618. return baseRest(function(args) {
  15619. var index = -1;
  15620. while (++index < length) {
  15621. var pair = pairs[index];
  15622. if (apply(pair[0], this, args)) {
  15623. return apply(pair[1], this, args);
  15624. }
  15625. }
  15626. });
  15627. }
  15628. /**
  15629. * Creates a function that invokes the predicate properties of `source` with
  15630. * the corresponding property values of a given object, returning `true` if
  15631. * all predicates return truthy, else `false`.
  15632. *
  15633. * **Note:** The created function is equivalent to `_.conformsTo` with
  15634. * `source` partially applied.
  15635. *
  15636. * @static
  15637. * @memberOf _
  15638. * @since 4.0.0
  15639. * @category Util
  15640. * @param {Object} source The object of property predicates to conform to.
  15641. * @returns {Function} Returns the new spec function.
  15642. * @example
  15643. *
  15644. * var objects = [
  15645. * { 'a': 2, 'b': 1 },
  15646. * { 'a': 1, 'b': 2 }
  15647. * ];
  15648. *
  15649. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15650. * // => [{ 'a': 1, 'b': 2 }]
  15651. */
  15652. function conforms(source) {
  15653. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15654. }
  15655. /**
  15656. * Creates a function that returns `value`.
  15657. *
  15658. * @static
  15659. * @memberOf _
  15660. * @since 2.4.0
  15661. * @category Util
  15662. * @param {*} value The value to return from the new function.
  15663. * @returns {Function} Returns the new constant function.
  15664. * @example
  15665. *
  15666. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15667. *
  15668. * console.log(objects);
  15669. * // => [{ 'a': 1 }, { 'a': 1 }]
  15670. *
  15671. * console.log(objects[0] === objects[1]);
  15672. * // => true
  15673. */
  15674. function constant(value) {
  15675. return function() {
  15676. return value;
  15677. };
  15678. }
  15679. /**
  15680. * Checks `value` to determine whether a default value should be returned in
  15681. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15682. * or `undefined`.
  15683. *
  15684. * @static
  15685. * @memberOf _
  15686. * @since 4.14.0
  15687. * @category Util
  15688. * @param {*} value The value to check.
  15689. * @param {*} defaultValue The default value.
  15690. * @returns {*} Returns the resolved value.
  15691. * @example
  15692. *
  15693. * _.defaultTo(1, 10);
  15694. * // => 1
  15695. *
  15696. * _.defaultTo(undefined, 10);
  15697. * // => 10
  15698. */
  15699. function defaultTo(value, defaultValue) {
  15700. return (value == null || value !== value) ? defaultValue : value;
  15701. }
  15702. /**
  15703. * Creates a function that returns the result of invoking the given functions
  15704. * with the `this` binding of the created function, where each successive
  15705. * invocation is supplied the return value of the previous.
  15706. *
  15707. * @static
  15708. * @memberOf _
  15709. * @since 3.0.0
  15710. * @category Util
  15711. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15712. * @returns {Function} Returns the new composite function.
  15713. * @see _.flowRight
  15714. * @example
  15715. *
  15716. * function square(n) {
  15717. * return n * n;
  15718. * }
  15719. *
  15720. * var addSquare = _.flow([_.add, square]);
  15721. * addSquare(1, 2);
  15722. * // => 9
  15723. */
  15724. var flow = createFlow();
  15725. /**
  15726. * This method is like `_.flow` except that it creates a function that
  15727. * invokes the given functions from right to left.
  15728. *
  15729. * @static
  15730. * @since 3.0.0
  15731. * @memberOf _
  15732. * @category Util
  15733. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15734. * @returns {Function} Returns the new composite function.
  15735. * @see _.flow
  15736. * @example
  15737. *
  15738. * function square(n) {
  15739. * return n * n;
  15740. * }
  15741. *
  15742. * var addSquare = _.flowRight([square, _.add]);
  15743. * addSquare(1, 2);
  15744. * // => 9
  15745. */
  15746. var flowRight = createFlow(true);
  15747. /**
  15748. * This method returns the first argument it receives.
  15749. *
  15750. * @static
  15751. * @since 0.1.0
  15752. * @memberOf _
  15753. * @category Util
  15754. * @param {*} value Any value.
  15755. * @returns {*} Returns `value`.
  15756. * @example
  15757. *
  15758. * var object = { 'a': 1 };
  15759. *
  15760. * console.log(_.identity(object) === object);
  15761. * // => true
  15762. */
  15763. function identity(value) {
  15764. return value;
  15765. }
  15766. /**
  15767. * Creates a function that invokes `func` with the arguments of the created
  15768. * function. If `func` is a property name, the created function returns the
  15769. * property value for a given element. If `func` is an array or object, the
  15770. * created function returns `true` for elements that contain the equivalent
  15771. * source properties, otherwise it returns `false`.
  15772. *
  15773. * @static
  15774. * @since 4.0.0
  15775. * @memberOf _
  15776. * @category Util
  15777. * @param {*} [func=_.identity] The value to convert to a callback.
  15778. * @returns {Function} Returns the callback.
  15779. * @example
  15780. *
  15781. * var users = [
  15782. * { 'user': 'barney', 'age': 36, 'active': true },
  15783. * { 'user': 'fred', 'age': 40, 'active': false }
  15784. * ];
  15785. *
  15786. * // The `_.matches` iteratee shorthand.
  15787. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15788. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15789. *
  15790. * // The `_.matchesProperty` iteratee shorthand.
  15791. * _.filter(users, _.iteratee(['user', 'fred']));
  15792. * // => [{ 'user': 'fred', 'age': 40 }]
  15793. *
  15794. * // The `_.property` iteratee shorthand.
  15795. * _.map(users, _.iteratee('user'));
  15796. * // => ['barney', 'fred']
  15797. *
  15798. * // Create custom iteratee shorthands.
  15799. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15800. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15801. * return func.test(string);
  15802. * };
  15803. * });
  15804. *
  15805. * _.filter(['abc', 'def'], /ef/);
  15806. * // => ['def']
  15807. */
  15808. function iteratee(func) {
  15809. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15810. }
  15811. /**
  15812. * Creates a function that performs a partial deep comparison between a given
  15813. * object and `source`, returning `true` if the given object has equivalent
  15814. * property values, else `false`.
  15815. *
  15816. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15817. * partially applied.
  15818. *
  15819. * Partial comparisons will match empty array and empty object `source`
  15820. * values against any array or object value, respectively. See `_.isEqual`
  15821. * for a list of supported value comparisons.
  15822. *
  15823. * **Note:** Multiple values can be checked by combining several matchers
  15824. * using `_.overSome`
  15825. *
  15826. * @static
  15827. * @memberOf _
  15828. * @since 3.0.0
  15829. * @category Util
  15830. * @param {Object} source The object of property values to match.
  15831. * @returns {Function} Returns the new spec function.
  15832. * @example
  15833. *
  15834. * var objects = [
  15835. * { 'a': 1, 'b': 2, 'c': 3 },
  15836. * { 'a': 4, 'b': 5, 'c': 6 }
  15837. * ];
  15838. *
  15839. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15840. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15841. *
  15842. * // Checking for several possible values
  15843. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15844. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15845. */
  15846. function matches(source) {
  15847. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15848. }
  15849. /**
  15850. * Creates a function that performs a partial deep comparison between the
  15851. * value at `path` of a given object to `srcValue`, returning `true` if the
  15852. * object value is equivalent, else `false`.
  15853. *
  15854. * **Note:** Partial comparisons will match empty array and empty object
  15855. * `srcValue` values against any array or object value, respectively. See
  15856. * `_.isEqual` for a list of supported value comparisons.
  15857. *
  15858. * **Note:** Multiple values can be checked by combining several matchers
  15859. * using `_.overSome`
  15860. *
  15861. * @static
  15862. * @memberOf _
  15863. * @since 3.2.0
  15864. * @category Util
  15865. * @param {Array|string} path The path of the property to get.
  15866. * @param {*} srcValue The value to match.
  15867. * @returns {Function} Returns the new spec function.
  15868. * @example
  15869. *
  15870. * var objects = [
  15871. * { 'a': 1, 'b': 2, 'c': 3 },
  15872. * { 'a': 4, 'b': 5, 'c': 6 }
  15873. * ];
  15874. *
  15875. * _.find(objects, _.matchesProperty('a', 4));
  15876. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15877. *
  15878. * // Checking for several possible values
  15879. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15880. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15881. */
  15882. function matchesProperty(path, srcValue) {
  15883. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15884. }
  15885. /**
  15886. * Creates a function that invokes the method at `path` of a given object.
  15887. * Any additional arguments are provided to the invoked method.
  15888. *
  15889. * @static
  15890. * @memberOf _
  15891. * @since 3.7.0
  15892. * @category Util
  15893. * @param {Array|string} path The path of the method to invoke.
  15894. * @param {...*} [args] The arguments to invoke the method with.
  15895. * @returns {Function} Returns the new invoker function.
  15896. * @example
  15897. *
  15898. * var objects = [
  15899. * { 'a': { 'b': _.constant(2) } },
  15900. * { 'a': { 'b': _.constant(1) } }
  15901. * ];
  15902. *
  15903. * _.map(objects, _.method('a.b'));
  15904. * // => [2, 1]
  15905. *
  15906. * _.map(objects, _.method(['a', 'b']));
  15907. * // => [2, 1]
  15908. */
  15909. var method = baseRest(function(path, args) {
  15910. return function(object) {
  15911. return baseInvoke(object, path, args);
  15912. };
  15913. });
  15914. /**
  15915. * The opposite of `_.method`; this method creates a function that invokes
  15916. * the method at a given path of `object`. Any additional arguments are
  15917. * provided to the invoked method.
  15918. *
  15919. * @static
  15920. * @memberOf _
  15921. * @since 3.7.0
  15922. * @category Util
  15923. * @param {Object} object The object to query.
  15924. * @param {...*} [args] The arguments to invoke the method with.
  15925. * @returns {Function} Returns the new invoker function.
  15926. * @example
  15927. *
  15928. * var array = _.times(3, _.constant),
  15929. * object = { 'a': array, 'b': array, 'c': array };
  15930. *
  15931. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15932. * // => [2, 0]
  15933. *
  15934. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15935. * // => [2, 0]
  15936. */
  15937. var methodOf = baseRest(function(object, args) {
  15938. return function(path) {
  15939. return baseInvoke(object, path, args);
  15940. };
  15941. });
  15942. /**
  15943. * Adds all own enumerable string keyed function properties of a source
  15944. * object to the destination object. If `object` is a function, then methods
  15945. * are added to its prototype as well.
  15946. *
  15947. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15948. * avoid conflicts caused by modifying the original.
  15949. *
  15950. * @static
  15951. * @since 0.1.0
  15952. * @memberOf _
  15953. * @category Util
  15954. * @param {Function|Object} [object=lodash] The destination object.
  15955. * @param {Object} source The object of functions to add.
  15956. * @param {Object} [options={}] The options object.
  15957. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15958. * @returns {Function|Object} Returns `object`.
  15959. * @example
  15960. *
  15961. * function vowels(string) {
  15962. * return _.filter(string, function(v) {
  15963. * return /[aeiou]/i.test(v);
  15964. * });
  15965. * }
  15966. *
  15967. * _.mixin({ 'vowels': vowels });
  15968. * _.vowels('fred');
  15969. * // => ['e']
  15970. *
  15971. * _('fred').vowels().value();
  15972. * // => ['e']
  15973. *
  15974. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15975. * _('fred').vowels();
  15976. * // => ['e']
  15977. */
  15978. function mixin(object, source, options) {
  15979. var props = keys(source),
  15980. methodNames = baseFunctions(source, props);
  15981. if (options == null &&
  15982. !(isObject(source) && (methodNames.length || !props.length))) {
  15983. options = source;
  15984. source = object;
  15985. object = this;
  15986. methodNames = baseFunctions(source, keys(source));
  15987. }
  15988. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15989. isFunc = isFunction(object);
  15990. arrayEach(methodNames, function(methodName) {
  15991. var func = source[methodName];
  15992. object[methodName] = func;
  15993. if (isFunc) {
  15994. object.prototype[methodName] = function() {
  15995. var chainAll = this.__chain__;
  15996. if (chain || chainAll) {
  15997. var result = object(this.__wrapped__),
  15998. actions = result.__actions__ = copyArray(this.__actions__);
  15999. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16000. result.__chain__ = chainAll;
  16001. return result;
  16002. }
  16003. return func.apply(object, arrayPush([this.value()], arguments));
  16004. };
  16005. }
  16006. });
  16007. return object;
  16008. }
  16009. /**
  16010. * Reverts the `_` variable to its previous value and returns a reference to
  16011. * the `lodash` function.
  16012. *
  16013. * @static
  16014. * @since 0.1.0
  16015. * @memberOf _
  16016. * @category Util
  16017. * @returns {Function} Returns the `lodash` function.
  16018. * @example
  16019. *
  16020. * var lodash = _.noConflict();
  16021. */
  16022. function noConflict() {
  16023. if (root._ === this) {
  16024. root._ = oldDash;
  16025. }
  16026. return this;
  16027. }
  16028. /**
  16029. * This method returns `undefined`.
  16030. *
  16031. * @static
  16032. * @memberOf _
  16033. * @since 2.3.0
  16034. * @category Util
  16035. * @example
  16036. *
  16037. * _.times(2, _.noop);
  16038. * // => [undefined, undefined]
  16039. */
  16040. function noop() {
  16041. // No operation performed.
  16042. }
  16043. /**
  16044. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16045. * the nth argument from the end is returned.
  16046. *
  16047. * @static
  16048. * @memberOf _
  16049. * @since 4.0.0
  16050. * @category Util
  16051. * @param {number} [n=0] The index of the argument to return.
  16052. * @returns {Function} Returns the new pass-thru function.
  16053. * @example
  16054. *
  16055. * var func = _.nthArg(1);
  16056. * func('a', 'b', 'c', 'd');
  16057. * // => 'b'
  16058. *
  16059. * var func = _.nthArg(-2);
  16060. * func('a', 'b', 'c', 'd');
  16061. * // => 'c'
  16062. */
  16063. function nthArg(n) {
  16064. n = toInteger(n);
  16065. return baseRest(function(args) {
  16066. return baseNth(args, n);
  16067. });
  16068. }
  16069. /**
  16070. * Creates a function that invokes `iteratees` with the arguments it receives
  16071. * and returns their results.
  16072. *
  16073. * @static
  16074. * @memberOf _
  16075. * @since 4.0.0
  16076. * @category Util
  16077. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16078. * The iteratees to invoke.
  16079. * @returns {Function} Returns the new function.
  16080. * @example
  16081. *
  16082. * var func = _.over([Math.max, Math.min]);
  16083. *
  16084. * func(1, 2, 3, 4);
  16085. * // => [4, 1]
  16086. */
  16087. var over = createOver(arrayMap);
  16088. /**
  16089. * Creates a function that checks if **all** of the `predicates` return
  16090. * truthy when invoked with the arguments it receives.
  16091. *
  16092. * Following shorthands are possible for providing predicates.
  16093. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16094. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16095. *
  16096. * @static
  16097. * @memberOf _
  16098. * @since 4.0.0
  16099. * @category Util
  16100. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16101. * The predicates to check.
  16102. * @returns {Function} Returns the new function.
  16103. * @example
  16104. *
  16105. * var func = _.overEvery([Boolean, isFinite]);
  16106. *
  16107. * func('1');
  16108. * // => true
  16109. *
  16110. * func(null);
  16111. * // => false
  16112. *
  16113. * func(NaN);
  16114. * // => false
  16115. */
  16116. var overEvery = createOver(arrayEvery);
  16117. /**
  16118. * Creates a function that checks if **any** of the `predicates` return
  16119. * truthy when invoked with the arguments it receives.
  16120. *
  16121. * Following shorthands are possible for providing predicates.
  16122. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16123. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16124. *
  16125. * @static
  16126. * @memberOf _
  16127. * @since 4.0.0
  16128. * @category Util
  16129. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16130. * The predicates to check.
  16131. * @returns {Function} Returns the new function.
  16132. * @example
  16133. *
  16134. * var func = _.overSome([Boolean, isFinite]);
  16135. *
  16136. * func('1');
  16137. * // => true
  16138. *
  16139. * func(null);
  16140. * // => true
  16141. *
  16142. * func(NaN);
  16143. * // => false
  16144. *
  16145. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16146. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16147. */
  16148. var overSome = createOver(arraySome);
  16149. /**
  16150. * Creates a function that returns the value at `path` of a given object.
  16151. *
  16152. * @static
  16153. * @memberOf _
  16154. * @since 2.4.0
  16155. * @category Util
  16156. * @param {Array|string} path The path of the property to get.
  16157. * @returns {Function} Returns the new accessor function.
  16158. * @example
  16159. *
  16160. * var objects = [
  16161. * { 'a': { 'b': 2 } },
  16162. * { 'a': { 'b': 1 } }
  16163. * ];
  16164. *
  16165. * _.map(objects, _.property('a.b'));
  16166. * // => [2, 1]
  16167. *
  16168. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16169. * // => [1, 2]
  16170. */
  16171. function property(path) {
  16172. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16173. }
  16174. /**
  16175. * The opposite of `_.property`; this method creates a function that returns
  16176. * the value at a given path of `object`.
  16177. *
  16178. * @static
  16179. * @memberOf _
  16180. * @since 3.0.0
  16181. * @category Util
  16182. * @param {Object} object The object to query.
  16183. * @returns {Function} Returns the new accessor function.
  16184. * @example
  16185. *
  16186. * var array = [0, 1, 2],
  16187. * object = { 'a': array, 'b': array, 'c': array };
  16188. *
  16189. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16190. * // => [2, 0]
  16191. *
  16192. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16193. * // => [2, 0]
  16194. */
  16195. function propertyOf(object) {
  16196. return function(path) {
  16197. return object == null ? undefined : baseGet(object, path);
  16198. };
  16199. }
  16200. /**
  16201. * Creates an array of numbers (positive and/or negative) progressing from
  16202. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16203. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16204. * it's set to `start` with `start` then set to `0`.
  16205. *
  16206. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16207. * floating-point values which can produce unexpected results.
  16208. *
  16209. * @static
  16210. * @since 0.1.0
  16211. * @memberOf _
  16212. * @category Util
  16213. * @param {number} [start=0] The start of the range.
  16214. * @param {number} end The end of the range.
  16215. * @param {number} [step=1] The value to increment or decrement by.
  16216. * @returns {Array} Returns the range of numbers.
  16217. * @see _.inRange, _.rangeRight
  16218. * @example
  16219. *
  16220. * _.range(4);
  16221. * // => [0, 1, 2, 3]
  16222. *
  16223. * _.range(-4);
  16224. * // => [0, -1, -2, -3]
  16225. *
  16226. * _.range(1, 5);
  16227. * // => [1, 2, 3, 4]
  16228. *
  16229. * _.range(0, 20, 5);
  16230. * // => [0, 5, 10, 15]
  16231. *
  16232. * _.range(0, -4, -1);
  16233. * // => [0, -1, -2, -3]
  16234. *
  16235. * _.range(1, 4, 0);
  16236. * // => [1, 1, 1]
  16237. *
  16238. * _.range(0);
  16239. * // => []
  16240. */
  16241. var range = createRange();
  16242. /**
  16243. * This method is like `_.range` except that it populates values in
  16244. * descending order.
  16245. *
  16246. * @static
  16247. * @memberOf _
  16248. * @since 4.0.0
  16249. * @category Util
  16250. * @param {number} [start=0] The start of the range.
  16251. * @param {number} end The end of the range.
  16252. * @param {number} [step=1] The value to increment or decrement by.
  16253. * @returns {Array} Returns the range of numbers.
  16254. * @see _.inRange, _.range
  16255. * @example
  16256. *
  16257. * _.rangeRight(4);
  16258. * // => [3, 2, 1, 0]
  16259. *
  16260. * _.rangeRight(-4);
  16261. * // => [-3, -2, -1, 0]
  16262. *
  16263. * _.rangeRight(1, 5);
  16264. * // => [4, 3, 2, 1]
  16265. *
  16266. * _.rangeRight(0, 20, 5);
  16267. * // => [15, 10, 5, 0]
  16268. *
  16269. * _.rangeRight(0, -4, -1);
  16270. * // => [-3, -2, -1, 0]
  16271. *
  16272. * _.rangeRight(1, 4, 0);
  16273. * // => [1, 1, 1]
  16274. *
  16275. * _.rangeRight(0);
  16276. * // => []
  16277. */
  16278. var rangeRight = createRange(true);
  16279. /**
  16280. * This method returns a new empty array.
  16281. *
  16282. * @static
  16283. * @memberOf _
  16284. * @since 4.13.0
  16285. * @category Util
  16286. * @returns {Array} Returns the new empty array.
  16287. * @example
  16288. *
  16289. * var arrays = _.times(2, _.stubArray);
  16290. *
  16291. * console.log(arrays);
  16292. * // => [[], []]
  16293. *
  16294. * console.log(arrays[0] === arrays[1]);
  16295. * // => false
  16296. */
  16297. function stubArray() {
  16298. return [];
  16299. }
  16300. /**
  16301. * This method returns `false`.
  16302. *
  16303. * @static
  16304. * @memberOf _
  16305. * @since 4.13.0
  16306. * @category Util
  16307. * @returns {boolean} Returns `false`.
  16308. * @example
  16309. *
  16310. * _.times(2, _.stubFalse);
  16311. * // => [false, false]
  16312. */
  16313. function stubFalse() {
  16314. return false;
  16315. }
  16316. /**
  16317. * This method returns a new empty object.
  16318. *
  16319. * @static
  16320. * @memberOf _
  16321. * @since 4.13.0
  16322. * @category Util
  16323. * @returns {Object} Returns the new empty object.
  16324. * @example
  16325. *
  16326. * var objects = _.times(2, _.stubObject);
  16327. *
  16328. * console.log(objects);
  16329. * // => [{}, {}]
  16330. *
  16331. * console.log(objects[0] === objects[1]);
  16332. * // => false
  16333. */
  16334. function stubObject() {
  16335. return {};
  16336. }
  16337. /**
  16338. * This method returns an empty string.
  16339. *
  16340. * @static
  16341. * @memberOf _
  16342. * @since 4.13.0
  16343. * @category Util
  16344. * @returns {string} Returns the empty string.
  16345. * @example
  16346. *
  16347. * _.times(2, _.stubString);
  16348. * // => ['', '']
  16349. */
  16350. function stubString() {
  16351. return '';
  16352. }
  16353. /**
  16354. * This method returns `true`.
  16355. *
  16356. * @static
  16357. * @memberOf _
  16358. * @since 4.13.0
  16359. * @category Util
  16360. * @returns {boolean} Returns `true`.
  16361. * @example
  16362. *
  16363. * _.times(2, _.stubTrue);
  16364. * // => [true, true]
  16365. */
  16366. function stubTrue() {
  16367. return true;
  16368. }
  16369. /**
  16370. * Invokes the iteratee `n` times, returning an array of the results of
  16371. * each invocation. The iteratee is invoked with one argument; (index).
  16372. *
  16373. * @static
  16374. * @since 0.1.0
  16375. * @memberOf _
  16376. * @category Util
  16377. * @param {number} n The number of times to invoke `iteratee`.
  16378. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16379. * @returns {Array} Returns the array of results.
  16380. * @example
  16381. *
  16382. * _.times(3, String);
  16383. * // => ['0', '1', '2']
  16384. *
  16385. * _.times(4, _.constant(0));
  16386. * // => [0, 0, 0, 0]
  16387. */
  16388. function times(n, iteratee) {
  16389. n = toInteger(n);
  16390. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16391. return [];
  16392. }
  16393. var index = MAX_ARRAY_LENGTH,
  16394. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16395. iteratee = getIteratee(iteratee);
  16396. n -= MAX_ARRAY_LENGTH;
  16397. var result = baseTimes(length, iteratee);
  16398. while (++index < n) {
  16399. iteratee(index);
  16400. }
  16401. return result;
  16402. }
  16403. /**
  16404. * Converts `value` to a property path array.
  16405. *
  16406. * @static
  16407. * @memberOf _
  16408. * @since 4.0.0
  16409. * @category Util
  16410. * @param {*} value The value to convert.
  16411. * @returns {Array} Returns the new property path array.
  16412. * @example
  16413. *
  16414. * _.toPath('a.b.c');
  16415. * // => ['a', 'b', 'c']
  16416. *
  16417. * _.toPath('a[0].b.c');
  16418. * // => ['a', '0', 'b', 'c']
  16419. */
  16420. function toPath(value) {
  16421. if (isArray(value)) {
  16422. return arrayMap(value, toKey);
  16423. }
  16424. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16425. }
  16426. /**
  16427. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16428. *
  16429. * @static
  16430. * @since 0.1.0
  16431. * @memberOf _
  16432. * @category Util
  16433. * @param {string} [prefix=''] The value to prefix the ID with.
  16434. * @returns {string} Returns the unique ID.
  16435. * @example
  16436. *
  16437. * _.uniqueId('contact_');
  16438. * // => 'contact_104'
  16439. *
  16440. * _.uniqueId();
  16441. * // => '105'
  16442. */
  16443. function uniqueId(prefix) {
  16444. var id = ++idCounter;
  16445. return toString(prefix) + id;
  16446. }
  16447. /*------------------------------------------------------------------------*/
  16448. /**
  16449. * Adds two numbers.
  16450. *
  16451. * @static
  16452. * @memberOf _
  16453. * @since 3.4.0
  16454. * @category Math
  16455. * @param {number} augend The first number in an addition.
  16456. * @param {number} addend The second number in an addition.
  16457. * @returns {number} Returns the total.
  16458. * @example
  16459. *
  16460. * _.add(6, 4);
  16461. * // => 10
  16462. */
  16463. var add = createMathOperation(function(augend, addend) {
  16464. return augend + addend;
  16465. }, 0);
  16466. /**
  16467. * Computes `number` rounded up to `precision`.
  16468. *
  16469. * @static
  16470. * @memberOf _
  16471. * @since 3.10.0
  16472. * @category Math
  16473. * @param {number} number The number to round up.
  16474. * @param {number} [precision=0] The precision to round up to.
  16475. * @returns {number} Returns the rounded up number.
  16476. * @example
  16477. *
  16478. * _.ceil(4.006);
  16479. * // => 5
  16480. *
  16481. * _.ceil(6.004, 2);
  16482. * // => 6.01
  16483. *
  16484. * _.ceil(6040, -2);
  16485. * // => 6100
  16486. */
  16487. var ceil = createRound('ceil');
  16488. /**
  16489. * Divide two numbers.
  16490. *
  16491. * @static
  16492. * @memberOf _
  16493. * @since 4.7.0
  16494. * @category Math
  16495. * @param {number} dividend The first number in a division.
  16496. * @param {number} divisor The second number in a division.
  16497. * @returns {number} Returns the quotient.
  16498. * @example
  16499. *
  16500. * _.divide(6, 4);
  16501. * // => 1.5
  16502. */
  16503. var divide = createMathOperation(function(dividend, divisor) {
  16504. return dividend / divisor;
  16505. }, 1);
  16506. /**
  16507. * Computes `number` rounded down to `precision`.
  16508. *
  16509. * @static
  16510. * @memberOf _
  16511. * @since 3.10.0
  16512. * @category Math
  16513. * @param {number} number The number to round down.
  16514. * @param {number} [precision=0] The precision to round down to.
  16515. * @returns {number} Returns the rounded down number.
  16516. * @example
  16517. *
  16518. * _.floor(4.006);
  16519. * // => 4
  16520. *
  16521. * _.floor(0.046, 2);
  16522. * // => 0.04
  16523. *
  16524. * _.floor(4060, -2);
  16525. * // => 4000
  16526. */
  16527. var floor = createRound('floor');
  16528. /**
  16529. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16530. * `undefined` is returned.
  16531. *
  16532. * @static
  16533. * @since 0.1.0
  16534. * @memberOf _
  16535. * @category Math
  16536. * @param {Array} array The array to iterate over.
  16537. * @returns {*} Returns the maximum value.
  16538. * @example
  16539. *
  16540. * _.max([4, 2, 8, 6]);
  16541. * // => 8
  16542. *
  16543. * _.max([]);
  16544. * // => undefined
  16545. */
  16546. function max(array) {
  16547. return (array && array.length)
  16548. ? baseExtremum(array, identity, baseGt)
  16549. : undefined;
  16550. }
  16551. /**
  16552. * This method is like `_.max` except that it accepts `iteratee` which is
  16553. * invoked for each element in `array` to generate the criterion by which
  16554. * the value is ranked. The iteratee is invoked with one argument: (value).
  16555. *
  16556. * @static
  16557. * @memberOf _
  16558. * @since 4.0.0
  16559. * @category Math
  16560. * @param {Array} array The array to iterate over.
  16561. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16562. * @returns {*} Returns the maximum value.
  16563. * @example
  16564. *
  16565. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16566. *
  16567. * _.maxBy(objects, function(o) { return o.n; });
  16568. * // => { 'n': 2 }
  16569. *
  16570. * // The `_.property` iteratee shorthand.
  16571. * _.maxBy(objects, 'n');
  16572. * // => { 'n': 2 }
  16573. */
  16574. function maxBy(array, iteratee) {
  16575. return (array && array.length)
  16576. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16577. : undefined;
  16578. }
  16579. /**
  16580. * Computes the mean of the values in `array`.
  16581. *
  16582. * @static
  16583. * @memberOf _
  16584. * @since 4.0.0
  16585. * @category Math
  16586. * @param {Array} array The array to iterate over.
  16587. * @returns {number} Returns the mean.
  16588. * @example
  16589. *
  16590. * _.mean([4, 2, 8, 6]);
  16591. * // => 5
  16592. */
  16593. function mean(array) {
  16594. return baseMean(array, identity);
  16595. }
  16596. /**
  16597. * This method is like `_.mean` except that it accepts `iteratee` which is
  16598. * invoked for each element in `array` to generate the value to be averaged.
  16599. * The iteratee is invoked with one argument: (value).
  16600. *
  16601. * @static
  16602. * @memberOf _
  16603. * @since 4.7.0
  16604. * @category Math
  16605. * @param {Array} array The array to iterate over.
  16606. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16607. * @returns {number} Returns the mean.
  16608. * @example
  16609. *
  16610. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16611. *
  16612. * _.meanBy(objects, function(o) { return o.n; });
  16613. * // => 5
  16614. *
  16615. * // The `_.property` iteratee shorthand.
  16616. * _.meanBy(objects, 'n');
  16617. * // => 5
  16618. */
  16619. function meanBy(array, iteratee) {
  16620. return baseMean(array, getIteratee(iteratee, 2));
  16621. }
  16622. /**
  16623. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16624. * `undefined` is returned.
  16625. *
  16626. * @static
  16627. * @since 0.1.0
  16628. * @memberOf _
  16629. * @category Math
  16630. * @param {Array} array The array to iterate over.
  16631. * @returns {*} Returns the minimum value.
  16632. * @example
  16633. *
  16634. * _.min([4, 2, 8, 6]);
  16635. * // => 2
  16636. *
  16637. * _.min([]);
  16638. * // => undefined
  16639. */
  16640. function min(array) {
  16641. return (array && array.length)
  16642. ? baseExtremum(array, identity, baseLt)
  16643. : undefined;
  16644. }
  16645. /**
  16646. * This method is like `_.min` except that it accepts `iteratee` which is
  16647. * invoked for each element in `array` to generate the criterion by which
  16648. * the value is ranked. The iteratee is invoked with one argument: (value).
  16649. *
  16650. * @static
  16651. * @memberOf _
  16652. * @since 4.0.0
  16653. * @category Math
  16654. * @param {Array} array The array to iterate over.
  16655. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16656. * @returns {*} Returns the minimum value.
  16657. * @example
  16658. *
  16659. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16660. *
  16661. * _.minBy(objects, function(o) { return o.n; });
  16662. * // => { 'n': 1 }
  16663. *
  16664. * // The `_.property` iteratee shorthand.
  16665. * _.minBy(objects, 'n');
  16666. * // => { 'n': 1 }
  16667. */
  16668. function minBy(array, iteratee) {
  16669. return (array && array.length)
  16670. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16671. : undefined;
  16672. }
  16673. /**
  16674. * Multiply two numbers.
  16675. *
  16676. * @static
  16677. * @memberOf _
  16678. * @since 4.7.0
  16679. * @category Math
  16680. * @param {number} multiplier The first number in a multiplication.
  16681. * @param {number} multiplicand The second number in a multiplication.
  16682. * @returns {number} Returns the product.
  16683. * @example
  16684. *
  16685. * _.multiply(6, 4);
  16686. * // => 24
  16687. */
  16688. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16689. return multiplier * multiplicand;
  16690. }, 1);
  16691. /**
  16692. * Computes `number` rounded to `precision`.
  16693. *
  16694. * @static
  16695. * @memberOf _
  16696. * @since 3.10.0
  16697. * @category Math
  16698. * @param {number} number The number to round.
  16699. * @param {number} [precision=0] The precision to round to.
  16700. * @returns {number} Returns the rounded number.
  16701. * @example
  16702. *
  16703. * _.round(4.006);
  16704. * // => 4
  16705. *
  16706. * _.round(4.006, 2);
  16707. * // => 4.01
  16708. *
  16709. * _.round(4060, -2);
  16710. * // => 4100
  16711. */
  16712. var round = createRound('round');
  16713. /**
  16714. * Subtract two numbers.
  16715. *
  16716. * @static
  16717. * @memberOf _
  16718. * @since 4.0.0
  16719. * @category Math
  16720. * @param {number} minuend The first number in a subtraction.
  16721. * @param {number} subtrahend The second number in a subtraction.
  16722. * @returns {number} Returns the difference.
  16723. * @example
  16724. *
  16725. * _.subtract(6, 4);
  16726. * // => 2
  16727. */
  16728. var subtract = createMathOperation(function(minuend, subtrahend) {
  16729. return minuend - subtrahend;
  16730. }, 0);
  16731. /**
  16732. * Computes the sum of the values in `array`.
  16733. *
  16734. * @static
  16735. * @memberOf _
  16736. * @since 3.4.0
  16737. * @category Math
  16738. * @param {Array} array The array to iterate over.
  16739. * @returns {number} Returns the sum.
  16740. * @example
  16741. *
  16742. * _.sum([4, 2, 8, 6]);
  16743. * // => 20
  16744. */
  16745. function sum(array) {
  16746. return (array && array.length)
  16747. ? baseSum(array, identity)
  16748. : 0;
  16749. }
  16750. /**
  16751. * This method is like `_.sum` except that it accepts `iteratee` which is
  16752. * invoked for each element in `array` to generate the value to be summed.
  16753. * The iteratee is invoked with one argument: (value).
  16754. *
  16755. * @static
  16756. * @memberOf _
  16757. * @since 4.0.0
  16758. * @category Math
  16759. * @param {Array} array The array to iterate over.
  16760. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16761. * @returns {number} Returns the sum.
  16762. * @example
  16763. *
  16764. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16765. *
  16766. * _.sumBy(objects, function(o) { return o.n; });
  16767. * // => 20
  16768. *
  16769. * // The `_.property` iteratee shorthand.
  16770. * _.sumBy(objects, 'n');
  16771. * // => 20
  16772. */
  16773. function sumBy(array, iteratee) {
  16774. return (array && array.length)
  16775. ? baseSum(array, getIteratee(iteratee, 2))
  16776. : 0;
  16777. }
  16778. /*------------------------------------------------------------------------*/
  16779. // Add methods that return wrapped values in chain sequences.
  16780. lodash.after = after;
  16781. lodash.ary = ary;
  16782. lodash.assign = assign;
  16783. lodash.assignIn = assignIn;
  16784. lodash.assignInWith = assignInWith;
  16785. lodash.assignWith = assignWith;
  16786. lodash.at = at;
  16787. lodash.before = before;
  16788. lodash.bind = bind;
  16789. lodash.bindAll = bindAll;
  16790. lodash.bindKey = bindKey;
  16791. lodash.castArray = castArray;
  16792. lodash.chain = chain;
  16793. lodash.chunk = chunk;
  16794. lodash.compact = compact;
  16795. lodash.concat = concat;
  16796. lodash.cond = cond;
  16797. lodash.conforms = conforms;
  16798. lodash.constant = constant;
  16799. lodash.countBy = countBy;
  16800. lodash.create = create;
  16801. lodash.curry = curry;
  16802. lodash.curryRight = curryRight;
  16803. lodash.debounce = debounce;
  16804. lodash.defaults = defaults;
  16805. lodash.defaultsDeep = defaultsDeep;
  16806. lodash.defer = defer;
  16807. lodash.delay = delay;
  16808. lodash.difference = difference;
  16809. lodash.differenceBy = differenceBy;
  16810. lodash.differenceWith = differenceWith;
  16811. lodash.drop = drop;
  16812. lodash.dropRight = dropRight;
  16813. lodash.dropRightWhile = dropRightWhile;
  16814. lodash.dropWhile = dropWhile;
  16815. lodash.fill = fill;
  16816. lodash.filter = filter;
  16817. lodash.flatMap = flatMap;
  16818. lodash.flatMapDeep = flatMapDeep;
  16819. lodash.flatMapDepth = flatMapDepth;
  16820. lodash.flatten = flatten;
  16821. lodash.flattenDeep = flattenDeep;
  16822. lodash.flattenDepth = flattenDepth;
  16823. lodash.flip = flip;
  16824. lodash.flow = flow;
  16825. lodash.flowRight = flowRight;
  16826. lodash.fromPairs = fromPairs;
  16827. lodash.functions = functions;
  16828. lodash.functionsIn = functionsIn;
  16829. lodash.groupBy = groupBy;
  16830. lodash.initial = initial;
  16831. lodash.intersection = intersection;
  16832. lodash.intersectionBy = intersectionBy;
  16833. lodash.intersectionWith = intersectionWith;
  16834. lodash.invert = invert;
  16835. lodash.invertBy = invertBy;
  16836. lodash.invokeMap = invokeMap;
  16837. lodash.iteratee = iteratee;
  16838. lodash.keyBy = keyBy;
  16839. lodash.keys = keys;
  16840. lodash.keysIn = keysIn;
  16841. lodash.map = map;
  16842. lodash.mapKeys = mapKeys;
  16843. lodash.mapValues = mapValues;
  16844. lodash.matches = matches;
  16845. lodash.matchesProperty = matchesProperty;
  16846. lodash.memoize = memoize;
  16847. lodash.merge = merge;
  16848. lodash.mergeWith = mergeWith;
  16849. lodash.method = method;
  16850. lodash.methodOf = methodOf;
  16851. lodash.mixin = mixin;
  16852. lodash.negate = negate;
  16853. lodash.nthArg = nthArg;
  16854. lodash.omit = omit;
  16855. lodash.omitBy = omitBy;
  16856. lodash.once = once;
  16857. lodash.orderBy = orderBy;
  16858. lodash.over = over;
  16859. lodash.overArgs = overArgs;
  16860. lodash.overEvery = overEvery;
  16861. lodash.overSome = overSome;
  16862. lodash.partial = partial;
  16863. lodash.partialRight = partialRight;
  16864. lodash.partition = partition;
  16865. lodash.pick = pick;
  16866. lodash.pickBy = pickBy;
  16867. lodash.property = property;
  16868. lodash.propertyOf = propertyOf;
  16869. lodash.pull = pull;
  16870. lodash.pullAll = pullAll;
  16871. lodash.pullAllBy = pullAllBy;
  16872. lodash.pullAllWith = pullAllWith;
  16873. lodash.pullAt = pullAt;
  16874. lodash.range = range;
  16875. lodash.rangeRight = rangeRight;
  16876. lodash.rearg = rearg;
  16877. lodash.reject = reject;
  16878. lodash.remove = remove;
  16879. lodash.rest = rest;
  16880. lodash.reverse = reverse;
  16881. lodash.sampleSize = sampleSize;
  16882. lodash.set = set;
  16883. lodash.setWith = setWith;
  16884. lodash.shuffle = shuffle;
  16885. lodash.slice = slice;
  16886. lodash.sortBy = sortBy;
  16887. lodash.sortedUniq = sortedUniq;
  16888. lodash.sortedUniqBy = sortedUniqBy;
  16889. lodash.split = split;
  16890. lodash.spread = spread;
  16891. lodash.tail = tail;
  16892. lodash.take = take;
  16893. lodash.takeRight = takeRight;
  16894. lodash.takeRightWhile = takeRightWhile;
  16895. lodash.takeWhile = takeWhile;
  16896. lodash.tap = tap;
  16897. lodash.throttle = throttle;
  16898. lodash.thru = thru;
  16899. lodash.toArray = toArray;
  16900. lodash.toPairs = toPairs;
  16901. lodash.toPairsIn = toPairsIn;
  16902. lodash.toPath = toPath;
  16903. lodash.toPlainObject = toPlainObject;
  16904. lodash.transform = transform;
  16905. lodash.unary = unary;
  16906. lodash.union = union;
  16907. lodash.unionBy = unionBy;
  16908. lodash.unionWith = unionWith;
  16909. lodash.uniq = uniq;
  16910. lodash.uniqBy = uniqBy;
  16911. lodash.uniqWith = uniqWith;
  16912. lodash.unset = unset;
  16913. lodash.unzip = unzip;
  16914. lodash.unzipWith = unzipWith;
  16915. lodash.update = update;
  16916. lodash.updateWith = updateWith;
  16917. lodash.values = values;
  16918. lodash.valuesIn = valuesIn;
  16919. lodash.without = without;
  16920. lodash.words = words;
  16921. lodash.wrap = wrap;
  16922. lodash.xor = xor;
  16923. lodash.xorBy = xorBy;
  16924. lodash.xorWith = xorWith;
  16925. lodash.zip = zip;
  16926. lodash.zipObject = zipObject;
  16927. lodash.zipObjectDeep = zipObjectDeep;
  16928. lodash.zipWith = zipWith;
  16929. // Add aliases.
  16930. lodash.entries = toPairs;
  16931. lodash.entriesIn = toPairsIn;
  16932. lodash.extend = assignIn;
  16933. lodash.extendWith = assignInWith;
  16934. // Add methods to `lodash.prototype`.
  16935. mixin(lodash, lodash);
  16936. /*------------------------------------------------------------------------*/
  16937. // Add methods that return unwrapped values in chain sequences.
  16938. lodash.add = add;
  16939. lodash.attempt = attempt;
  16940. lodash.camelCase = camelCase;
  16941. lodash.capitalize = capitalize;
  16942. lodash.ceil = ceil;
  16943. lodash.clamp = clamp;
  16944. lodash.clone = clone;
  16945. lodash.cloneDeep = cloneDeep;
  16946. lodash.cloneDeepWith = cloneDeepWith;
  16947. lodash.cloneWith = cloneWith;
  16948. lodash.conformsTo = conformsTo;
  16949. lodash.deburr = deburr;
  16950. lodash.defaultTo = defaultTo;
  16951. lodash.divide = divide;
  16952. lodash.endsWith = endsWith;
  16953. lodash.eq = eq;
  16954. lodash.escape = escape;
  16955. lodash.escapeRegExp = escapeRegExp;
  16956. lodash.every = every;
  16957. lodash.find = find;
  16958. lodash.findIndex = findIndex;
  16959. lodash.findKey = findKey;
  16960. lodash.findLast = findLast;
  16961. lodash.findLastIndex = findLastIndex;
  16962. lodash.findLastKey = findLastKey;
  16963. lodash.floor = floor;
  16964. lodash.forEach = forEach;
  16965. lodash.forEachRight = forEachRight;
  16966. lodash.forIn = forIn;
  16967. lodash.forInRight = forInRight;
  16968. lodash.forOwn = forOwn;
  16969. lodash.forOwnRight = forOwnRight;
  16970. lodash.get = get;
  16971. lodash.gt = gt;
  16972. lodash.gte = gte;
  16973. lodash.has = has;
  16974. lodash.hasIn = hasIn;
  16975. lodash.head = head;
  16976. lodash.identity = identity;
  16977. lodash.includes = includes;
  16978. lodash.indexOf = indexOf;
  16979. lodash.inRange = inRange;
  16980. lodash.invoke = invoke;
  16981. lodash.isArguments = isArguments;
  16982. lodash.isArray = isArray;
  16983. lodash.isArrayBuffer = isArrayBuffer;
  16984. lodash.isArrayLike = isArrayLike;
  16985. lodash.isArrayLikeObject = isArrayLikeObject;
  16986. lodash.isBoolean = isBoolean;
  16987. lodash.isBuffer = isBuffer;
  16988. lodash.isDate = isDate;
  16989. lodash.isElement = isElement;
  16990. lodash.isEmpty = isEmpty;
  16991. lodash.isEqual = isEqual;
  16992. lodash.isEqualWith = isEqualWith;
  16993. lodash.isError = isError;
  16994. lodash.isFinite = isFinite;
  16995. lodash.isFunction = isFunction;
  16996. lodash.isInteger = isInteger;
  16997. lodash.isLength = isLength;
  16998. lodash.isMap = isMap;
  16999. lodash.isMatch = isMatch;
  17000. lodash.isMatchWith = isMatchWith;
  17001. lodash.isNaN = isNaN;
  17002. lodash.isNative = isNative;
  17003. lodash.isNil = isNil;
  17004. lodash.isNull = isNull;
  17005. lodash.isNumber = isNumber;
  17006. lodash.isObject = isObject;
  17007. lodash.isObjectLike = isObjectLike;
  17008. lodash.isPlainObject = isPlainObject;
  17009. lodash.isRegExp = isRegExp;
  17010. lodash.isSafeInteger = isSafeInteger;
  17011. lodash.isSet = isSet;
  17012. lodash.isString = isString;
  17013. lodash.isSymbol = isSymbol;
  17014. lodash.isTypedArray = isTypedArray;
  17015. lodash.isUndefined = isUndefined;
  17016. lodash.isWeakMap = isWeakMap;
  17017. lodash.isWeakSet = isWeakSet;
  17018. lodash.join = join;
  17019. lodash.kebabCase = kebabCase;
  17020. lodash.last = last;
  17021. lodash.lastIndexOf = lastIndexOf;
  17022. lodash.lowerCase = lowerCase;
  17023. lodash.lowerFirst = lowerFirst;
  17024. lodash.lt = lt;
  17025. lodash.lte = lte;
  17026. lodash.max = max;
  17027. lodash.maxBy = maxBy;
  17028. lodash.mean = mean;
  17029. lodash.meanBy = meanBy;
  17030. lodash.min = min;
  17031. lodash.minBy = minBy;
  17032. lodash.stubArray = stubArray;
  17033. lodash.stubFalse = stubFalse;
  17034. lodash.stubObject = stubObject;
  17035. lodash.stubString = stubString;
  17036. lodash.stubTrue = stubTrue;
  17037. lodash.multiply = multiply;
  17038. lodash.nth = nth;
  17039. lodash.noConflict = noConflict;
  17040. lodash.noop = noop;
  17041. lodash.now = now;
  17042. lodash.pad = pad;
  17043. lodash.padEnd = padEnd;
  17044. lodash.padStart = padStart;
  17045. lodash.parseInt = parseInt;
  17046. lodash.random = random;
  17047. lodash.reduce = reduce;
  17048. lodash.reduceRight = reduceRight;
  17049. lodash.repeat = repeat;
  17050. lodash.replace = replace;
  17051. lodash.result = result;
  17052. lodash.round = round;
  17053. lodash.runInContext = runInContext;
  17054. lodash.sample = sample;
  17055. lodash.size = size;
  17056. lodash.snakeCase = snakeCase;
  17057. lodash.some = some;
  17058. lodash.sortedIndex = sortedIndex;
  17059. lodash.sortedIndexBy = sortedIndexBy;
  17060. lodash.sortedIndexOf = sortedIndexOf;
  17061. lodash.sortedLastIndex = sortedLastIndex;
  17062. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17063. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17064. lodash.startCase = startCase;
  17065. lodash.startsWith = startsWith;
  17066. lodash.subtract = subtract;
  17067. lodash.sum = sum;
  17068. lodash.sumBy = sumBy;
  17069. lodash.template = template;
  17070. lodash.times = times;
  17071. lodash.toFinite = toFinite;
  17072. lodash.toInteger = toInteger;
  17073. lodash.toLength = toLength;
  17074. lodash.toLower = toLower;
  17075. lodash.toNumber = toNumber;
  17076. lodash.toSafeInteger = toSafeInteger;
  17077. lodash.toString = toString;
  17078. lodash.toUpper = toUpper;
  17079. lodash.trim = trim;
  17080. lodash.trimEnd = trimEnd;
  17081. lodash.trimStart = trimStart;
  17082. lodash.truncate = truncate;
  17083. lodash.unescape = unescape;
  17084. lodash.uniqueId = uniqueId;
  17085. lodash.upperCase = upperCase;
  17086. lodash.upperFirst = upperFirst;
  17087. // Add aliases.
  17088. lodash.each = forEach;
  17089. lodash.eachRight = forEachRight;
  17090. lodash.first = head;
  17091. mixin(lodash, (function() {
  17092. var source = {};
  17093. baseForOwn(lodash, function(func, methodName) {
  17094. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17095. source[methodName] = func;
  17096. }
  17097. });
  17098. return source;
  17099. }()), { 'chain': false });
  17100. /*------------------------------------------------------------------------*/
  17101. /**
  17102. * The semantic version number.
  17103. *
  17104. * @static
  17105. * @memberOf _
  17106. * @type {string}
  17107. */
  17108. lodash.VERSION = VERSION;
  17109. // Assign default placeholders.
  17110. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17111. lodash[methodName].placeholder = lodash;
  17112. });
  17113. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17114. arrayEach(['drop', 'take'], function(methodName, index) {
  17115. LazyWrapper.prototype[methodName] = function(n) {
  17116. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17117. var result = (this.__filtered__ && !index)
  17118. ? new LazyWrapper(this)
  17119. : this.clone();
  17120. if (result.__filtered__) {
  17121. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17122. } else {
  17123. result.__views__.push({
  17124. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17125. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17126. });
  17127. }
  17128. return result;
  17129. };
  17130. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17131. return this.reverse()[methodName](n).reverse();
  17132. };
  17133. });
  17134. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17135. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17136. var type = index + 1,
  17137. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17138. LazyWrapper.prototype[methodName] = function(iteratee) {
  17139. var result = this.clone();
  17140. result.__iteratees__.push({
  17141. 'iteratee': getIteratee(iteratee, 3),
  17142. 'type': type
  17143. });
  17144. result.__filtered__ = result.__filtered__ || isFilter;
  17145. return result;
  17146. };
  17147. });
  17148. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17149. arrayEach(['head', 'last'], function(methodName, index) {
  17150. var takeName = 'take' + (index ? 'Right' : '');
  17151. LazyWrapper.prototype[methodName] = function() {
  17152. return this[takeName](1).value()[0];
  17153. };
  17154. });
  17155. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17156. arrayEach(['initial', 'tail'], function(methodName, index) {
  17157. var dropName = 'drop' + (index ? '' : 'Right');
  17158. LazyWrapper.prototype[methodName] = function() {
  17159. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17160. };
  17161. });
  17162. LazyWrapper.prototype.compact = function() {
  17163. return this.filter(identity);
  17164. };
  17165. LazyWrapper.prototype.find = function(predicate) {
  17166. return this.filter(predicate).head();
  17167. };
  17168. LazyWrapper.prototype.findLast = function(predicate) {
  17169. return this.reverse().find(predicate);
  17170. };
  17171. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17172. if (typeof path == 'function') {
  17173. return new LazyWrapper(this);
  17174. }
  17175. return this.map(function(value) {
  17176. return baseInvoke(value, path, args);
  17177. });
  17178. });
  17179. LazyWrapper.prototype.reject = function(predicate) {
  17180. return this.filter(negate(getIteratee(predicate)));
  17181. };
  17182. LazyWrapper.prototype.slice = function(start, end) {
  17183. start = toInteger(start);
  17184. var result = this;
  17185. if (result.__filtered__ && (start > 0 || end < 0)) {
  17186. return new LazyWrapper(result);
  17187. }
  17188. if (start < 0) {
  17189. result = result.takeRight(-start);
  17190. } else if (start) {
  17191. result = result.drop(start);
  17192. }
  17193. if (end !== undefined) {
  17194. end = toInteger(end);
  17195. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17196. }
  17197. return result;
  17198. };
  17199. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17200. return this.reverse().takeWhile(predicate).reverse();
  17201. };
  17202. LazyWrapper.prototype.toArray = function() {
  17203. return this.take(MAX_ARRAY_LENGTH);
  17204. };
  17205. // Add `LazyWrapper` methods to `lodash.prototype`.
  17206. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17207. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17208. isTaker = /^(?:head|last)$/.test(methodName),
  17209. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17210. retUnwrapped = isTaker || /^find/.test(methodName);
  17211. if (!lodashFunc) {
  17212. return;
  17213. }
  17214. lodash.prototype[methodName] = function() {
  17215. var value = this.__wrapped__,
  17216. args = isTaker ? [1] : arguments,
  17217. isLazy = value instanceof LazyWrapper,
  17218. iteratee = args[0],
  17219. useLazy = isLazy || isArray(value);
  17220. var interceptor = function(value) {
  17221. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17222. return (isTaker && chainAll) ? result[0] : result;
  17223. };
  17224. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17225. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17226. isLazy = useLazy = false;
  17227. }
  17228. var chainAll = this.__chain__,
  17229. isHybrid = !!this.__actions__.length,
  17230. isUnwrapped = retUnwrapped && !chainAll,
  17231. onlyLazy = isLazy && !isHybrid;
  17232. if (!retUnwrapped && useLazy) {
  17233. value = onlyLazy ? value : new LazyWrapper(this);
  17234. var result = func.apply(value, args);
  17235. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17236. return new LodashWrapper(result, chainAll);
  17237. }
  17238. if (isUnwrapped && onlyLazy) {
  17239. return func.apply(this, args);
  17240. }
  17241. result = this.thru(interceptor);
  17242. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17243. };
  17244. });
  17245. // Add `Array` methods to `lodash.prototype`.
  17246. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17247. var func = arrayProto[methodName],
  17248. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17249. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17250. lodash.prototype[methodName] = function() {
  17251. var args = arguments;
  17252. if (retUnwrapped && !this.__chain__) {
  17253. var value = this.value();
  17254. return func.apply(isArray(value) ? value : [], args);
  17255. }
  17256. return this[chainName](function(value) {
  17257. return func.apply(isArray(value) ? value : [], args);
  17258. });
  17259. };
  17260. });
  17261. // Map minified method names to their real names.
  17262. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17263. var lodashFunc = lodash[methodName];
  17264. if (lodashFunc) {
  17265. var key = lodashFunc.name + '';
  17266. if (!hasOwnProperty.call(realNames, key)) {
  17267. realNames[key] = [];
  17268. }
  17269. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17270. }
  17271. });
  17272. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17273. 'name': 'wrapper',
  17274. 'func': undefined
  17275. }];
  17276. // Add methods to `LazyWrapper`.
  17277. LazyWrapper.prototype.clone = lazyClone;
  17278. LazyWrapper.prototype.reverse = lazyReverse;
  17279. LazyWrapper.prototype.value = lazyValue;
  17280. // Add chain sequence methods to the `lodash` wrapper.
  17281. lodash.prototype.at = wrapperAt;
  17282. lodash.prototype.chain = wrapperChain;
  17283. lodash.prototype.commit = wrapperCommit;
  17284. lodash.prototype.next = wrapperNext;
  17285. lodash.prototype.plant = wrapperPlant;
  17286. lodash.prototype.reverse = wrapperReverse;
  17287. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17288. // Add lazy aliases.
  17289. lodash.prototype.first = lodash.prototype.head;
  17290. if (symIterator) {
  17291. lodash.prototype[symIterator] = wrapperToIterator;
  17292. }
  17293. return lodash;
  17294. });
  17295. /*--------------------------------------------------------------------------*/
  17296. // Export lodash.
  17297. var _ = runInContext();
  17298. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17299. if (true) {
  17300. // Expose Lodash on the global object to prevent errors when Lodash is
  17301. // loaded by a script tag in the presence of an AMD loader.
  17302. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17303. // Use `_.noConflict` to remove Lodash from the global object.
  17304. root._ = _;
  17305. // Define as an anonymous module so, through path mapping, it can be
  17306. // referenced as the "underscore" module.
  17307. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17308. return _;
  17309. }).call(exports, __webpack_require__, exports, module),
  17310. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17311. }
  17312. // Check for `exports` after `define` in case a build optimizer adds it.
  17313. else {}
  17314. }.call(this));
  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/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&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/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&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_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");
  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_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_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_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_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/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&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_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");
  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_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_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_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17353. /***/ }),
  17354. /***/ "./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":
  17355. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17356. !*** ./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 ***!
  17357. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17358. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17359. "use strict";
  17360. __webpack_require__.r(__webpack_exports__);
  17361. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17362. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17363. /* harmony export */ });
  17364. /* 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");
  17365. /* 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__);
  17366. /* 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");
  17367. var options = {};
  17368. options.insert = "head";
  17369. options.singleton = false;
  17370. 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);
  17371. /* 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 || {});
  17372. /***/ }),
  17373. /***/ "./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":
  17374. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17375. !*** ./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 ***!
  17376. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17377. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17378. "use strict";
  17379. __webpack_require__.r(__webpack_exports__);
  17380. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17381. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17382. /* harmony export */ });
  17383. /* 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");
  17384. /* 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__);
  17385. /* 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");
  17386. var options = {};
  17387. options.insert = "head";
  17388. options.singleton = false;
  17389. 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);
  17390. /* 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 || {});
  17391. /***/ }),
  17392. /***/ "./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":
  17393. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17394. !*** ./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 ***!
  17395. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17396. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17397. "use strict";
  17398. __webpack_require__.r(__webpack_exports__);
  17399. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17400. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17401. /* harmony export */ });
  17402. /* 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");
  17403. /* 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__);
  17404. /* 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");
  17405. var options = {};
  17406. options.insert = "head";
  17407. options.singleton = false;
  17408. 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);
  17409. /* 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 || {});
  17410. /***/ }),
  17411. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17412. /*!******************************************************!*\
  17413. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17414. \******************************************************/
  17415. /***/ ((__unused_webpack_module, exports) => {
  17416. "use strict";
  17417. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17418. // runtime helper for setting properties on components
  17419. // in a tree-shakable way
  17420. exports["default"] = (sfc, props) => {
  17421. const target = sfc.__vccOpts || sfc;
  17422. for (const [key, val] of props) {
  17423. target[key] = val;
  17424. }
  17425. return target;
  17426. };
  17427. /***/ }),
  17428. /***/ "./resources/js/components/AppButtonLink.vue":
  17429. /*!***************************************************!*\
  17430. !*** ./resources/js/components/AppButtonLink.vue ***!
  17431. \***************************************************/
  17432. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17433. "use strict";
  17434. __webpack_require__.r(__webpack_exports__);
  17435. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17436. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17437. /* harmony export */ });
  17438. /* 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");
  17439. /* 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");
  17440. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17441. ;
  17442. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17443. /* hot reload */
  17444. if (false) {}
  17445. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17446. /***/ }),
  17447. /***/ "./resources/js/components/AppFooter.vue":
  17448. /*!***********************************************!*\
  17449. !*** ./resources/js/components/AppFooter.vue ***!
  17450. \***********************************************/
  17451. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17452. "use strict";
  17453. __webpack_require__.r(__webpack_exports__);
  17454. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17455. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17456. /* harmony export */ });
  17457. /* 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");
  17458. /* 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");
  17459. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17460. const script = {}
  17461. ;
  17462. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17463. /* hot reload */
  17464. if (false) {}
  17465. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17466. /***/ }),
  17467. /***/ "./resources/js/components/AppMessage.vue":
  17468. /*!************************************************!*\
  17469. !*** ./resources/js/components/AppMessage.vue ***!
  17470. \************************************************/
  17471. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17472. "use strict";
  17473. __webpack_require__.r(__webpack_exports__);
  17474. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17475. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17476. /* harmony export */ });
  17477. /* 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");
  17478. /* 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");
  17479. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17480. ;
  17481. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17482. /* hot reload */
  17483. if (false) {}
  17484. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17485. /***/ }),
  17486. /***/ "./resources/js/components/AppPagination.vue":
  17487. /*!***************************************************!*\
  17488. !*** ./resources/js/components/AppPagination.vue ***!
  17489. \***************************************************/
  17490. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17491. "use strict";
  17492. __webpack_require__.r(__webpack_exports__);
  17493. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17494. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17495. /* harmony export */ });
  17496. /* 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");
  17497. /* 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");
  17498. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17499. ;
  17500. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17501. /* hot reload */
  17502. if (false) {}
  17503. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17504. /***/ }),
  17505. /***/ "./resources/js/components/AppSidebar.vue":
  17506. /*!************************************************!*\
  17507. !*** ./resources/js/components/AppSidebar.vue ***!
  17508. \************************************************/
  17509. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17510. "use strict";
  17511. __webpack_require__.r(__webpack_exports__);
  17512. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17513. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17514. /* harmony export */ });
  17515. /* 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");
  17516. /* 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");
  17517. /* 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");
  17518. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17519. ;
  17520. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17521. /* hot reload */
  17522. if (false) {}
  17523. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17524. /***/ }),
  17525. /***/ "./resources/js/components/AppSubSidebar.vue":
  17526. /*!***************************************************!*\
  17527. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17528. \***************************************************/
  17529. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17530. "use strict";
  17531. __webpack_require__.r(__webpack_exports__);
  17532. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17533. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17534. /* harmony export */ });
  17535. /* 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");
  17536. /* 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");
  17537. /* 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");
  17538. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17539. ;
  17540. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17541. /* hot reload */
  17542. if (false) {}
  17543. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17544. /***/ }),
  17545. /***/ "./resources/js/components/AppTopBar.vue":
  17546. /*!***********************************************!*\
  17547. !*** ./resources/js/components/AppTopBar.vue ***!
  17548. \***********************************************/
  17549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17550. "use strict";
  17551. __webpack_require__.r(__webpack_exports__);
  17552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17553. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17554. /* harmony export */ });
  17555. /* 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");
  17556. /* 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");
  17557. /* 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");
  17558. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17559. ;
  17560. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17561. /* hot reload */
  17562. if (false) {}
  17563. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17564. /***/ }),
  17565. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17566. /*!**************************************************!*\
  17567. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17568. \**************************************************/
  17569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17570. "use strict";
  17571. __webpack_require__.r(__webpack_exports__);
  17572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17573. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17574. /* harmony export */ });
  17575. /* 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");
  17576. /* 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");
  17577. /* 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");
  17578. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17579. ;
  17580. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17581. /* hot reload */
  17582. if (false) {}
  17583. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17584. /***/ }),
  17585. /***/ "./resources/js/pages/user/Index.vue":
  17586. /*!*******************************************!*\
  17587. !*** ./resources/js/pages/user/Index.vue ***!
  17588. \*******************************************/
  17589. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17590. "use strict";
  17591. __webpack_require__.r(__webpack_exports__);
  17592. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17593. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17594. /* harmony export */ });
  17595. /* 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");
  17596. /* 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");
  17597. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17598. ;
  17599. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/user/Index.vue"]])
  17600. /* hot reload */
  17601. if (false) {}
  17602. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17603. /***/ }),
  17604. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17605. /*!**************************************************************************************!*\
  17606. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17607. \**************************************************************************************/
  17608. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17609. "use strict";
  17610. __webpack_require__.r(__webpack_exports__);
  17611. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17612. /* 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"])
  17613. /* harmony export */ });
  17614. /* 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");
  17615. /***/ }),
  17616. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17617. /*!***********************************************************************************!*\
  17618. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17619. \***********************************************************************************/
  17620. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17621. "use strict";
  17622. __webpack_require__.r(__webpack_exports__);
  17623. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17624. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17625. /* harmony export */ });
  17626. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17627. /***/ }),
  17628. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17629. /*!**************************************************************************************!*\
  17630. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17631. \**************************************************************************************/
  17632. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17633. "use strict";
  17634. __webpack_require__.r(__webpack_exports__);
  17635. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17636. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17637. /* harmony export */ });
  17638. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17639. /***/ }),
  17640. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17641. /*!***********************************************************************************!*\
  17642. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17643. \***********************************************************************************/
  17644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17645. "use strict";
  17646. __webpack_require__.r(__webpack_exports__);
  17647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17648. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17649. /* harmony export */ });
  17650. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17651. /***/ }),
  17652. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17653. /*!**************************************************************************************!*\
  17654. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17655. \**************************************************************************************/
  17656. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17657. "use strict";
  17658. __webpack_require__.r(__webpack_exports__);
  17659. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17660. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17661. /* harmony export */ });
  17662. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17663. /***/ }),
  17664. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17665. /*!**********************************************************************************!*\
  17666. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17667. \**********************************************************************************/
  17668. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17669. "use strict";
  17670. __webpack_require__.r(__webpack_exports__);
  17671. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17672. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17673. /* harmony export */ });
  17674. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17675. /***/ }),
  17676. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17677. /*!*************************************************************************************!*\
  17678. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17679. \*************************************************************************************/
  17680. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17681. "use strict";
  17682. __webpack_require__.r(__webpack_exports__);
  17683. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17684. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17685. /* harmony export */ });
  17686. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17687. /***/ }),
  17688. /***/ "./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  17689. /*!******************************************************************************!*\
  17690. !*** ./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  17691. \******************************************************************************/
  17692. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17693. "use strict";
  17694. __webpack_require__.r(__webpack_exports__);
  17695. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17696. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17697. /* harmony export */ });
  17698. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17699. /***/ }),
  17700. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17701. /*!*********************************************************************************!*\
  17702. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17703. \*********************************************************************************/
  17704. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17705. "use strict";
  17706. __webpack_require__.r(__webpack_exports__);
  17707. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17708. /* harmony export */ "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)
  17709. /* harmony export */ });
  17710. /* 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");
  17711. /***/ }),
  17712. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17713. /*!*****************************************************************************************!*\
  17714. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17715. \*****************************************************************************************/
  17716. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17717. "use strict";
  17718. __webpack_require__.r(__webpack_exports__);
  17719. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17720. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17721. /* harmony export */ });
  17722. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17723. /***/ }),
  17724. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17725. /*!******************************************************************************!*\
  17726. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17727. \******************************************************************************/
  17728. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17729. "use strict";
  17730. __webpack_require__.r(__webpack_exports__);
  17731. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17732. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17733. /* harmony export */ });
  17734. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17735. /***/ }),
  17736. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17737. /*!*********************************************************************************!*\
  17738. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17739. \*********************************************************************************/
  17740. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17741. "use strict";
  17742. __webpack_require__.r(__webpack_exports__);
  17743. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17744. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17745. /* harmony export */ });
  17746. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17747. /***/ }),
  17748. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17749. /*!******************************************************************************************!*\
  17750. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17751. \******************************************************************************************/
  17752. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17753. "use strict";
  17754. __webpack_require__.r(__webpack_exports__);
  17755. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17756. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17757. /* harmony export */ });
  17758. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17759. /***/ }),
  17760. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17761. /*!*********************************************************************************************!*\
  17762. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17763. \*********************************************************************************************/
  17764. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17765. "use strict";
  17766. __webpack_require__.r(__webpack_exports__);
  17767. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17768. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17769. /* harmony export */ });
  17770. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17771. /***/ }),
  17772. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17773. /*!*****************************************************************************************!*\
  17774. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17775. \*****************************************************************************************/
  17776. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17777. "use strict";
  17778. __webpack_require__.r(__webpack_exports__);
  17779. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17780. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17781. /* harmony export */ });
  17782. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17783. /***/ }),
  17784. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17785. /*!********************************************************************************************!*\
  17786. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17787. \********************************************************************************************/
  17788. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17789. "use strict";
  17790. __webpack_require__.r(__webpack_exports__);
  17791. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17792. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17793. /* harmony export */ });
  17794. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17795. /***/ }),
  17796. /***/ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  17797. /*!*************************************************************************!*\
  17798. !*** ./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  17799. \*************************************************************************/
  17800. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17801. "use strict";
  17802. __webpack_require__.r(__webpack_exports__);
  17803. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17804. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render)
  17805. /* harmony export */ });
  17806. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17807. /***/ }),
  17808. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17809. /*!********************************************************************************************************!*\
  17810. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17811. \********************************************************************************************************/
  17812. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17813. "use strict";
  17814. __webpack_require__.r(__webpack_exports__);
  17815. /* 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");
  17816. /***/ }),
  17817. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17818. /*!*********************************************************************************************************!*\
  17819. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17820. \*********************************************************************************************************/
  17821. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17822. "use strict";
  17823. __webpack_require__.r(__webpack_exports__);
  17824. /* 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");
  17825. /***/ }),
  17826. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17827. /*!************************************************************************************************************!*\
  17828. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17829. \************************************************************************************************************/
  17830. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17831. "use strict";
  17832. __webpack_require__.r(__webpack_exports__);
  17833. /* 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");
  17834. /***/ }),
  17835. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17836. /*!********************************************************************************************************!*\
  17837. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17838. \********************************************************************************************************/
  17839. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17840. "use strict";
  17841. __webpack_require__.r(__webpack_exports__);
  17842. /* 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");
  17843. /***/ }),
  17844. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17845. /*!***********************************************************************************************************!*\
  17846. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17847. \***********************************************************************************************************/
  17848. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17849. "use strict";
  17850. __webpack_require__.r(__webpack_exports__);
  17851. /* 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");
  17852. /***/ })
  17853. }]);