resources_js_pages_User_Index_vue.js 693KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_User_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: String,
  21. label: String,
  22. classButton: String
  23. },
  24. setup: function setup(__props, _ref) {
  25. var expose = _ref.expose;
  26. expose();
  27. var __returned__ = {
  28. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  29. };
  30. Object.defineProperty(__returned__, '__isScriptSetup', {
  31. enumerable: false,
  32. value: true
  33. });
  34. return __returned__;
  35. }
  36. });
  37. /***/ }),
  38. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  39. /*!***************************************************************************************************************************************************************************************************************!*\
  40. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  41. \***************************************************************************************************************************************************************************************************************/
  42. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  43. "use strict";
  44. __webpack_require__.r(__webpack_exports__);
  45. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  46. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  47. /* harmony export */ });
  48. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  49. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  50. __name: 'AppMessage',
  51. setup: function setup(__props, _ref) {
  52. var expose = _ref.expose;
  53. expose();
  54. var onClose = function onClose() {
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  56. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  58. };
  59. var __returned__ = {
  60. onClose: onClose,
  61. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  62. };
  63. Object.defineProperty(__returned__, '__isScriptSetup', {
  64. enumerable: false,
  65. value: true
  66. });
  67. return __returned__;
  68. }
  69. });
  70. /***/ }),
  71. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  72. /*!******************************************************************************************************************************************************************************************************************!*\
  73. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  74. \******************************************************************************************************************************************************************************************************************/
  75. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  76. "use strict";
  77. __webpack_require__.r(__webpack_exports__);
  78. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  79. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  80. /* harmony export */ });
  81. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  82. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  83. __name: 'AppPagination',
  84. props: {
  85. links: Array
  86. },
  87. setup: function setup(__props, _ref) {
  88. var expose = _ref.expose;
  89. expose();
  90. var __returned__ = {
  91. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  92. };
  93. Object.defineProperty(__returned__, '__isScriptSetup', {
  94. enumerable: false,
  95. value: true
  96. });
  97. return __returned__;
  98. }
  99. });
  100. /***/ }),
  101. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  102. /*!***************************************************************************************************************************************************************************************************************!*\
  103. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  104. \***************************************************************************************************************************************************************************************************************/
  105. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  106. "use strict";
  107. __webpack_require__.r(__webpack_exports__);
  108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  110. /* harmony export */ });
  111. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  112. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  113. __name: 'AppSidebar',
  114. props: {
  115. menu: Array
  116. },
  117. setup: function setup(__props, _ref) {
  118. var expose = _ref.expose;
  119. expose();
  120. var __returned__ = {
  121. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  122. };
  123. Object.defineProperty(__returned__, '__isScriptSetup', {
  124. enumerable: false,
  125. value: true
  126. });
  127. return __returned__;
  128. }
  129. });
  130. /***/ }),
  131. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  132. /*!******************************************************************************************************************************************************************************************************************!*\
  133. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  134. \******************************************************************************************************************************************************************************************************************/
  135. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  136. "use strict";
  137. __webpack_require__.r(__webpack_exports__);
  138. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  139. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  140. /* harmony export */ });
  141. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  142. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  143. __name: 'AppSubSidebar',
  144. props: {
  145. items: Array,
  146. root: {
  147. type: Boolean,
  148. "default": false
  149. }
  150. },
  151. setup: function setup(__props, _ref) {
  152. var expose = _ref.expose;
  153. expose();
  154. var __returned__ = {
  155. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  156. };
  157. Object.defineProperty(__returned__, '__isScriptSetup', {
  158. enumerable: false,
  159. value: true
  160. });
  161. return __returned__;
  162. }
  163. });
  164. /***/ }),
  165. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  166. /*!**************************************************************************************************************************************************************************************************************!*\
  167. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  168. \**************************************************************************************************************************************************************************************************************/
  169. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  170. "use strict";
  171. __webpack_require__.r(__webpack_exports__);
  172. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  173. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  174. /* harmony export */ });
  175. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  177. __name: 'AppTopBar',
  178. emits: ['menu-toggle'],
  179. setup: function setup(__props, _ref) {
  180. var expose = _ref.expose;
  181. expose();
  182. var __returned__ = {
  183. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  184. };
  185. Object.defineProperty(__returned__, '__isScriptSetup', {
  186. enumerable: false,
  187. value: true
  188. });
  189. return __returned__;
  190. }
  191. });
  192. /***/ }),
  193. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  194. /*!*****************************************************************************************************************************************************************************************************************!*\
  195. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  196. \*****************************************************************************************************************************************************************************************************************/
  197. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  198. "use strict";
  199. __webpack_require__.r(__webpack_exports__);
  200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  202. /* harmony export */ });
  203. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  204. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  205. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  206. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  207. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  208. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  209. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  210. __name: 'DashboardLayout',
  211. setup: function setup(__props, _ref) {
  212. var expose = _ref.expose;
  213. expose();
  214. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  215. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var isDesktop = function isDesktop() {
  218. return window.innerWidth >= 992;
  219. };
  220. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  221. return ['layout-wrapper', {
  222. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  223. 'layout-mobile-sidebar-active': mobileMenuActive.value
  224. }];
  225. });
  226. var onWrapperClick = function onWrapperClick() {
  227. if (!menuClick.value) {
  228. mobileMenuActive.value = false;
  229. }
  230. menuClick.value = false;
  231. };
  232. var onMenuToggle = function onMenuToggle(event) {
  233. menuClick.value = true;
  234. if (isDesktop()) {
  235. staticMenuInactive.value = !staticMenuInactive.value;
  236. } else {
  237. mobileMenuActive.value = !mobileMenuActive.value;
  238. }
  239. event.preventDefault();
  240. };
  241. var __returned__ = {
  242. mobileMenuActive: mobileMenuActive,
  243. staticMenuInactive: staticMenuInactive,
  244. menuClick: menuClick,
  245. isDesktop: isDesktop,
  246. containerClass: containerClass,
  247. onWrapperClick: onWrapperClick,
  248. onMenuToggle: onMenuToggle,
  249. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  250. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  251. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  252. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  253. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/User/Index.vue?vue&type=script&setup=true&lang=js":
  266. /*!**********************************************************************************************************************************************************************************************************!*\
  267. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/User/Index.vue?vue&type=script&setup=true&lang=js ***!
  268. \**********************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/User/tableHeader.js");
  281. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  282. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  283. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  284. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  286. __name: 'Index',
  287. props: {
  288. users: Object,
  289. initialSearch: String
  290. },
  291. setup: function setup(__props, _ref) {
  292. var expose = _ref.expose;
  293. expose();
  294. var props = __props;
  295. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  296. search = _useSearchText.search;
  297. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  298. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var __returned__ = {
  305. props: props,
  306. search: search,
  307. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  310. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  311. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  312. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  313. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  314. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  316. };
  317. Object.defineProperty(__returned__, '__isScriptSetup', {
  318. enumerable: false,
  319. value: true
  320. });
  321. return __returned__;
  322. }
  323. });
  324. /***/ }),
  325. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  326. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  327. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  328. \***********************************************************************************************************************************************************************************************************************************************************************************/
  329. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  330. "use strict";
  331. __webpack_require__.r(__webpack_exports__);
  332. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  333. /* harmony export */ "render": () => (/* binding */ render)
  334. /* harmony export */ });
  335. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  336. var _hoisted_1 = {
  337. key: 1,
  338. "class": "p-button-label"
  339. };
  340. var _hoisted_2 = {
  341. key: 1,
  342. "class": "p-button-label"
  343. };
  344. function render(_ctx, _cache, $props, $setup, $data, $options) {
  345. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  346. key: 0,
  347. "class": "p-button p-component",
  348. as: "button",
  349. type: "button"
  350. }, {
  351. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  352. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  353. key: 0,
  354. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  355. }, null, 2
  356. /* CLASS */
  357. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  358. /* TEXT */
  359. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  360. }),
  361. _: 1
  362. /* STABLE */
  363. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  364. key: 1,
  365. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  366. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  367. key: 0,
  368. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  369. }, null, 2
  370. /* CLASS */
  371. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  372. /* TEXT */
  373. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  374. /* CLASS */
  375. ));
  376. }
  377. /***/ }),
  378. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  379. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  380. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  381. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  382. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  383. "use strict";
  384. __webpack_require__.r(__webpack_exports__);
  385. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  386. /* harmony export */ "render": () => (/* binding */ render)
  387. /* harmony export */ });
  388. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  389. var _withScopeId = function _withScopeId(n) {
  390. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  391. };
  392. var _hoisted_1 = {
  393. "class": "layout-footer"
  394. };
  395. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  396. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  397. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  398. href: "https://dijitalcode.com",
  399. target: "_blank",
  400. "class": "font-medium ml-2"
  401. }, "DijitalCODE", -1
  402. /* HOISTED */
  403. );
  404. });
  405. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  406. function render(_ctx, _cache) {
  407. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  408. }
  409. /***/ }),
  410. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  411. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  412. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  413. \********************************************************************************************************************************************************************************************************************************************************************************/
  414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  415. "use strict";
  416. __webpack_require__.r(__webpack_exports__);
  417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  418. /* harmony export */ "render": () => (/* binding */ render)
  419. /* harmony export */ });
  420. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  421. var _hoisted_1 = {
  422. key: 0
  423. };
  424. var _hoisted_2 = {
  425. key: 1
  426. };
  427. function render(_ctx, _cache, $props, $setup, $data, $options) {
  428. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  429. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  430. key: 0,
  431. severity: "success",
  432. onClose: $setup.onClose
  433. }, {
  434. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  435. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  436. /* TEXT */
  437. )];
  438. }),
  439. _: 1
  440. /* STABLE */
  441. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  442. key: 1,
  443. severity: "error",
  444. onClose: $setup.onClose
  445. }, {
  446. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  447. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  448. /* TEXT */
  449. )];
  450. }),
  451. _: 1
  452. /* STABLE */
  453. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  454. key: 2,
  455. severity: "error",
  456. onClose: $setup.onClose
  457. }, {
  458. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  459. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  460. /* TEXT */
  461. ))];
  462. }),
  463. _: 1
  464. /* STABLE */
  465. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  466. /* STABLE_FRAGMENT */
  467. );
  468. }
  469. /***/ }),
  470. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  471. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  472. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  473. \***********************************************************************************************************************************************************************************************************************************************************************************/
  474. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  475. "use strict";
  476. __webpack_require__.r(__webpack_exports__);
  477. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  478. /* harmony export */ "render": () => (/* binding */ render)
  479. /* harmony export */ });
  480. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  481. var _hoisted_1 = {
  482. key: 0,
  483. "class": "p-paginator p-component flex justify-content-start"
  484. };
  485. var _hoisted_2 = {
  486. "class": "p-paginator-pages"
  487. };
  488. var _hoisted_3 = ["innerHTML"];
  489. function render(_ctx, _cache, $props, $setup, $data, $options) {
  490. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  491. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  492. key: "link-".concat(key),
  493. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  494. 'p-disabled': link
  495. }]),
  496. innerHTML: link.label
  497. }, null, 10
  498. /* CLASS, PROPS */
  499. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  500. key: "link-".concat(key),
  501. href: link.url,
  502. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  503. 'p-highlight': link.active
  504. }, "p-paginator-page p-paginator-element p-link"]),
  505. innerHTML: link.label
  506. }, null, 8
  507. /* PROPS */
  508. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  509. /* STABLE_FRAGMENT */
  510. );
  511. }), 256
  512. /* UNKEYED_FRAGMENT */
  513. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  514. }
  515. /***/ }),
  516. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  517. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  518. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  519. \********************************************************************************************************************************************************************************************************************************************************************************************/
  520. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  521. "use strict";
  522. __webpack_require__.r(__webpack_exports__);
  523. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  524. /* harmony export */ "render": () => (/* binding */ render)
  525. /* harmony export */ });
  526. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  527. function render(_ctx, _cache, $props, $setup, $data, $options) {
  528. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  529. "class": "layout-menu",
  530. items: $props.menu,
  531. root: true
  532. }, null, 8
  533. /* PROPS */
  534. , ["items"])]);
  535. }
  536. /***/ }),
  537. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  538. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  539. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  540. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  542. "use strict";
  543. __webpack_require__.r(__webpack_exports__);
  544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  545. /* harmony export */ "render": () => (/* binding */ render)
  546. /* harmony export */ });
  547. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  548. var _withScopeId = function _withScopeId(n) {
  549. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  550. };
  551. var _hoisted_1 = {
  552. key: 0
  553. };
  554. var _hoisted_2 = ["aria-label"];
  555. var _hoisted_3 = ["aria-label"];
  556. function render(_ctx, _cache, $props, $setup, $data, $options) {
  557. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  558. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  559. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  560. key: i,
  561. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  562. 'layout-menuitem-category': $props.root
  563. }]),
  564. role: "none"
  565. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  566. key: 0
  567. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  568. "class": "layout-menuitem-root-text",
  569. "aria-label": item.label
  570. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  571. /* TEXT, PROPS */
  572. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  573. items: item.items
  574. }, null, 8
  575. /* PROPS */
  576. , ["items"])], 64
  577. /* STABLE_FRAGMENT */
  578. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  579. key: 1
  580. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  581. key: 0,
  582. role: "menuitem",
  583. href: item.to,
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  585. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  586. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  587. }]),
  588. "aria-label": item.label
  589. }, {
  590. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  591. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  593. }, null, 2
  594. /* CLASS */
  595. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  596. /* TEXT */
  597. )];
  598. }),
  599. _: 2
  600. /* DYNAMIC */
  601. }, 1032
  602. /* PROPS, DYNAMIC_SLOTS */
  603. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  604. key: 1,
  605. href: "#",
  606. role: "menuitem",
  607. "aria-label": item.label
  608. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  609. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  610. }, null, 2
  611. /* CLASS */
  612. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  613. /* TEXT */
  614. )], 8
  615. /* PROPS */
  616. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  617. items: item.items
  618. }, null, 8
  619. /* PROPS */
  620. , ["items"])], 64
  621. /* STABLE_FRAGMENT */
  622. ))], 2
  623. /* CLASS */
  624. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  625. /* STABLE_FRAGMENT */
  626. );
  627. }), 256
  628. /* UNKEYED_FRAGMENT */
  629. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  630. }
  631. /***/ }),
  632. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  633. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  634. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  635. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  637. "use strict";
  638. __webpack_require__.r(__webpack_exports__);
  639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  640. /* harmony export */ "render": () => (/* binding */ render)
  641. /* harmony export */ });
  642. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  643. var _withScopeId = function _withScopeId(n) {
  644. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  645. };
  646. var _hoisted_1 = {
  647. "class": "layout-topbar"
  648. };
  649. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  650. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  651. alt: "Logo",
  652. src: "/images/logo.svg",
  653. "class": "md:mr-3"
  654. }, null, -1
  655. /* HOISTED */
  656. );
  657. });
  658. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  659. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  660. /* HOISTED */
  661. );
  662. });
  663. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  664. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  665. "class": "pi pi-bars"
  666. }, null, -1
  667. /* HOISTED */
  668. );
  669. });
  670. var _hoisted_5 = [_hoisted_4];
  671. var _hoisted_6 = {
  672. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  673. };
  674. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  675. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  676. "class": "pi pi-ellipsis-v"
  677. }, null, -1
  678. /* HOISTED */
  679. );
  680. });
  681. var _hoisted_8 = [_hoisted_7];
  682. var _hoisted_9 = {
  683. "class": "layout-topbar-menu hidden lg:flex origin-top"
  684. };
  685. var _hoisted_10 = {
  686. "class": "align-self-center"
  687. };
  688. var _hoisted_11 = {
  689. "class": "hidden lg:inline"
  690. };
  691. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  692. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  693. "class": "pi pi-user"
  694. }, null, -1
  695. /* HOISTED */
  696. );
  697. });
  698. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  699. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  700. /* HOISTED */
  701. );
  702. });
  703. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  704. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  705. "class": "pi pi-sign-out"
  706. }, null, -1
  707. /* HOISTED */
  708. );
  709. });
  710. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  711. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  712. /* HOISTED */
  713. );
  714. });
  715. function render(_ctx, _cache, $props, $setup, $data, $options) {
  716. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  717. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  718. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  719. href: "/",
  720. "class": "layout-topbar-logo"
  721. }, {
  722. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  723. return [_hoisted_2, _hoisted_3];
  724. }),
  725. _: 1
  726. /* STABLE */
  727. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  728. "class": "p-link layout-menu-button layout-topbar-button",
  729. onClick: _cache[0] || (_cache[0] = function ($event) {
  730. return _ctx.$emit('menu-toggle', $event);
  731. })
  732. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  733. selector: '@next',
  734. enterClass: 'hidden',
  735. enterActiveClass: 'scalein',
  736. leaveToClass: 'hidden',
  737. leaveActiveClass: 'fadeout',
  738. hideOnOutsideClick: true
  739. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  740. /* TEXT */
  741. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  742. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  743. "class": "p-link layout-topbar-button"
  744. }, {
  745. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  746. return [_hoisted_12, _hoisted_13];
  747. }),
  748. _: 1
  749. /* STABLE */
  750. }, 8
  751. /* PROPS */
  752. , ["href"])), [[_directive_tooltip, {
  753. value: 'Ubah Profil',
  754. "class": 'layout-topbar-menu-tooltip'
  755. }, void 0, {
  756. bottom: true
  757. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  758. href: _ctx.route('logout'),
  759. as: "button",
  760. method: "post",
  761. "class": "p-link layout-topbar-button"
  762. }, {
  763. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  764. return [_hoisted_14, _hoisted_15];
  765. }),
  766. _: 1
  767. /* STABLE */
  768. }, 8
  769. /* PROPS */
  770. , ["href"])), [[_directive_tooltip, {
  771. value: 'Keluar',
  772. "class": 'layout-topbar-menu-tooltip'
  773. }, void 0, {
  774. bottom: true
  775. }]])])])]);
  776. }
  777. /***/ }),
  778. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  779. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  780. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  781. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  783. "use strict";
  784. __webpack_require__.r(__webpack_exports__);
  785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  786. /* harmony export */ "render": () => (/* binding */ render)
  787. /* harmony export */ });
  788. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  789. var _withScopeId = function _withScopeId(n) {
  790. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  791. };
  792. var _hoisted_1 = {
  793. "class": "layout-sidebar"
  794. };
  795. var _hoisted_2 = {
  796. "class": "layout-main-container"
  797. };
  798. var _hoisted_3 = {
  799. "class": "layout-main"
  800. };
  801. var _hoisted_4 = {
  802. key: 0,
  803. "class": "layout-mask p-component-overlay"
  804. };
  805. function render(_ctx, _cache, $props, $setup, $data, $options) {
  806. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  807. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  808. onClick: $setup.onWrapperClick
  809. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  810. onMenuToggle: $setup.onMenuToggle
  811. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  812. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  813. }, null, 8
  814. /* PROPS */
  815. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  816. name: "layout-mask"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. })], 2
  824. /* CLASS */
  825. );
  826. }
  827. /***/ }),
  828. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/User/Index.vue?vue&type=template&id=01ddde92":
  829. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  830. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/User/Index.vue?vue&type=template&id=01ddde92 ***!
  831. \***************************************************************************************************************************************************************************************************************************************************************************/
  832. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  833. "use strict";
  834. __webpack_require__.r(__webpack_exports__);
  835. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  836. /* harmony export */ "render": () => (/* binding */ render)
  837. /* harmony export */ });
  838. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  839. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  840. /* HOISTED */
  841. );
  842. var _hoisted_2 = {
  843. "class": "grid"
  844. };
  845. var _hoisted_3 = {
  846. "class": "col-12 md:col-8"
  847. };
  848. var _hoisted_4 = {
  849. "class": "flex align-items-center"
  850. };
  851. var _hoisted_5 = {
  852. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  853. };
  854. function render(_ctx, _cache, $props, $setup, $data, $options) {
  855. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  856. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  857. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  858. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  859. title: "Daftar User"
  860. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  861. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  862. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  863. responsiveLayout: "scroll",
  864. columnResizeMode: "expand",
  865. value: $props.users.data,
  866. rowHover: true,
  867. stripedRows: true
  868. }, {
  869. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  871. "class": "w-full md:w-27rem",
  872. placeholder: "cari, contoh: tina, tina@xx.com",
  873. modelValue: $setup.search,
  874. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  875. return $setup.search = $event;
  876. })
  877. }, null, 8
  878. /* PROPS */
  879. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  880. label: "Tambah User",
  881. icon: "pi pi-pencil",
  882. "class": "p-button-outlined",
  883. href: _ctx.route('users.create')
  884. }, null, 8
  885. /* PROPS */
  886. , ["href"])])])];
  887. }),
  888. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  889. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  890. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  891. field: value.field,
  892. header: value.header,
  893. key: value.field
  894. }, null, 8
  895. /* PROPS */
  896. , ["field", "header"]);
  897. }), 128
  898. /* KEYED_FRAGMENT */
  899. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  900. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  901. var data = _ref.data;
  902. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  903. icon: "pi pi-pencil",
  904. "class": "p-button-icon-only p-button-rounded p-button-text",
  905. href: _ctx.route('users.edit', data.id)
  906. }, null, 8
  907. /* PROPS */
  908. , ["href"])];
  909. }),
  910. _: 1
  911. /* STABLE */
  912. })];
  913. }),
  914. _: 1
  915. /* STABLE */
  916. }, 8
  917. /* PROPS */
  918. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  919. links: $props.users.links
  920. }, null, 8
  921. /* PROPS */
  922. , ["links"])];
  923. }),
  924. _: 1
  925. /* STABLE */
  926. })], 64
  927. /* STABLE_FRAGMENT */
  928. );
  929. }
  930. /***/ }),
  931. /***/ "./resources/js/components/useSearchText.js":
  932. /*!**************************************************!*\
  933. !*** ./resources/js/components/useSearchText.js ***!
  934. \**************************************************/
  935. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  936. "use strict";
  937. __webpack_require__.r(__webpack_exports__);
  938. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  939. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  940. /* harmony export */ });
  941. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  942. function useSearchText(props) {
  943. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  944. return {
  945. search: search
  946. };
  947. }
  948. /***/ }),
  949. /***/ "./resources/js/pages/User/tableHeader.js":
  950. /*!************************************************!*\
  951. !*** ./resources/js/pages/User/tableHeader.js ***!
  952. \************************************************/
  953. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  954. "use strict";
  955. __webpack_require__.r(__webpack_exports__);
  956. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  957. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  958. /* harmony export */ });
  959. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  960. field: 'name',
  961. header: 'Nama'
  962. }, {
  963. field: 'username',
  964. header: 'Nama Pengguna'
  965. }, {
  966. field: 'role',
  967. header: 'Hak Akses'
  968. }, {
  969. field: 'status',
  970. header: 'Status'
  971. }]);
  972. /***/ }),
  973. /***/ "./resources/js/utils/menu.js":
  974. /*!************************************!*\
  975. !*** ./resources/js/utils/menu.js ***!
  976. \************************************/
  977. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  978. "use strict";
  979. __webpack_require__.r(__webpack_exports__);
  980. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  981. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  982. /* harmony export */ });
  983. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  984. // Admin
  985. 1: [{
  986. label: 'Home',
  987. items: [{
  988. label: 'Dashboard',
  989. icon: 'pi pi-chart-bar',
  990. to: '/dashboards',
  991. component: 'Home/Index'
  992. }]
  993. }, {
  994. label: 'Laporan',
  995. items: []
  996. }, {
  997. label: 'Master',
  998. items: [{
  999. label: 'User',
  1000. icon: 'pi pi-user',
  1001. to: '/users',
  1002. component: 'User/Index'
  1003. }]
  1004. }],
  1005. // Supervisor
  1006. 2: [{
  1007. label: 'Master',
  1008. items: [{
  1009. label: 'Pelanggan',
  1010. icon: 'pi pi-home',
  1011. to: '/customers',
  1012. component: 'Customers/Index'
  1013. }, {
  1014. label: 'Pembelian',
  1015. icon: 'pi pi-home',
  1016. to: '/purchases',
  1017. component: 'Purchases/Index'
  1018. }, {
  1019. label: 'Penjualan',
  1020. icon: 'pi pi-home',
  1021. to: '/sales',
  1022. component: 'Sales/Index'
  1023. }]
  1024. }],
  1025. // Operator
  1026. 3: [{
  1027. label: 'Master',
  1028. items: [{
  1029. label: 'Supplier',
  1030. icon: 'pi pi-home',
  1031. to: '/suppliers',
  1032. component: 'Suppliers/Index'
  1033. }, {
  1034. label: 'Stok Barang',
  1035. icon: 'pi pi-home',
  1036. to: '/stocks',
  1037. component: 'Stocks/Index'
  1038. }]
  1039. }]
  1040. });
  1041. /***/ }),
  1042. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1043. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1044. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1045. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1046. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1047. "use strict";
  1048. __webpack_require__.r(__webpack_exports__);
  1049. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1050. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1051. /* harmony export */ });
  1052. /* 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");
  1053. /* 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__);
  1054. // Imports
  1055. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1056. // Module
  1057. ___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}", ""]);
  1058. // Exports
  1059. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1060. /***/ }),
  1061. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1062. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1063. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1064. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1065. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1066. "use strict";
  1067. __webpack_require__.r(__webpack_exports__);
  1068. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1069. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1070. /* harmony export */ });
  1071. /* 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");
  1072. /* 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__);
  1073. // Imports
  1074. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1075. // Module
  1076. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1077. // Exports
  1078. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1079. /***/ }),
  1080. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1081. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1082. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1083. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1084. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1085. "use strict";
  1086. __webpack_require__.r(__webpack_exports__);
  1087. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1088. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1089. /* harmony export */ });
  1090. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1091. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1092. // Imports
  1093. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1094. // Module
  1095. ___CSS_LOADER_EXPORT___.push([module.id, "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}", ""]);
  1096. // Exports
  1097. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1098. /***/ }),
  1099. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1100. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1101. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1102. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1103. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1104. "use strict";
  1105. __webpack_require__.r(__webpack_exports__);
  1106. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1107. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1108. /* harmony export */ });
  1109. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1110. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1111. // Imports
  1112. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1113. // Module
  1114. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1115. // Exports
  1116. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1117. /***/ }),
  1118. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1119. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1120. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1121. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1122. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1123. "use strict";
  1124. __webpack_require__.r(__webpack_exports__);
  1125. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1126. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1127. /* harmony export */ });
  1128. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1129. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1130. // Imports
  1131. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1132. // Module
  1133. ___CSS_LOADER_EXPORT___.push([module.id, ".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}", ""]);
  1134. // Exports
  1135. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1136. /***/ }),
  1137. /***/ "./node_modules/lodash/lodash.js":
  1138. /*!***************************************!*\
  1139. !*** ./node_modules/lodash/lodash.js ***!
  1140. \***************************************/
  1141. /***/ (function(module, exports, __webpack_require__) {
  1142. /* module decorator */ module = __webpack_require__.nmd(module);
  1143. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1144. * @license
  1145. * Lodash <https://lodash.com/>
  1146. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1147. * Released under MIT license <https://lodash.com/license>
  1148. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1149. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1150. */
  1151. ;(function() {
  1152. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1153. var undefined;
  1154. /** Used as the semantic version number. */
  1155. var VERSION = '4.17.21';
  1156. /** Used as the size to enable large array optimizations. */
  1157. var LARGE_ARRAY_SIZE = 200;
  1158. /** Error message constants. */
  1159. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1160. FUNC_ERROR_TEXT = 'Expected a function',
  1161. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1162. /** Used to stand-in for `undefined` hash values. */
  1163. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1164. /** Used as the maximum memoize cache size. */
  1165. var MAX_MEMOIZE_SIZE = 500;
  1166. /** Used as the internal argument placeholder. */
  1167. var PLACEHOLDER = '__lodash_placeholder__';
  1168. /** Used to compose bitmasks for cloning. */
  1169. var CLONE_DEEP_FLAG = 1,
  1170. CLONE_FLAT_FLAG = 2,
  1171. CLONE_SYMBOLS_FLAG = 4;
  1172. /** Used to compose bitmasks for value comparisons. */
  1173. var COMPARE_PARTIAL_FLAG = 1,
  1174. COMPARE_UNORDERED_FLAG = 2;
  1175. /** Used to compose bitmasks for function metadata. */
  1176. var WRAP_BIND_FLAG = 1,
  1177. WRAP_BIND_KEY_FLAG = 2,
  1178. WRAP_CURRY_BOUND_FLAG = 4,
  1179. WRAP_CURRY_FLAG = 8,
  1180. WRAP_CURRY_RIGHT_FLAG = 16,
  1181. WRAP_PARTIAL_FLAG = 32,
  1182. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1183. WRAP_ARY_FLAG = 128,
  1184. WRAP_REARG_FLAG = 256,
  1185. WRAP_FLIP_FLAG = 512;
  1186. /** Used as default options for `_.truncate`. */
  1187. var DEFAULT_TRUNC_LENGTH = 30,
  1188. DEFAULT_TRUNC_OMISSION = '...';
  1189. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1190. var HOT_COUNT = 800,
  1191. HOT_SPAN = 16;
  1192. /** Used to indicate the type of lazy iteratees. */
  1193. var LAZY_FILTER_FLAG = 1,
  1194. LAZY_MAP_FLAG = 2,
  1195. LAZY_WHILE_FLAG = 3;
  1196. /** Used as references for various `Number` constants. */
  1197. var INFINITY = 1 / 0,
  1198. MAX_SAFE_INTEGER = 9007199254740991,
  1199. MAX_INTEGER = 1.7976931348623157e+308,
  1200. NAN = 0 / 0;
  1201. /** Used as references for the maximum length and index of an array. */
  1202. var MAX_ARRAY_LENGTH = 4294967295,
  1203. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1204. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1205. /** Used to associate wrap methods with their bit flags. */
  1206. var wrapFlags = [
  1207. ['ary', WRAP_ARY_FLAG],
  1208. ['bind', WRAP_BIND_FLAG],
  1209. ['bindKey', WRAP_BIND_KEY_FLAG],
  1210. ['curry', WRAP_CURRY_FLAG],
  1211. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1212. ['flip', WRAP_FLIP_FLAG],
  1213. ['partial', WRAP_PARTIAL_FLAG],
  1214. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1215. ['rearg', WRAP_REARG_FLAG]
  1216. ];
  1217. /** `Object#toString` result references. */
  1218. var argsTag = '[object Arguments]',
  1219. arrayTag = '[object Array]',
  1220. asyncTag = '[object AsyncFunction]',
  1221. boolTag = '[object Boolean]',
  1222. dateTag = '[object Date]',
  1223. domExcTag = '[object DOMException]',
  1224. errorTag = '[object Error]',
  1225. funcTag = '[object Function]',
  1226. genTag = '[object GeneratorFunction]',
  1227. mapTag = '[object Map]',
  1228. numberTag = '[object Number]',
  1229. nullTag = '[object Null]',
  1230. objectTag = '[object Object]',
  1231. promiseTag = '[object Promise]',
  1232. proxyTag = '[object Proxy]',
  1233. regexpTag = '[object RegExp]',
  1234. setTag = '[object Set]',
  1235. stringTag = '[object String]',
  1236. symbolTag = '[object Symbol]',
  1237. undefinedTag = '[object Undefined]',
  1238. weakMapTag = '[object WeakMap]',
  1239. weakSetTag = '[object WeakSet]';
  1240. var arrayBufferTag = '[object ArrayBuffer]',
  1241. dataViewTag = '[object DataView]',
  1242. float32Tag = '[object Float32Array]',
  1243. float64Tag = '[object Float64Array]',
  1244. int8Tag = '[object Int8Array]',
  1245. int16Tag = '[object Int16Array]',
  1246. int32Tag = '[object Int32Array]',
  1247. uint8Tag = '[object Uint8Array]',
  1248. uint8ClampedTag = '[object Uint8ClampedArray]',
  1249. uint16Tag = '[object Uint16Array]',
  1250. uint32Tag = '[object Uint32Array]';
  1251. /** Used to match empty string literals in compiled template source. */
  1252. var reEmptyStringLeading = /\b__p \+= '';/g,
  1253. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1254. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1255. /** Used to match HTML entities and HTML characters. */
  1256. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1257. reUnescapedHtml = /[&<>"']/g,
  1258. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1259. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1260. /** Used to match template delimiters. */
  1261. var reEscape = /<%-([\s\S]+?)%>/g,
  1262. reEvaluate = /<%([\s\S]+?)%>/g,
  1263. reInterpolate = /<%=([\s\S]+?)%>/g;
  1264. /** Used to match property names within property paths. */
  1265. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1266. reIsPlainProp = /^\w*$/,
  1267. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1268. /**
  1269. * Used to match `RegExp`
  1270. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1271. */
  1272. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1273. reHasRegExpChar = RegExp(reRegExpChar.source);
  1274. /** Used to match leading whitespace. */
  1275. var reTrimStart = /^\s+/;
  1276. /** Used to match a single whitespace character. */
  1277. var reWhitespace = /\s/;
  1278. /** Used to match wrap detail comments. */
  1279. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1280. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1281. reSplitDetails = /,? & /;
  1282. /** Used to match words composed of alphanumeric characters. */
  1283. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1284. /**
  1285. * Used to validate the `validate` option in `_.template` variable.
  1286. *
  1287. * Forbids characters which could potentially change the meaning of the function argument definition:
  1288. * - "()," (modification of function parameters)
  1289. * - "=" (default value)
  1290. * - "[]{}" (destructuring of function parameters)
  1291. * - "/" (beginning of a comment)
  1292. * - whitespace
  1293. */
  1294. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1295. /** Used to match backslashes in property paths. */
  1296. var reEscapeChar = /\\(\\)?/g;
  1297. /**
  1298. * Used to match
  1299. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1300. */
  1301. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1302. /** Used to match `RegExp` flags from their coerced string values. */
  1303. var reFlags = /\w*$/;
  1304. /** Used to detect bad signed hexadecimal string values. */
  1305. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1306. /** Used to detect binary string values. */
  1307. var reIsBinary = /^0b[01]+$/i;
  1308. /** Used to detect host constructors (Safari). */
  1309. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1310. /** Used to detect octal string values. */
  1311. var reIsOctal = /^0o[0-7]+$/i;
  1312. /** Used to detect unsigned integer values. */
  1313. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1314. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1315. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1316. /** Used to ensure capturing order of template delimiters. */
  1317. var reNoMatch = /($^)/;
  1318. /** Used to match unescaped characters in compiled string literals. */
  1319. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1320. /** Used to compose unicode character classes. */
  1321. var rsAstralRange = '\\ud800-\\udfff',
  1322. rsComboMarksRange = '\\u0300-\\u036f',
  1323. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1324. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1325. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1326. rsDingbatRange = '\\u2700-\\u27bf',
  1327. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1328. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1329. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1330. rsPunctuationRange = '\\u2000-\\u206f',
  1331. 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',
  1332. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1333. rsVarRange = '\\ufe0e\\ufe0f',
  1334. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1335. /** Used to compose unicode capture groups. */
  1336. var rsApos = "['\u2019]",
  1337. rsAstral = '[' + rsAstralRange + ']',
  1338. rsBreak = '[' + rsBreakRange + ']',
  1339. rsCombo = '[' + rsComboRange + ']',
  1340. rsDigits = '\\d+',
  1341. rsDingbat = '[' + rsDingbatRange + ']',
  1342. rsLower = '[' + rsLowerRange + ']',
  1343. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1344. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1345. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1346. rsNonAstral = '[^' + rsAstralRange + ']',
  1347. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1348. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1349. rsUpper = '[' + rsUpperRange + ']',
  1350. rsZWJ = '\\u200d';
  1351. /** Used to compose unicode regexes. */
  1352. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1353. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1354. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1355. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1356. reOptMod = rsModifier + '?',
  1357. rsOptVar = '[' + rsVarRange + ']?',
  1358. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1359. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1360. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1361. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1362. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1363. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1364. /** Used to match apostrophes. */
  1365. var reApos = RegExp(rsApos, 'g');
  1366. /**
  1367. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1368. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1369. */
  1370. var reComboMark = RegExp(rsCombo, 'g');
  1371. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1372. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1373. /** Used to match complex or compound words. */
  1374. var reUnicodeWord = RegExp([
  1375. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1376. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1377. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1378. rsUpper + '+' + rsOptContrUpper,
  1379. rsOrdUpper,
  1380. rsOrdLower,
  1381. rsDigits,
  1382. rsEmoji
  1383. ].join('|'), 'g');
  1384. /** 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/). */
  1385. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1386. /** Used to detect strings that need a more robust regexp to match words. */
  1387. 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 ]/;
  1388. /** Used to assign default `context` object properties. */
  1389. var contextProps = [
  1390. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1391. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1392. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1393. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1394. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1395. ];
  1396. /** Used to make template sourceURLs easier to identify. */
  1397. var templateCounter = -1;
  1398. /** Used to identify `toStringTag` values of typed arrays. */
  1399. var typedArrayTags = {};
  1400. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1401. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1402. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1403. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1404. typedArrayTags[uint32Tag] = true;
  1405. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1406. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1407. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1408. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1409. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1410. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1411. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1412. typedArrayTags[weakMapTag] = false;
  1413. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1414. var cloneableTags = {};
  1415. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1416. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1417. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1418. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1419. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1420. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1421. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1422. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1423. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1424. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1425. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1426. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1427. cloneableTags[weakMapTag] = false;
  1428. /** Used to map Latin Unicode letters to basic Latin letters. */
  1429. var deburredLetters = {
  1430. // Latin-1 Supplement block.
  1431. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1432. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1433. '\xc7': 'C', '\xe7': 'c',
  1434. '\xd0': 'D', '\xf0': 'd',
  1435. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1436. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1437. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1438. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1439. '\xd1': 'N', '\xf1': 'n',
  1440. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1441. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1442. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1443. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1444. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1445. '\xc6': 'Ae', '\xe6': 'ae',
  1446. '\xde': 'Th', '\xfe': 'th',
  1447. '\xdf': 'ss',
  1448. // Latin Extended-A block.
  1449. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1450. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1451. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1452. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1453. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1454. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1455. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1456. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1457. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1458. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1459. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1460. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1461. '\u0134': 'J', '\u0135': 'j',
  1462. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1463. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1464. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1465. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1466. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1467. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1468. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1469. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1470. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1471. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1472. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1473. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1474. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1475. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1476. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1477. '\u0174': 'W', '\u0175': 'w',
  1478. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1479. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1480. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1481. '\u0132': 'IJ', '\u0133': 'ij',
  1482. '\u0152': 'Oe', '\u0153': 'oe',
  1483. '\u0149': "'n", '\u017f': 's'
  1484. };
  1485. /** Used to map characters to HTML entities. */
  1486. var htmlEscapes = {
  1487. '&': '&amp;',
  1488. '<': '&lt;',
  1489. '>': '&gt;',
  1490. '"': '&quot;',
  1491. "'": '&#39;'
  1492. };
  1493. /** Used to map HTML entities to characters. */
  1494. var htmlUnescapes = {
  1495. '&amp;': '&',
  1496. '&lt;': '<',
  1497. '&gt;': '>',
  1498. '&quot;': '"',
  1499. '&#39;': "'"
  1500. };
  1501. /** Used to escape characters for inclusion in compiled string literals. */
  1502. var stringEscapes = {
  1503. '\\': '\\',
  1504. "'": "'",
  1505. '\n': 'n',
  1506. '\r': 'r',
  1507. '\u2028': 'u2028',
  1508. '\u2029': 'u2029'
  1509. };
  1510. /** Built-in method references without a dependency on `root`. */
  1511. var freeParseFloat = parseFloat,
  1512. freeParseInt = parseInt;
  1513. /** Detect free variable `global` from Node.js. */
  1514. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1515. /** Detect free variable `self`. */
  1516. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1517. /** Used as a reference to the global object. */
  1518. var root = freeGlobal || freeSelf || Function('return this')();
  1519. /** Detect free variable `exports`. */
  1520. var freeExports = true && exports && !exports.nodeType && exports;
  1521. /** Detect free variable `module`. */
  1522. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1523. /** Detect the popular CommonJS extension `module.exports`. */
  1524. var moduleExports = freeModule && freeModule.exports === freeExports;
  1525. /** Detect free variable `process` from Node.js. */
  1526. var freeProcess = moduleExports && freeGlobal.process;
  1527. /** Used to access faster Node.js helpers. */
  1528. var nodeUtil = (function() {
  1529. try {
  1530. // Use `util.types` for Node.js 10+.
  1531. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1532. if (types) {
  1533. return types;
  1534. }
  1535. // Legacy `process.binding('util')` for Node.js < 10.
  1536. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1537. } catch (e) {}
  1538. }());
  1539. /* Node.js helper references. */
  1540. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1541. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1542. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1543. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1544. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1545. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1546. /*--------------------------------------------------------------------------*/
  1547. /**
  1548. * A faster alternative to `Function#apply`, this function invokes `func`
  1549. * with the `this` binding of `thisArg` and the arguments of `args`.
  1550. *
  1551. * @private
  1552. * @param {Function} func The function to invoke.
  1553. * @param {*} thisArg The `this` binding of `func`.
  1554. * @param {Array} args The arguments to invoke `func` with.
  1555. * @returns {*} Returns the result of `func`.
  1556. */
  1557. function apply(func, thisArg, args) {
  1558. switch (args.length) {
  1559. case 0: return func.call(thisArg);
  1560. case 1: return func.call(thisArg, args[0]);
  1561. case 2: return func.call(thisArg, args[0], args[1]);
  1562. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1563. }
  1564. return func.apply(thisArg, args);
  1565. }
  1566. /**
  1567. * A specialized version of `baseAggregator` for arrays.
  1568. *
  1569. * @private
  1570. * @param {Array} [array] The array to iterate over.
  1571. * @param {Function} setter The function to set `accumulator` values.
  1572. * @param {Function} iteratee The iteratee to transform keys.
  1573. * @param {Object} accumulator The initial aggregated object.
  1574. * @returns {Function} Returns `accumulator`.
  1575. */
  1576. function arrayAggregator(array, setter, iteratee, accumulator) {
  1577. var index = -1,
  1578. length = array == null ? 0 : array.length;
  1579. while (++index < length) {
  1580. var value = array[index];
  1581. setter(accumulator, value, iteratee(value), array);
  1582. }
  1583. return accumulator;
  1584. }
  1585. /**
  1586. * A specialized version of `_.forEach` for arrays without support for
  1587. * iteratee shorthands.
  1588. *
  1589. * @private
  1590. * @param {Array} [array] The array to iterate over.
  1591. * @param {Function} iteratee The function invoked per iteration.
  1592. * @returns {Array} Returns `array`.
  1593. */
  1594. function arrayEach(array, iteratee) {
  1595. var index = -1,
  1596. length = array == null ? 0 : array.length;
  1597. while (++index < length) {
  1598. if (iteratee(array[index], index, array) === false) {
  1599. break;
  1600. }
  1601. }
  1602. return array;
  1603. }
  1604. /**
  1605. * A specialized version of `_.forEachRight` for arrays without support for
  1606. * iteratee shorthands.
  1607. *
  1608. * @private
  1609. * @param {Array} [array] The array to iterate over.
  1610. * @param {Function} iteratee The function invoked per iteration.
  1611. * @returns {Array} Returns `array`.
  1612. */
  1613. function arrayEachRight(array, iteratee) {
  1614. var length = array == null ? 0 : array.length;
  1615. while (length--) {
  1616. if (iteratee(array[length], length, array) === false) {
  1617. break;
  1618. }
  1619. }
  1620. return array;
  1621. }
  1622. /**
  1623. * A specialized version of `_.every` for arrays without support for
  1624. * iteratee shorthands.
  1625. *
  1626. * @private
  1627. * @param {Array} [array] The array to iterate over.
  1628. * @param {Function} predicate The function invoked per iteration.
  1629. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1630. * else `false`.
  1631. */
  1632. function arrayEvery(array, predicate) {
  1633. var index = -1,
  1634. length = array == null ? 0 : array.length;
  1635. while (++index < length) {
  1636. if (!predicate(array[index], index, array)) {
  1637. return false;
  1638. }
  1639. }
  1640. return true;
  1641. }
  1642. /**
  1643. * A specialized version of `_.filter` for arrays without support for
  1644. * iteratee shorthands.
  1645. *
  1646. * @private
  1647. * @param {Array} [array] The array to iterate over.
  1648. * @param {Function} predicate The function invoked per iteration.
  1649. * @returns {Array} Returns the new filtered array.
  1650. */
  1651. function arrayFilter(array, predicate) {
  1652. var index = -1,
  1653. length = array == null ? 0 : array.length,
  1654. resIndex = 0,
  1655. result = [];
  1656. while (++index < length) {
  1657. var value = array[index];
  1658. if (predicate(value, index, array)) {
  1659. result[resIndex++] = value;
  1660. }
  1661. }
  1662. return result;
  1663. }
  1664. /**
  1665. * A specialized version of `_.includes` for arrays without support for
  1666. * specifying an index to search from.
  1667. *
  1668. * @private
  1669. * @param {Array} [array] The array to inspect.
  1670. * @param {*} target The value to search for.
  1671. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1672. */
  1673. function arrayIncludes(array, value) {
  1674. var length = array == null ? 0 : array.length;
  1675. return !!length && baseIndexOf(array, value, 0) > -1;
  1676. }
  1677. /**
  1678. * This function is like `arrayIncludes` except that it accepts a comparator.
  1679. *
  1680. * @private
  1681. * @param {Array} [array] The array to inspect.
  1682. * @param {*} target The value to search for.
  1683. * @param {Function} comparator The comparator invoked per element.
  1684. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1685. */
  1686. function arrayIncludesWith(array, value, comparator) {
  1687. var index = -1,
  1688. length = array == null ? 0 : array.length;
  1689. while (++index < length) {
  1690. if (comparator(value, array[index])) {
  1691. return true;
  1692. }
  1693. }
  1694. return false;
  1695. }
  1696. /**
  1697. * A specialized version of `_.map` for arrays without support for iteratee
  1698. * shorthands.
  1699. *
  1700. * @private
  1701. * @param {Array} [array] The array to iterate over.
  1702. * @param {Function} iteratee The function invoked per iteration.
  1703. * @returns {Array} Returns the new mapped array.
  1704. */
  1705. function arrayMap(array, iteratee) {
  1706. var index = -1,
  1707. length = array == null ? 0 : array.length,
  1708. result = Array(length);
  1709. while (++index < length) {
  1710. result[index] = iteratee(array[index], index, array);
  1711. }
  1712. return result;
  1713. }
  1714. /**
  1715. * Appends the elements of `values` to `array`.
  1716. *
  1717. * @private
  1718. * @param {Array} array The array to modify.
  1719. * @param {Array} values The values to append.
  1720. * @returns {Array} Returns `array`.
  1721. */
  1722. function arrayPush(array, values) {
  1723. var index = -1,
  1724. length = values.length,
  1725. offset = array.length;
  1726. while (++index < length) {
  1727. array[offset + index] = values[index];
  1728. }
  1729. return array;
  1730. }
  1731. /**
  1732. * A specialized version of `_.reduce` for arrays without support for
  1733. * iteratee shorthands.
  1734. *
  1735. * @private
  1736. * @param {Array} [array] The array to iterate over.
  1737. * @param {Function} iteratee The function invoked per iteration.
  1738. * @param {*} [accumulator] The initial value.
  1739. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1740. * the initial value.
  1741. * @returns {*} Returns the accumulated value.
  1742. */
  1743. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1744. var index = -1,
  1745. length = array == null ? 0 : array.length;
  1746. if (initAccum && length) {
  1747. accumulator = array[++index];
  1748. }
  1749. while (++index < length) {
  1750. accumulator = iteratee(accumulator, array[index], index, array);
  1751. }
  1752. return accumulator;
  1753. }
  1754. /**
  1755. * A specialized version of `_.reduceRight` for arrays without support for
  1756. * iteratee shorthands.
  1757. *
  1758. * @private
  1759. * @param {Array} [array] The array to iterate over.
  1760. * @param {Function} iteratee The function invoked per iteration.
  1761. * @param {*} [accumulator] The initial value.
  1762. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1763. * the initial value.
  1764. * @returns {*} Returns the accumulated value.
  1765. */
  1766. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1767. var length = array == null ? 0 : array.length;
  1768. if (initAccum && length) {
  1769. accumulator = array[--length];
  1770. }
  1771. while (length--) {
  1772. accumulator = iteratee(accumulator, array[length], length, array);
  1773. }
  1774. return accumulator;
  1775. }
  1776. /**
  1777. * A specialized version of `_.some` for arrays without support for iteratee
  1778. * shorthands.
  1779. *
  1780. * @private
  1781. * @param {Array} [array] The array to iterate over.
  1782. * @param {Function} predicate The function invoked per iteration.
  1783. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1784. * else `false`.
  1785. */
  1786. function arraySome(array, predicate) {
  1787. var index = -1,
  1788. length = array == null ? 0 : array.length;
  1789. while (++index < length) {
  1790. if (predicate(array[index], index, array)) {
  1791. return true;
  1792. }
  1793. }
  1794. return false;
  1795. }
  1796. /**
  1797. * Gets the size of an ASCII `string`.
  1798. *
  1799. * @private
  1800. * @param {string} string The string inspect.
  1801. * @returns {number} Returns the string size.
  1802. */
  1803. var asciiSize = baseProperty('length');
  1804. /**
  1805. * Converts an ASCII `string` to an array.
  1806. *
  1807. * @private
  1808. * @param {string} string The string to convert.
  1809. * @returns {Array} Returns the converted array.
  1810. */
  1811. function asciiToArray(string) {
  1812. return string.split('');
  1813. }
  1814. /**
  1815. * Splits an ASCII `string` into an array of its words.
  1816. *
  1817. * @private
  1818. * @param {string} The string to inspect.
  1819. * @returns {Array} Returns the words of `string`.
  1820. */
  1821. function asciiWords(string) {
  1822. return string.match(reAsciiWord) || [];
  1823. }
  1824. /**
  1825. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1826. * without support for iteratee shorthands, which iterates over `collection`
  1827. * using `eachFunc`.
  1828. *
  1829. * @private
  1830. * @param {Array|Object} collection The collection to inspect.
  1831. * @param {Function} predicate The function invoked per iteration.
  1832. * @param {Function} eachFunc The function to iterate over `collection`.
  1833. * @returns {*} Returns the found element or its key, else `undefined`.
  1834. */
  1835. function baseFindKey(collection, predicate, eachFunc) {
  1836. var result;
  1837. eachFunc(collection, function(value, key, collection) {
  1838. if (predicate(value, key, collection)) {
  1839. result = key;
  1840. return false;
  1841. }
  1842. });
  1843. return result;
  1844. }
  1845. /**
  1846. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1847. * support for iteratee shorthands.
  1848. *
  1849. * @private
  1850. * @param {Array} array The array to inspect.
  1851. * @param {Function} predicate The function invoked per iteration.
  1852. * @param {number} fromIndex The index to search from.
  1853. * @param {boolean} [fromRight] Specify iterating from right to left.
  1854. * @returns {number} Returns the index of the matched value, else `-1`.
  1855. */
  1856. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1857. var length = array.length,
  1858. index = fromIndex + (fromRight ? 1 : -1);
  1859. while ((fromRight ? index-- : ++index < length)) {
  1860. if (predicate(array[index], index, array)) {
  1861. return index;
  1862. }
  1863. }
  1864. return -1;
  1865. }
  1866. /**
  1867. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1868. *
  1869. * @private
  1870. * @param {Array} array The array to inspect.
  1871. * @param {*} value The value to search for.
  1872. * @param {number} fromIndex The index to search from.
  1873. * @returns {number} Returns the index of the matched value, else `-1`.
  1874. */
  1875. function baseIndexOf(array, value, fromIndex) {
  1876. return value === value
  1877. ? strictIndexOf(array, value, fromIndex)
  1878. : baseFindIndex(array, baseIsNaN, fromIndex);
  1879. }
  1880. /**
  1881. * This function is like `baseIndexOf` except that it accepts a comparator.
  1882. *
  1883. * @private
  1884. * @param {Array} array The array to inspect.
  1885. * @param {*} value The value to search for.
  1886. * @param {number} fromIndex The index to search from.
  1887. * @param {Function} comparator The comparator invoked per element.
  1888. * @returns {number} Returns the index of the matched value, else `-1`.
  1889. */
  1890. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1891. var index = fromIndex - 1,
  1892. length = array.length;
  1893. while (++index < length) {
  1894. if (comparator(array[index], value)) {
  1895. return index;
  1896. }
  1897. }
  1898. return -1;
  1899. }
  1900. /**
  1901. * The base implementation of `_.isNaN` without support for number objects.
  1902. *
  1903. * @private
  1904. * @param {*} value The value to check.
  1905. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1906. */
  1907. function baseIsNaN(value) {
  1908. return value !== value;
  1909. }
  1910. /**
  1911. * The base implementation of `_.mean` and `_.meanBy` without support for
  1912. * iteratee shorthands.
  1913. *
  1914. * @private
  1915. * @param {Array} array The array to iterate over.
  1916. * @param {Function} iteratee The function invoked per iteration.
  1917. * @returns {number} Returns the mean.
  1918. */
  1919. function baseMean(array, iteratee) {
  1920. var length = array == null ? 0 : array.length;
  1921. return length ? (baseSum(array, iteratee) / length) : NAN;
  1922. }
  1923. /**
  1924. * The base implementation of `_.property` without support for deep paths.
  1925. *
  1926. * @private
  1927. * @param {string} key The key of the property to get.
  1928. * @returns {Function} Returns the new accessor function.
  1929. */
  1930. function baseProperty(key) {
  1931. return function(object) {
  1932. return object == null ? undefined : object[key];
  1933. };
  1934. }
  1935. /**
  1936. * The base implementation of `_.propertyOf` without support for deep paths.
  1937. *
  1938. * @private
  1939. * @param {Object} object The object to query.
  1940. * @returns {Function} Returns the new accessor function.
  1941. */
  1942. function basePropertyOf(object) {
  1943. return function(key) {
  1944. return object == null ? undefined : object[key];
  1945. };
  1946. }
  1947. /**
  1948. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1949. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1950. *
  1951. * @private
  1952. * @param {Array|Object} collection The collection to iterate over.
  1953. * @param {Function} iteratee The function invoked per iteration.
  1954. * @param {*} accumulator The initial value.
  1955. * @param {boolean} initAccum Specify using the first or last element of
  1956. * `collection` as the initial value.
  1957. * @param {Function} eachFunc The function to iterate over `collection`.
  1958. * @returns {*} Returns the accumulated value.
  1959. */
  1960. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1961. eachFunc(collection, function(value, index, collection) {
  1962. accumulator = initAccum
  1963. ? (initAccum = false, value)
  1964. : iteratee(accumulator, value, index, collection);
  1965. });
  1966. return accumulator;
  1967. }
  1968. /**
  1969. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1970. * sort order of `array` and replaces criteria objects with their corresponding
  1971. * values.
  1972. *
  1973. * @private
  1974. * @param {Array} array The array to sort.
  1975. * @param {Function} comparer The function to define sort order.
  1976. * @returns {Array} Returns `array`.
  1977. */
  1978. function baseSortBy(array, comparer) {
  1979. var length = array.length;
  1980. array.sort(comparer);
  1981. while (length--) {
  1982. array[length] = array[length].value;
  1983. }
  1984. return array;
  1985. }
  1986. /**
  1987. * The base implementation of `_.sum` and `_.sumBy` without support for
  1988. * iteratee shorthands.
  1989. *
  1990. * @private
  1991. * @param {Array} array The array to iterate over.
  1992. * @param {Function} iteratee The function invoked per iteration.
  1993. * @returns {number} Returns the sum.
  1994. */
  1995. function baseSum(array, iteratee) {
  1996. var result,
  1997. index = -1,
  1998. length = array.length;
  1999. while (++index < length) {
  2000. var current = iteratee(array[index]);
  2001. if (current !== undefined) {
  2002. result = result === undefined ? current : (result + current);
  2003. }
  2004. }
  2005. return result;
  2006. }
  2007. /**
  2008. * The base implementation of `_.times` without support for iteratee shorthands
  2009. * or max array length checks.
  2010. *
  2011. * @private
  2012. * @param {number} n The number of times to invoke `iteratee`.
  2013. * @param {Function} iteratee The function invoked per iteration.
  2014. * @returns {Array} Returns the array of results.
  2015. */
  2016. function baseTimes(n, iteratee) {
  2017. var index = -1,
  2018. result = Array(n);
  2019. while (++index < n) {
  2020. result[index] = iteratee(index);
  2021. }
  2022. return result;
  2023. }
  2024. /**
  2025. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2026. * of key-value pairs for `object` corresponding to the property names of `props`.
  2027. *
  2028. * @private
  2029. * @param {Object} object The object to query.
  2030. * @param {Array} props The property names to get values for.
  2031. * @returns {Object} Returns the key-value pairs.
  2032. */
  2033. function baseToPairs(object, props) {
  2034. return arrayMap(props, function(key) {
  2035. return [key, object[key]];
  2036. });
  2037. }
  2038. /**
  2039. * The base implementation of `_.trim`.
  2040. *
  2041. * @private
  2042. * @param {string} string The string to trim.
  2043. * @returns {string} Returns the trimmed string.
  2044. */
  2045. function baseTrim(string) {
  2046. return string
  2047. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2048. : string;
  2049. }
  2050. /**
  2051. * The base implementation of `_.unary` without support for storing metadata.
  2052. *
  2053. * @private
  2054. * @param {Function} func The function to cap arguments for.
  2055. * @returns {Function} Returns the new capped function.
  2056. */
  2057. function baseUnary(func) {
  2058. return function(value) {
  2059. return func(value);
  2060. };
  2061. }
  2062. /**
  2063. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2064. * array of `object` property values corresponding to the property names
  2065. * of `props`.
  2066. *
  2067. * @private
  2068. * @param {Object} object The object to query.
  2069. * @param {Array} props The property names to get values for.
  2070. * @returns {Object} Returns the array of property values.
  2071. */
  2072. function baseValues(object, props) {
  2073. return arrayMap(props, function(key) {
  2074. return object[key];
  2075. });
  2076. }
  2077. /**
  2078. * Checks if a `cache` value for `key` exists.
  2079. *
  2080. * @private
  2081. * @param {Object} cache The cache to query.
  2082. * @param {string} key The key of the entry to check.
  2083. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2084. */
  2085. function cacheHas(cache, key) {
  2086. return cache.has(key);
  2087. }
  2088. /**
  2089. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2090. * that is not found in the character symbols.
  2091. *
  2092. * @private
  2093. * @param {Array} strSymbols The string symbols to inspect.
  2094. * @param {Array} chrSymbols The character symbols to find.
  2095. * @returns {number} Returns the index of the first unmatched string symbol.
  2096. */
  2097. function charsStartIndex(strSymbols, chrSymbols) {
  2098. var index = -1,
  2099. length = strSymbols.length;
  2100. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2101. return index;
  2102. }
  2103. /**
  2104. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2105. * that is not found in the character symbols.
  2106. *
  2107. * @private
  2108. * @param {Array} strSymbols The string symbols to inspect.
  2109. * @param {Array} chrSymbols The character symbols to find.
  2110. * @returns {number} Returns the index of the last unmatched string symbol.
  2111. */
  2112. function charsEndIndex(strSymbols, chrSymbols) {
  2113. var index = strSymbols.length;
  2114. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2115. return index;
  2116. }
  2117. /**
  2118. * Gets the number of `placeholder` occurrences in `array`.
  2119. *
  2120. * @private
  2121. * @param {Array} array The array to inspect.
  2122. * @param {*} placeholder The placeholder to search for.
  2123. * @returns {number} Returns the placeholder count.
  2124. */
  2125. function countHolders(array, placeholder) {
  2126. var length = array.length,
  2127. result = 0;
  2128. while (length--) {
  2129. if (array[length] === placeholder) {
  2130. ++result;
  2131. }
  2132. }
  2133. return result;
  2134. }
  2135. /**
  2136. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2137. * letters to basic Latin letters.
  2138. *
  2139. * @private
  2140. * @param {string} letter The matched letter to deburr.
  2141. * @returns {string} Returns the deburred letter.
  2142. */
  2143. var deburrLetter = basePropertyOf(deburredLetters);
  2144. /**
  2145. * Used by `_.escape` to convert characters to HTML entities.
  2146. *
  2147. * @private
  2148. * @param {string} chr The matched character to escape.
  2149. * @returns {string} Returns the escaped character.
  2150. */
  2151. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2152. /**
  2153. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2154. *
  2155. * @private
  2156. * @param {string} chr The matched character to escape.
  2157. * @returns {string} Returns the escaped character.
  2158. */
  2159. function escapeStringChar(chr) {
  2160. return '\\' + stringEscapes[chr];
  2161. }
  2162. /**
  2163. * Gets the value at `key` of `object`.
  2164. *
  2165. * @private
  2166. * @param {Object} [object] The object to query.
  2167. * @param {string} key The key of the property to get.
  2168. * @returns {*} Returns the property value.
  2169. */
  2170. function getValue(object, key) {
  2171. return object == null ? undefined : object[key];
  2172. }
  2173. /**
  2174. * Checks if `string` contains Unicode symbols.
  2175. *
  2176. * @private
  2177. * @param {string} string The string to inspect.
  2178. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2179. */
  2180. function hasUnicode(string) {
  2181. return reHasUnicode.test(string);
  2182. }
  2183. /**
  2184. * Checks if `string` contains a word composed of Unicode symbols.
  2185. *
  2186. * @private
  2187. * @param {string} string The string to inspect.
  2188. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2189. */
  2190. function hasUnicodeWord(string) {
  2191. return reHasUnicodeWord.test(string);
  2192. }
  2193. /**
  2194. * Converts `iterator` to an array.
  2195. *
  2196. * @private
  2197. * @param {Object} iterator The iterator to convert.
  2198. * @returns {Array} Returns the converted array.
  2199. */
  2200. function iteratorToArray(iterator) {
  2201. var data,
  2202. result = [];
  2203. while (!(data = iterator.next()).done) {
  2204. result.push(data.value);
  2205. }
  2206. return result;
  2207. }
  2208. /**
  2209. * Converts `map` to its key-value pairs.
  2210. *
  2211. * @private
  2212. * @param {Object} map The map to convert.
  2213. * @returns {Array} Returns the key-value pairs.
  2214. */
  2215. function mapToArray(map) {
  2216. var index = -1,
  2217. result = Array(map.size);
  2218. map.forEach(function(value, key) {
  2219. result[++index] = [key, value];
  2220. });
  2221. return result;
  2222. }
  2223. /**
  2224. * Creates a unary function that invokes `func` with its argument transformed.
  2225. *
  2226. * @private
  2227. * @param {Function} func The function to wrap.
  2228. * @param {Function} transform The argument transform.
  2229. * @returns {Function} Returns the new function.
  2230. */
  2231. function overArg(func, transform) {
  2232. return function(arg) {
  2233. return func(transform(arg));
  2234. };
  2235. }
  2236. /**
  2237. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2238. * and returns an array of their indexes.
  2239. *
  2240. * @private
  2241. * @param {Array} array The array to modify.
  2242. * @param {*} placeholder The placeholder to replace.
  2243. * @returns {Array} Returns the new array of placeholder indexes.
  2244. */
  2245. function replaceHolders(array, placeholder) {
  2246. var index = -1,
  2247. length = array.length,
  2248. resIndex = 0,
  2249. result = [];
  2250. while (++index < length) {
  2251. var value = array[index];
  2252. if (value === placeholder || value === PLACEHOLDER) {
  2253. array[index] = PLACEHOLDER;
  2254. result[resIndex++] = index;
  2255. }
  2256. }
  2257. return result;
  2258. }
  2259. /**
  2260. * Converts `set` to an array of its values.
  2261. *
  2262. * @private
  2263. * @param {Object} set The set to convert.
  2264. * @returns {Array} Returns the values.
  2265. */
  2266. function setToArray(set) {
  2267. var index = -1,
  2268. result = Array(set.size);
  2269. set.forEach(function(value) {
  2270. result[++index] = value;
  2271. });
  2272. return result;
  2273. }
  2274. /**
  2275. * Converts `set` to its value-value pairs.
  2276. *
  2277. * @private
  2278. * @param {Object} set The set to convert.
  2279. * @returns {Array} Returns the value-value pairs.
  2280. */
  2281. function setToPairs(set) {
  2282. var index = -1,
  2283. result = Array(set.size);
  2284. set.forEach(function(value) {
  2285. result[++index] = [value, value];
  2286. });
  2287. return result;
  2288. }
  2289. /**
  2290. * A specialized version of `_.indexOf` which performs strict equality
  2291. * comparisons of values, i.e. `===`.
  2292. *
  2293. * @private
  2294. * @param {Array} array The array to inspect.
  2295. * @param {*} value The value to search for.
  2296. * @param {number} fromIndex The index to search from.
  2297. * @returns {number} Returns the index of the matched value, else `-1`.
  2298. */
  2299. function strictIndexOf(array, value, fromIndex) {
  2300. var index = fromIndex - 1,
  2301. length = array.length;
  2302. while (++index < length) {
  2303. if (array[index] === value) {
  2304. return index;
  2305. }
  2306. }
  2307. return -1;
  2308. }
  2309. /**
  2310. * A specialized version of `_.lastIndexOf` which performs strict equality
  2311. * comparisons of values, i.e. `===`.
  2312. *
  2313. * @private
  2314. * @param {Array} array The array to inspect.
  2315. * @param {*} value The value to search for.
  2316. * @param {number} fromIndex The index to search from.
  2317. * @returns {number} Returns the index of the matched value, else `-1`.
  2318. */
  2319. function strictLastIndexOf(array, value, fromIndex) {
  2320. var index = fromIndex + 1;
  2321. while (index--) {
  2322. if (array[index] === value) {
  2323. return index;
  2324. }
  2325. }
  2326. return index;
  2327. }
  2328. /**
  2329. * Gets the number of symbols in `string`.
  2330. *
  2331. * @private
  2332. * @param {string} string The string to inspect.
  2333. * @returns {number} Returns the string size.
  2334. */
  2335. function stringSize(string) {
  2336. return hasUnicode(string)
  2337. ? unicodeSize(string)
  2338. : asciiSize(string);
  2339. }
  2340. /**
  2341. * Converts `string` to an array.
  2342. *
  2343. * @private
  2344. * @param {string} string The string to convert.
  2345. * @returns {Array} Returns the converted array.
  2346. */
  2347. function stringToArray(string) {
  2348. return hasUnicode(string)
  2349. ? unicodeToArray(string)
  2350. : asciiToArray(string);
  2351. }
  2352. /**
  2353. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2354. * character of `string`.
  2355. *
  2356. * @private
  2357. * @param {string} string The string to inspect.
  2358. * @returns {number} Returns the index of the last non-whitespace character.
  2359. */
  2360. function trimmedEndIndex(string) {
  2361. var index = string.length;
  2362. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2363. return index;
  2364. }
  2365. /**
  2366. * Used by `_.unescape` to convert HTML entities to characters.
  2367. *
  2368. * @private
  2369. * @param {string} chr The matched character to unescape.
  2370. * @returns {string} Returns the unescaped character.
  2371. */
  2372. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2373. /**
  2374. * Gets the size of a Unicode `string`.
  2375. *
  2376. * @private
  2377. * @param {string} string The string inspect.
  2378. * @returns {number} Returns the string size.
  2379. */
  2380. function unicodeSize(string) {
  2381. var result = reUnicode.lastIndex = 0;
  2382. while (reUnicode.test(string)) {
  2383. ++result;
  2384. }
  2385. return result;
  2386. }
  2387. /**
  2388. * Converts a Unicode `string` to an array.
  2389. *
  2390. * @private
  2391. * @param {string} string The string to convert.
  2392. * @returns {Array} Returns the converted array.
  2393. */
  2394. function unicodeToArray(string) {
  2395. return string.match(reUnicode) || [];
  2396. }
  2397. /**
  2398. * Splits a Unicode `string` into an array of its words.
  2399. *
  2400. * @private
  2401. * @param {string} The string to inspect.
  2402. * @returns {Array} Returns the words of `string`.
  2403. */
  2404. function unicodeWords(string) {
  2405. return string.match(reUnicodeWord) || [];
  2406. }
  2407. /*--------------------------------------------------------------------------*/
  2408. /**
  2409. * Create a new pristine `lodash` function using the `context` object.
  2410. *
  2411. * @static
  2412. * @memberOf _
  2413. * @since 1.1.0
  2414. * @category Util
  2415. * @param {Object} [context=root] The context object.
  2416. * @returns {Function} Returns a new `lodash` function.
  2417. * @example
  2418. *
  2419. * _.mixin({ 'foo': _.constant('foo') });
  2420. *
  2421. * var lodash = _.runInContext();
  2422. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2423. *
  2424. * _.isFunction(_.foo);
  2425. * // => true
  2426. * _.isFunction(_.bar);
  2427. * // => false
  2428. *
  2429. * lodash.isFunction(lodash.foo);
  2430. * // => false
  2431. * lodash.isFunction(lodash.bar);
  2432. * // => true
  2433. *
  2434. * // Create a suped-up `defer` in Node.js.
  2435. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2436. */
  2437. var runInContext = (function runInContext(context) {
  2438. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2439. /** Built-in constructor references. */
  2440. var Array = context.Array,
  2441. Date = context.Date,
  2442. Error = context.Error,
  2443. Function = context.Function,
  2444. Math = context.Math,
  2445. Object = context.Object,
  2446. RegExp = context.RegExp,
  2447. String = context.String,
  2448. TypeError = context.TypeError;
  2449. /** Used for built-in method references. */
  2450. var arrayProto = Array.prototype,
  2451. funcProto = Function.prototype,
  2452. objectProto = Object.prototype;
  2453. /** Used to detect overreaching core-js shims. */
  2454. var coreJsData = context['__core-js_shared__'];
  2455. /** Used to resolve the decompiled source of functions. */
  2456. var funcToString = funcProto.toString;
  2457. /** Used to check objects for own properties. */
  2458. var hasOwnProperty = objectProto.hasOwnProperty;
  2459. /** Used to generate unique IDs. */
  2460. var idCounter = 0;
  2461. /** Used to detect methods masquerading as native. */
  2462. var maskSrcKey = (function() {
  2463. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2464. return uid ? ('Symbol(src)_1.' + uid) : '';
  2465. }());
  2466. /**
  2467. * Used to resolve the
  2468. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2469. * of values.
  2470. */
  2471. var nativeObjectToString = objectProto.toString;
  2472. /** Used to infer the `Object` constructor. */
  2473. var objectCtorString = funcToString.call(Object);
  2474. /** Used to restore the original `_` reference in `_.noConflict`. */
  2475. var oldDash = root._;
  2476. /** Used to detect if a method is native. */
  2477. var reIsNative = RegExp('^' +
  2478. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2479. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2480. );
  2481. /** Built-in value references. */
  2482. var Buffer = moduleExports ? context.Buffer : undefined,
  2483. Symbol = context.Symbol,
  2484. Uint8Array = context.Uint8Array,
  2485. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2486. getPrototype = overArg(Object.getPrototypeOf, Object),
  2487. objectCreate = Object.create,
  2488. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2489. splice = arrayProto.splice,
  2490. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2491. symIterator = Symbol ? Symbol.iterator : undefined,
  2492. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2493. var defineProperty = (function() {
  2494. try {
  2495. var func = getNative(Object, 'defineProperty');
  2496. func({}, '', {});
  2497. return func;
  2498. } catch (e) {}
  2499. }());
  2500. /** Mocked built-ins. */
  2501. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2502. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2503. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2504. /* Built-in method references for those with the same name as other `lodash` methods. */
  2505. var nativeCeil = Math.ceil,
  2506. nativeFloor = Math.floor,
  2507. nativeGetSymbols = Object.getOwnPropertySymbols,
  2508. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2509. nativeIsFinite = context.isFinite,
  2510. nativeJoin = arrayProto.join,
  2511. nativeKeys = overArg(Object.keys, Object),
  2512. nativeMax = Math.max,
  2513. nativeMin = Math.min,
  2514. nativeNow = Date.now,
  2515. nativeParseInt = context.parseInt,
  2516. nativeRandom = Math.random,
  2517. nativeReverse = arrayProto.reverse;
  2518. /* Built-in method references that are verified to be native. */
  2519. var DataView = getNative(context, 'DataView'),
  2520. Map = getNative(context, 'Map'),
  2521. Promise = getNative(context, 'Promise'),
  2522. Set = getNative(context, 'Set'),
  2523. WeakMap = getNative(context, 'WeakMap'),
  2524. nativeCreate = getNative(Object, 'create');
  2525. /** Used to store function metadata. */
  2526. var metaMap = WeakMap && new WeakMap;
  2527. /** Used to lookup unminified function names. */
  2528. var realNames = {};
  2529. /** Used to detect maps, sets, and weakmaps. */
  2530. var dataViewCtorString = toSource(DataView),
  2531. mapCtorString = toSource(Map),
  2532. promiseCtorString = toSource(Promise),
  2533. setCtorString = toSource(Set),
  2534. weakMapCtorString = toSource(WeakMap);
  2535. /** Used to convert symbols to primitives and strings. */
  2536. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2537. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2538. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2539. /*------------------------------------------------------------------------*/
  2540. /**
  2541. * Creates a `lodash` object which wraps `value` to enable implicit method
  2542. * chain sequences. Methods that operate on and return arrays, collections,
  2543. * and functions can be chained together. Methods that retrieve a single value
  2544. * or may return a primitive value will automatically end the chain sequence
  2545. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2546. * with `_#value`.
  2547. *
  2548. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2549. * enabled using `_.chain`.
  2550. *
  2551. * The execution of chained methods is lazy, that is, it's deferred until
  2552. * `_#value` is implicitly or explicitly called.
  2553. *
  2554. * Lazy evaluation allows several methods to support shortcut fusion.
  2555. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2556. * the creation of intermediate arrays and can greatly reduce the number of
  2557. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2558. * fusion if the section is applied to an array and iteratees accept only
  2559. * one argument. The heuristic for whether a section qualifies for shortcut
  2560. * fusion is subject to change.
  2561. *
  2562. * Chaining is supported in custom builds as long as the `_#value` method is
  2563. * directly or indirectly included in the build.
  2564. *
  2565. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2566. *
  2567. * The wrapper `Array` methods are:
  2568. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2569. *
  2570. * The wrapper `String` methods are:
  2571. * `replace` and `split`
  2572. *
  2573. * The wrapper methods that support shortcut fusion are:
  2574. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2575. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2576. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2577. *
  2578. * The chainable wrapper methods are:
  2579. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2580. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2581. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2582. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2583. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2584. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2585. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2586. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2587. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2588. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2589. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2590. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2591. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2592. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2593. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2594. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2595. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2596. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2597. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2598. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2599. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2600. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2601. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2602. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2603. *
  2604. * The wrapper methods that are **not** chainable by default are:
  2605. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2606. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2607. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2608. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2609. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2610. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2611. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2612. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2613. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2614. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2615. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2616. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2617. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2618. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2619. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2620. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2621. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2622. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2623. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2624. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2625. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2626. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2627. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2628. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2629. * `upperFirst`, `value`, and `words`
  2630. *
  2631. * @name _
  2632. * @constructor
  2633. * @category Seq
  2634. * @param {*} value The value to wrap in a `lodash` instance.
  2635. * @returns {Object} Returns the new `lodash` wrapper instance.
  2636. * @example
  2637. *
  2638. * function square(n) {
  2639. * return n * n;
  2640. * }
  2641. *
  2642. * var wrapped = _([1, 2, 3]);
  2643. *
  2644. * // Returns an unwrapped value.
  2645. * wrapped.reduce(_.add);
  2646. * // => 6
  2647. *
  2648. * // Returns a wrapped value.
  2649. * var squares = wrapped.map(square);
  2650. *
  2651. * _.isArray(squares);
  2652. * // => false
  2653. *
  2654. * _.isArray(squares.value());
  2655. * // => true
  2656. */
  2657. function lodash(value) {
  2658. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2659. if (value instanceof LodashWrapper) {
  2660. return value;
  2661. }
  2662. if (hasOwnProperty.call(value, '__wrapped__')) {
  2663. return wrapperClone(value);
  2664. }
  2665. }
  2666. return new LodashWrapper(value);
  2667. }
  2668. /**
  2669. * The base implementation of `_.create` without support for assigning
  2670. * properties to the created object.
  2671. *
  2672. * @private
  2673. * @param {Object} proto The object to inherit from.
  2674. * @returns {Object} Returns the new object.
  2675. */
  2676. var baseCreate = (function() {
  2677. function object() {}
  2678. return function(proto) {
  2679. if (!isObject(proto)) {
  2680. return {};
  2681. }
  2682. if (objectCreate) {
  2683. return objectCreate(proto);
  2684. }
  2685. object.prototype = proto;
  2686. var result = new object;
  2687. object.prototype = undefined;
  2688. return result;
  2689. };
  2690. }());
  2691. /**
  2692. * The function whose prototype chain sequence wrappers inherit from.
  2693. *
  2694. * @private
  2695. */
  2696. function baseLodash() {
  2697. // No operation performed.
  2698. }
  2699. /**
  2700. * The base constructor for creating `lodash` wrapper objects.
  2701. *
  2702. * @private
  2703. * @param {*} value The value to wrap.
  2704. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2705. */
  2706. function LodashWrapper(value, chainAll) {
  2707. this.__wrapped__ = value;
  2708. this.__actions__ = [];
  2709. this.__chain__ = !!chainAll;
  2710. this.__index__ = 0;
  2711. this.__values__ = undefined;
  2712. }
  2713. /**
  2714. * By default, the template delimiters used by lodash are like those in
  2715. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2716. * following template settings to use alternative delimiters.
  2717. *
  2718. * @static
  2719. * @memberOf _
  2720. * @type {Object}
  2721. */
  2722. lodash.templateSettings = {
  2723. /**
  2724. * Used to detect `data` property values to be HTML-escaped.
  2725. *
  2726. * @memberOf _.templateSettings
  2727. * @type {RegExp}
  2728. */
  2729. 'escape': reEscape,
  2730. /**
  2731. * Used to detect code to be evaluated.
  2732. *
  2733. * @memberOf _.templateSettings
  2734. * @type {RegExp}
  2735. */
  2736. 'evaluate': reEvaluate,
  2737. /**
  2738. * Used to detect `data` property values to inject.
  2739. *
  2740. * @memberOf _.templateSettings
  2741. * @type {RegExp}
  2742. */
  2743. 'interpolate': reInterpolate,
  2744. /**
  2745. * Used to reference the data object in the template text.
  2746. *
  2747. * @memberOf _.templateSettings
  2748. * @type {string}
  2749. */
  2750. 'variable': '',
  2751. /**
  2752. * Used to import variables into the compiled template.
  2753. *
  2754. * @memberOf _.templateSettings
  2755. * @type {Object}
  2756. */
  2757. 'imports': {
  2758. /**
  2759. * A reference to the `lodash` function.
  2760. *
  2761. * @memberOf _.templateSettings.imports
  2762. * @type {Function}
  2763. */
  2764. '_': lodash
  2765. }
  2766. };
  2767. // Ensure wrappers are instances of `baseLodash`.
  2768. lodash.prototype = baseLodash.prototype;
  2769. lodash.prototype.constructor = lodash;
  2770. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2771. LodashWrapper.prototype.constructor = LodashWrapper;
  2772. /*------------------------------------------------------------------------*/
  2773. /**
  2774. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2775. *
  2776. * @private
  2777. * @constructor
  2778. * @param {*} value The value to wrap.
  2779. */
  2780. function LazyWrapper(value) {
  2781. this.__wrapped__ = value;
  2782. this.__actions__ = [];
  2783. this.__dir__ = 1;
  2784. this.__filtered__ = false;
  2785. this.__iteratees__ = [];
  2786. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2787. this.__views__ = [];
  2788. }
  2789. /**
  2790. * Creates a clone of the lazy wrapper object.
  2791. *
  2792. * @private
  2793. * @name clone
  2794. * @memberOf LazyWrapper
  2795. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2796. */
  2797. function lazyClone() {
  2798. var result = new LazyWrapper(this.__wrapped__);
  2799. result.__actions__ = copyArray(this.__actions__);
  2800. result.__dir__ = this.__dir__;
  2801. result.__filtered__ = this.__filtered__;
  2802. result.__iteratees__ = copyArray(this.__iteratees__);
  2803. result.__takeCount__ = this.__takeCount__;
  2804. result.__views__ = copyArray(this.__views__);
  2805. return result;
  2806. }
  2807. /**
  2808. * Reverses the direction of lazy iteration.
  2809. *
  2810. * @private
  2811. * @name reverse
  2812. * @memberOf LazyWrapper
  2813. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2814. */
  2815. function lazyReverse() {
  2816. if (this.__filtered__) {
  2817. var result = new LazyWrapper(this);
  2818. result.__dir__ = -1;
  2819. result.__filtered__ = true;
  2820. } else {
  2821. result = this.clone();
  2822. result.__dir__ *= -1;
  2823. }
  2824. return result;
  2825. }
  2826. /**
  2827. * Extracts the unwrapped value from its lazy wrapper.
  2828. *
  2829. * @private
  2830. * @name value
  2831. * @memberOf LazyWrapper
  2832. * @returns {*} Returns the unwrapped value.
  2833. */
  2834. function lazyValue() {
  2835. var array = this.__wrapped__.value(),
  2836. dir = this.__dir__,
  2837. isArr = isArray(array),
  2838. isRight = dir < 0,
  2839. arrLength = isArr ? array.length : 0,
  2840. view = getView(0, arrLength, this.__views__),
  2841. start = view.start,
  2842. end = view.end,
  2843. length = end - start,
  2844. index = isRight ? end : (start - 1),
  2845. iteratees = this.__iteratees__,
  2846. iterLength = iteratees.length,
  2847. resIndex = 0,
  2848. takeCount = nativeMin(length, this.__takeCount__);
  2849. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2850. return baseWrapperValue(array, this.__actions__);
  2851. }
  2852. var result = [];
  2853. outer:
  2854. while (length-- && resIndex < takeCount) {
  2855. index += dir;
  2856. var iterIndex = -1,
  2857. value = array[index];
  2858. while (++iterIndex < iterLength) {
  2859. var data = iteratees[iterIndex],
  2860. iteratee = data.iteratee,
  2861. type = data.type,
  2862. computed = iteratee(value);
  2863. if (type == LAZY_MAP_FLAG) {
  2864. value = computed;
  2865. } else if (!computed) {
  2866. if (type == LAZY_FILTER_FLAG) {
  2867. continue outer;
  2868. } else {
  2869. break outer;
  2870. }
  2871. }
  2872. }
  2873. result[resIndex++] = value;
  2874. }
  2875. return result;
  2876. }
  2877. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2878. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2879. LazyWrapper.prototype.constructor = LazyWrapper;
  2880. /*------------------------------------------------------------------------*/
  2881. /**
  2882. * Creates a hash object.
  2883. *
  2884. * @private
  2885. * @constructor
  2886. * @param {Array} [entries] The key-value pairs to cache.
  2887. */
  2888. function Hash(entries) {
  2889. var index = -1,
  2890. length = entries == null ? 0 : entries.length;
  2891. this.clear();
  2892. while (++index < length) {
  2893. var entry = entries[index];
  2894. this.set(entry[0], entry[1]);
  2895. }
  2896. }
  2897. /**
  2898. * Removes all key-value entries from the hash.
  2899. *
  2900. * @private
  2901. * @name clear
  2902. * @memberOf Hash
  2903. */
  2904. function hashClear() {
  2905. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2906. this.size = 0;
  2907. }
  2908. /**
  2909. * Removes `key` and its value from the hash.
  2910. *
  2911. * @private
  2912. * @name delete
  2913. * @memberOf Hash
  2914. * @param {Object} hash The hash to modify.
  2915. * @param {string} key The key of the value to remove.
  2916. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2917. */
  2918. function hashDelete(key) {
  2919. var result = this.has(key) && delete this.__data__[key];
  2920. this.size -= result ? 1 : 0;
  2921. return result;
  2922. }
  2923. /**
  2924. * Gets the hash value for `key`.
  2925. *
  2926. * @private
  2927. * @name get
  2928. * @memberOf Hash
  2929. * @param {string} key The key of the value to get.
  2930. * @returns {*} Returns the entry value.
  2931. */
  2932. function hashGet(key) {
  2933. var data = this.__data__;
  2934. if (nativeCreate) {
  2935. var result = data[key];
  2936. return result === HASH_UNDEFINED ? undefined : result;
  2937. }
  2938. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2939. }
  2940. /**
  2941. * Checks if a hash value for `key` exists.
  2942. *
  2943. * @private
  2944. * @name has
  2945. * @memberOf Hash
  2946. * @param {string} key The key of the entry to check.
  2947. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2948. */
  2949. function hashHas(key) {
  2950. var data = this.__data__;
  2951. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2952. }
  2953. /**
  2954. * Sets the hash `key` to `value`.
  2955. *
  2956. * @private
  2957. * @name set
  2958. * @memberOf Hash
  2959. * @param {string} key The key of the value to set.
  2960. * @param {*} value The value to set.
  2961. * @returns {Object} Returns the hash instance.
  2962. */
  2963. function hashSet(key, value) {
  2964. var data = this.__data__;
  2965. this.size += this.has(key) ? 0 : 1;
  2966. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2967. return this;
  2968. }
  2969. // Add methods to `Hash`.
  2970. Hash.prototype.clear = hashClear;
  2971. Hash.prototype['delete'] = hashDelete;
  2972. Hash.prototype.get = hashGet;
  2973. Hash.prototype.has = hashHas;
  2974. Hash.prototype.set = hashSet;
  2975. /*------------------------------------------------------------------------*/
  2976. /**
  2977. * Creates an list cache object.
  2978. *
  2979. * @private
  2980. * @constructor
  2981. * @param {Array} [entries] The key-value pairs to cache.
  2982. */
  2983. function ListCache(entries) {
  2984. var index = -1,
  2985. length = entries == null ? 0 : entries.length;
  2986. this.clear();
  2987. while (++index < length) {
  2988. var entry = entries[index];
  2989. this.set(entry[0], entry[1]);
  2990. }
  2991. }
  2992. /**
  2993. * Removes all key-value entries from the list cache.
  2994. *
  2995. * @private
  2996. * @name clear
  2997. * @memberOf ListCache
  2998. */
  2999. function listCacheClear() {
  3000. this.__data__ = [];
  3001. this.size = 0;
  3002. }
  3003. /**
  3004. * Removes `key` and its value from the list cache.
  3005. *
  3006. * @private
  3007. * @name delete
  3008. * @memberOf ListCache
  3009. * @param {string} key The key of the value to remove.
  3010. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3011. */
  3012. function listCacheDelete(key) {
  3013. var data = this.__data__,
  3014. index = assocIndexOf(data, key);
  3015. if (index < 0) {
  3016. return false;
  3017. }
  3018. var lastIndex = data.length - 1;
  3019. if (index == lastIndex) {
  3020. data.pop();
  3021. } else {
  3022. splice.call(data, index, 1);
  3023. }
  3024. --this.size;
  3025. return true;
  3026. }
  3027. /**
  3028. * Gets the list cache value for `key`.
  3029. *
  3030. * @private
  3031. * @name get
  3032. * @memberOf ListCache
  3033. * @param {string} key The key of the value to get.
  3034. * @returns {*} Returns the entry value.
  3035. */
  3036. function listCacheGet(key) {
  3037. var data = this.__data__,
  3038. index = assocIndexOf(data, key);
  3039. return index < 0 ? undefined : data[index][1];
  3040. }
  3041. /**
  3042. * Checks if a list cache value for `key` exists.
  3043. *
  3044. * @private
  3045. * @name has
  3046. * @memberOf ListCache
  3047. * @param {string} key The key of the entry to check.
  3048. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3049. */
  3050. function listCacheHas(key) {
  3051. return assocIndexOf(this.__data__, key) > -1;
  3052. }
  3053. /**
  3054. * Sets the list cache `key` to `value`.
  3055. *
  3056. * @private
  3057. * @name set
  3058. * @memberOf ListCache
  3059. * @param {string} key The key of the value to set.
  3060. * @param {*} value The value to set.
  3061. * @returns {Object} Returns the list cache instance.
  3062. */
  3063. function listCacheSet(key, value) {
  3064. var data = this.__data__,
  3065. index = assocIndexOf(data, key);
  3066. if (index < 0) {
  3067. ++this.size;
  3068. data.push([key, value]);
  3069. } else {
  3070. data[index][1] = value;
  3071. }
  3072. return this;
  3073. }
  3074. // Add methods to `ListCache`.
  3075. ListCache.prototype.clear = listCacheClear;
  3076. ListCache.prototype['delete'] = listCacheDelete;
  3077. ListCache.prototype.get = listCacheGet;
  3078. ListCache.prototype.has = listCacheHas;
  3079. ListCache.prototype.set = listCacheSet;
  3080. /*------------------------------------------------------------------------*/
  3081. /**
  3082. * Creates a map cache object to store key-value pairs.
  3083. *
  3084. * @private
  3085. * @constructor
  3086. * @param {Array} [entries] The key-value pairs to cache.
  3087. */
  3088. function MapCache(entries) {
  3089. var index = -1,
  3090. length = entries == null ? 0 : entries.length;
  3091. this.clear();
  3092. while (++index < length) {
  3093. var entry = entries[index];
  3094. this.set(entry[0], entry[1]);
  3095. }
  3096. }
  3097. /**
  3098. * Removes all key-value entries from the map.
  3099. *
  3100. * @private
  3101. * @name clear
  3102. * @memberOf MapCache
  3103. */
  3104. function mapCacheClear() {
  3105. this.size = 0;
  3106. this.__data__ = {
  3107. 'hash': new Hash,
  3108. 'map': new (Map || ListCache),
  3109. 'string': new Hash
  3110. };
  3111. }
  3112. /**
  3113. * Removes `key` and its value from the map.
  3114. *
  3115. * @private
  3116. * @name delete
  3117. * @memberOf MapCache
  3118. * @param {string} key The key of the value to remove.
  3119. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3120. */
  3121. function mapCacheDelete(key) {
  3122. var result = getMapData(this, key)['delete'](key);
  3123. this.size -= result ? 1 : 0;
  3124. return result;
  3125. }
  3126. /**
  3127. * Gets the map value for `key`.
  3128. *
  3129. * @private
  3130. * @name get
  3131. * @memberOf MapCache
  3132. * @param {string} key The key of the value to get.
  3133. * @returns {*} Returns the entry value.
  3134. */
  3135. function mapCacheGet(key) {
  3136. return getMapData(this, key).get(key);
  3137. }
  3138. /**
  3139. * Checks if a map value for `key` exists.
  3140. *
  3141. * @private
  3142. * @name has
  3143. * @memberOf MapCache
  3144. * @param {string} key The key of the entry to check.
  3145. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3146. */
  3147. function mapCacheHas(key) {
  3148. return getMapData(this, key).has(key);
  3149. }
  3150. /**
  3151. * Sets the map `key` to `value`.
  3152. *
  3153. * @private
  3154. * @name set
  3155. * @memberOf MapCache
  3156. * @param {string} key The key of the value to set.
  3157. * @param {*} value The value to set.
  3158. * @returns {Object} Returns the map cache instance.
  3159. */
  3160. function mapCacheSet(key, value) {
  3161. var data = getMapData(this, key),
  3162. size = data.size;
  3163. data.set(key, value);
  3164. this.size += data.size == size ? 0 : 1;
  3165. return this;
  3166. }
  3167. // Add methods to `MapCache`.
  3168. MapCache.prototype.clear = mapCacheClear;
  3169. MapCache.prototype['delete'] = mapCacheDelete;
  3170. MapCache.prototype.get = mapCacheGet;
  3171. MapCache.prototype.has = mapCacheHas;
  3172. MapCache.prototype.set = mapCacheSet;
  3173. /*------------------------------------------------------------------------*/
  3174. /**
  3175. *
  3176. * Creates an array cache object to store unique values.
  3177. *
  3178. * @private
  3179. * @constructor
  3180. * @param {Array} [values] The values to cache.
  3181. */
  3182. function SetCache(values) {
  3183. var index = -1,
  3184. length = values == null ? 0 : values.length;
  3185. this.__data__ = new MapCache;
  3186. while (++index < length) {
  3187. this.add(values[index]);
  3188. }
  3189. }
  3190. /**
  3191. * Adds `value` to the array cache.
  3192. *
  3193. * @private
  3194. * @name add
  3195. * @memberOf SetCache
  3196. * @alias push
  3197. * @param {*} value The value to cache.
  3198. * @returns {Object} Returns the cache instance.
  3199. */
  3200. function setCacheAdd(value) {
  3201. this.__data__.set(value, HASH_UNDEFINED);
  3202. return this;
  3203. }
  3204. /**
  3205. * Checks if `value` is in the array cache.
  3206. *
  3207. * @private
  3208. * @name has
  3209. * @memberOf SetCache
  3210. * @param {*} value The value to search for.
  3211. * @returns {number} Returns `true` if `value` is found, else `false`.
  3212. */
  3213. function setCacheHas(value) {
  3214. return this.__data__.has(value);
  3215. }
  3216. // Add methods to `SetCache`.
  3217. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3218. SetCache.prototype.has = setCacheHas;
  3219. /*------------------------------------------------------------------------*/
  3220. /**
  3221. * Creates a stack cache object to store key-value pairs.
  3222. *
  3223. * @private
  3224. * @constructor
  3225. * @param {Array} [entries] The key-value pairs to cache.
  3226. */
  3227. function Stack(entries) {
  3228. var data = this.__data__ = new ListCache(entries);
  3229. this.size = data.size;
  3230. }
  3231. /**
  3232. * Removes all key-value entries from the stack.
  3233. *
  3234. * @private
  3235. * @name clear
  3236. * @memberOf Stack
  3237. */
  3238. function stackClear() {
  3239. this.__data__ = new ListCache;
  3240. this.size = 0;
  3241. }
  3242. /**
  3243. * Removes `key` and its value from the stack.
  3244. *
  3245. * @private
  3246. * @name delete
  3247. * @memberOf Stack
  3248. * @param {string} key The key of the value to remove.
  3249. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3250. */
  3251. function stackDelete(key) {
  3252. var data = this.__data__,
  3253. result = data['delete'](key);
  3254. this.size = data.size;
  3255. return result;
  3256. }
  3257. /**
  3258. * Gets the stack value for `key`.
  3259. *
  3260. * @private
  3261. * @name get
  3262. * @memberOf Stack
  3263. * @param {string} key The key of the value to get.
  3264. * @returns {*} Returns the entry value.
  3265. */
  3266. function stackGet(key) {
  3267. return this.__data__.get(key);
  3268. }
  3269. /**
  3270. * Checks if a stack value for `key` exists.
  3271. *
  3272. * @private
  3273. * @name has
  3274. * @memberOf Stack
  3275. * @param {string} key The key of the entry to check.
  3276. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3277. */
  3278. function stackHas(key) {
  3279. return this.__data__.has(key);
  3280. }
  3281. /**
  3282. * Sets the stack `key` to `value`.
  3283. *
  3284. * @private
  3285. * @name set
  3286. * @memberOf Stack
  3287. * @param {string} key The key of the value to set.
  3288. * @param {*} value The value to set.
  3289. * @returns {Object} Returns the stack cache instance.
  3290. */
  3291. function stackSet(key, value) {
  3292. var data = this.__data__;
  3293. if (data instanceof ListCache) {
  3294. var pairs = data.__data__;
  3295. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3296. pairs.push([key, value]);
  3297. this.size = ++data.size;
  3298. return this;
  3299. }
  3300. data = this.__data__ = new MapCache(pairs);
  3301. }
  3302. data.set(key, value);
  3303. this.size = data.size;
  3304. return this;
  3305. }
  3306. // Add methods to `Stack`.
  3307. Stack.prototype.clear = stackClear;
  3308. Stack.prototype['delete'] = stackDelete;
  3309. Stack.prototype.get = stackGet;
  3310. Stack.prototype.has = stackHas;
  3311. Stack.prototype.set = stackSet;
  3312. /*------------------------------------------------------------------------*/
  3313. /**
  3314. * Creates an array of the enumerable property names of the array-like `value`.
  3315. *
  3316. * @private
  3317. * @param {*} value The value to query.
  3318. * @param {boolean} inherited Specify returning inherited property names.
  3319. * @returns {Array} Returns the array of property names.
  3320. */
  3321. function arrayLikeKeys(value, inherited) {
  3322. var isArr = isArray(value),
  3323. isArg = !isArr && isArguments(value),
  3324. isBuff = !isArr && !isArg && isBuffer(value),
  3325. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3326. skipIndexes = isArr || isArg || isBuff || isType,
  3327. result = skipIndexes ? baseTimes(value.length, String) : [],
  3328. length = result.length;
  3329. for (var key in value) {
  3330. if ((inherited || hasOwnProperty.call(value, key)) &&
  3331. !(skipIndexes && (
  3332. // Safari 9 has enumerable `arguments.length` in strict mode.
  3333. key == 'length' ||
  3334. // Node.js 0.10 has enumerable non-index properties on buffers.
  3335. (isBuff && (key == 'offset' || key == 'parent')) ||
  3336. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3337. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3338. // Skip index properties.
  3339. isIndex(key, length)
  3340. ))) {
  3341. result.push(key);
  3342. }
  3343. }
  3344. return result;
  3345. }
  3346. /**
  3347. * A specialized version of `_.sample` for arrays.
  3348. *
  3349. * @private
  3350. * @param {Array} array The array to sample.
  3351. * @returns {*} Returns the random element.
  3352. */
  3353. function arraySample(array) {
  3354. var length = array.length;
  3355. return length ? array[baseRandom(0, length - 1)] : undefined;
  3356. }
  3357. /**
  3358. * A specialized version of `_.sampleSize` for arrays.
  3359. *
  3360. * @private
  3361. * @param {Array} array The array to sample.
  3362. * @param {number} n The number of elements to sample.
  3363. * @returns {Array} Returns the random elements.
  3364. */
  3365. function arraySampleSize(array, n) {
  3366. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3367. }
  3368. /**
  3369. * A specialized version of `_.shuffle` for arrays.
  3370. *
  3371. * @private
  3372. * @param {Array} array The array to shuffle.
  3373. * @returns {Array} Returns the new shuffled array.
  3374. */
  3375. function arrayShuffle(array) {
  3376. return shuffleSelf(copyArray(array));
  3377. }
  3378. /**
  3379. * This function is like `assignValue` except that it doesn't assign
  3380. * `undefined` values.
  3381. *
  3382. * @private
  3383. * @param {Object} object The object to modify.
  3384. * @param {string} key The key of the property to assign.
  3385. * @param {*} value The value to assign.
  3386. */
  3387. function assignMergeValue(object, key, value) {
  3388. if ((value !== undefined && !eq(object[key], value)) ||
  3389. (value === undefined && !(key in object))) {
  3390. baseAssignValue(object, key, value);
  3391. }
  3392. }
  3393. /**
  3394. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3395. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3396. * for equality comparisons.
  3397. *
  3398. * @private
  3399. * @param {Object} object The object to modify.
  3400. * @param {string} key The key of the property to assign.
  3401. * @param {*} value The value to assign.
  3402. */
  3403. function assignValue(object, key, value) {
  3404. var objValue = object[key];
  3405. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3406. (value === undefined && !(key in object))) {
  3407. baseAssignValue(object, key, value);
  3408. }
  3409. }
  3410. /**
  3411. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3412. *
  3413. * @private
  3414. * @param {Array} array The array to inspect.
  3415. * @param {*} key The key to search for.
  3416. * @returns {number} Returns the index of the matched value, else `-1`.
  3417. */
  3418. function assocIndexOf(array, key) {
  3419. var length = array.length;
  3420. while (length--) {
  3421. if (eq(array[length][0], key)) {
  3422. return length;
  3423. }
  3424. }
  3425. return -1;
  3426. }
  3427. /**
  3428. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3429. * by `iteratee` and values set by `setter`.
  3430. *
  3431. * @private
  3432. * @param {Array|Object} collection The collection to iterate over.
  3433. * @param {Function} setter The function to set `accumulator` values.
  3434. * @param {Function} iteratee The iteratee to transform keys.
  3435. * @param {Object} accumulator The initial aggregated object.
  3436. * @returns {Function} Returns `accumulator`.
  3437. */
  3438. function baseAggregator(collection, setter, iteratee, accumulator) {
  3439. baseEach(collection, function(value, key, collection) {
  3440. setter(accumulator, value, iteratee(value), collection);
  3441. });
  3442. return accumulator;
  3443. }
  3444. /**
  3445. * The base implementation of `_.assign` without support for multiple sources
  3446. * or `customizer` functions.
  3447. *
  3448. * @private
  3449. * @param {Object} object The destination object.
  3450. * @param {Object} source The source object.
  3451. * @returns {Object} Returns `object`.
  3452. */
  3453. function baseAssign(object, source) {
  3454. return object && copyObject(source, keys(source), object);
  3455. }
  3456. /**
  3457. * The base implementation of `_.assignIn` without support for multiple sources
  3458. * or `customizer` functions.
  3459. *
  3460. * @private
  3461. * @param {Object} object The destination object.
  3462. * @param {Object} source The source object.
  3463. * @returns {Object} Returns `object`.
  3464. */
  3465. function baseAssignIn(object, source) {
  3466. return object && copyObject(source, keysIn(source), object);
  3467. }
  3468. /**
  3469. * The base implementation of `assignValue` and `assignMergeValue` without
  3470. * value checks.
  3471. *
  3472. * @private
  3473. * @param {Object} object The object to modify.
  3474. * @param {string} key The key of the property to assign.
  3475. * @param {*} value The value to assign.
  3476. */
  3477. function baseAssignValue(object, key, value) {
  3478. if (key == '__proto__' && defineProperty) {
  3479. defineProperty(object, key, {
  3480. 'configurable': true,
  3481. 'enumerable': true,
  3482. 'value': value,
  3483. 'writable': true
  3484. });
  3485. } else {
  3486. object[key] = value;
  3487. }
  3488. }
  3489. /**
  3490. * The base implementation of `_.at` without support for individual paths.
  3491. *
  3492. * @private
  3493. * @param {Object} object The object to iterate over.
  3494. * @param {string[]} paths The property paths to pick.
  3495. * @returns {Array} Returns the picked elements.
  3496. */
  3497. function baseAt(object, paths) {
  3498. var index = -1,
  3499. length = paths.length,
  3500. result = Array(length),
  3501. skip = object == null;
  3502. while (++index < length) {
  3503. result[index] = skip ? undefined : get(object, paths[index]);
  3504. }
  3505. return result;
  3506. }
  3507. /**
  3508. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3509. *
  3510. * @private
  3511. * @param {number} number The number to clamp.
  3512. * @param {number} [lower] The lower bound.
  3513. * @param {number} upper The upper bound.
  3514. * @returns {number} Returns the clamped number.
  3515. */
  3516. function baseClamp(number, lower, upper) {
  3517. if (number === number) {
  3518. if (upper !== undefined) {
  3519. number = number <= upper ? number : upper;
  3520. }
  3521. if (lower !== undefined) {
  3522. number = number >= lower ? number : lower;
  3523. }
  3524. }
  3525. return number;
  3526. }
  3527. /**
  3528. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3529. * traversed objects.
  3530. *
  3531. * @private
  3532. * @param {*} value The value to clone.
  3533. * @param {boolean} bitmask The bitmask flags.
  3534. * 1 - Deep clone
  3535. * 2 - Flatten inherited properties
  3536. * 4 - Clone symbols
  3537. * @param {Function} [customizer] The function to customize cloning.
  3538. * @param {string} [key] The key of `value`.
  3539. * @param {Object} [object] The parent object of `value`.
  3540. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3541. * @returns {*} Returns the cloned value.
  3542. */
  3543. function baseClone(value, bitmask, customizer, key, object, stack) {
  3544. var result,
  3545. isDeep = bitmask & CLONE_DEEP_FLAG,
  3546. isFlat = bitmask & CLONE_FLAT_FLAG,
  3547. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3548. if (customizer) {
  3549. result = object ? customizer(value, key, object, stack) : customizer(value);
  3550. }
  3551. if (result !== undefined) {
  3552. return result;
  3553. }
  3554. if (!isObject(value)) {
  3555. return value;
  3556. }
  3557. var isArr = isArray(value);
  3558. if (isArr) {
  3559. result = initCloneArray(value);
  3560. if (!isDeep) {
  3561. return copyArray(value, result);
  3562. }
  3563. } else {
  3564. var tag = getTag(value),
  3565. isFunc = tag == funcTag || tag == genTag;
  3566. if (isBuffer(value)) {
  3567. return cloneBuffer(value, isDeep);
  3568. }
  3569. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3570. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3571. if (!isDeep) {
  3572. return isFlat
  3573. ? copySymbolsIn(value, baseAssignIn(result, value))
  3574. : copySymbols(value, baseAssign(result, value));
  3575. }
  3576. } else {
  3577. if (!cloneableTags[tag]) {
  3578. return object ? value : {};
  3579. }
  3580. result = initCloneByTag(value, tag, isDeep);
  3581. }
  3582. }
  3583. // Check for circular references and return its corresponding clone.
  3584. stack || (stack = new Stack);
  3585. var stacked = stack.get(value);
  3586. if (stacked) {
  3587. return stacked;
  3588. }
  3589. stack.set(value, result);
  3590. if (isSet(value)) {
  3591. value.forEach(function(subValue) {
  3592. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3593. });
  3594. } else if (isMap(value)) {
  3595. value.forEach(function(subValue, key) {
  3596. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3597. });
  3598. }
  3599. var keysFunc = isFull
  3600. ? (isFlat ? getAllKeysIn : getAllKeys)
  3601. : (isFlat ? keysIn : keys);
  3602. var props = isArr ? undefined : keysFunc(value);
  3603. arrayEach(props || value, function(subValue, key) {
  3604. if (props) {
  3605. key = subValue;
  3606. subValue = value[key];
  3607. }
  3608. // Recursively populate clone (susceptible to call stack limits).
  3609. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3610. });
  3611. return result;
  3612. }
  3613. /**
  3614. * The base implementation of `_.conforms` which doesn't clone `source`.
  3615. *
  3616. * @private
  3617. * @param {Object} source The object of property predicates to conform to.
  3618. * @returns {Function} Returns the new spec function.
  3619. */
  3620. function baseConforms(source) {
  3621. var props = keys(source);
  3622. return function(object) {
  3623. return baseConformsTo(object, source, props);
  3624. };
  3625. }
  3626. /**
  3627. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3628. *
  3629. * @private
  3630. * @param {Object} object The object to inspect.
  3631. * @param {Object} source The object of property predicates to conform to.
  3632. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3633. */
  3634. function baseConformsTo(object, source, props) {
  3635. var length = props.length;
  3636. if (object == null) {
  3637. return !length;
  3638. }
  3639. object = Object(object);
  3640. while (length--) {
  3641. var key = props[length],
  3642. predicate = source[key],
  3643. value = object[key];
  3644. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3645. return false;
  3646. }
  3647. }
  3648. return true;
  3649. }
  3650. /**
  3651. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3652. * to provide to `func`.
  3653. *
  3654. * @private
  3655. * @param {Function} func The function to delay.
  3656. * @param {number} wait The number of milliseconds to delay invocation.
  3657. * @param {Array} args The arguments to provide to `func`.
  3658. * @returns {number|Object} Returns the timer id or timeout object.
  3659. */
  3660. function baseDelay(func, wait, args) {
  3661. if (typeof func != 'function') {
  3662. throw new TypeError(FUNC_ERROR_TEXT);
  3663. }
  3664. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3665. }
  3666. /**
  3667. * The base implementation of methods like `_.difference` without support
  3668. * for excluding multiple arrays or iteratee shorthands.
  3669. *
  3670. * @private
  3671. * @param {Array} array The array to inspect.
  3672. * @param {Array} values The values to exclude.
  3673. * @param {Function} [iteratee] The iteratee invoked per element.
  3674. * @param {Function} [comparator] The comparator invoked per element.
  3675. * @returns {Array} Returns the new array of filtered values.
  3676. */
  3677. function baseDifference(array, values, iteratee, comparator) {
  3678. var index = -1,
  3679. includes = arrayIncludes,
  3680. isCommon = true,
  3681. length = array.length,
  3682. result = [],
  3683. valuesLength = values.length;
  3684. if (!length) {
  3685. return result;
  3686. }
  3687. if (iteratee) {
  3688. values = arrayMap(values, baseUnary(iteratee));
  3689. }
  3690. if (comparator) {
  3691. includes = arrayIncludesWith;
  3692. isCommon = false;
  3693. }
  3694. else if (values.length >= LARGE_ARRAY_SIZE) {
  3695. includes = cacheHas;
  3696. isCommon = false;
  3697. values = new SetCache(values);
  3698. }
  3699. outer:
  3700. while (++index < length) {
  3701. var value = array[index],
  3702. computed = iteratee == null ? value : iteratee(value);
  3703. value = (comparator || value !== 0) ? value : 0;
  3704. if (isCommon && computed === computed) {
  3705. var valuesIndex = valuesLength;
  3706. while (valuesIndex--) {
  3707. if (values[valuesIndex] === computed) {
  3708. continue outer;
  3709. }
  3710. }
  3711. result.push(value);
  3712. }
  3713. else if (!includes(values, computed, comparator)) {
  3714. result.push(value);
  3715. }
  3716. }
  3717. return result;
  3718. }
  3719. /**
  3720. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3721. *
  3722. * @private
  3723. * @param {Array|Object} collection The collection to iterate over.
  3724. * @param {Function} iteratee The function invoked per iteration.
  3725. * @returns {Array|Object} Returns `collection`.
  3726. */
  3727. var baseEach = createBaseEach(baseForOwn);
  3728. /**
  3729. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3730. *
  3731. * @private
  3732. * @param {Array|Object} collection The collection to iterate over.
  3733. * @param {Function} iteratee The function invoked per iteration.
  3734. * @returns {Array|Object} Returns `collection`.
  3735. */
  3736. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3737. /**
  3738. * The base implementation of `_.every` without support for iteratee shorthands.
  3739. *
  3740. * @private
  3741. * @param {Array|Object} collection The collection to iterate over.
  3742. * @param {Function} predicate The function invoked per iteration.
  3743. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3744. * else `false`
  3745. */
  3746. function baseEvery(collection, predicate) {
  3747. var result = true;
  3748. baseEach(collection, function(value, index, collection) {
  3749. result = !!predicate(value, index, collection);
  3750. return result;
  3751. });
  3752. return result;
  3753. }
  3754. /**
  3755. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3756. * `comparator` to determine the extremum value.
  3757. *
  3758. * @private
  3759. * @param {Array} array The array to iterate over.
  3760. * @param {Function} iteratee The iteratee invoked per iteration.
  3761. * @param {Function} comparator The comparator used to compare values.
  3762. * @returns {*} Returns the extremum value.
  3763. */
  3764. function baseExtremum(array, iteratee, comparator) {
  3765. var index = -1,
  3766. length = array.length;
  3767. while (++index < length) {
  3768. var value = array[index],
  3769. current = iteratee(value);
  3770. if (current != null && (computed === undefined
  3771. ? (current === current && !isSymbol(current))
  3772. : comparator(current, computed)
  3773. )) {
  3774. var computed = current,
  3775. result = value;
  3776. }
  3777. }
  3778. return result;
  3779. }
  3780. /**
  3781. * The base implementation of `_.fill` without an iteratee call guard.
  3782. *
  3783. * @private
  3784. * @param {Array} array The array to fill.
  3785. * @param {*} value The value to fill `array` with.
  3786. * @param {number} [start=0] The start position.
  3787. * @param {number} [end=array.length] The end position.
  3788. * @returns {Array} Returns `array`.
  3789. */
  3790. function baseFill(array, value, start, end) {
  3791. var length = array.length;
  3792. start = toInteger(start);
  3793. if (start < 0) {
  3794. start = -start > length ? 0 : (length + start);
  3795. }
  3796. end = (end === undefined || end > length) ? length : toInteger(end);
  3797. if (end < 0) {
  3798. end += length;
  3799. }
  3800. end = start > end ? 0 : toLength(end);
  3801. while (start < end) {
  3802. array[start++] = value;
  3803. }
  3804. return array;
  3805. }
  3806. /**
  3807. * The base implementation of `_.filter` without support for iteratee shorthands.
  3808. *
  3809. * @private
  3810. * @param {Array|Object} collection The collection to iterate over.
  3811. * @param {Function} predicate The function invoked per iteration.
  3812. * @returns {Array} Returns the new filtered array.
  3813. */
  3814. function baseFilter(collection, predicate) {
  3815. var result = [];
  3816. baseEach(collection, function(value, index, collection) {
  3817. if (predicate(value, index, collection)) {
  3818. result.push(value);
  3819. }
  3820. });
  3821. return result;
  3822. }
  3823. /**
  3824. * The base implementation of `_.flatten` with support for restricting flattening.
  3825. *
  3826. * @private
  3827. * @param {Array} array The array to flatten.
  3828. * @param {number} depth The maximum recursion depth.
  3829. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3830. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3831. * @param {Array} [result=[]] The initial result value.
  3832. * @returns {Array} Returns the new flattened array.
  3833. */
  3834. function baseFlatten(array, depth, predicate, isStrict, result) {
  3835. var index = -1,
  3836. length = array.length;
  3837. predicate || (predicate = isFlattenable);
  3838. result || (result = []);
  3839. while (++index < length) {
  3840. var value = array[index];
  3841. if (depth > 0 && predicate(value)) {
  3842. if (depth > 1) {
  3843. // Recursively flatten arrays (susceptible to call stack limits).
  3844. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3845. } else {
  3846. arrayPush(result, value);
  3847. }
  3848. } else if (!isStrict) {
  3849. result[result.length] = value;
  3850. }
  3851. }
  3852. return result;
  3853. }
  3854. /**
  3855. * The base implementation of `baseForOwn` which iterates over `object`
  3856. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3857. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3858. *
  3859. * @private
  3860. * @param {Object} object The object to iterate over.
  3861. * @param {Function} iteratee The function invoked per iteration.
  3862. * @param {Function} keysFunc The function to get the keys of `object`.
  3863. * @returns {Object} Returns `object`.
  3864. */
  3865. var baseFor = createBaseFor();
  3866. /**
  3867. * This function is like `baseFor` except that it iterates over properties
  3868. * in the opposite order.
  3869. *
  3870. * @private
  3871. * @param {Object} object The object to iterate over.
  3872. * @param {Function} iteratee The function invoked per iteration.
  3873. * @param {Function} keysFunc The function to get the keys of `object`.
  3874. * @returns {Object} Returns `object`.
  3875. */
  3876. var baseForRight = createBaseFor(true);
  3877. /**
  3878. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3879. *
  3880. * @private
  3881. * @param {Object} object The object to iterate over.
  3882. * @param {Function} iteratee The function invoked per iteration.
  3883. * @returns {Object} Returns `object`.
  3884. */
  3885. function baseForOwn(object, iteratee) {
  3886. return object && baseFor(object, iteratee, keys);
  3887. }
  3888. /**
  3889. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3890. *
  3891. * @private
  3892. * @param {Object} object The object to iterate over.
  3893. * @param {Function} iteratee The function invoked per iteration.
  3894. * @returns {Object} Returns `object`.
  3895. */
  3896. function baseForOwnRight(object, iteratee) {
  3897. return object && baseForRight(object, iteratee, keys);
  3898. }
  3899. /**
  3900. * The base implementation of `_.functions` which creates an array of
  3901. * `object` function property names filtered from `props`.
  3902. *
  3903. * @private
  3904. * @param {Object} object The object to inspect.
  3905. * @param {Array} props The property names to filter.
  3906. * @returns {Array} Returns the function names.
  3907. */
  3908. function baseFunctions(object, props) {
  3909. return arrayFilter(props, function(key) {
  3910. return isFunction(object[key]);
  3911. });
  3912. }
  3913. /**
  3914. * The base implementation of `_.get` without support for default values.
  3915. *
  3916. * @private
  3917. * @param {Object} object The object to query.
  3918. * @param {Array|string} path The path of the property to get.
  3919. * @returns {*} Returns the resolved value.
  3920. */
  3921. function baseGet(object, path) {
  3922. path = castPath(path, object);
  3923. var index = 0,
  3924. length = path.length;
  3925. while (object != null && index < length) {
  3926. object = object[toKey(path[index++])];
  3927. }
  3928. return (index && index == length) ? object : undefined;
  3929. }
  3930. /**
  3931. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3932. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3933. * symbols of `object`.
  3934. *
  3935. * @private
  3936. * @param {Object} object The object to query.
  3937. * @param {Function} keysFunc The function to get the keys of `object`.
  3938. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3939. * @returns {Array} Returns the array of property names and symbols.
  3940. */
  3941. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3942. var result = keysFunc(object);
  3943. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3944. }
  3945. /**
  3946. * The base implementation of `getTag` without fallbacks for buggy environments.
  3947. *
  3948. * @private
  3949. * @param {*} value The value to query.
  3950. * @returns {string} Returns the `toStringTag`.
  3951. */
  3952. function baseGetTag(value) {
  3953. if (value == null) {
  3954. return value === undefined ? undefinedTag : nullTag;
  3955. }
  3956. return (symToStringTag && symToStringTag in Object(value))
  3957. ? getRawTag(value)
  3958. : objectToString(value);
  3959. }
  3960. /**
  3961. * The base implementation of `_.gt` which doesn't coerce arguments.
  3962. *
  3963. * @private
  3964. * @param {*} value The value to compare.
  3965. * @param {*} other The other value to compare.
  3966. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3967. * else `false`.
  3968. */
  3969. function baseGt(value, other) {
  3970. return value > other;
  3971. }
  3972. /**
  3973. * The base implementation of `_.has` without support for deep paths.
  3974. *
  3975. * @private
  3976. * @param {Object} [object] The object to query.
  3977. * @param {Array|string} key The key to check.
  3978. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3979. */
  3980. function baseHas(object, key) {
  3981. return object != null && hasOwnProperty.call(object, key);
  3982. }
  3983. /**
  3984. * The base implementation of `_.hasIn` without support for deep paths.
  3985. *
  3986. * @private
  3987. * @param {Object} [object] The object to query.
  3988. * @param {Array|string} key The key to check.
  3989. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3990. */
  3991. function baseHasIn(object, key) {
  3992. return object != null && key in Object(object);
  3993. }
  3994. /**
  3995. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3996. *
  3997. * @private
  3998. * @param {number} number The number to check.
  3999. * @param {number} start The start of the range.
  4000. * @param {number} end The end of the range.
  4001. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4002. */
  4003. function baseInRange(number, start, end) {
  4004. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4005. }
  4006. /**
  4007. * The base implementation of methods like `_.intersection`, without support
  4008. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4009. *
  4010. * @private
  4011. * @param {Array} arrays The arrays to inspect.
  4012. * @param {Function} [iteratee] The iteratee invoked per element.
  4013. * @param {Function} [comparator] The comparator invoked per element.
  4014. * @returns {Array} Returns the new array of shared values.
  4015. */
  4016. function baseIntersection(arrays, iteratee, comparator) {
  4017. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4018. length = arrays[0].length,
  4019. othLength = arrays.length,
  4020. othIndex = othLength,
  4021. caches = Array(othLength),
  4022. maxLength = Infinity,
  4023. result = [];
  4024. while (othIndex--) {
  4025. var array = arrays[othIndex];
  4026. if (othIndex && iteratee) {
  4027. array = arrayMap(array, baseUnary(iteratee));
  4028. }
  4029. maxLength = nativeMin(array.length, maxLength);
  4030. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4031. ? new SetCache(othIndex && array)
  4032. : undefined;
  4033. }
  4034. array = arrays[0];
  4035. var index = -1,
  4036. seen = caches[0];
  4037. outer:
  4038. while (++index < length && result.length < maxLength) {
  4039. var value = array[index],
  4040. computed = iteratee ? iteratee(value) : value;
  4041. value = (comparator || value !== 0) ? value : 0;
  4042. if (!(seen
  4043. ? cacheHas(seen, computed)
  4044. : includes(result, computed, comparator)
  4045. )) {
  4046. othIndex = othLength;
  4047. while (--othIndex) {
  4048. var cache = caches[othIndex];
  4049. if (!(cache
  4050. ? cacheHas(cache, computed)
  4051. : includes(arrays[othIndex], computed, comparator))
  4052. ) {
  4053. continue outer;
  4054. }
  4055. }
  4056. if (seen) {
  4057. seen.push(computed);
  4058. }
  4059. result.push(value);
  4060. }
  4061. }
  4062. return result;
  4063. }
  4064. /**
  4065. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4066. * `object` with values transformed by `iteratee` and set by `setter`.
  4067. *
  4068. * @private
  4069. * @param {Object} object The object to iterate over.
  4070. * @param {Function} setter The function to set `accumulator` values.
  4071. * @param {Function} iteratee The iteratee to transform values.
  4072. * @param {Object} accumulator The initial inverted object.
  4073. * @returns {Function} Returns `accumulator`.
  4074. */
  4075. function baseInverter(object, setter, iteratee, accumulator) {
  4076. baseForOwn(object, function(value, key, object) {
  4077. setter(accumulator, iteratee(value), key, object);
  4078. });
  4079. return accumulator;
  4080. }
  4081. /**
  4082. * The base implementation of `_.invoke` without support for individual
  4083. * method arguments.
  4084. *
  4085. * @private
  4086. * @param {Object} object The object to query.
  4087. * @param {Array|string} path The path of the method to invoke.
  4088. * @param {Array} args The arguments to invoke the method with.
  4089. * @returns {*} Returns the result of the invoked method.
  4090. */
  4091. function baseInvoke(object, path, args) {
  4092. path = castPath(path, object);
  4093. object = parent(object, path);
  4094. var func = object == null ? object : object[toKey(last(path))];
  4095. return func == null ? undefined : apply(func, object, args);
  4096. }
  4097. /**
  4098. * The base implementation of `_.isArguments`.
  4099. *
  4100. * @private
  4101. * @param {*} value The value to check.
  4102. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4103. */
  4104. function baseIsArguments(value) {
  4105. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4106. }
  4107. /**
  4108. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4109. *
  4110. * @private
  4111. * @param {*} value The value to check.
  4112. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4113. */
  4114. function baseIsArrayBuffer(value) {
  4115. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4116. }
  4117. /**
  4118. * The base implementation of `_.isDate` without Node.js optimizations.
  4119. *
  4120. * @private
  4121. * @param {*} value The value to check.
  4122. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4123. */
  4124. function baseIsDate(value) {
  4125. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4126. }
  4127. /**
  4128. * The base implementation of `_.isEqual` which supports partial comparisons
  4129. * and tracks traversed objects.
  4130. *
  4131. * @private
  4132. * @param {*} value The value to compare.
  4133. * @param {*} other The other value to compare.
  4134. * @param {boolean} bitmask The bitmask flags.
  4135. * 1 - Unordered comparison
  4136. * 2 - Partial comparison
  4137. * @param {Function} [customizer] The function to customize comparisons.
  4138. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4139. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4140. */
  4141. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4142. if (value === other) {
  4143. return true;
  4144. }
  4145. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4146. return value !== value && other !== other;
  4147. }
  4148. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4149. }
  4150. /**
  4151. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4152. * deep comparisons and tracks traversed objects enabling objects with circular
  4153. * references to be compared.
  4154. *
  4155. * @private
  4156. * @param {Object} object The object to compare.
  4157. * @param {Object} other The other object to compare.
  4158. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4159. * @param {Function} customizer The function to customize comparisons.
  4160. * @param {Function} equalFunc The function to determine equivalents of values.
  4161. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4162. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4163. */
  4164. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4165. var objIsArr = isArray(object),
  4166. othIsArr = isArray(other),
  4167. objTag = objIsArr ? arrayTag : getTag(object),
  4168. othTag = othIsArr ? arrayTag : getTag(other);
  4169. objTag = objTag == argsTag ? objectTag : objTag;
  4170. othTag = othTag == argsTag ? objectTag : othTag;
  4171. var objIsObj = objTag == objectTag,
  4172. othIsObj = othTag == objectTag,
  4173. isSameTag = objTag == othTag;
  4174. if (isSameTag && isBuffer(object)) {
  4175. if (!isBuffer(other)) {
  4176. return false;
  4177. }
  4178. objIsArr = true;
  4179. objIsObj = false;
  4180. }
  4181. if (isSameTag && !objIsObj) {
  4182. stack || (stack = new Stack);
  4183. return (objIsArr || isTypedArray(object))
  4184. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4185. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4186. }
  4187. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4188. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4189. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4190. if (objIsWrapped || othIsWrapped) {
  4191. var objUnwrapped = objIsWrapped ? object.value() : object,
  4192. othUnwrapped = othIsWrapped ? other.value() : other;
  4193. stack || (stack = new Stack);
  4194. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4195. }
  4196. }
  4197. if (!isSameTag) {
  4198. return false;
  4199. }
  4200. stack || (stack = new Stack);
  4201. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4202. }
  4203. /**
  4204. * The base implementation of `_.isMap` without Node.js optimizations.
  4205. *
  4206. * @private
  4207. * @param {*} value The value to check.
  4208. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4209. */
  4210. function baseIsMap(value) {
  4211. return isObjectLike(value) && getTag(value) == mapTag;
  4212. }
  4213. /**
  4214. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4215. *
  4216. * @private
  4217. * @param {Object} object The object to inspect.
  4218. * @param {Object} source The object of property values to match.
  4219. * @param {Array} matchData The property names, values, and compare flags to match.
  4220. * @param {Function} [customizer] The function to customize comparisons.
  4221. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4222. */
  4223. function baseIsMatch(object, source, matchData, customizer) {
  4224. var index = matchData.length,
  4225. length = index,
  4226. noCustomizer = !customizer;
  4227. if (object == null) {
  4228. return !length;
  4229. }
  4230. object = Object(object);
  4231. while (index--) {
  4232. var data = matchData[index];
  4233. if ((noCustomizer && data[2])
  4234. ? data[1] !== object[data[0]]
  4235. : !(data[0] in object)
  4236. ) {
  4237. return false;
  4238. }
  4239. }
  4240. while (++index < length) {
  4241. data = matchData[index];
  4242. var key = data[0],
  4243. objValue = object[key],
  4244. srcValue = data[1];
  4245. if (noCustomizer && data[2]) {
  4246. if (objValue === undefined && !(key in object)) {
  4247. return false;
  4248. }
  4249. } else {
  4250. var stack = new Stack;
  4251. if (customizer) {
  4252. var result = customizer(objValue, srcValue, key, object, source, stack);
  4253. }
  4254. if (!(result === undefined
  4255. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4256. : result
  4257. )) {
  4258. return false;
  4259. }
  4260. }
  4261. }
  4262. return true;
  4263. }
  4264. /**
  4265. * The base implementation of `_.isNative` without bad shim checks.
  4266. *
  4267. * @private
  4268. * @param {*} value The value to check.
  4269. * @returns {boolean} Returns `true` if `value` is a native function,
  4270. * else `false`.
  4271. */
  4272. function baseIsNative(value) {
  4273. if (!isObject(value) || isMasked(value)) {
  4274. return false;
  4275. }
  4276. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4277. return pattern.test(toSource(value));
  4278. }
  4279. /**
  4280. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4281. *
  4282. * @private
  4283. * @param {*} value The value to check.
  4284. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4285. */
  4286. function baseIsRegExp(value) {
  4287. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4288. }
  4289. /**
  4290. * The base implementation of `_.isSet` without Node.js optimizations.
  4291. *
  4292. * @private
  4293. * @param {*} value The value to check.
  4294. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4295. */
  4296. function baseIsSet(value) {
  4297. return isObjectLike(value) && getTag(value) == setTag;
  4298. }
  4299. /**
  4300. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4301. *
  4302. * @private
  4303. * @param {*} value The value to check.
  4304. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4305. */
  4306. function baseIsTypedArray(value) {
  4307. return isObjectLike(value) &&
  4308. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4309. }
  4310. /**
  4311. * The base implementation of `_.iteratee`.
  4312. *
  4313. * @private
  4314. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4315. * @returns {Function} Returns the iteratee.
  4316. */
  4317. function baseIteratee(value) {
  4318. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4319. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4320. if (typeof value == 'function') {
  4321. return value;
  4322. }
  4323. if (value == null) {
  4324. return identity;
  4325. }
  4326. if (typeof value == 'object') {
  4327. return isArray(value)
  4328. ? baseMatchesProperty(value[0], value[1])
  4329. : baseMatches(value);
  4330. }
  4331. return property(value);
  4332. }
  4333. /**
  4334. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4335. *
  4336. * @private
  4337. * @param {Object} object The object to query.
  4338. * @returns {Array} Returns the array of property names.
  4339. */
  4340. function baseKeys(object) {
  4341. if (!isPrototype(object)) {
  4342. return nativeKeys(object);
  4343. }
  4344. var result = [];
  4345. for (var key in Object(object)) {
  4346. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4347. result.push(key);
  4348. }
  4349. }
  4350. return result;
  4351. }
  4352. /**
  4353. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4354. *
  4355. * @private
  4356. * @param {Object} object The object to query.
  4357. * @returns {Array} Returns the array of property names.
  4358. */
  4359. function baseKeysIn(object) {
  4360. if (!isObject(object)) {
  4361. return nativeKeysIn(object);
  4362. }
  4363. var isProto = isPrototype(object),
  4364. result = [];
  4365. for (var key in object) {
  4366. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4367. result.push(key);
  4368. }
  4369. }
  4370. return result;
  4371. }
  4372. /**
  4373. * The base implementation of `_.lt` which doesn't coerce arguments.
  4374. *
  4375. * @private
  4376. * @param {*} value The value to compare.
  4377. * @param {*} other The other value to compare.
  4378. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4379. * else `false`.
  4380. */
  4381. function baseLt(value, other) {
  4382. return value < other;
  4383. }
  4384. /**
  4385. * The base implementation of `_.map` without support for iteratee shorthands.
  4386. *
  4387. * @private
  4388. * @param {Array|Object} collection The collection to iterate over.
  4389. * @param {Function} iteratee The function invoked per iteration.
  4390. * @returns {Array} Returns the new mapped array.
  4391. */
  4392. function baseMap(collection, iteratee) {
  4393. var index = -1,
  4394. result = isArrayLike(collection) ? Array(collection.length) : [];
  4395. baseEach(collection, function(value, key, collection) {
  4396. result[++index] = iteratee(value, key, collection);
  4397. });
  4398. return result;
  4399. }
  4400. /**
  4401. * The base implementation of `_.matches` which doesn't clone `source`.
  4402. *
  4403. * @private
  4404. * @param {Object} source The object of property values to match.
  4405. * @returns {Function} Returns the new spec function.
  4406. */
  4407. function baseMatches(source) {
  4408. var matchData = getMatchData(source);
  4409. if (matchData.length == 1 && matchData[0][2]) {
  4410. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4411. }
  4412. return function(object) {
  4413. return object === source || baseIsMatch(object, source, matchData);
  4414. };
  4415. }
  4416. /**
  4417. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4418. *
  4419. * @private
  4420. * @param {string} path The path of the property to get.
  4421. * @param {*} srcValue The value to match.
  4422. * @returns {Function} Returns the new spec function.
  4423. */
  4424. function baseMatchesProperty(path, srcValue) {
  4425. if (isKey(path) && isStrictComparable(srcValue)) {
  4426. return matchesStrictComparable(toKey(path), srcValue);
  4427. }
  4428. return function(object) {
  4429. var objValue = get(object, path);
  4430. return (objValue === undefined && objValue === srcValue)
  4431. ? hasIn(object, path)
  4432. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4433. };
  4434. }
  4435. /**
  4436. * The base implementation of `_.merge` without support for multiple sources.
  4437. *
  4438. * @private
  4439. * @param {Object} object The destination object.
  4440. * @param {Object} source The source object.
  4441. * @param {number} srcIndex The index of `source`.
  4442. * @param {Function} [customizer] The function to customize merged values.
  4443. * @param {Object} [stack] Tracks traversed source values and their merged
  4444. * counterparts.
  4445. */
  4446. function baseMerge(object, source, srcIndex, customizer, stack) {
  4447. if (object === source) {
  4448. return;
  4449. }
  4450. baseFor(source, function(srcValue, key) {
  4451. stack || (stack = new Stack);
  4452. if (isObject(srcValue)) {
  4453. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4454. }
  4455. else {
  4456. var newValue = customizer
  4457. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4458. : undefined;
  4459. if (newValue === undefined) {
  4460. newValue = srcValue;
  4461. }
  4462. assignMergeValue(object, key, newValue);
  4463. }
  4464. }, keysIn);
  4465. }
  4466. /**
  4467. * A specialized version of `baseMerge` for arrays and objects which performs
  4468. * deep merges and tracks traversed objects enabling objects with circular
  4469. * references to be merged.
  4470. *
  4471. * @private
  4472. * @param {Object} object The destination object.
  4473. * @param {Object} source The source object.
  4474. * @param {string} key The key of the value to merge.
  4475. * @param {number} srcIndex The index of `source`.
  4476. * @param {Function} mergeFunc The function to merge values.
  4477. * @param {Function} [customizer] The function to customize assigned values.
  4478. * @param {Object} [stack] Tracks traversed source values and their merged
  4479. * counterparts.
  4480. */
  4481. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4482. var objValue = safeGet(object, key),
  4483. srcValue = safeGet(source, key),
  4484. stacked = stack.get(srcValue);
  4485. if (stacked) {
  4486. assignMergeValue(object, key, stacked);
  4487. return;
  4488. }
  4489. var newValue = customizer
  4490. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4491. : undefined;
  4492. var isCommon = newValue === undefined;
  4493. if (isCommon) {
  4494. var isArr = isArray(srcValue),
  4495. isBuff = !isArr && isBuffer(srcValue),
  4496. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4497. newValue = srcValue;
  4498. if (isArr || isBuff || isTyped) {
  4499. if (isArray(objValue)) {
  4500. newValue = objValue;
  4501. }
  4502. else if (isArrayLikeObject(objValue)) {
  4503. newValue = copyArray(objValue);
  4504. }
  4505. else if (isBuff) {
  4506. isCommon = false;
  4507. newValue = cloneBuffer(srcValue, true);
  4508. }
  4509. else if (isTyped) {
  4510. isCommon = false;
  4511. newValue = cloneTypedArray(srcValue, true);
  4512. }
  4513. else {
  4514. newValue = [];
  4515. }
  4516. }
  4517. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4518. newValue = objValue;
  4519. if (isArguments(objValue)) {
  4520. newValue = toPlainObject(objValue);
  4521. }
  4522. else if (!isObject(objValue) || isFunction(objValue)) {
  4523. newValue = initCloneObject(srcValue);
  4524. }
  4525. }
  4526. else {
  4527. isCommon = false;
  4528. }
  4529. }
  4530. if (isCommon) {
  4531. // Recursively merge objects and arrays (susceptible to call stack limits).
  4532. stack.set(srcValue, newValue);
  4533. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4534. stack['delete'](srcValue);
  4535. }
  4536. assignMergeValue(object, key, newValue);
  4537. }
  4538. /**
  4539. * The base implementation of `_.nth` which doesn't coerce arguments.
  4540. *
  4541. * @private
  4542. * @param {Array} array The array to query.
  4543. * @param {number} n The index of the element to return.
  4544. * @returns {*} Returns the nth element of `array`.
  4545. */
  4546. function baseNth(array, n) {
  4547. var length = array.length;
  4548. if (!length) {
  4549. return;
  4550. }
  4551. n += n < 0 ? length : 0;
  4552. return isIndex(n, length) ? array[n] : undefined;
  4553. }
  4554. /**
  4555. * The base implementation of `_.orderBy` without param guards.
  4556. *
  4557. * @private
  4558. * @param {Array|Object} collection The collection to iterate over.
  4559. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4560. * @param {string[]} orders The sort orders of `iteratees`.
  4561. * @returns {Array} Returns the new sorted array.
  4562. */
  4563. function baseOrderBy(collection, iteratees, orders) {
  4564. if (iteratees.length) {
  4565. iteratees = arrayMap(iteratees, function(iteratee) {
  4566. if (isArray(iteratee)) {
  4567. return function(value) {
  4568. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4569. }
  4570. }
  4571. return iteratee;
  4572. });
  4573. } else {
  4574. iteratees = [identity];
  4575. }
  4576. var index = -1;
  4577. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4578. var result = baseMap(collection, function(value, key, collection) {
  4579. var criteria = arrayMap(iteratees, function(iteratee) {
  4580. return iteratee(value);
  4581. });
  4582. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4583. });
  4584. return baseSortBy(result, function(object, other) {
  4585. return compareMultiple(object, other, orders);
  4586. });
  4587. }
  4588. /**
  4589. * The base implementation of `_.pick` without support for individual
  4590. * property identifiers.
  4591. *
  4592. * @private
  4593. * @param {Object} object The source object.
  4594. * @param {string[]} paths The property paths to pick.
  4595. * @returns {Object} Returns the new object.
  4596. */
  4597. function basePick(object, paths) {
  4598. return basePickBy(object, paths, function(value, path) {
  4599. return hasIn(object, path);
  4600. });
  4601. }
  4602. /**
  4603. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4604. *
  4605. * @private
  4606. * @param {Object} object The source object.
  4607. * @param {string[]} paths The property paths to pick.
  4608. * @param {Function} predicate The function invoked per property.
  4609. * @returns {Object} Returns the new object.
  4610. */
  4611. function basePickBy(object, paths, predicate) {
  4612. var index = -1,
  4613. length = paths.length,
  4614. result = {};
  4615. while (++index < length) {
  4616. var path = paths[index],
  4617. value = baseGet(object, path);
  4618. if (predicate(value, path)) {
  4619. baseSet(result, castPath(path, object), value);
  4620. }
  4621. }
  4622. return result;
  4623. }
  4624. /**
  4625. * A specialized version of `baseProperty` which supports deep paths.
  4626. *
  4627. * @private
  4628. * @param {Array|string} path The path of the property to get.
  4629. * @returns {Function} Returns the new accessor function.
  4630. */
  4631. function basePropertyDeep(path) {
  4632. return function(object) {
  4633. return baseGet(object, path);
  4634. };
  4635. }
  4636. /**
  4637. * The base implementation of `_.pullAllBy` without support for iteratee
  4638. * shorthands.
  4639. *
  4640. * @private
  4641. * @param {Array} array The array to modify.
  4642. * @param {Array} values The values to remove.
  4643. * @param {Function} [iteratee] The iteratee invoked per element.
  4644. * @param {Function} [comparator] The comparator invoked per element.
  4645. * @returns {Array} Returns `array`.
  4646. */
  4647. function basePullAll(array, values, iteratee, comparator) {
  4648. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4649. index = -1,
  4650. length = values.length,
  4651. seen = array;
  4652. if (array === values) {
  4653. values = copyArray(values);
  4654. }
  4655. if (iteratee) {
  4656. seen = arrayMap(array, baseUnary(iteratee));
  4657. }
  4658. while (++index < length) {
  4659. var fromIndex = 0,
  4660. value = values[index],
  4661. computed = iteratee ? iteratee(value) : value;
  4662. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4663. if (seen !== array) {
  4664. splice.call(seen, fromIndex, 1);
  4665. }
  4666. splice.call(array, fromIndex, 1);
  4667. }
  4668. }
  4669. return array;
  4670. }
  4671. /**
  4672. * The base implementation of `_.pullAt` without support for individual
  4673. * indexes or capturing the removed elements.
  4674. *
  4675. * @private
  4676. * @param {Array} array The array to modify.
  4677. * @param {number[]} indexes The indexes of elements to remove.
  4678. * @returns {Array} Returns `array`.
  4679. */
  4680. function basePullAt(array, indexes) {
  4681. var length = array ? indexes.length : 0,
  4682. lastIndex = length - 1;
  4683. while (length--) {
  4684. var index = indexes[length];
  4685. if (length == lastIndex || index !== previous) {
  4686. var previous = index;
  4687. if (isIndex(index)) {
  4688. splice.call(array, index, 1);
  4689. } else {
  4690. baseUnset(array, index);
  4691. }
  4692. }
  4693. }
  4694. return array;
  4695. }
  4696. /**
  4697. * The base implementation of `_.random` without support for returning
  4698. * floating-point numbers.
  4699. *
  4700. * @private
  4701. * @param {number} lower The lower bound.
  4702. * @param {number} upper The upper bound.
  4703. * @returns {number} Returns the random number.
  4704. */
  4705. function baseRandom(lower, upper) {
  4706. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4707. }
  4708. /**
  4709. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4710. * coerce arguments.
  4711. *
  4712. * @private
  4713. * @param {number} start The start of the range.
  4714. * @param {number} end The end of the range.
  4715. * @param {number} step The value to increment or decrement by.
  4716. * @param {boolean} [fromRight] Specify iterating from right to left.
  4717. * @returns {Array} Returns the range of numbers.
  4718. */
  4719. function baseRange(start, end, step, fromRight) {
  4720. var index = -1,
  4721. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4722. result = Array(length);
  4723. while (length--) {
  4724. result[fromRight ? length : ++index] = start;
  4725. start += step;
  4726. }
  4727. return result;
  4728. }
  4729. /**
  4730. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4731. *
  4732. * @private
  4733. * @param {string} string The string to repeat.
  4734. * @param {number} n The number of times to repeat the string.
  4735. * @returns {string} Returns the repeated string.
  4736. */
  4737. function baseRepeat(string, n) {
  4738. var result = '';
  4739. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4740. return result;
  4741. }
  4742. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4743. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4744. do {
  4745. if (n % 2) {
  4746. result += string;
  4747. }
  4748. n = nativeFloor(n / 2);
  4749. if (n) {
  4750. string += string;
  4751. }
  4752. } while (n);
  4753. return result;
  4754. }
  4755. /**
  4756. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4757. *
  4758. * @private
  4759. * @param {Function} func The function to apply a rest parameter to.
  4760. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4761. * @returns {Function} Returns the new function.
  4762. */
  4763. function baseRest(func, start) {
  4764. return setToString(overRest(func, start, identity), func + '');
  4765. }
  4766. /**
  4767. * The base implementation of `_.sample`.
  4768. *
  4769. * @private
  4770. * @param {Array|Object} collection The collection to sample.
  4771. * @returns {*} Returns the random element.
  4772. */
  4773. function baseSample(collection) {
  4774. return arraySample(values(collection));
  4775. }
  4776. /**
  4777. * The base implementation of `_.sampleSize` without param guards.
  4778. *
  4779. * @private
  4780. * @param {Array|Object} collection The collection to sample.
  4781. * @param {number} n The number of elements to sample.
  4782. * @returns {Array} Returns the random elements.
  4783. */
  4784. function baseSampleSize(collection, n) {
  4785. var array = values(collection);
  4786. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4787. }
  4788. /**
  4789. * The base implementation of `_.set`.
  4790. *
  4791. * @private
  4792. * @param {Object} object The object to modify.
  4793. * @param {Array|string} path The path of the property to set.
  4794. * @param {*} value The value to set.
  4795. * @param {Function} [customizer] The function to customize path creation.
  4796. * @returns {Object} Returns `object`.
  4797. */
  4798. function baseSet(object, path, value, customizer) {
  4799. if (!isObject(object)) {
  4800. return object;
  4801. }
  4802. path = castPath(path, object);
  4803. var index = -1,
  4804. length = path.length,
  4805. lastIndex = length - 1,
  4806. nested = object;
  4807. while (nested != null && ++index < length) {
  4808. var key = toKey(path[index]),
  4809. newValue = value;
  4810. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4811. return object;
  4812. }
  4813. if (index != lastIndex) {
  4814. var objValue = nested[key];
  4815. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4816. if (newValue === undefined) {
  4817. newValue = isObject(objValue)
  4818. ? objValue
  4819. : (isIndex(path[index + 1]) ? [] : {});
  4820. }
  4821. }
  4822. assignValue(nested, key, newValue);
  4823. nested = nested[key];
  4824. }
  4825. return object;
  4826. }
  4827. /**
  4828. * The base implementation of `setData` without support for hot loop shorting.
  4829. *
  4830. * @private
  4831. * @param {Function} func The function to associate metadata with.
  4832. * @param {*} data The metadata.
  4833. * @returns {Function} Returns `func`.
  4834. */
  4835. var baseSetData = !metaMap ? identity : function(func, data) {
  4836. metaMap.set(func, data);
  4837. return func;
  4838. };
  4839. /**
  4840. * The base implementation of `setToString` without support for hot loop shorting.
  4841. *
  4842. * @private
  4843. * @param {Function} func The function to modify.
  4844. * @param {Function} string The `toString` result.
  4845. * @returns {Function} Returns `func`.
  4846. */
  4847. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4848. return defineProperty(func, 'toString', {
  4849. 'configurable': true,
  4850. 'enumerable': false,
  4851. 'value': constant(string),
  4852. 'writable': true
  4853. });
  4854. };
  4855. /**
  4856. * The base implementation of `_.shuffle`.
  4857. *
  4858. * @private
  4859. * @param {Array|Object} collection The collection to shuffle.
  4860. * @returns {Array} Returns the new shuffled array.
  4861. */
  4862. function baseShuffle(collection) {
  4863. return shuffleSelf(values(collection));
  4864. }
  4865. /**
  4866. * The base implementation of `_.slice` without an iteratee call guard.
  4867. *
  4868. * @private
  4869. * @param {Array} array The array to slice.
  4870. * @param {number} [start=0] The start position.
  4871. * @param {number} [end=array.length] The end position.
  4872. * @returns {Array} Returns the slice of `array`.
  4873. */
  4874. function baseSlice(array, start, end) {
  4875. var index = -1,
  4876. length = array.length;
  4877. if (start < 0) {
  4878. start = -start > length ? 0 : (length + start);
  4879. }
  4880. end = end > length ? length : end;
  4881. if (end < 0) {
  4882. end += length;
  4883. }
  4884. length = start > end ? 0 : ((end - start) >>> 0);
  4885. start >>>= 0;
  4886. var result = Array(length);
  4887. while (++index < length) {
  4888. result[index] = array[index + start];
  4889. }
  4890. return result;
  4891. }
  4892. /**
  4893. * The base implementation of `_.some` without support for iteratee shorthands.
  4894. *
  4895. * @private
  4896. * @param {Array|Object} collection The collection to iterate over.
  4897. * @param {Function} predicate The function invoked per iteration.
  4898. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4899. * else `false`.
  4900. */
  4901. function baseSome(collection, predicate) {
  4902. var result;
  4903. baseEach(collection, function(value, index, collection) {
  4904. result = predicate(value, index, collection);
  4905. return !result;
  4906. });
  4907. return !!result;
  4908. }
  4909. /**
  4910. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4911. * performs a binary search of `array` to determine the index at which `value`
  4912. * should be inserted into `array` in order to maintain its sort order.
  4913. *
  4914. * @private
  4915. * @param {Array} array The sorted array to inspect.
  4916. * @param {*} value The value to evaluate.
  4917. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4918. * @returns {number} Returns the index at which `value` should be inserted
  4919. * into `array`.
  4920. */
  4921. function baseSortedIndex(array, value, retHighest) {
  4922. var low = 0,
  4923. high = array == null ? low : array.length;
  4924. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4925. while (low < high) {
  4926. var mid = (low + high) >>> 1,
  4927. computed = array[mid];
  4928. if (computed !== null && !isSymbol(computed) &&
  4929. (retHighest ? (computed <= value) : (computed < value))) {
  4930. low = mid + 1;
  4931. } else {
  4932. high = mid;
  4933. }
  4934. }
  4935. return high;
  4936. }
  4937. return baseSortedIndexBy(array, value, identity, retHighest);
  4938. }
  4939. /**
  4940. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4941. * which invokes `iteratee` for `value` and each element of `array` to compute
  4942. * their sort ranking. The iteratee is invoked with one argument; (value).
  4943. *
  4944. * @private
  4945. * @param {Array} array The sorted array to inspect.
  4946. * @param {*} value The value to evaluate.
  4947. * @param {Function} iteratee The iteratee invoked per element.
  4948. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4949. * @returns {number} Returns the index at which `value` should be inserted
  4950. * into `array`.
  4951. */
  4952. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4953. var low = 0,
  4954. high = array == null ? 0 : array.length;
  4955. if (high === 0) {
  4956. return 0;
  4957. }
  4958. value = iteratee(value);
  4959. var valIsNaN = value !== value,
  4960. valIsNull = value === null,
  4961. valIsSymbol = isSymbol(value),
  4962. valIsUndefined = value === undefined;
  4963. while (low < high) {
  4964. var mid = nativeFloor((low + high) / 2),
  4965. computed = iteratee(array[mid]),
  4966. othIsDefined = computed !== undefined,
  4967. othIsNull = computed === null,
  4968. othIsReflexive = computed === computed,
  4969. othIsSymbol = isSymbol(computed);
  4970. if (valIsNaN) {
  4971. var setLow = retHighest || othIsReflexive;
  4972. } else if (valIsUndefined) {
  4973. setLow = othIsReflexive && (retHighest || othIsDefined);
  4974. } else if (valIsNull) {
  4975. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4976. } else if (valIsSymbol) {
  4977. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4978. } else if (othIsNull || othIsSymbol) {
  4979. setLow = false;
  4980. } else {
  4981. setLow = retHighest ? (computed <= value) : (computed < value);
  4982. }
  4983. if (setLow) {
  4984. low = mid + 1;
  4985. } else {
  4986. high = mid;
  4987. }
  4988. }
  4989. return nativeMin(high, MAX_ARRAY_INDEX);
  4990. }
  4991. /**
  4992. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4993. * support for iteratee shorthands.
  4994. *
  4995. * @private
  4996. * @param {Array} array The array to inspect.
  4997. * @param {Function} [iteratee] The iteratee invoked per element.
  4998. * @returns {Array} Returns the new duplicate free array.
  4999. */
  5000. function baseSortedUniq(array, iteratee) {
  5001. var index = -1,
  5002. length = array.length,
  5003. resIndex = 0,
  5004. result = [];
  5005. while (++index < length) {
  5006. var value = array[index],
  5007. computed = iteratee ? iteratee(value) : value;
  5008. if (!index || !eq(computed, seen)) {
  5009. var seen = computed;
  5010. result[resIndex++] = value === 0 ? 0 : value;
  5011. }
  5012. }
  5013. return result;
  5014. }
  5015. /**
  5016. * The base implementation of `_.toNumber` which doesn't ensure correct
  5017. * conversions of binary, hexadecimal, or octal string values.
  5018. *
  5019. * @private
  5020. * @param {*} value The value to process.
  5021. * @returns {number} Returns the number.
  5022. */
  5023. function baseToNumber(value) {
  5024. if (typeof value == 'number') {
  5025. return value;
  5026. }
  5027. if (isSymbol(value)) {
  5028. return NAN;
  5029. }
  5030. return +value;
  5031. }
  5032. /**
  5033. * The base implementation of `_.toString` which doesn't convert nullish
  5034. * values to empty strings.
  5035. *
  5036. * @private
  5037. * @param {*} value The value to process.
  5038. * @returns {string} Returns the string.
  5039. */
  5040. function baseToString(value) {
  5041. // Exit early for strings to avoid a performance hit in some environments.
  5042. if (typeof value == 'string') {
  5043. return value;
  5044. }
  5045. if (isArray(value)) {
  5046. // Recursively convert values (susceptible to call stack limits).
  5047. return arrayMap(value, baseToString) + '';
  5048. }
  5049. if (isSymbol(value)) {
  5050. return symbolToString ? symbolToString.call(value) : '';
  5051. }
  5052. var result = (value + '');
  5053. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5054. }
  5055. /**
  5056. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5057. *
  5058. * @private
  5059. * @param {Array} array The array to inspect.
  5060. * @param {Function} [iteratee] The iteratee invoked per element.
  5061. * @param {Function} [comparator] The comparator invoked per element.
  5062. * @returns {Array} Returns the new duplicate free array.
  5063. */
  5064. function baseUniq(array, iteratee, comparator) {
  5065. var index = -1,
  5066. includes = arrayIncludes,
  5067. length = array.length,
  5068. isCommon = true,
  5069. result = [],
  5070. seen = result;
  5071. if (comparator) {
  5072. isCommon = false;
  5073. includes = arrayIncludesWith;
  5074. }
  5075. else if (length >= LARGE_ARRAY_SIZE) {
  5076. var set = iteratee ? null : createSet(array);
  5077. if (set) {
  5078. return setToArray(set);
  5079. }
  5080. isCommon = false;
  5081. includes = cacheHas;
  5082. seen = new SetCache;
  5083. }
  5084. else {
  5085. seen = iteratee ? [] : result;
  5086. }
  5087. outer:
  5088. while (++index < length) {
  5089. var value = array[index],
  5090. computed = iteratee ? iteratee(value) : value;
  5091. value = (comparator || value !== 0) ? value : 0;
  5092. if (isCommon && computed === computed) {
  5093. var seenIndex = seen.length;
  5094. while (seenIndex--) {
  5095. if (seen[seenIndex] === computed) {
  5096. continue outer;
  5097. }
  5098. }
  5099. if (iteratee) {
  5100. seen.push(computed);
  5101. }
  5102. result.push(value);
  5103. }
  5104. else if (!includes(seen, computed, comparator)) {
  5105. if (seen !== result) {
  5106. seen.push(computed);
  5107. }
  5108. result.push(value);
  5109. }
  5110. }
  5111. return result;
  5112. }
  5113. /**
  5114. * The base implementation of `_.unset`.
  5115. *
  5116. * @private
  5117. * @param {Object} object The object to modify.
  5118. * @param {Array|string} path The property path to unset.
  5119. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5120. */
  5121. function baseUnset(object, path) {
  5122. path = castPath(path, object);
  5123. object = parent(object, path);
  5124. return object == null || delete object[toKey(last(path))];
  5125. }
  5126. /**
  5127. * The base implementation of `_.update`.
  5128. *
  5129. * @private
  5130. * @param {Object} object The object to modify.
  5131. * @param {Array|string} path The path of the property to update.
  5132. * @param {Function} updater The function to produce the updated value.
  5133. * @param {Function} [customizer] The function to customize path creation.
  5134. * @returns {Object} Returns `object`.
  5135. */
  5136. function baseUpdate(object, path, updater, customizer) {
  5137. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5138. }
  5139. /**
  5140. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5141. * without support for iteratee shorthands.
  5142. *
  5143. * @private
  5144. * @param {Array} array The array to query.
  5145. * @param {Function} predicate The function invoked per iteration.
  5146. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5147. * @param {boolean} [fromRight] Specify iterating from right to left.
  5148. * @returns {Array} Returns the slice of `array`.
  5149. */
  5150. function baseWhile(array, predicate, isDrop, fromRight) {
  5151. var length = array.length,
  5152. index = fromRight ? length : -1;
  5153. while ((fromRight ? index-- : ++index < length) &&
  5154. predicate(array[index], index, array)) {}
  5155. return isDrop
  5156. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5157. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5158. }
  5159. /**
  5160. * The base implementation of `wrapperValue` which returns the result of
  5161. * performing a sequence of actions on the unwrapped `value`, where each
  5162. * successive action is supplied the return value of the previous.
  5163. *
  5164. * @private
  5165. * @param {*} value The unwrapped value.
  5166. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5167. * @returns {*} Returns the resolved value.
  5168. */
  5169. function baseWrapperValue(value, actions) {
  5170. var result = value;
  5171. if (result instanceof LazyWrapper) {
  5172. result = result.value();
  5173. }
  5174. return arrayReduce(actions, function(result, action) {
  5175. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5176. }, result);
  5177. }
  5178. /**
  5179. * The base implementation of methods like `_.xor`, without support for
  5180. * iteratee shorthands, that accepts an array of arrays to inspect.
  5181. *
  5182. * @private
  5183. * @param {Array} arrays The arrays to inspect.
  5184. * @param {Function} [iteratee] The iteratee invoked per element.
  5185. * @param {Function} [comparator] The comparator invoked per element.
  5186. * @returns {Array} Returns the new array of values.
  5187. */
  5188. function baseXor(arrays, iteratee, comparator) {
  5189. var length = arrays.length;
  5190. if (length < 2) {
  5191. return length ? baseUniq(arrays[0]) : [];
  5192. }
  5193. var index = -1,
  5194. result = Array(length);
  5195. while (++index < length) {
  5196. var array = arrays[index],
  5197. othIndex = -1;
  5198. while (++othIndex < length) {
  5199. if (othIndex != index) {
  5200. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5201. }
  5202. }
  5203. }
  5204. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5205. }
  5206. /**
  5207. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5208. *
  5209. * @private
  5210. * @param {Array} props The property identifiers.
  5211. * @param {Array} values The property values.
  5212. * @param {Function} assignFunc The function to assign values.
  5213. * @returns {Object} Returns the new object.
  5214. */
  5215. function baseZipObject(props, values, assignFunc) {
  5216. var index = -1,
  5217. length = props.length,
  5218. valsLength = values.length,
  5219. result = {};
  5220. while (++index < length) {
  5221. var value = index < valsLength ? values[index] : undefined;
  5222. assignFunc(result, props[index], value);
  5223. }
  5224. return result;
  5225. }
  5226. /**
  5227. * Casts `value` to an empty array if it's not an array like object.
  5228. *
  5229. * @private
  5230. * @param {*} value The value to inspect.
  5231. * @returns {Array|Object} Returns the cast array-like object.
  5232. */
  5233. function castArrayLikeObject(value) {
  5234. return isArrayLikeObject(value) ? value : [];
  5235. }
  5236. /**
  5237. * Casts `value` to `identity` if it's not a function.
  5238. *
  5239. * @private
  5240. * @param {*} value The value to inspect.
  5241. * @returns {Function} Returns cast function.
  5242. */
  5243. function castFunction(value) {
  5244. return typeof value == 'function' ? value : identity;
  5245. }
  5246. /**
  5247. * Casts `value` to a path array if it's not one.
  5248. *
  5249. * @private
  5250. * @param {*} value The value to inspect.
  5251. * @param {Object} [object] The object to query keys on.
  5252. * @returns {Array} Returns the cast property path array.
  5253. */
  5254. function castPath(value, object) {
  5255. if (isArray(value)) {
  5256. return value;
  5257. }
  5258. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5259. }
  5260. /**
  5261. * A `baseRest` alias which can be replaced with `identity` by module
  5262. * replacement plugins.
  5263. *
  5264. * @private
  5265. * @type {Function}
  5266. * @param {Function} func The function to apply a rest parameter to.
  5267. * @returns {Function} Returns the new function.
  5268. */
  5269. var castRest = baseRest;
  5270. /**
  5271. * Casts `array` to a slice if it's needed.
  5272. *
  5273. * @private
  5274. * @param {Array} array The array to inspect.
  5275. * @param {number} start The start position.
  5276. * @param {number} [end=array.length] The end position.
  5277. * @returns {Array} Returns the cast slice.
  5278. */
  5279. function castSlice(array, start, end) {
  5280. var length = array.length;
  5281. end = end === undefined ? length : end;
  5282. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5283. }
  5284. /**
  5285. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5286. *
  5287. * @private
  5288. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5289. */
  5290. var clearTimeout = ctxClearTimeout || function(id) {
  5291. return root.clearTimeout(id);
  5292. };
  5293. /**
  5294. * Creates a clone of `buffer`.
  5295. *
  5296. * @private
  5297. * @param {Buffer} buffer The buffer to clone.
  5298. * @param {boolean} [isDeep] Specify a deep clone.
  5299. * @returns {Buffer} Returns the cloned buffer.
  5300. */
  5301. function cloneBuffer(buffer, isDeep) {
  5302. if (isDeep) {
  5303. return buffer.slice();
  5304. }
  5305. var length = buffer.length,
  5306. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5307. buffer.copy(result);
  5308. return result;
  5309. }
  5310. /**
  5311. * Creates a clone of `arrayBuffer`.
  5312. *
  5313. * @private
  5314. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5315. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5316. */
  5317. function cloneArrayBuffer(arrayBuffer) {
  5318. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5319. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5320. return result;
  5321. }
  5322. /**
  5323. * Creates a clone of `dataView`.
  5324. *
  5325. * @private
  5326. * @param {Object} dataView The data view to clone.
  5327. * @param {boolean} [isDeep] Specify a deep clone.
  5328. * @returns {Object} Returns the cloned data view.
  5329. */
  5330. function cloneDataView(dataView, isDeep) {
  5331. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5332. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5333. }
  5334. /**
  5335. * Creates a clone of `regexp`.
  5336. *
  5337. * @private
  5338. * @param {Object} regexp The regexp to clone.
  5339. * @returns {Object} Returns the cloned regexp.
  5340. */
  5341. function cloneRegExp(regexp) {
  5342. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5343. result.lastIndex = regexp.lastIndex;
  5344. return result;
  5345. }
  5346. /**
  5347. * Creates a clone of the `symbol` object.
  5348. *
  5349. * @private
  5350. * @param {Object} symbol The symbol object to clone.
  5351. * @returns {Object} Returns the cloned symbol object.
  5352. */
  5353. function cloneSymbol(symbol) {
  5354. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5355. }
  5356. /**
  5357. * Creates a clone of `typedArray`.
  5358. *
  5359. * @private
  5360. * @param {Object} typedArray The typed array to clone.
  5361. * @param {boolean} [isDeep] Specify a deep clone.
  5362. * @returns {Object} Returns the cloned typed array.
  5363. */
  5364. function cloneTypedArray(typedArray, isDeep) {
  5365. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5366. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5367. }
  5368. /**
  5369. * Compares values to sort them in ascending order.
  5370. *
  5371. * @private
  5372. * @param {*} value The value to compare.
  5373. * @param {*} other The other value to compare.
  5374. * @returns {number} Returns the sort order indicator for `value`.
  5375. */
  5376. function compareAscending(value, other) {
  5377. if (value !== other) {
  5378. var valIsDefined = value !== undefined,
  5379. valIsNull = value === null,
  5380. valIsReflexive = value === value,
  5381. valIsSymbol = isSymbol(value);
  5382. var othIsDefined = other !== undefined,
  5383. othIsNull = other === null,
  5384. othIsReflexive = other === other,
  5385. othIsSymbol = isSymbol(other);
  5386. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5387. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5388. (valIsNull && othIsDefined && othIsReflexive) ||
  5389. (!valIsDefined && othIsReflexive) ||
  5390. !valIsReflexive) {
  5391. return 1;
  5392. }
  5393. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5394. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5395. (othIsNull && valIsDefined && valIsReflexive) ||
  5396. (!othIsDefined && valIsReflexive) ||
  5397. !othIsReflexive) {
  5398. return -1;
  5399. }
  5400. }
  5401. return 0;
  5402. }
  5403. /**
  5404. * Used by `_.orderBy` to compare multiple properties of a value to another
  5405. * and stable sort them.
  5406. *
  5407. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5408. * specify an order of "desc" for descending or "asc" for ascending sort order
  5409. * of corresponding values.
  5410. *
  5411. * @private
  5412. * @param {Object} object The object to compare.
  5413. * @param {Object} other The other object to compare.
  5414. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5415. * @returns {number} Returns the sort order indicator for `object`.
  5416. */
  5417. function compareMultiple(object, other, orders) {
  5418. var index = -1,
  5419. objCriteria = object.criteria,
  5420. othCriteria = other.criteria,
  5421. length = objCriteria.length,
  5422. ordersLength = orders.length;
  5423. while (++index < length) {
  5424. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5425. if (result) {
  5426. if (index >= ordersLength) {
  5427. return result;
  5428. }
  5429. var order = orders[index];
  5430. return result * (order == 'desc' ? -1 : 1);
  5431. }
  5432. }
  5433. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5434. // that causes it, under certain circumstances, to provide the same value for
  5435. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5436. // for more details.
  5437. //
  5438. // This also ensures a stable sort in V8 and other engines.
  5439. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5440. return object.index - other.index;
  5441. }
  5442. /**
  5443. * Creates an array that is the composition of partially applied arguments,
  5444. * placeholders, and provided arguments into a single array of arguments.
  5445. *
  5446. * @private
  5447. * @param {Array} args The provided arguments.
  5448. * @param {Array} partials The arguments to prepend to those provided.
  5449. * @param {Array} holders The `partials` placeholder indexes.
  5450. * @params {boolean} [isCurried] Specify composing for a curried function.
  5451. * @returns {Array} Returns the new array of composed arguments.
  5452. */
  5453. function composeArgs(args, partials, holders, isCurried) {
  5454. var argsIndex = -1,
  5455. argsLength = args.length,
  5456. holdersLength = holders.length,
  5457. leftIndex = -1,
  5458. leftLength = partials.length,
  5459. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5460. result = Array(leftLength + rangeLength),
  5461. isUncurried = !isCurried;
  5462. while (++leftIndex < leftLength) {
  5463. result[leftIndex] = partials[leftIndex];
  5464. }
  5465. while (++argsIndex < holdersLength) {
  5466. if (isUncurried || argsIndex < argsLength) {
  5467. result[holders[argsIndex]] = args[argsIndex];
  5468. }
  5469. }
  5470. while (rangeLength--) {
  5471. result[leftIndex++] = args[argsIndex++];
  5472. }
  5473. return result;
  5474. }
  5475. /**
  5476. * This function is like `composeArgs` except that the arguments composition
  5477. * is tailored for `_.partialRight`.
  5478. *
  5479. * @private
  5480. * @param {Array} args The provided arguments.
  5481. * @param {Array} partials The arguments to append to those provided.
  5482. * @param {Array} holders The `partials` placeholder indexes.
  5483. * @params {boolean} [isCurried] Specify composing for a curried function.
  5484. * @returns {Array} Returns the new array of composed arguments.
  5485. */
  5486. function composeArgsRight(args, partials, holders, isCurried) {
  5487. var argsIndex = -1,
  5488. argsLength = args.length,
  5489. holdersIndex = -1,
  5490. holdersLength = holders.length,
  5491. rightIndex = -1,
  5492. rightLength = partials.length,
  5493. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5494. result = Array(rangeLength + rightLength),
  5495. isUncurried = !isCurried;
  5496. while (++argsIndex < rangeLength) {
  5497. result[argsIndex] = args[argsIndex];
  5498. }
  5499. var offset = argsIndex;
  5500. while (++rightIndex < rightLength) {
  5501. result[offset + rightIndex] = partials[rightIndex];
  5502. }
  5503. while (++holdersIndex < holdersLength) {
  5504. if (isUncurried || argsIndex < argsLength) {
  5505. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5506. }
  5507. }
  5508. return result;
  5509. }
  5510. /**
  5511. * Copies the values of `source` to `array`.
  5512. *
  5513. * @private
  5514. * @param {Array} source The array to copy values from.
  5515. * @param {Array} [array=[]] The array to copy values to.
  5516. * @returns {Array} Returns `array`.
  5517. */
  5518. function copyArray(source, array) {
  5519. var index = -1,
  5520. length = source.length;
  5521. array || (array = Array(length));
  5522. while (++index < length) {
  5523. array[index] = source[index];
  5524. }
  5525. return array;
  5526. }
  5527. /**
  5528. * Copies properties of `source` to `object`.
  5529. *
  5530. * @private
  5531. * @param {Object} source The object to copy properties from.
  5532. * @param {Array} props The property identifiers to copy.
  5533. * @param {Object} [object={}] The object to copy properties to.
  5534. * @param {Function} [customizer] The function to customize copied values.
  5535. * @returns {Object} Returns `object`.
  5536. */
  5537. function copyObject(source, props, object, customizer) {
  5538. var isNew = !object;
  5539. object || (object = {});
  5540. var index = -1,
  5541. length = props.length;
  5542. while (++index < length) {
  5543. var key = props[index];
  5544. var newValue = customizer
  5545. ? customizer(object[key], source[key], key, object, source)
  5546. : undefined;
  5547. if (newValue === undefined) {
  5548. newValue = source[key];
  5549. }
  5550. if (isNew) {
  5551. baseAssignValue(object, key, newValue);
  5552. } else {
  5553. assignValue(object, key, newValue);
  5554. }
  5555. }
  5556. return object;
  5557. }
  5558. /**
  5559. * Copies own symbols of `source` to `object`.
  5560. *
  5561. * @private
  5562. * @param {Object} source The object to copy symbols from.
  5563. * @param {Object} [object={}] The object to copy symbols to.
  5564. * @returns {Object} Returns `object`.
  5565. */
  5566. function copySymbols(source, object) {
  5567. return copyObject(source, getSymbols(source), object);
  5568. }
  5569. /**
  5570. * Copies own and inherited symbols of `source` to `object`.
  5571. *
  5572. * @private
  5573. * @param {Object} source The object to copy symbols from.
  5574. * @param {Object} [object={}] The object to copy symbols to.
  5575. * @returns {Object} Returns `object`.
  5576. */
  5577. function copySymbolsIn(source, object) {
  5578. return copyObject(source, getSymbolsIn(source), object);
  5579. }
  5580. /**
  5581. * Creates a function like `_.groupBy`.
  5582. *
  5583. * @private
  5584. * @param {Function} setter The function to set accumulator values.
  5585. * @param {Function} [initializer] The accumulator object initializer.
  5586. * @returns {Function} Returns the new aggregator function.
  5587. */
  5588. function createAggregator(setter, initializer) {
  5589. return function(collection, iteratee) {
  5590. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5591. accumulator = initializer ? initializer() : {};
  5592. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5593. };
  5594. }
  5595. /**
  5596. * Creates a function like `_.assign`.
  5597. *
  5598. * @private
  5599. * @param {Function} assigner The function to assign values.
  5600. * @returns {Function} Returns the new assigner function.
  5601. */
  5602. function createAssigner(assigner) {
  5603. return baseRest(function(object, sources) {
  5604. var index = -1,
  5605. length = sources.length,
  5606. customizer = length > 1 ? sources[length - 1] : undefined,
  5607. guard = length > 2 ? sources[2] : undefined;
  5608. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5609. ? (length--, customizer)
  5610. : undefined;
  5611. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5612. customizer = length < 3 ? undefined : customizer;
  5613. length = 1;
  5614. }
  5615. object = Object(object);
  5616. while (++index < length) {
  5617. var source = sources[index];
  5618. if (source) {
  5619. assigner(object, source, index, customizer);
  5620. }
  5621. }
  5622. return object;
  5623. });
  5624. }
  5625. /**
  5626. * Creates a `baseEach` or `baseEachRight` function.
  5627. *
  5628. * @private
  5629. * @param {Function} eachFunc The function to iterate over a collection.
  5630. * @param {boolean} [fromRight] Specify iterating from right to left.
  5631. * @returns {Function} Returns the new base function.
  5632. */
  5633. function createBaseEach(eachFunc, fromRight) {
  5634. return function(collection, iteratee) {
  5635. if (collection == null) {
  5636. return collection;
  5637. }
  5638. if (!isArrayLike(collection)) {
  5639. return eachFunc(collection, iteratee);
  5640. }
  5641. var length = collection.length,
  5642. index = fromRight ? length : -1,
  5643. iterable = Object(collection);
  5644. while ((fromRight ? index-- : ++index < length)) {
  5645. if (iteratee(iterable[index], index, iterable) === false) {
  5646. break;
  5647. }
  5648. }
  5649. return collection;
  5650. };
  5651. }
  5652. /**
  5653. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5654. *
  5655. * @private
  5656. * @param {boolean} [fromRight] Specify iterating from right to left.
  5657. * @returns {Function} Returns the new base function.
  5658. */
  5659. function createBaseFor(fromRight) {
  5660. return function(object, iteratee, keysFunc) {
  5661. var index = -1,
  5662. iterable = Object(object),
  5663. props = keysFunc(object),
  5664. length = props.length;
  5665. while (length--) {
  5666. var key = props[fromRight ? length : ++index];
  5667. if (iteratee(iterable[key], key, iterable) === false) {
  5668. break;
  5669. }
  5670. }
  5671. return object;
  5672. };
  5673. }
  5674. /**
  5675. * Creates a function that wraps `func` to invoke it with the optional `this`
  5676. * binding of `thisArg`.
  5677. *
  5678. * @private
  5679. * @param {Function} func The function to wrap.
  5680. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5681. * @param {*} [thisArg] The `this` binding of `func`.
  5682. * @returns {Function} Returns the new wrapped function.
  5683. */
  5684. function createBind(func, bitmask, thisArg) {
  5685. var isBind = bitmask & WRAP_BIND_FLAG,
  5686. Ctor = createCtor(func);
  5687. function wrapper() {
  5688. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5689. return fn.apply(isBind ? thisArg : this, arguments);
  5690. }
  5691. return wrapper;
  5692. }
  5693. /**
  5694. * Creates a function like `_.lowerFirst`.
  5695. *
  5696. * @private
  5697. * @param {string} methodName The name of the `String` case method to use.
  5698. * @returns {Function} Returns the new case function.
  5699. */
  5700. function createCaseFirst(methodName) {
  5701. return function(string) {
  5702. string = toString(string);
  5703. var strSymbols = hasUnicode(string)
  5704. ? stringToArray(string)
  5705. : undefined;
  5706. var chr = strSymbols
  5707. ? strSymbols[0]
  5708. : string.charAt(0);
  5709. var trailing = strSymbols
  5710. ? castSlice(strSymbols, 1).join('')
  5711. : string.slice(1);
  5712. return chr[methodName]() + trailing;
  5713. };
  5714. }
  5715. /**
  5716. * Creates a function like `_.camelCase`.
  5717. *
  5718. * @private
  5719. * @param {Function} callback The function to combine each word.
  5720. * @returns {Function} Returns the new compounder function.
  5721. */
  5722. function createCompounder(callback) {
  5723. return function(string) {
  5724. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5725. };
  5726. }
  5727. /**
  5728. * Creates a function that produces an instance of `Ctor` regardless of
  5729. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5730. *
  5731. * @private
  5732. * @param {Function} Ctor The constructor to wrap.
  5733. * @returns {Function} Returns the new wrapped function.
  5734. */
  5735. function createCtor(Ctor) {
  5736. return function() {
  5737. // Use a `switch` statement to work with class constructors. See
  5738. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5739. // for more details.
  5740. var args = arguments;
  5741. switch (args.length) {
  5742. case 0: return new Ctor;
  5743. case 1: return new Ctor(args[0]);
  5744. case 2: return new Ctor(args[0], args[1]);
  5745. case 3: return new Ctor(args[0], args[1], args[2]);
  5746. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5747. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5748. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5749. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5750. }
  5751. var thisBinding = baseCreate(Ctor.prototype),
  5752. result = Ctor.apply(thisBinding, args);
  5753. // Mimic the constructor's `return` behavior.
  5754. // See https://es5.github.io/#x13.2.2 for more details.
  5755. return isObject(result) ? result : thisBinding;
  5756. };
  5757. }
  5758. /**
  5759. * Creates a function that wraps `func` to enable currying.
  5760. *
  5761. * @private
  5762. * @param {Function} func The function to wrap.
  5763. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5764. * @param {number} arity The arity of `func`.
  5765. * @returns {Function} Returns the new wrapped function.
  5766. */
  5767. function createCurry(func, bitmask, arity) {
  5768. var Ctor = createCtor(func);
  5769. function wrapper() {
  5770. var length = arguments.length,
  5771. args = Array(length),
  5772. index = length,
  5773. placeholder = getHolder(wrapper);
  5774. while (index--) {
  5775. args[index] = arguments[index];
  5776. }
  5777. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5778. ? []
  5779. : replaceHolders(args, placeholder);
  5780. length -= holders.length;
  5781. if (length < arity) {
  5782. return createRecurry(
  5783. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5784. args, holders, undefined, undefined, arity - length);
  5785. }
  5786. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5787. return apply(fn, this, args);
  5788. }
  5789. return wrapper;
  5790. }
  5791. /**
  5792. * Creates a `_.find` or `_.findLast` function.
  5793. *
  5794. * @private
  5795. * @param {Function} findIndexFunc The function to find the collection index.
  5796. * @returns {Function} Returns the new find function.
  5797. */
  5798. function createFind(findIndexFunc) {
  5799. return function(collection, predicate, fromIndex) {
  5800. var iterable = Object(collection);
  5801. if (!isArrayLike(collection)) {
  5802. var iteratee = getIteratee(predicate, 3);
  5803. collection = keys(collection);
  5804. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5805. }
  5806. var index = findIndexFunc(collection, predicate, fromIndex);
  5807. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5808. };
  5809. }
  5810. /**
  5811. * Creates a `_.flow` or `_.flowRight` function.
  5812. *
  5813. * @private
  5814. * @param {boolean} [fromRight] Specify iterating from right to left.
  5815. * @returns {Function} Returns the new flow function.
  5816. */
  5817. function createFlow(fromRight) {
  5818. return flatRest(function(funcs) {
  5819. var length = funcs.length,
  5820. index = length,
  5821. prereq = LodashWrapper.prototype.thru;
  5822. if (fromRight) {
  5823. funcs.reverse();
  5824. }
  5825. while (index--) {
  5826. var func = funcs[index];
  5827. if (typeof func != 'function') {
  5828. throw new TypeError(FUNC_ERROR_TEXT);
  5829. }
  5830. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5831. var wrapper = new LodashWrapper([], true);
  5832. }
  5833. }
  5834. index = wrapper ? index : length;
  5835. while (++index < length) {
  5836. func = funcs[index];
  5837. var funcName = getFuncName(func),
  5838. data = funcName == 'wrapper' ? getData(func) : undefined;
  5839. if (data && isLaziable(data[0]) &&
  5840. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5841. !data[4].length && data[9] == 1
  5842. ) {
  5843. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5844. } else {
  5845. wrapper = (func.length == 1 && isLaziable(func))
  5846. ? wrapper[funcName]()
  5847. : wrapper.thru(func);
  5848. }
  5849. }
  5850. return function() {
  5851. var args = arguments,
  5852. value = args[0];
  5853. if (wrapper && args.length == 1 && isArray(value)) {
  5854. return wrapper.plant(value).value();
  5855. }
  5856. var index = 0,
  5857. result = length ? funcs[index].apply(this, args) : value;
  5858. while (++index < length) {
  5859. result = funcs[index].call(this, result);
  5860. }
  5861. return result;
  5862. };
  5863. });
  5864. }
  5865. /**
  5866. * Creates a function that wraps `func` to invoke it with optional `this`
  5867. * binding of `thisArg`, partial application, and currying.
  5868. *
  5869. * @private
  5870. * @param {Function|string} func The function or method name to wrap.
  5871. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5872. * @param {*} [thisArg] The `this` binding of `func`.
  5873. * @param {Array} [partials] The arguments to prepend to those provided to
  5874. * the new function.
  5875. * @param {Array} [holders] The `partials` placeholder indexes.
  5876. * @param {Array} [partialsRight] The arguments to append to those provided
  5877. * to the new function.
  5878. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5879. * @param {Array} [argPos] The argument positions of the new function.
  5880. * @param {number} [ary] The arity cap of `func`.
  5881. * @param {number} [arity] The arity of `func`.
  5882. * @returns {Function} Returns the new wrapped function.
  5883. */
  5884. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5885. var isAry = bitmask & WRAP_ARY_FLAG,
  5886. isBind = bitmask & WRAP_BIND_FLAG,
  5887. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5888. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5889. isFlip = bitmask & WRAP_FLIP_FLAG,
  5890. Ctor = isBindKey ? undefined : createCtor(func);
  5891. function wrapper() {
  5892. var length = arguments.length,
  5893. args = Array(length),
  5894. index = length;
  5895. while (index--) {
  5896. args[index] = arguments[index];
  5897. }
  5898. if (isCurried) {
  5899. var placeholder = getHolder(wrapper),
  5900. holdersCount = countHolders(args, placeholder);
  5901. }
  5902. if (partials) {
  5903. args = composeArgs(args, partials, holders, isCurried);
  5904. }
  5905. if (partialsRight) {
  5906. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5907. }
  5908. length -= holdersCount;
  5909. if (isCurried && length < arity) {
  5910. var newHolders = replaceHolders(args, placeholder);
  5911. return createRecurry(
  5912. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5913. args, newHolders, argPos, ary, arity - length
  5914. );
  5915. }
  5916. var thisBinding = isBind ? thisArg : this,
  5917. fn = isBindKey ? thisBinding[func] : func;
  5918. length = args.length;
  5919. if (argPos) {
  5920. args = reorder(args, argPos);
  5921. } else if (isFlip && length > 1) {
  5922. args.reverse();
  5923. }
  5924. if (isAry && ary < length) {
  5925. args.length = ary;
  5926. }
  5927. if (this && this !== root && this instanceof wrapper) {
  5928. fn = Ctor || createCtor(fn);
  5929. }
  5930. return fn.apply(thisBinding, args);
  5931. }
  5932. return wrapper;
  5933. }
  5934. /**
  5935. * Creates a function like `_.invertBy`.
  5936. *
  5937. * @private
  5938. * @param {Function} setter The function to set accumulator values.
  5939. * @param {Function} toIteratee The function to resolve iteratees.
  5940. * @returns {Function} Returns the new inverter function.
  5941. */
  5942. function createInverter(setter, toIteratee) {
  5943. return function(object, iteratee) {
  5944. return baseInverter(object, setter, toIteratee(iteratee), {});
  5945. };
  5946. }
  5947. /**
  5948. * Creates a function that performs a mathematical operation on two values.
  5949. *
  5950. * @private
  5951. * @param {Function} operator The function to perform the operation.
  5952. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5953. * @returns {Function} Returns the new mathematical operation function.
  5954. */
  5955. function createMathOperation(operator, defaultValue) {
  5956. return function(value, other) {
  5957. var result;
  5958. if (value === undefined && other === undefined) {
  5959. return defaultValue;
  5960. }
  5961. if (value !== undefined) {
  5962. result = value;
  5963. }
  5964. if (other !== undefined) {
  5965. if (result === undefined) {
  5966. return other;
  5967. }
  5968. if (typeof value == 'string' || typeof other == 'string') {
  5969. value = baseToString(value);
  5970. other = baseToString(other);
  5971. } else {
  5972. value = baseToNumber(value);
  5973. other = baseToNumber(other);
  5974. }
  5975. result = operator(value, other);
  5976. }
  5977. return result;
  5978. };
  5979. }
  5980. /**
  5981. * Creates a function like `_.over`.
  5982. *
  5983. * @private
  5984. * @param {Function} arrayFunc The function to iterate over iteratees.
  5985. * @returns {Function} Returns the new over function.
  5986. */
  5987. function createOver(arrayFunc) {
  5988. return flatRest(function(iteratees) {
  5989. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5990. return baseRest(function(args) {
  5991. var thisArg = this;
  5992. return arrayFunc(iteratees, function(iteratee) {
  5993. return apply(iteratee, thisArg, args);
  5994. });
  5995. });
  5996. });
  5997. }
  5998. /**
  5999. * Creates the padding for `string` based on `length`. The `chars` string
  6000. * is truncated if the number of characters exceeds `length`.
  6001. *
  6002. * @private
  6003. * @param {number} length The padding length.
  6004. * @param {string} [chars=' '] The string used as padding.
  6005. * @returns {string} Returns the padding for `string`.
  6006. */
  6007. function createPadding(length, chars) {
  6008. chars = chars === undefined ? ' ' : baseToString(chars);
  6009. var charsLength = chars.length;
  6010. if (charsLength < 2) {
  6011. return charsLength ? baseRepeat(chars, length) : chars;
  6012. }
  6013. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6014. return hasUnicode(chars)
  6015. ? castSlice(stringToArray(result), 0, length).join('')
  6016. : result.slice(0, length);
  6017. }
  6018. /**
  6019. * Creates a function that wraps `func` to invoke it with the `this` binding
  6020. * of `thisArg` and `partials` prepended to the arguments it receives.
  6021. *
  6022. * @private
  6023. * @param {Function} func The function to wrap.
  6024. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6025. * @param {*} thisArg The `this` binding of `func`.
  6026. * @param {Array} partials The arguments to prepend to those provided to
  6027. * the new function.
  6028. * @returns {Function} Returns the new wrapped function.
  6029. */
  6030. function createPartial(func, bitmask, thisArg, partials) {
  6031. var isBind = bitmask & WRAP_BIND_FLAG,
  6032. Ctor = createCtor(func);
  6033. function wrapper() {
  6034. var argsIndex = -1,
  6035. argsLength = arguments.length,
  6036. leftIndex = -1,
  6037. leftLength = partials.length,
  6038. args = Array(leftLength + argsLength),
  6039. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6040. while (++leftIndex < leftLength) {
  6041. args[leftIndex] = partials[leftIndex];
  6042. }
  6043. while (argsLength--) {
  6044. args[leftIndex++] = arguments[++argsIndex];
  6045. }
  6046. return apply(fn, isBind ? thisArg : this, args);
  6047. }
  6048. return wrapper;
  6049. }
  6050. /**
  6051. * Creates a `_.range` or `_.rangeRight` function.
  6052. *
  6053. * @private
  6054. * @param {boolean} [fromRight] Specify iterating from right to left.
  6055. * @returns {Function} Returns the new range function.
  6056. */
  6057. function createRange(fromRight) {
  6058. return function(start, end, step) {
  6059. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6060. end = step = undefined;
  6061. }
  6062. // Ensure the sign of `-0` is preserved.
  6063. start = toFinite(start);
  6064. if (end === undefined) {
  6065. end = start;
  6066. start = 0;
  6067. } else {
  6068. end = toFinite(end);
  6069. }
  6070. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6071. return baseRange(start, end, step, fromRight);
  6072. };
  6073. }
  6074. /**
  6075. * Creates a function that performs a relational operation on two values.
  6076. *
  6077. * @private
  6078. * @param {Function} operator The function to perform the operation.
  6079. * @returns {Function} Returns the new relational operation function.
  6080. */
  6081. function createRelationalOperation(operator) {
  6082. return function(value, other) {
  6083. if (!(typeof value == 'string' && typeof other == 'string')) {
  6084. value = toNumber(value);
  6085. other = toNumber(other);
  6086. }
  6087. return operator(value, other);
  6088. };
  6089. }
  6090. /**
  6091. * Creates a function that wraps `func` to continue currying.
  6092. *
  6093. * @private
  6094. * @param {Function} func The function to wrap.
  6095. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6096. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6097. * @param {*} placeholder The placeholder value.
  6098. * @param {*} [thisArg] The `this` binding of `func`.
  6099. * @param {Array} [partials] The arguments to prepend to those provided to
  6100. * the new function.
  6101. * @param {Array} [holders] The `partials` placeholder indexes.
  6102. * @param {Array} [argPos] The argument positions of the new function.
  6103. * @param {number} [ary] The arity cap of `func`.
  6104. * @param {number} [arity] The arity of `func`.
  6105. * @returns {Function} Returns the new wrapped function.
  6106. */
  6107. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6108. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6109. newHolders = isCurry ? holders : undefined,
  6110. newHoldersRight = isCurry ? undefined : holders,
  6111. newPartials = isCurry ? partials : undefined,
  6112. newPartialsRight = isCurry ? undefined : partials;
  6113. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6114. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6115. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6116. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6117. }
  6118. var newData = [
  6119. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6120. newHoldersRight, argPos, ary, arity
  6121. ];
  6122. var result = wrapFunc.apply(undefined, newData);
  6123. if (isLaziable(func)) {
  6124. setData(result, newData);
  6125. }
  6126. result.placeholder = placeholder;
  6127. return setWrapToString(result, func, bitmask);
  6128. }
  6129. /**
  6130. * Creates a function like `_.round`.
  6131. *
  6132. * @private
  6133. * @param {string} methodName The name of the `Math` method to use when rounding.
  6134. * @returns {Function} Returns the new round function.
  6135. */
  6136. function createRound(methodName) {
  6137. var func = Math[methodName];
  6138. return function(number, precision) {
  6139. number = toNumber(number);
  6140. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6141. if (precision && nativeIsFinite(number)) {
  6142. // Shift with exponential notation to avoid floating-point issues.
  6143. // See [MDN](https://mdn.io/round#Examples) for more details.
  6144. var pair = (toString(number) + 'e').split('e'),
  6145. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6146. pair = (toString(value) + 'e').split('e');
  6147. return +(pair[0] + 'e' + (+pair[1] - precision));
  6148. }
  6149. return func(number);
  6150. };
  6151. }
  6152. /**
  6153. * Creates a set object of `values`.
  6154. *
  6155. * @private
  6156. * @param {Array} values The values to add to the set.
  6157. * @returns {Object} Returns the new set.
  6158. */
  6159. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6160. return new Set(values);
  6161. };
  6162. /**
  6163. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6164. *
  6165. * @private
  6166. * @param {Function} keysFunc The function to get the keys of a given object.
  6167. * @returns {Function} Returns the new pairs function.
  6168. */
  6169. function createToPairs(keysFunc) {
  6170. return function(object) {
  6171. var tag = getTag(object);
  6172. if (tag == mapTag) {
  6173. return mapToArray(object);
  6174. }
  6175. if (tag == setTag) {
  6176. return setToPairs(object);
  6177. }
  6178. return baseToPairs(object, keysFunc(object));
  6179. };
  6180. }
  6181. /**
  6182. * Creates a function that either curries or invokes `func` with optional
  6183. * `this` binding and partially applied arguments.
  6184. *
  6185. * @private
  6186. * @param {Function|string} func The function or method name to wrap.
  6187. * @param {number} bitmask The bitmask flags.
  6188. * 1 - `_.bind`
  6189. * 2 - `_.bindKey`
  6190. * 4 - `_.curry` or `_.curryRight` of a bound function
  6191. * 8 - `_.curry`
  6192. * 16 - `_.curryRight`
  6193. * 32 - `_.partial`
  6194. * 64 - `_.partialRight`
  6195. * 128 - `_.rearg`
  6196. * 256 - `_.ary`
  6197. * 512 - `_.flip`
  6198. * @param {*} [thisArg] The `this` binding of `func`.
  6199. * @param {Array} [partials] The arguments to be partially applied.
  6200. * @param {Array} [holders] The `partials` placeholder indexes.
  6201. * @param {Array} [argPos] The argument positions of the new function.
  6202. * @param {number} [ary] The arity cap of `func`.
  6203. * @param {number} [arity] The arity of `func`.
  6204. * @returns {Function} Returns the new wrapped function.
  6205. */
  6206. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6207. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6208. if (!isBindKey && typeof func != 'function') {
  6209. throw new TypeError(FUNC_ERROR_TEXT);
  6210. }
  6211. var length = partials ? partials.length : 0;
  6212. if (!length) {
  6213. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6214. partials = holders = undefined;
  6215. }
  6216. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6217. arity = arity === undefined ? arity : toInteger(arity);
  6218. length -= holders ? holders.length : 0;
  6219. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6220. var partialsRight = partials,
  6221. holdersRight = holders;
  6222. partials = holders = undefined;
  6223. }
  6224. var data = isBindKey ? undefined : getData(func);
  6225. var newData = [
  6226. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6227. argPos, ary, arity
  6228. ];
  6229. if (data) {
  6230. mergeData(newData, data);
  6231. }
  6232. func = newData[0];
  6233. bitmask = newData[1];
  6234. thisArg = newData[2];
  6235. partials = newData[3];
  6236. holders = newData[4];
  6237. arity = newData[9] = newData[9] === undefined
  6238. ? (isBindKey ? 0 : func.length)
  6239. : nativeMax(newData[9] - length, 0);
  6240. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6241. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6242. }
  6243. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6244. var result = createBind(func, bitmask, thisArg);
  6245. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6246. result = createCurry(func, bitmask, arity);
  6247. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6248. result = createPartial(func, bitmask, thisArg, partials);
  6249. } else {
  6250. result = createHybrid.apply(undefined, newData);
  6251. }
  6252. var setter = data ? baseSetData : setData;
  6253. return setWrapToString(setter(result, newData), func, bitmask);
  6254. }
  6255. /**
  6256. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6257. * of source objects to the destination object for all destination properties
  6258. * that resolve to `undefined`.
  6259. *
  6260. * @private
  6261. * @param {*} objValue The destination value.
  6262. * @param {*} srcValue The source value.
  6263. * @param {string} key The key of the property to assign.
  6264. * @param {Object} object The parent object of `objValue`.
  6265. * @returns {*} Returns the value to assign.
  6266. */
  6267. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6268. if (objValue === undefined ||
  6269. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6270. return srcValue;
  6271. }
  6272. return objValue;
  6273. }
  6274. /**
  6275. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6276. * objects into destination objects that are passed thru.
  6277. *
  6278. * @private
  6279. * @param {*} objValue The destination value.
  6280. * @param {*} srcValue The source value.
  6281. * @param {string} key The key of the property to merge.
  6282. * @param {Object} object The parent object of `objValue`.
  6283. * @param {Object} source The parent object of `srcValue`.
  6284. * @param {Object} [stack] Tracks traversed source values and their merged
  6285. * counterparts.
  6286. * @returns {*} Returns the value to assign.
  6287. */
  6288. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6289. if (isObject(objValue) && isObject(srcValue)) {
  6290. // Recursively merge objects and arrays (susceptible to call stack limits).
  6291. stack.set(srcValue, objValue);
  6292. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6293. stack['delete'](srcValue);
  6294. }
  6295. return objValue;
  6296. }
  6297. /**
  6298. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6299. * objects.
  6300. *
  6301. * @private
  6302. * @param {*} value The value to inspect.
  6303. * @param {string} key The key of the property to inspect.
  6304. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6305. */
  6306. function customOmitClone(value) {
  6307. return isPlainObject(value) ? undefined : value;
  6308. }
  6309. /**
  6310. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6311. * partial deep comparisons.
  6312. *
  6313. * @private
  6314. * @param {Array} array The array to compare.
  6315. * @param {Array} other The other array to compare.
  6316. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6317. * @param {Function} customizer The function to customize comparisons.
  6318. * @param {Function} equalFunc The function to determine equivalents of values.
  6319. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6320. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6321. */
  6322. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6323. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6324. arrLength = array.length,
  6325. othLength = other.length;
  6326. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6327. return false;
  6328. }
  6329. // Check that cyclic values are equal.
  6330. var arrStacked = stack.get(array);
  6331. var othStacked = stack.get(other);
  6332. if (arrStacked && othStacked) {
  6333. return arrStacked == other && othStacked == array;
  6334. }
  6335. var index = -1,
  6336. result = true,
  6337. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6338. stack.set(array, other);
  6339. stack.set(other, array);
  6340. // Ignore non-index properties.
  6341. while (++index < arrLength) {
  6342. var arrValue = array[index],
  6343. othValue = other[index];
  6344. if (customizer) {
  6345. var compared = isPartial
  6346. ? customizer(othValue, arrValue, index, other, array, stack)
  6347. : customizer(arrValue, othValue, index, array, other, stack);
  6348. }
  6349. if (compared !== undefined) {
  6350. if (compared) {
  6351. continue;
  6352. }
  6353. result = false;
  6354. break;
  6355. }
  6356. // Recursively compare arrays (susceptible to call stack limits).
  6357. if (seen) {
  6358. if (!arraySome(other, function(othValue, othIndex) {
  6359. if (!cacheHas(seen, othIndex) &&
  6360. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6361. return seen.push(othIndex);
  6362. }
  6363. })) {
  6364. result = false;
  6365. break;
  6366. }
  6367. } else if (!(
  6368. arrValue === othValue ||
  6369. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6370. )) {
  6371. result = false;
  6372. break;
  6373. }
  6374. }
  6375. stack['delete'](array);
  6376. stack['delete'](other);
  6377. return result;
  6378. }
  6379. /**
  6380. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6381. * the same `toStringTag`.
  6382. *
  6383. * **Note:** This function only supports comparing values with tags of
  6384. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6385. *
  6386. * @private
  6387. * @param {Object} object The object to compare.
  6388. * @param {Object} other The other object to compare.
  6389. * @param {string} tag The `toStringTag` of the objects to compare.
  6390. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6391. * @param {Function} customizer The function to customize comparisons.
  6392. * @param {Function} equalFunc The function to determine equivalents of values.
  6393. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6394. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6395. */
  6396. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6397. switch (tag) {
  6398. case dataViewTag:
  6399. if ((object.byteLength != other.byteLength) ||
  6400. (object.byteOffset != other.byteOffset)) {
  6401. return false;
  6402. }
  6403. object = object.buffer;
  6404. other = other.buffer;
  6405. case arrayBufferTag:
  6406. if ((object.byteLength != other.byteLength) ||
  6407. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6408. return false;
  6409. }
  6410. return true;
  6411. case boolTag:
  6412. case dateTag:
  6413. case numberTag:
  6414. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6415. // Invalid dates are coerced to `NaN`.
  6416. return eq(+object, +other);
  6417. case errorTag:
  6418. return object.name == other.name && object.message == other.message;
  6419. case regexpTag:
  6420. case stringTag:
  6421. // Coerce regexes to strings and treat strings, primitives and objects,
  6422. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6423. // for more details.
  6424. return object == (other + '');
  6425. case mapTag:
  6426. var convert = mapToArray;
  6427. case setTag:
  6428. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6429. convert || (convert = setToArray);
  6430. if (object.size != other.size && !isPartial) {
  6431. return false;
  6432. }
  6433. // Assume cyclic values are equal.
  6434. var stacked = stack.get(object);
  6435. if (stacked) {
  6436. return stacked == other;
  6437. }
  6438. bitmask |= COMPARE_UNORDERED_FLAG;
  6439. // Recursively compare objects (susceptible to call stack limits).
  6440. stack.set(object, other);
  6441. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6442. stack['delete'](object);
  6443. return result;
  6444. case symbolTag:
  6445. if (symbolValueOf) {
  6446. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6447. }
  6448. }
  6449. return false;
  6450. }
  6451. /**
  6452. * A specialized version of `baseIsEqualDeep` for objects with support for
  6453. * partial deep comparisons.
  6454. *
  6455. * @private
  6456. * @param {Object} object The object to compare.
  6457. * @param {Object} other The other object to compare.
  6458. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6459. * @param {Function} customizer The function to customize comparisons.
  6460. * @param {Function} equalFunc The function to determine equivalents of values.
  6461. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6462. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6463. */
  6464. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6465. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6466. objProps = getAllKeys(object),
  6467. objLength = objProps.length,
  6468. othProps = getAllKeys(other),
  6469. othLength = othProps.length;
  6470. if (objLength != othLength && !isPartial) {
  6471. return false;
  6472. }
  6473. var index = objLength;
  6474. while (index--) {
  6475. var key = objProps[index];
  6476. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6477. return false;
  6478. }
  6479. }
  6480. // Check that cyclic values are equal.
  6481. var objStacked = stack.get(object);
  6482. var othStacked = stack.get(other);
  6483. if (objStacked && othStacked) {
  6484. return objStacked == other && othStacked == object;
  6485. }
  6486. var result = true;
  6487. stack.set(object, other);
  6488. stack.set(other, object);
  6489. var skipCtor = isPartial;
  6490. while (++index < objLength) {
  6491. key = objProps[index];
  6492. var objValue = object[key],
  6493. othValue = other[key];
  6494. if (customizer) {
  6495. var compared = isPartial
  6496. ? customizer(othValue, objValue, key, other, object, stack)
  6497. : customizer(objValue, othValue, key, object, other, stack);
  6498. }
  6499. // Recursively compare objects (susceptible to call stack limits).
  6500. if (!(compared === undefined
  6501. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6502. : compared
  6503. )) {
  6504. result = false;
  6505. break;
  6506. }
  6507. skipCtor || (skipCtor = key == 'constructor');
  6508. }
  6509. if (result && !skipCtor) {
  6510. var objCtor = object.constructor,
  6511. othCtor = other.constructor;
  6512. // Non `Object` object instances with different constructors are not equal.
  6513. if (objCtor != othCtor &&
  6514. ('constructor' in object && 'constructor' in other) &&
  6515. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6516. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6517. result = false;
  6518. }
  6519. }
  6520. stack['delete'](object);
  6521. stack['delete'](other);
  6522. return result;
  6523. }
  6524. /**
  6525. * A specialized version of `baseRest` which flattens the rest array.
  6526. *
  6527. * @private
  6528. * @param {Function} func The function to apply a rest parameter to.
  6529. * @returns {Function} Returns the new function.
  6530. */
  6531. function flatRest(func) {
  6532. return setToString(overRest(func, undefined, flatten), func + '');
  6533. }
  6534. /**
  6535. * Creates an array of own enumerable property names and symbols of `object`.
  6536. *
  6537. * @private
  6538. * @param {Object} object The object to query.
  6539. * @returns {Array} Returns the array of property names and symbols.
  6540. */
  6541. function getAllKeys(object) {
  6542. return baseGetAllKeys(object, keys, getSymbols);
  6543. }
  6544. /**
  6545. * Creates an array of own and inherited enumerable property names and
  6546. * symbols of `object`.
  6547. *
  6548. * @private
  6549. * @param {Object} object The object to query.
  6550. * @returns {Array} Returns the array of property names and symbols.
  6551. */
  6552. function getAllKeysIn(object) {
  6553. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6554. }
  6555. /**
  6556. * Gets metadata for `func`.
  6557. *
  6558. * @private
  6559. * @param {Function} func The function to query.
  6560. * @returns {*} Returns the metadata for `func`.
  6561. */
  6562. var getData = !metaMap ? noop : function(func) {
  6563. return metaMap.get(func);
  6564. };
  6565. /**
  6566. * Gets the name of `func`.
  6567. *
  6568. * @private
  6569. * @param {Function} func The function to query.
  6570. * @returns {string} Returns the function name.
  6571. */
  6572. function getFuncName(func) {
  6573. var result = (func.name + ''),
  6574. array = realNames[result],
  6575. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6576. while (length--) {
  6577. var data = array[length],
  6578. otherFunc = data.func;
  6579. if (otherFunc == null || otherFunc == func) {
  6580. return data.name;
  6581. }
  6582. }
  6583. return result;
  6584. }
  6585. /**
  6586. * Gets the argument placeholder value for `func`.
  6587. *
  6588. * @private
  6589. * @param {Function} func The function to inspect.
  6590. * @returns {*} Returns the placeholder value.
  6591. */
  6592. function getHolder(func) {
  6593. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6594. return object.placeholder;
  6595. }
  6596. /**
  6597. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6598. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6599. * If arguments are provided, the chosen function is invoked with them and
  6600. * its result is returned.
  6601. *
  6602. * @private
  6603. * @param {*} [value] The value to convert to an iteratee.
  6604. * @param {number} [arity] The arity of the created iteratee.
  6605. * @returns {Function} Returns the chosen function or its result.
  6606. */
  6607. function getIteratee() {
  6608. var result = lodash.iteratee || iteratee;
  6609. result = result === iteratee ? baseIteratee : result;
  6610. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6611. }
  6612. /**
  6613. * Gets the data for `map`.
  6614. *
  6615. * @private
  6616. * @param {Object} map The map to query.
  6617. * @param {string} key The reference key.
  6618. * @returns {*} Returns the map data.
  6619. */
  6620. function getMapData(map, key) {
  6621. var data = map.__data__;
  6622. return isKeyable(key)
  6623. ? data[typeof key == 'string' ? 'string' : 'hash']
  6624. : data.map;
  6625. }
  6626. /**
  6627. * Gets the property names, values, and compare flags of `object`.
  6628. *
  6629. * @private
  6630. * @param {Object} object The object to query.
  6631. * @returns {Array} Returns the match data of `object`.
  6632. */
  6633. function getMatchData(object) {
  6634. var result = keys(object),
  6635. length = result.length;
  6636. while (length--) {
  6637. var key = result[length],
  6638. value = object[key];
  6639. result[length] = [key, value, isStrictComparable(value)];
  6640. }
  6641. return result;
  6642. }
  6643. /**
  6644. * Gets the native function at `key` of `object`.
  6645. *
  6646. * @private
  6647. * @param {Object} object The object to query.
  6648. * @param {string} key The key of the method to get.
  6649. * @returns {*} Returns the function if it's native, else `undefined`.
  6650. */
  6651. function getNative(object, key) {
  6652. var value = getValue(object, key);
  6653. return baseIsNative(value) ? value : undefined;
  6654. }
  6655. /**
  6656. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6657. *
  6658. * @private
  6659. * @param {*} value The value to query.
  6660. * @returns {string} Returns the raw `toStringTag`.
  6661. */
  6662. function getRawTag(value) {
  6663. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6664. tag = value[symToStringTag];
  6665. try {
  6666. value[symToStringTag] = undefined;
  6667. var unmasked = true;
  6668. } catch (e) {}
  6669. var result = nativeObjectToString.call(value);
  6670. if (unmasked) {
  6671. if (isOwn) {
  6672. value[symToStringTag] = tag;
  6673. } else {
  6674. delete value[symToStringTag];
  6675. }
  6676. }
  6677. return result;
  6678. }
  6679. /**
  6680. * Creates an array of the own enumerable symbols of `object`.
  6681. *
  6682. * @private
  6683. * @param {Object} object The object to query.
  6684. * @returns {Array} Returns the array of symbols.
  6685. */
  6686. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6687. if (object == null) {
  6688. return [];
  6689. }
  6690. object = Object(object);
  6691. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6692. return propertyIsEnumerable.call(object, symbol);
  6693. });
  6694. };
  6695. /**
  6696. * Creates an array of the own and inherited enumerable symbols of `object`.
  6697. *
  6698. * @private
  6699. * @param {Object} object The object to query.
  6700. * @returns {Array} Returns the array of symbols.
  6701. */
  6702. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6703. var result = [];
  6704. while (object) {
  6705. arrayPush(result, getSymbols(object));
  6706. object = getPrototype(object);
  6707. }
  6708. return result;
  6709. };
  6710. /**
  6711. * Gets the `toStringTag` of `value`.
  6712. *
  6713. * @private
  6714. * @param {*} value The value to query.
  6715. * @returns {string} Returns the `toStringTag`.
  6716. */
  6717. var getTag = baseGetTag;
  6718. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6719. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6720. (Map && getTag(new Map) != mapTag) ||
  6721. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6722. (Set && getTag(new Set) != setTag) ||
  6723. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6724. getTag = function(value) {
  6725. var result = baseGetTag(value),
  6726. Ctor = result == objectTag ? value.constructor : undefined,
  6727. ctorString = Ctor ? toSource(Ctor) : '';
  6728. if (ctorString) {
  6729. switch (ctorString) {
  6730. case dataViewCtorString: return dataViewTag;
  6731. case mapCtorString: return mapTag;
  6732. case promiseCtorString: return promiseTag;
  6733. case setCtorString: return setTag;
  6734. case weakMapCtorString: return weakMapTag;
  6735. }
  6736. }
  6737. return result;
  6738. };
  6739. }
  6740. /**
  6741. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6742. *
  6743. * @private
  6744. * @param {number} start The start of the view.
  6745. * @param {number} end The end of the view.
  6746. * @param {Array} transforms The transformations to apply to the view.
  6747. * @returns {Object} Returns an object containing the `start` and `end`
  6748. * positions of the view.
  6749. */
  6750. function getView(start, end, transforms) {
  6751. var index = -1,
  6752. length = transforms.length;
  6753. while (++index < length) {
  6754. var data = transforms[index],
  6755. size = data.size;
  6756. switch (data.type) {
  6757. case 'drop': start += size; break;
  6758. case 'dropRight': end -= size; break;
  6759. case 'take': end = nativeMin(end, start + size); break;
  6760. case 'takeRight': start = nativeMax(start, end - size); break;
  6761. }
  6762. }
  6763. return { 'start': start, 'end': end };
  6764. }
  6765. /**
  6766. * Extracts wrapper details from the `source` body comment.
  6767. *
  6768. * @private
  6769. * @param {string} source The source to inspect.
  6770. * @returns {Array} Returns the wrapper details.
  6771. */
  6772. function getWrapDetails(source) {
  6773. var match = source.match(reWrapDetails);
  6774. return match ? match[1].split(reSplitDetails) : [];
  6775. }
  6776. /**
  6777. * Checks if `path` exists on `object`.
  6778. *
  6779. * @private
  6780. * @param {Object} object The object to query.
  6781. * @param {Array|string} path The path to check.
  6782. * @param {Function} hasFunc The function to check properties.
  6783. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6784. */
  6785. function hasPath(object, path, hasFunc) {
  6786. path = castPath(path, object);
  6787. var index = -1,
  6788. length = path.length,
  6789. result = false;
  6790. while (++index < length) {
  6791. var key = toKey(path[index]);
  6792. if (!(result = object != null && hasFunc(object, key))) {
  6793. break;
  6794. }
  6795. object = object[key];
  6796. }
  6797. if (result || ++index != length) {
  6798. return result;
  6799. }
  6800. length = object == null ? 0 : object.length;
  6801. return !!length && isLength(length) && isIndex(key, length) &&
  6802. (isArray(object) || isArguments(object));
  6803. }
  6804. /**
  6805. * Initializes an array clone.
  6806. *
  6807. * @private
  6808. * @param {Array} array The array to clone.
  6809. * @returns {Array} Returns the initialized clone.
  6810. */
  6811. function initCloneArray(array) {
  6812. var length = array.length,
  6813. result = new array.constructor(length);
  6814. // Add properties assigned by `RegExp#exec`.
  6815. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6816. result.index = array.index;
  6817. result.input = array.input;
  6818. }
  6819. return result;
  6820. }
  6821. /**
  6822. * Initializes an object clone.
  6823. *
  6824. * @private
  6825. * @param {Object} object The object to clone.
  6826. * @returns {Object} Returns the initialized clone.
  6827. */
  6828. function initCloneObject(object) {
  6829. return (typeof object.constructor == 'function' && !isPrototype(object))
  6830. ? baseCreate(getPrototype(object))
  6831. : {};
  6832. }
  6833. /**
  6834. * Initializes an object clone based on its `toStringTag`.
  6835. *
  6836. * **Note:** This function only supports cloning values with tags of
  6837. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6838. *
  6839. * @private
  6840. * @param {Object} object The object to clone.
  6841. * @param {string} tag The `toStringTag` of the object to clone.
  6842. * @param {boolean} [isDeep] Specify a deep clone.
  6843. * @returns {Object} Returns the initialized clone.
  6844. */
  6845. function initCloneByTag(object, tag, isDeep) {
  6846. var Ctor = object.constructor;
  6847. switch (tag) {
  6848. case arrayBufferTag:
  6849. return cloneArrayBuffer(object);
  6850. case boolTag:
  6851. case dateTag:
  6852. return new Ctor(+object);
  6853. case dataViewTag:
  6854. return cloneDataView(object, isDeep);
  6855. case float32Tag: case float64Tag:
  6856. case int8Tag: case int16Tag: case int32Tag:
  6857. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6858. return cloneTypedArray(object, isDeep);
  6859. case mapTag:
  6860. return new Ctor;
  6861. case numberTag:
  6862. case stringTag:
  6863. return new Ctor(object);
  6864. case regexpTag:
  6865. return cloneRegExp(object);
  6866. case setTag:
  6867. return new Ctor;
  6868. case symbolTag:
  6869. return cloneSymbol(object);
  6870. }
  6871. }
  6872. /**
  6873. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6874. *
  6875. * @private
  6876. * @param {string} source The source to modify.
  6877. * @returns {Array} details The details to insert.
  6878. * @returns {string} Returns the modified source.
  6879. */
  6880. function insertWrapDetails(source, details) {
  6881. var length = details.length;
  6882. if (!length) {
  6883. return source;
  6884. }
  6885. var lastIndex = length - 1;
  6886. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6887. details = details.join(length > 2 ? ', ' : ' ');
  6888. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6889. }
  6890. /**
  6891. * Checks if `value` is a flattenable `arguments` object or array.
  6892. *
  6893. * @private
  6894. * @param {*} value The value to check.
  6895. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6896. */
  6897. function isFlattenable(value) {
  6898. return isArray(value) || isArguments(value) ||
  6899. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6900. }
  6901. /**
  6902. * Checks if `value` is a valid array-like index.
  6903. *
  6904. * @private
  6905. * @param {*} value The value to check.
  6906. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6907. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6908. */
  6909. function isIndex(value, length) {
  6910. var type = typeof value;
  6911. length = length == null ? MAX_SAFE_INTEGER : length;
  6912. return !!length &&
  6913. (type == 'number' ||
  6914. (type != 'symbol' && reIsUint.test(value))) &&
  6915. (value > -1 && value % 1 == 0 && value < length);
  6916. }
  6917. /**
  6918. * Checks if the given arguments are from an iteratee call.
  6919. *
  6920. * @private
  6921. * @param {*} value The potential iteratee value argument.
  6922. * @param {*} index The potential iteratee index or key argument.
  6923. * @param {*} object The potential iteratee object argument.
  6924. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6925. * else `false`.
  6926. */
  6927. function isIterateeCall(value, index, object) {
  6928. if (!isObject(object)) {
  6929. return false;
  6930. }
  6931. var type = typeof index;
  6932. if (type == 'number'
  6933. ? (isArrayLike(object) && isIndex(index, object.length))
  6934. : (type == 'string' && index in object)
  6935. ) {
  6936. return eq(object[index], value);
  6937. }
  6938. return false;
  6939. }
  6940. /**
  6941. * Checks if `value` is a property name and not a property path.
  6942. *
  6943. * @private
  6944. * @param {*} value The value to check.
  6945. * @param {Object} [object] The object to query keys on.
  6946. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6947. */
  6948. function isKey(value, object) {
  6949. if (isArray(value)) {
  6950. return false;
  6951. }
  6952. var type = typeof value;
  6953. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6954. value == null || isSymbol(value)) {
  6955. return true;
  6956. }
  6957. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6958. (object != null && value in Object(object));
  6959. }
  6960. /**
  6961. * Checks if `value` is suitable for use as unique object key.
  6962. *
  6963. * @private
  6964. * @param {*} value The value to check.
  6965. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6966. */
  6967. function isKeyable(value) {
  6968. var type = typeof value;
  6969. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6970. ? (value !== '__proto__')
  6971. : (value === null);
  6972. }
  6973. /**
  6974. * Checks if `func` has a lazy counterpart.
  6975. *
  6976. * @private
  6977. * @param {Function} func The function to check.
  6978. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6979. * else `false`.
  6980. */
  6981. function isLaziable(func) {
  6982. var funcName = getFuncName(func),
  6983. other = lodash[funcName];
  6984. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6985. return false;
  6986. }
  6987. if (func === other) {
  6988. return true;
  6989. }
  6990. var data = getData(other);
  6991. return !!data && func === data[0];
  6992. }
  6993. /**
  6994. * Checks if `func` has its source masked.
  6995. *
  6996. * @private
  6997. * @param {Function} func The function to check.
  6998. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6999. */
  7000. function isMasked(func) {
  7001. return !!maskSrcKey && (maskSrcKey in func);
  7002. }
  7003. /**
  7004. * Checks if `func` is capable of being masked.
  7005. *
  7006. * @private
  7007. * @param {*} value The value to check.
  7008. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7009. */
  7010. var isMaskable = coreJsData ? isFunction : stubFalse;
  7011. /**
  7012. * Checks if `value` is likely a prototype object.
  7013. *
  7014. * @private
  7015. * @param {*} value The value to check.
  7016. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7017. */
  7018. function isPrototype(value) {
  7019. var Ctor = value && value.constructor,
  7020. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7021. return value === proto;
  7022. }
  7023. /**
  7024. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7025. *
  7026. * @private
  7027. * @param {*} value The value to check.
  7028. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7029. * equality comparisons, else `false`.
  7030. */
  7031. function isStrictComparable(value) {
  7032. return value === value && !isObject(value);
  7033. }
  7034. /**
  7035. * A specialized version of `matchesProperty` for source values suitable
  7036. * for strict equality comparisons, i.e. `===`.
  7037. *
  7038. * @private
  7039. * @param {string} key The key of the property to get.
  7040. * @param {*} srcValue The value to match.
  7041. * @returns {Function} Returns the new spec function.
  7042. */
  7043. function matchesStrictComparable(key, srcValue) {
  7044. return function(object) {
  7045. if (object == null) {
  7046. return false;
  7047. }
  7048. return object[key] === srcValue &&
  7049. (srcValue !== undefined || (key in Object(object)));
  7050. };
  7051. }
  7052. /**
  7053. * A specialized version of `_.memoize` which clears the memoized function's
  7054. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7055. *
  7056. * @private
  7057. * @param {Function} func The function to have its output memoized.
  7058. * @returns {Function} Returns the new memoized function.
  7059. */
  7060. function memoizeCapped(func) {
  7061. var result = memoize(func, function(key) {
  7062. if (cache.size === MAX_MEMOIZE_SIZE) {
  7063. cache.clear();
  7064. }
  7065. return key;
  7066. });
  7067. var cache = result.cache;
  7068. return result;
  7069. }
  7070. /**
  7071. * Merges the function metadata of `source` into `data`.
  7072. *
  7073. * Merging metadata reduces the number of wrappers used to invoke a function.
  7074. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7075. * may be applied regardless of execution order. Methods like `_.ary` and
  7076. * `_.rearg` modify function arguments, making the order in which they are
  7077. * executed important, preventing the merging of metadata. However, we make
  7078. * an exception for a safe combined case where curried functions have `_.ary`
  7079. * and or `_.rearg` applied.
  7080. *
  7081. * @private
  7082. * @param {Array} data The destination metadata.
  7083. * @param {Array} source The source metadata.
  7084. * @returns {Array} Returns `data`.
  7085. */
  7086. function mergeData(data, source) {
  7087. var bitmask = data[1],
  7088. srcBitmask = source[1],
  7089. newBitmask = bitmask | srcBitmask,
  7090. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7091. var isCombo =
  7092. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7093. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7094. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7095. // Exit early if metadata can't be merged.
  7096. if (!(isCommon || isCombo)) {
  7097. return data;
  7098. }
  7099. // Use source `thisArg` if available.
  7100. if (srcBitmask & WRAP_BIND_FLAG) {
  7101. data[2] = source[2];
  7102. // Set when currying a bound function.
  7103. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7104. }
  7105. // Compose partial arguments.
  7106. var value = source[3];
  7107. if (value) {
  7108. var partials = data[3];
  7109. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7110. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7111. }
  7112. // Compose partial right arguments.
  7113. value = source[5];
  7114. if (value) {
  7115. partials = data[5];
  7116. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7117. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7118. }
  7119. // Use source `argPos` if available.
  7120. value = source[7];
  7121. if (value) {
  7122. data[7] = value;
  7123. }
  7124. // Use source `ary` if it's smaller.
  7125. if (srcBitmask & WRAP_ARY_FLAG) {
  7126. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7127. }
  7128. // Use source `arity` if one is not provided.
  7129. if (data[9] == null) {
  7130. data[9] = source[9];
  7131. }
  7132. // Use source `func` and merge bitmasks.
  7133. data[0] = source[0];
  7134. data[1] = newBitmask;
  7135. return data;
  7136. }
  7137. /**
  7138. * This function is like
  7139. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7140. * except that it includes inherited enumerable properties.
  7141. *
  7142. * @private
  7143. * @param {Object} object The object to query.
  7144. * @returns {Array} Returns the array of property names.
  7145. */
  7146. function nativeKeysIn(object) {
  7147. var result = [];
  7148. if (object != null) {
  7149. for (var key in Object(object)) {
  7150. result.push(key);
  7151. }
  7152. }
  7153. return result;
  7154. }
  7155. /**
  7156. * Converts `value` to a string using `Object.prototype.toString`.
  7157. *
  7158. * @private
  7159. * @param {*} value The value to convert.
  7160. * @returns {string} Returns the converted string.
  7161. */
  7162. function objectToString(value) {
  7163. return nativeObjectToString.call(value);
  7164. }
  7165. /**
  7166. * A specialized version of `baseRest` which transforms the rest array.
  7167. *
  7168. * @private
  7169. * @param {Function} func The function to apply a rest parameter to.
  7170. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7171. * @param {Function} transform The rest array transform.
  7172. * @returns {Function} Returns the new function.
  7173. */
  7174. function overRest(func, start, transform) {
  7175. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7176. return function() {
  7177. var args = arguments,
  7178. index = -1,
  7179. length = nativeMax(args.length - start, 0),
  7180. array = Array(length);
  7181. while (++index < length) {
  7182. array[index] = args[start + index];
  7183. }
  7184. index = -1;
  7185. var otherArgs = Array(start + 1);
  7186. while (++index < start) {
  7187. otherArgs[index] = args[index];
  7188. }
  7189. otherArgs[start] = transform(array);
  7190. return apply(func, this, otherArgs);
  7191. };
  7192. }
  7193. /**
  7194. * Gets the parent value at `path` of `object`.
  7195. *
  7196. * @private
  7197. * @param {Object} object The object to query.
  7198. * @param {Array} path The path to get the parent value of.
  7199. * @returns {*} Returns the parent value.
  7200. */
  7201. function parent(object, path) {
  7202. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7203. }
  7204. /**
  7205. * Reorder `array` according to the specified indexes where the element at
  7206. * the first index is assigned as the first element, the element at
  7207. * the second index is assigned as the second element, and so on.
  7208. *
  7209. * @private
  7210. * @param {Array} array The array to reorder.
  7211. * @param {Array} indexes The arranged array indexes.
  7212. * @returns {Array} Returns `array`.
  7213. */
  7214. function reorder(array, indexes) {
  7215. var arrLength = array.length,
  7216. length = nativeMin(indexes.length, arrLength),
  7217. oldArray = copyArray(array);
  7218. while (length--) {
  7219. var index = indexes[length];
  7220. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7221. }
  7222. return array;
  7223. }
  7224. /**
  7225. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7226. *
  7227. * @private
  7228. * @param {Object} object The object to query.
  7229. * @param {string} key The key of the property to get.
  7230. * @returns {*} Returns the property value.
  7231. */
  7232. function safeGet(object, key) {
  7233. if (key === 'constructor' && typeof object[key] === 'function') {
  7234. return;
  7235. }
  7236. if (key == '__proto__') {
  7237. return;
  7238. }
  7239. return object[key];
  7240. }
  7241. /**
  7242. * Sets metadata for `func`.
  7243. *
  7244. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7245. * period of time, it will trip its breaker and transition to an identity
  7246. * function to avoid garbage collection pauses in V8. See
  7247. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7248. * for more details.
  7249. *
  7250. * @private
  7251. * @param {Function} func The function to associate metadata with.
  7252. * @param {*} data The metadata.
  7253. * @returns {Function} Returns `func`.
  7254. */
  7255. var setData = shortOut(baseSetData);
  7256. /**
  7257. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7258. *
  7259. * @private
  7260. * @param {Function} func The function to delay.
  7261. * @param {number} wait The number of milliseconds to delay invocation.
  7262. * @returns {number|Object} Returns the timer id or timeout object.
  7263. */
  7264. var setTimeout = ctxSetTimeout || function(func, wait) {
  7265. return root.setTimeout(func, wait);
  7266. };
  7267. /**
  7268. * Sets the `toString` method of `func` to return `string`.
  7269. *
  7270. * @private
  7271. * @param {Function} func The function to modify.
  7272. * @param {Function} string The `toString` result.
  7273. * @returns {Function} Returns `func`.
  7274. */
  7275. var setToString = shortOut(baseSetToString);
  7276. /**
  7277. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7278. * with wrapper details in a comment at the top of the source body.
  7279. *
  7280. * @private
  7281. * @param {Function} wrapper The function to modify.
  7282. * @param {Function} reference The reference function.
  7283. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7284. * @returns {Function} Returns `wrapper`.
  7285. */
  7286. function setWrapToString(wrapper, reference, bitmask) {
  7287. var source = (reference + '');
  7288. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7289. }
  7290. /**
  7291. * Creates a function that'll short out and invoke `identity` instead
  7292. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7293. * milliseconds.
  7294. *
  7295. * @private
  7296. * @param {Function} func The function to restrict.
  7297. * @returns {Function} Returns the new shortable function.
  7298. */
  7299. function shortOut(func) {
  7300. var count = 0,
  7301. lastCalled = 0;
  7302. return function() {
  7303. var stamp = nativeNow(),
  7304. remaining = HOT_SPAN - (stamp - lastCalled);
  7305. lastCalled = stamp;
  7306. if (remaining > 0) {
  7307. if (++count >= HOT_COUNT) {
  7308. return arguments[0];
  7309. }
  7310. } else {
  7311. count = 0;
  7312. }
  7313. return func.apply(undefined, arguments);
  7314. };
  7315. }
  7316. /**
  7317. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7318. *
  7319. * @private
  7320. * @param {Array} array The array to shuffle.
  7321. * @param {number} [size=array.length] The size of `array`.
  7322. * @returns {Array} Returns `array`.
  7323. */
  7324. function shuffleSelf(array, size) {
  7325. var index = -1,
  7326. length = array.length,
  7327. lastIndex = length - 1;
  7328. size = size === undefined ? length : size;
  7329. while (++index < size) {
  7330. var rand = baseRandom(index, lastIndex),
  7331. value = array[rand];
  7332. array[rand] = array[index];
  7333. array[index] = value;
  7334. }
  7335. array.length = size;
  7336. return array;
  7337. }
  7338. /**
  7339. * Converts `string` to a property path array.
  7340. *
  7341. * @private
  7342. * @param {string} string The string to convert.
  7343. * @returns {Array} Returns the property path array.
  7344. */
  7345. var stringToPath = memoizeCapped(function(string) {
  7346. var result = [];
  7347. if (string.charCodeAt(0) === 46 /* . */) {
  7348. result.push('');
  7349. }
  7350. string.replace(rePropName, function(match, number, quote, subString) {
  7351. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7352. });
  7353. return result;
  7354. });
  7355. /**
  7356. * Converts `value` to a string key if it's not a string or symbol.
  7357. *
  7358. * @private
  7359. * @param {*} value The value to inspect.
  7360. * @returns {string|symbol} Returns the key.
  7361. */
  7362. function toKey(value) {
  7363. if (typeof value == 'string' || isSymbol(value)) {
  7364. return value;
  7365. }
  7366. var result = (value + '');
  7367. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7368. }
  7369. /**
  7370. * Converts `func` to its source code.
  7371. *
  7372. * @private
  7373. * @param {Function} func The function to convert.
  7374. * @returns {string} Returns the source code.
  7375. */
  7376. function toSource(func) {
  7377. if (func != null) {
  7378. try {
  7379. return funcToString.call(func);
  7380. } catch (e) {}
  7381. try {
  7382. return (func + '');
  7383. } catch (e) {}
  7384. }
  7385. return '';
  7386. }
  7387. /**
  7388. * Updates wrapper `details` based on `bitmask` flags.
  7389. *
  7390. * @private
  7391. * @returns {Array} details The details to modify.
  7392. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7393. * @returns {Array} Returns `details`.
  7394. */
  7395. function updateWrapDetails(details, bitmask) {
  7396. arrayEach(wrapFlags, function(pair) {
  7397. var value = '_.' + pair[0];
  7398. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7399. details.push(value);
  7400. }
  7401. });
  7402. return details.sort();
  7403. }
  7404. /**
  7405. * Creates a clone of `wrapper`.
  7406. *
  7407. * @private
  7408. * @param {Object} wrapper The wrapper to clone.
  7409. * @returns {Object} Returns the cloned wrapper.
  7410. */
  7411. function wrapperClone(wrapper) {
  7412. if (wrapper instanceof LazyWrapper) {
  7413. return wrapper.clone();
  7414. }
  7415. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7416. result.__actions__ = copyArray(wrapper.__actions__);
  7417. result.__index__ = wrapper.__index__;
  7418. result.__values__ = wrapper.__values__;
  7419. return result;
  7420. }
  7421. /*------------------------------------------------------------------------*/
  7422. /**
  7423. * Creates an array of elements split into groups the length of `size`.
  7424. * If `array` can't be split evenly, the final chunk will be the remaining
  7425. * elements.
  7426. *
  7427. * @static
  7428. * @memberOf _
  7429. * @since 3.0.0
  7430. * @category Array
  7431. * @param {Array} array The array to process.
  7432. * @param {number} [size=1] The length of each chunk
  7433. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7434. * @returns {Array} Returns the new array of chunks.
  7435. * @example
  7436. *
  7437. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7438. * // => [['a', 'b'], ['c', 'd']]
  7439. *
  7440. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7441. * // => [['a', 'b', 'c'], ['d']]
  7442. */
  7443. function chunk(array, size, guard) {
  7444. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7445. size = 1;
  7446. } else {
  7447. size = nativeMax(toInteger(size), 0);
  7448. }
  7449. var length = array == null ? 0 : array.length;
  7450. if (!length || size < 1) {
  7451. return [];
  7452. }
  7453. var index = 0,
  7454. resIndex = 0,
  7455. result = Array(nativeCeil(length / size));
  7456. while (index < length) {
  7457. result[resIndex++] = baseSlice(array, index, (index += size));
  7458. }
  7459. return result;
  7460. }
  7461. /**
  7462. * Creates an array with all falsey values removed. The values `false`, `null`,
  7463. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7464. *
  7465. * @static
  7466. * @memberOf _
  7467. * @since 0.1.0
  7468. * @category Array
  7469. * @param {Array} array The array to compact.
  7470. * @returns {Array} Returns the new array of filtered values.
  7471. * @example
  7472. *
  7473. * _.compact([0, 1, false, 2, '', 3]);
  7474. * // => [1, 2, 3]
  7475. */
  7476. function compact(array) {
  7477. var index = -1,
  7478. length = array == null ? 0 : array.length,
  7479. resIndex = 0,
  7480. result = [];
  7481. while (++index < length) {
  7482. var value = array[index];
  7483. if (value) {
  7484. result[resIndex++] = value;
  7485. }
  7486. }
  7487. return result;
  7488. }
  7489. /**
  7490. * Creates a new array concatenating `array` with any additional arrays
  7491. * and/or values.
  7492. *
  7493. * @static
  7494. * @memberOf _
  7495. * @since 4.0.0
  7496. * @category Array
  7497. * @param {Array} array The array to concatenate.
  7498. * @param {...*} [values] The values to concatenate.
  7499. * @returns {Array} Returns the new concatenated array.
  7500. * @example
  7501. *
  7502. * var array = [1];
  7503. * var other = _.concat(array, 2, [3], [[4]]);
  7504. *
  7505. * console.log(other);
  7506. * // => [1, 2, 3, [4]]
  7507. *
  7508. * console.log(array);
  7509. * // => [1]
  7510. */
  7511. function concat() {
  7512. var length = arguments.length;
  7513. if (!length) {
  7514. return [];
  7515. }
  7516. var args = Array(length - 1),
  7517. array = arguments[0],
  7518. index = length;
  7519. while (index--) {
  7520. args[index - 1] = arguments[index];
  7521. }
  7522. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7523. }
  7524. /**
  7525. * Creates an array of `array` values not included in the other given arrays
  7526. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7527. * for equality comparisons. The order and references of result values are
  7528. * determined by the first array.
  7529. *
  7530. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7531. *
  7532. * @static
  7533. * @memberOf _
  7534. * @since 0.1.0
  7535. * @category Array
  7536. * @param {Array} array The array to inspect.
  7537. * @param {...Array} [values] The values to exclude.
  7538. * @returns {Array} Returns the new array of filtered values.
  7539. * @see _.without, _.xor
  7540. * @example
  7541. *
  7542. * _.difference([2, 1], [2, 3]);
  7543. * // => [1]
  7544. */
  7545. var difference = baseRest(function(array, values) {
  7546. return isArrayLikeObject(array)
  7547. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7548. : [];
  7549. });
  7550. /**
  7551. * This method is like `_.difference` except that it accepts `iteratee` which
  7552. * is invoked for each element of `array` and `values` to generate the criterion
  7553. * by which they're compared. The order and references of result values are
  7554. * determined by the first array. The iteratee is invoked with one argument:
  7555. * (value).
  7556. *
  7557. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7558. *
  7559. * @static
  7560. * @memberOf _
  7561. * @since 4.0.0
  7562. * @category Array
  7563. * @param {Array} array The array to inspect.
  7564. * @param {...Array} [values] The values to exclude.
  7565. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7566. * @returns {Array} Returns the new array of filtered values.
  7567. * @example
  7568. *
  7569. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7570. * // => [1.2]
  7571. *
  7572. * // The `_.property` iteratee shorthand.
  7573. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7574. * // => [{ 'x': 2 }]
  7575. */
  7576. var differenceBy = baseRest(function(array, values) {
  7577. var iteratee = last(values);
  7578. if (isArrayLikeObject(iteratee)) {
  7579. iteratee = undefined;
  7580. }
  7581. return isArrayLikeObject(array)
  7582. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7583. : [];
  7584. });
  7585. /**
  7586. * This method is like `_.difference` except that it accepts `comparator`
  7587. * which is invoked to compare elements of `array` to `values`. The order and
  7588. * references of result values are determined by the first array. The comparator
  7589. * is invoked with two arguments: (arrVal, othVal).
  7590. *
  7591. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7592. *
  7593. * @static
  7594. * @memberOf _
  7595. * @since 4.0.0
  7596. * @category Array
  7597. * @param {Array} array The array to inspect.
  7598. * @param {...Array} [values] The values to exclude.
  7599. * @param {Function} [comparator] The comparator invoked per element.
  7600. * @returns {Array} Returns the new array of filtered values.
  7601. * @example
  7602. *
  7603. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7604. *
  7605. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7606. * // => [{ 'x': 2, 'y': 1 }]
  7607. */
  7608. var differenceWith = baseRest(function(array, values) {
  7609. var comparator = last(values);
  7610. if (isArrayLikeObject(comparator)) {
  7611. comparator = undefined;
  7612. }
  7613. return isArrayLikeObject(array)
  7614. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7615. : [];
  7616. });
  7617. /**
  7618. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7619. *
  7620. * @static
  7621. * @memberOf _
  7622. * @since 0.5.0
  7623. * @category Array
  7624. * @param {Array} array The array to query.
  7625. * @param {number} [n=1] The number of elements to drop.
  7626. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7627. * @returns {Array} Returns the slice of `array`.
  7628. * @example
  7629. *
  7630. * _.drop([1, 2, 3]);
  7631. * // => [2, 3]
  7632. *
  7633. * _.drop([1, 2, 3], 2);
  7634. * // => [3]
  7635. *
  7636. * _.drop([1, 2, 3], 5);
  7637. * // => []
  7638. *
  7639. * _.drop([1, 2, 3], 0);
  7640. * // => [1, 2, 3]
  7641. */
  7642. function drop(array, n, guard) {
  7643. var length = array == null ? 0 : array.length;
  7644. if (!length) {
  7645. return [];
  7646. }
  7647. n = (guard || n === undefined) ? 1 : toInteger(n);
  7648. return baseSlice(array, n < 0 ? 0 : n, length);
  7649. }
  7650. /**
  7651. * Creates a slice of `array` with `n` elements dropped from the end.
  7652. *
  7653. * @static
  7654. * @memberOf _
  7655. * @since 3.0.0
  7656. * @category Array
  7657. * @param {Array} array The array to query.
  7658. * @param {number} [n=1] The number of elements to drop.
  7659. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7660. * @returns {Array} Returns the slice of `array`.
  7661. * @example
  7662. *
  7663. * _.dropRight([1, 2, 3]);
  7664. * // => [1, 2]
  7665. *
  7666. * _.dropRight([1, 2, 3], 2);
  7667. * // => [1]
  7668. *
  7669. * _.dropRight([1, 2, 3], 5);
  7670. * // => []
  7671. *
  7672. * _.dropRight([1, 2, 3], 0);
  7673. * // => [1, 2, 3]
  7674. */
  7675. function dropRight(array, n, guard) {
  7676. var length = array == null ? 0 : array.length;
  7677. if (!length) {
  7678. return [];
  7679. }
  7680. n = (guard || n === undefined) ? 1 : toInteger(n);
  7681. n = length - n;
  7682. return baseSlice(array, 0, n < 0 ? 0 : n);
  7683. }
  7684. /**
  7685. * Creates a slice of `array` excluding elements dropped from the end.
  7686. * Elements are dropped until `predicate` returns falsey. The predicate is
  7687. * invoked with three arguments: (value, index, array).
  7688. *
  7689. * @static
  7690. * @memberOf _
  7691. * @since 3.0.0
  7692. * @category Array
  7693. * @param {Array} array The array to query.
  7694. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7695. * @returns {Array} Returns the slice of `array`.
  7696. * @example
  7697. *
  7698. * var users = [
  7699. * { 'user': 'barney', 'active': true },
  7700. * { 'user': 'fred', 'active': false },
  7701. * { 'user': 'pebbles', 'active': false }
  7702. * ];
  7703. *
  7704. * _.dropRightWhile(users, function(o) { return !o.active; });
  7705. * // => objects for ['barney']
  7706. *
  7707. * // The `_.matches` iteratee shorthand.
  7708. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7709. * // => objects for ['barney', 'fred']
  7710. *
  7711. * // The `_.matchesProperty` iteratee shorthand.
  7712. * _.dropRightWhile(users, ['active', false]);
  7713. * // => objects for ['barney']
  7714. *
  7715. * // The `_.property` iteratee shorthand.
  7716. * _.dropRightWhile(users, 'active');
  7717. * // => objects for ['barney', 'fred', 'pebbles']
  7718. */
  7719. function dropRightWhile(array, predicate) {
  7720. return (array && array.length)
  7721. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7722. : [];
  7723. }
  7724. /**
  7725. * Creates a slice of `array` excluding elements dropped from the beginning.
  7726. * Elements are dropped until `predicate` returns falsey. The predicate is
  7727. * invoked with three arguments: (value, index, array).
  7728. *
  7729. * @static
  7730. * @memberOf _
  7731. * @since 3.0.0
  7732. * @category Array
  7733. * @param {Array} array The array to query.
  7734. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7735. * @returns {Array} Returns the slice of `array`.
  7736. * @example
  7737. *
  7738. * var users = [
  7739. * { 'user': 'barney', 'active': false },
  7740. * { 'user': 'fred', 'active': false },
  7741. * { 'user': 'pebbles', 'active': true }
  7742. * ];
  7743. *
  7744. * _.dropWhile(users, function(o) { return !o.active; });
  7745. * // => objects for ['pebbles']
  7746. *
  7747. * // The `_.matches` iteratee shorthand.
  7748. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7749. * // => objects for ['fred', 'pebbles']
  7750. *
  7751. * // The `_.matchesProperty` iteratee shorthand.
  7752. * _.dropWhile(users, ['active', false]);
  7753. * // => objects for ['pebbles']
  7754. *
  7755. * // The `_.property` iteratee shorthand.
  7756. * _.dropWhile(users, 'active');
  7757. * // => objects for ['barney', 'fred', 'pebbles']
  7758. */
  7759. function dropWhile(array, predicate) {
  7760. return (array && array.length)
  7761. ? baseWhile(array, getIteratee(predicate, 3), true)
  7762. : [];
  7763. }
  7764. /**
  7765. * Fills elements of `array` with `value` from `start` up to, but not
  7766. * including, `end`.
  7767. *
  7768. * **Note:** This method mutates `array`.
  7769. *
  7770. * @static
  7771. * @memberOf _
  7772. * @since 3.2.0
  7773. * @category Array
  7774. * @param {Array} array The array to fill.
  7775. * @param {*} value The value to fill `array` with.
  7776. * @param {number} [start=0] The start position.
  7777. * @param {number} [end=array.length] The end position.
  7778. * @returns {Array} Returns `array`.
  7779. * @example
  7780. *
  7781. * var array = [1, 2, 3];
  7782. *
  7783. * _.fill(array, 'a');
  7784. * console.log(array);
  7785. * // => ['a', 'a', 'a']
  7786. *
  7787. * _.fill(Array(3), 2);
  7788. * // => [2, 2, 2]
  7789. *
  7790. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7791. * // => [4, '*', '*', 10]
  7792. */
  7793. function fill(array, value, start, end) {
  7794. var length = array == null ? 0 : array.length;
  7795. if (!length) {
  7796. return [];
  7797. }
  7798. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7799. start = 0;
  7800. end = length;
  7801. }
  7802. return baseFill(array, value, start, end);
  7803. }
  7804. /**
  7805. * This method is like `_.find` except that it returns the index of the first
  7806. * element `predicate` returns truthy for instead of the element itself.
  7807. *
  7808. * @static
  7809. * @memberOf _
  7810. * @since 1.1.0
  7811. * @category Array
  7812. * @param {Array} array The array to inspect.
  7813. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7814. * @param {number} [fromIndex=0] The index to search from.
  7815. * @returns {number} Returns the index of the found element, else `-1`.
  7816. * @example
  7817. *
  7818. * var users = [
  7819. * { 'user': 'barney', 'active': false },
  7820. * { 'user': 'fred', 'active': false },
  7821. * { 'user': 'pebbles', 'active': true }
  7822. * ];
  7823. *
  7824. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7825. * // => 0
  7826. *
  7827. * // The `_.matches` iteratee shorthand.
  7828. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7829. * // => 1
  7830. *
  7831. * // The `_.matchesProperty` iteratee shorthand.
  7832. * _.findIndex(users, ['active', false]);
  7833. * // => 0
  7834. *
  7835. * // The `_.property` iteratee shorthand.
  7836. * _.findIndex(users, 'active');
  7837. * // => 2
  7838. */
  7839. function findIndex(array, predicate, fromIndex) {
  7840. var length = array == null ? 0 : array.length;
  7841. if (!length) {
  7842. return -1;
  7843. }
  7844. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7845. if (index < 0) {
  7846. index = nativeMax(length + index, 0);
  7847. }
  7848. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7849. }
  7850. /**
  7851. * This method is like `_.findIndex` except that it iterates over elements
  7852. * of `collection` from right to left.
  7853. *
  7854. * @static
  7855. * @memberOf _
  7856. * @since 2.0.0
  7857. * @category Array
  7858. * @param {Array} array The array to inspect.
  7859. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7860. * @param {number} [fromIndex=array.length-1] The index to search from.
  7861. * @returns {number} Returns the index of the found element, else `-1`.
  7862. * @example
  7863. *
  7864. * var users = [
  7865. * { 'user': 'barney', 'active': true },
  7866. * { 'user': 'fred', 'active': false },
  7867. * { 'user': 'pebbles', 'active': false }
  7868. * ];
  7869. *
  7870. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7871. * // => 2
  7872. *
  7873. * // The `_.matches` iteratee shorthand.
  7874. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7875. * // => 0
  7876. *
  7877. * // The `_.matchesProperty` iteratee shorthand.
  7878. * _.findLastIndex(users, ['active', false]);
  7879. * // => 2
  7880. *
  7881. * // The `_.property` iteratee shorthand.
  7882. * _.findLastIndex(users, 'active');
  7883. * // => 0
  7884. */
  7885. function findLastIndex(array, predicate, fromIndex) {
  7886. var length = array == null ? 0 : array.length;
  7887. if (!length) {
  7888. return -1;
  7889. }
  7890. var index = length - 1;
  7891. if (fromIndex !== undefined) {
  7892. index = toInteger(fromIndex);
  7893. index = fromIndex < 0
  7894. ? nativeMax(length + index, 0)
  7895. : nativeMin(index, length - 1);
  7896. }
  7897. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7898. }
  7899. /**
  7900. * Flattens `array` a single level deep.
  7901. *
  7902. * @static
  7903. * @memberOf _
  7904. * @since 0.1.0
  7905. * @category Array
  7906. * @param {Array} array The array to flatten.
  7907. * @returns {Array} Returns the new flattened array.
  7908. * @example
  7909. *
  7910. * _.flatten([1, [2, [3, [4]], 5]]);
  7911. * // => [1, 2, [3, [4]], 5]
  7912. */
  7913. function flatten(array) {
  7914. var length = array == null ? 0 : array.length;
  7915. return length ? baseFlatten(array, 1) : [];
  7916. }
  7917. /**
  7918. * Recursively flattens `array`.
  7919. *
  7920. * @static
  7921. * @memberOf _
  7922. * @since 3.0.0
  7923. * @category Array
  7924. * @param {Array} array The array to flatten.
  7925. * @returns {Array} Returns the new flattened array.
  7926. * @example
  7927. *
  7928. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7929. * // => [1, 2, 3, 4, 5]
  7930. */
  7931. function flattenDeep(array) {
  7932. var length = array == null ? 0 : array.length;
  7933. return length ? baseFlatten(array, INFINITY) : [];
  7934. }
  7935. /**
  7936. * Recursively flatten `array` up to `depth` times.
  7937. *
  7938. * @static
  7939. * @memberOf _
  7940. * @since 4.4.0
  7941. * @category Array
  7942. * @param {Array} array The array to flatten.
  7943. * @param {number} [depth=1] The maximum recursion depth.
  7944. * @returns {Array} Returns the new flattened array.
  7945. * @example
  7946. *
  7947. * var array = [1, [2, [3, [4]], 5]];
  7948. *
  7949. * _.flattenDepth(array, 1);
  7950. * // => [1, 2, [3, [4]], 5]
  7951. *
  7952. * _.flattenDepth(array, 2);
  7953. * // => [1, 2, 3, [4], 5]
  7954. */
  7955. function flattenDepth(array, depth) {
  7956. var length = array == null ? 0 : array.length;
  7957. if (!length) {
  7958. return [];
  7959. }
  7960. depth = depth === undefined ? 1 : toInteger(depth);
  7961. return baseFlatten(array, depth);
  7962. }
  7963. /**
  7964. * The inverse of `_.toPairs`; this method returns an object composed
  7965. * from key-value `pairs`.
  7966. *
  7967. * @static
  7968. * @memberOf _
  7969. * @since 4.0.0
  7970. * @category Array
  7971. * @param {Array} pairs The key-value pairs.
  7972. * @returns {Object} Returns the new object.
  7973. * @example
  7974. *
  7975. * _.fromPairs([['a', 1], ['b', 2]]);
  7976. * // => { 'a': 1, 'b': 2 }
  7977. */
  7978. function fromPairs(pairs) {
  7979. var index = -1,
  7980. length = pairs == null ? 0 : pairs.length,
  7981. result = {};
  7982. while (++index < length) {
  7983. var pair = pairs[index];
  7984. result[pair[0]] = pair[1];
  7985. }
  7986. return result;
  7987. }
  7988. /**
  7989. * Gets the first element of `array`.
  7990. *
  7991. * @static
  7992. * @memberOf _
  7993. * @since 0.1.0
  7994. * @alias first
  7995. * @category Array
  7996. * @param {Array} array The array to query.
  7997. * @returns {*} Returns the first element of `array`.
  7998. * @example
  7999. *
  8000. * _.head([1, 2, 3]);
  8001. * // => 1
  8002. *
  8003. * _.head([]);
  8004. * // => undefined
  8005. */
  8006. function head(array) {
  8007. return (array && array.length) ? array[0] : undefined;
  8008. }
  8009. /**
  8010. * Gets the index at which the first occurrence of `value` is found in `array`
  8011. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8012. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8013. * offset from the end of `array`.
  8014. *
  8015. * @static
  8016. * @memberOf _
  8017. * @since 0.1.0
  8018. * @category Array
  8019. * @param {Array} array The array to inspect.
  8020. * @param {*} value The value to search for.
  8021. * @param {number} [fromIndex=0] The index to search from.
  8022. * @returns {number} Returns the index of the matched value, else `-1`.
  8023. * @example
  8024. *
  8025. * _.indexOf([1, 2, 1, 2], 2);
  8026. * // => 1
  8027. *
  8028. * // Search from the `fromIndex`.
  8029. * _.indexOf([1, 2, 1, 2], 2, 2);
  8030. * // => 3
  8031. */
  8032. function indexOf(array, value, fromIndex) {
  8033. var length = array == null ? 0 : array.length;
  8034. if (!length) {
  8035. return -1;
  8036. }
  8037. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8038. if (index < 0) {
  8039. index = nativeMax(length + index, 0);
  8040. }
  8041. return baseIndexOf(array, value, index);
  8042. }
  8043. /**
  8044. * Gets all but the last element of `array`.
  8045. *
  8046. * @static
  8047. * @memberOf _
  8048. * @since 0.1.0
  8049. * @category Array
  8050. * @param {Array} array The array to query.
  8051. * @returns {Array} Returns the slice of `array`.
  8052. * @example
  8053. *
  8054. * _.initial([1, 2, 3]);
  8055. * // => [1, 2]
  8056. */
  8057. function initial(array) {
  8058. var length = array == null ? 0 : array.length;
  8059. return length ? baseSlice(array, 0, -1) : [];
  8060. }
  8061. /**
  8062. * Creates an array of unique values that are included in all given arrays
  8063. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8064. * for equality comparisons. The order and references of result values are
  8065. * determined by the first array.
  8066. *
  8067. * @static
  8068. * @memberOf _
  8069. * @since 0.1.0
  8070. * @category Array
  8071. * @param {...Array} [arrays] The arrays to inspect.
  8072. * @returns {Array} Returns the new array of intersecting values.
  8073. * @example
  8074. *
  8075. * _.intersection([2, 1], [2, 3]);
  8076. * // => [2]
  8077. */
  8078. var intersection = baseRest(function(arrays) {
  8079. var mapped = arrayMap(arrays, castArrayLikeObject);
  8080. return (mapped.length && mapped[0] === arrays[0])
  8081. ? baseIntersection(mapped)
  8082. : [];
  8083. });
  8084. /**
  8085. * This method is like `_.intersection` except that it accepts `iteratee`
  8086. * which is invoked for each element of each `arrays` to generate the criterion
  8087. * by which they're compared. The order and references of result values are
  8088. * determined by the first array. The iteratee is invoked with one argument:
  8089. * (value).
  8090. *
  8091. * @static
  8092. * @memberOf _
  8093. * @since 4.0.0
  8094. * @category Array
  8095. * @param {...Array} [arrays] The arrays to inspect.
  8096. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8097. * @returns {Array} Returns the new array of intersecting values.
  8098. * @example
  8099. *
  8100. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8101. * // => [2.1]
  8102. *
  8103. * // The `_.property` iteratee shorthand.
  8104. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8105. * // => [{ 'x': 1 }]
  8106. */
  8107. var intersectionBy = baseRest(function(arrays) {
  8108. var iteratee = last(arrays),
  8109. mapped = arrayMap(arrays, castArrayLikeObject);
  8110. if (iteratee === last(mapped)) {
  8111. iteratee = undefined;
  8112. } else {
  8113. mapped.pop();
  8114. }
  8115. return (mapped.length && mapped[0] === arrays[0])
  8116. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8117. : [];
  8118. });
  8119. /**
  8120. * This method is like `_.intersection` except that it accepts `comparator`
  8121. * which is invoked to compare elements of `arrays`. The order and references
  8122. * of result values are determined by the first array. The comparator is
  8123. * invoked with two arguments: (arrVal, othVal).
  8124. *
  8125. * @static
  8126. * @memberOf _
  8127. * @since 4.0.0
  8128. * @category Array
  8129. * @param {...Array} [arrays] The arrays to inspect.
  8130. * @param {Function} [comparator] The comparator invoked per element.
  8131. * @returns {Array} Returns the new array of intersecting values.
  8132. * @example
  8133. *
  8134. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8135. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8136. *
  8137. * _.intersectionWith(objects, others, _.isEqual);
  8138. * // => [{ 'x': 1, 'y': 2 }]
  8139. */
  8140. var intersectionWith = baseRest(function(arrays) {
  8141. var comparator = last(arrays),
  8142. mapped = arrayMap(arrays, castArrayLikeObject);
  8143. comparator = typeof comparator == 'function' ? comparator : undefined;
  8144. if (comparator) {
  8145. mapped.pop();
  8146. }
  8147. return (mapped.length && mapped[0] === arrays[0])
  8148. ? baseIntersection(mapped, undefined, comparator)
  8149. : [];
  8150. });
  8151. /**
  8152. * Converts all elements in `array` into a string separated by `separator`.
  8153. *
  8154. * @static
  8155. * @memberOf _
  8156. * @since 4.0.0
  8157. * @category Array
  8158. * @param {Array} array The array to convert.
  8159. * @param {string} [separator=','] The element separator.
  8160. * @returns {string} Returns the joined string.
  8161. * @example
  8162. *
  8163. * _.join(['a', 'b', 'c'], '~');
  8164. * // => 'a~b~c'
  8165. */
  8166. function join(array, separator) {
  8167. return array == null ? '' : nativeJoin.call(array, separator);
  8168. }
  8169. /**
  8170. * Gets the last element of `array`.
  8171. *
  8172. * @static
  8173. * @memberOf _
  8174. * @since 0.1.0
  8175. * @category Array
  8176. * @param {Array} array The array to query.
  8177. * @returns {*} Returns the last element of `array`.
  8178. * @example
  8179. *
  8180. * _.last([1, 2, 3]);
  8181. * // => 3
  8182. */
  8183. function last(array) {
  8184. var length = array == null ? 0 : array.length;
  8185. return length ? array[length - 1] : undefined;
  8186. }
  8187. /**
  8188. * This method is like `_.indexOf` except that it iterates over elements of
  8189. * `array` from right to left.
  8190. *
  8191. * @static
  8192. * @memberOf _
  8193. * @since 0.1.0
  8194. * @category Array
  8195. * @param {Array} array The array to inspect.
  8196. * @param {*} value The value to search for.
  8197. * @param {number} [fromIndex=array.length-1] The index to search from.
  8198. * @returns {number} Returns the index of the matched value, else `-1`.
  8199. * @example
  8200. *
  8201. * _.lastIndexOf([1, 2, 1, 2], 2);
  8202. * // => 3
  8203. *
  8204. * // Search from the `fromIndex`.
  8205. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8206. * // => 1
  8207. */
  8208. function lastIndexOf(array, value, fromIndex) {
  8209. var length = array == null ? 0 : array.length;
  8210. if (!length) {
  8211. return -1;
  8212. }
  8213. var index = length;
  8214. if (fromIndex !== undefined) {
  8215. index = toInteger(fromIndex);
  8216. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8217. }
  8218. return value === value
  8219. ? strictLastIndexOf(array, value, index)
  8220. : baseFindIndex(array, baseIsNaN, index, true);
  8221. }
  8222. /**
  8223. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8224. * element from the end is returned.
  8225. *
  8226. * @static
  8227. * @memberOf _
  8228. * @since 4.11.0
  8229. * @category Array
  8230. * @param {Array} array The array to query.
  8231. * @param {number} [n=0] The index of the element to return.
  8232. * @returns {*} Returns the nth element of `array`.
  8233. * @example
  8234. *
  8235. * var array = ['a', 'b', 'c', 'd'];
  8236. *
  8237. * _.nth(array, 1);
  8238. * // => 'b'
  8239. *
  8240. * _.nth(array, -2);
  8241. * // => 'c';
  8242. */
  8243. function nth(array, n) {
  8244. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8245. }
  8246. /**
  8247. * Removes all given values from `array` using
  8248. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8249. * for equality comparisons.
  8250. *
  8251. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8252. * to remove elements from an array by predicate.
  8253. *
  8254. * @static
  8255. * @memberOf _
  8256. * @since 2.0.0
  8257. * @category Array
  8258. * @param {Array} array The array to modify.
  8259. * @param {...*} [values] The values to remove.
  8260. * @returns {Array} Returns `array`.
  8261. * @example
  8262. *
  8263. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8264. *
  8265. * _.pull(array, 'a', 'c');
  8266. * console.log(array);
  8267. * // => ['b', 'b']
  8268. */
  8269. var pull = baseRest(pullAll);
  8270. /**
  8271. * This method is like `_.pull` except that it accepts an array of values to remove.
  8272. *
  8273. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8274. *
  8275. * @static
  8276. * @memberOf _
  8277. * @since 4.0.0
  8278. * @category Array
  8279. * @param {Array} array The array to modify.
  8280. * @param {Array} values The values to remove.
  8281. * @returns {Array} Returns `array`.
  8282. * @example
  8283. *
  8284. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8285. *
  8286. * _.pullAll(array, ['a', 'c']);
  8287. * console.log(array);
  8288. * // => ['b', 'b']
  8289. */
  8290. function pullAll(array, values) {
  8291. return (array && array.length && values && values.length)
  8292. ? basePullAll(array, values)
  8293. : array;
  8294. }
  8295. /**
  8296. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8297. * invoked for each element of `array` and `values` to generate the criterion
  8298. * by which they're compared. The iteratee is invoked with one argument: (value).
  8299. *
  8300. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8301. *
  8302. * @static
  8303. * @memberOf _
  8304. * @since 4.0.0
  8305. * @category Array
  8306. * @param {Array} array The array to modify.
  8307. * @param {Array} values The values to remove.
  8308. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8309. * @returns {Array} Returns `array`.
  8310. * @example
  8311. *
  8312. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8313. *
  8314. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8315. * console.log(array);
  8316. * // => [{ 'x': 2 }]
  8317. */
  8318. function pullAllBy(array, values, iteratee) {
  8319. return (array && array.length && values && values.length)
  8320. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8321. : array;
  8322. }
  8323. /**
  8324. * This method is like `_.pullAll` except that it accepts `comparator` which
  8325. * is invoked to compare elements of `array` to `values`. The comparator is
  8326. * invoked with two arguments: (arrVal, othVal).
  8327. *
  8328. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8329. *
  8330. * @static
  8331. * @memberOf _
  8332. * @since 4.6.0
  8333. * @category Array
  8334. * @param {Array} array The array to modify.
  8335. * @param {Array} values The values to remove.
  8336. * @param {Function} [comparator] The comparator invoked per element.
  8337. * @returns {Array} Returns `array`.
  8338. * @example
  8339. *
  8340. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8341. *
  8342. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8343. * console.log(array);
  8344. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8345. */
  8346. function pullAllWith(array, values, comparator) {
  8347. return (array && array.length && values && values.length)
  8348. ? basePullAll(array, values, undefined, comparator)
  8349. : array;
  8350. }
  8351. /**
  8352. * Removes elements from `array` corresponding to `indexes` and returns an
  8353. * array of removed elements.
  8354. *
  8355. * **Note:** Unlike `_.at`, this method mutates `array`.
  8356. *
  8357. * @static
  8358. * @memberOf _
  8359. * @since 3.0.0
  8360. * @category Array
  8361. * @param {Array} array The array to modify.
  8362. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8363. * @returns {Array} Returns the new array of removed elements.
  8364. * @example
  8365. *
  8366. * var array = ['a', 'b', 'c', 'd'];
  8367. * var pulled = _.pullAt(array, [1, 3]);
  8368. *
  8369. * console.log(array);
  8370. * // => ['a', 'c']
  8371. *
  8372. * console.log(pulled);
  8373. * // => ['b', 'd']
  8374. */
  8375. var pullAt = flatRest(function(array, indexes) {
  8376. var length = array == null ? 0 : array.length,
  8377. result = baseAt(array, indexes);
  8378. basePullAt(array, arrayMap(indexes, function(index) {
  8379. return isIndex(index, length) ? +index : index;
  8380. }).sort(compareAscending));
  8381. return result;
  8382. });
  8383. /**
  8384. * Removes all elements from `array` that `predicate` returns truthy for
  8385. * and returns an array of the removed elements. The predicate is invoked
  8386. * with three arguments: (value, index, array).
  8387. *
  8388. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8389. * to pull elements from an array by value.
  8390. *
  8391. * @static
  8392. * @memberOf _
  8393. * @since 2.0.0
  8394. * @category Array
  8395. * @param {Array} array The array to modify.
  8396. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8397. * @returns {Array} Returns the new array of removed elements.
  8398. * @example
  8399. *
  8400. * var array = [1, 2, 3, 4];
  8401. * var evens = _.remove(array, function(n) {
  8402. * return n % 2 == 0;
  8403. * });
  8404. *
  8405. * console.log(array);
  8406. * // => [1, 3]
  8407. *
  8408. * console.log(evens);
  8409. * // => [2, 4]
  8410. */
  8411. function remove(array, predicate) {
  8412. var result = [];
  8413. if (!(array && array.length)) {
  8414. return result;
  8415. }
  8416. var index = -1,
  8417. indexes = [],
  8418. length = array.length;
  8419. predicate = getIteratee(predicate, 3);
  8420. while (++index < length) {
  8421. var value = array[index];
  8422. if (predicate(value, index, array)) {
  8423. result.push(value);
  8424. indexes.push(index);
  8425. }
  8426. }
  8427. basePullAt(array, indexes);
  8428. return result;
  8429. }
  8430. /**
  8431. * Reverses `array` so that the first element becomes the last, the second
  8432. * element becomes the second to last, and so on.
  8433. *
  8434. * **Note:** This method mutates `array` and is based on
  8435. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8436. *
  8437. * @static
  8438. * @memberOf _
  8439. * @since 4.0.0
  8440. * @category Array
  8441. * @param {Array} array The array to modify.
  8442. * @returns {Array} Returns `array`.
  8443. * @example
  8444. *
  8445. * var array = [1, 2, 3];
  8446. *
  8447. * _.reverse(array);
  8448. * // => [3, 2, 1]
  8449. *
  8450. * console.log(array);
  8451. * // => [3, 2, 1]
  8452. */
  8453. function reverse(array) {
  8454. return array == null ? array : nativeReverse.call(array);
  8455. }
  8456. /**
  8457. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8458. *
  8459. * **Note:** This method is used instead of
  8460. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8461. * returned.
  8462. *
  8463. * @static
  8464. * @memberOf _
  8465. * @since 3.0.0
  8466. * @category Array
  8467. * @param {Array} array The array to slice.
  8468. * @param {number} [start=0] The start position.
  8469. * @param {number} [end=array.length] The end position.
  8470. * @returns {Array} Returns the slice of `array`.
  8471. */
  8472. function slice(array, start, end) {
  8473. var length = array == null ? 0 : array.length;
  8474. if (!length) {
  8475. return [];
  8476. }
  8477. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8478. start = 0;
  8479. end = length;
  8480. }
  8481. else {
  8482. start = start == null ? 0 : toInteger(start);
  8483. end = end === undefined ? length : toInteger(end);
  8484. }
  8485. return baseSlice(array, start, end);
  8486. }
  8487. /**
  8488. * Uses a binary search to determine the lowest index at which `value`
  8489. * should be inserted into `array` in order to maintain its sort order.
  8490. *
  8491. * @static
  8492. * @memberOf _
  8493. * @since 0.1.0
  8494. * @category Array
  8495. * @param {Array} array The sorted array to inspect.
  8496. * @param {*} value The value to evaluate.
  8497. * @returns {number} Returns the index at which `value` should be inserted
  8498. * into `array`.
  8499. * @example
  8500. *
  8501. * _.sortedIndex([30, 50], 40);
  8502. * // => 1
  8503. */
  8504. function sortedIndex(array, value) {
  8505. return baseSortedIndex(array, value);
  8506. }
  8507. /**
  8508. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8509. * which is invoked for `value` and each element of `array` to compute their
  8510. * sort ranking. The iteratee is invoked with one argument: (value).
  8511. *
  8512. * @static
  8513. * @memberOf _
  8514. * @since 4.0.0
  8515. * @category Array
  8516. * @param {Array} array The sorted array to inspect.
  8517. * @param {*} value The value to evaluate.
  8518. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8519. * @returns {number} Returns the index at which `value` should be inserted
  8520. * into `array`.
  8521. * @example
  8522. *
  8523. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8524. *
  8525. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8526. * // => 0
  8527. *
  8528. * // The `_.property` iteratee shorthand.
  8529. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8530. * // => 0
  8531. */
  8532. function sortedIndexBy(array, value, iteratee) {
  8533. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8534. }
  8535. /**
  8536. * This method is like `_.indexOf` except that it performs a binary
  8537. * search on a sorted `array`.
  8538. *
  8539. * @static
  8540. * @memberOf _
  8541. * @since 4.0.0
  8542. * @category Array
  8543. * @param {Array} array The array to inspect.
  8544. * @param {*} value The value to search for.
  8545. * @returns {number} Returns the index of the matched value, else `-1`.
  8546. * @example
  8547. *
  8548. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8549. * // => 1
  8550. */
  8551. function sortedIndexOf(array, value) {
  8552. var length = array == null ? 0 : array.length;
  8553. if (length) {
  8554. var index = baseSortedIndex(array, value);
  8555. if (index < length && eq(array[index], value)) {
  8556. return index;
  8557. }
  8558. }
  8559. return -1;
  8560. }
  8561. /**
  8562. * This method is like `_.sortedIndex` except that it returns the highest
  8563. * index at which `value` should be inserted into `array` in order to
  8564. * maintain its sort order.
  8565. *
  8566. * @static
  8567. * @memberOf _
  8568. * @since 3.0.0
  8569. * @category Array
  8570. * @param {Array} array The sorted array to inspect.
  8571. * @param {*} value The value to evaluate.
  8572. * @returns {number} Returns the index at which `value` should be inserted
  8573. * into `array`.
  8574. * @example
  8575. *
  8576. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8577. * // => 4
  8578. */
  8579. function sortedLastIndex(array, value) {
  8580. return baseSortedIndex(array, value, true);
  8581. }
  8582. /**
  8583. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8584. * which is invoked for `value` and each element of `array` to compute their
  8585. * sort ranking. The iteratee is invoked with one argument: (value).
  8586. *
  8587. * @static
  8588. * @memberOf _
  8589. * @since 4.0.0
  8590. * @category Array
  8591. * @param {Array} array The sorted array to inspect.
  8592. * @param {*} value The value to evaluate.
  8593. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8594. * @returns {number} Returns the index at which `value` should be inserted
  8595. * into `array`.
  8596. * @example
  8597. *
  8598. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8599. *
  8600. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8601. * // => 1
  8602. *
  8603. * // The `_.property` iteratee shorthand.
  8604. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8605. * // => 1
  8606. */
  8607. function sortedLastIndexBy(array, value, iteratee) {
  8608. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8609. }
  8610. /**
  8611. * This method is like `_.lastIndexOf` except that it performs a binary
  8612. * search on a sorted `array`.
  8613. *
  8614. * @static
  8615. * @memberOf _
  8616. * @since 4.0.0
  8617. * @category Array
  8618. * @param {Array} array The array to inspect.
  8619. * @param {*} value The value to search for.
  8620. * @returns {number} Returns the index of the matched value, else `-1`.
  8621. * @example
  8622. *
  8623. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8624. * // => 3
  8625. */
  8626. function sortedLastIndexOf(array, value) {
  8627. var length = array == null ? 0 : array.length;
  8628. if (length) {
  8629. var index = baseSortedIndex(array, value, true) - 1;
  8630. if (eq(array[index], value)) {
  8631. return index;
  8632. }
  8633. }
  8634. return -1;
  8635. }
  8636. /**
  8637. * This method is like `_.uniq` except that it's designed and optimized
  8638. * for sorted arrays.
  8639. *
  8640. * @static
  8641. * @memberOf _
  8642. * @since 4.0.0
  8643. * @category Array
  8644. * @param {Array} array The array to inspect.
  8645. * @returns {Array} Returns the new duplicate free array.
  8646. * @example
  8647. *
  8648. * _.sortedUniq([1, 1, 2]);
  8649. * // => [1, 2]
  8650. */
  8651. function sortedUniq(array) {
  8652. return (array && array.length)
  8653. ? baseSortedUniq(array)
  8654. : [];
  8655. }
  8656. /**
  8657. * This method is like `_.uniqBy` except that it's designed and optimized
  8658. * for sorted arrays.
  8659. *
  8660. * @static
  8661. * @memberOf _
  8662. * @since 4.0.0
  8663. * @category Array
  8664. * @param {Array} array The array to inspect.
  8665. * @param {Function} [iteratee] The iteratee invoked per element.
  8666. * @returns {Array} Returns the new duplicate free array.
  8667. * @example
  8668. *
  8669. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8670. * // => [1.1, 2.3]
  8671. */
  8672. function sortedUniqBy(array, iteratee) {
  8673. return (array && array.length)
  8674. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8675. : [];
  8676. }
  8677. /**
  8678. * Gets all but the first element of `array`.
  8679. *
  8680. * @static
  8681. * @memberOf _
  8682. * @since 4.0.0
  8683. * @category Array
  8684. * @param {Array} array The array to query.
  8685. * @returns {Array} Returns the slice of `array`.
  8686. * @example
  8687. *
  8688. * _.tail([1, 2, 3]);
  8689. * // => [2, 3]
  8690. */
  8691. function tail(array) {
  8692. var length = array == null ? 0 : array.length;
  8693. return length ? baseSlice(array, 1, length) : [];
  8694. }
  8695. /**
  8696. * Creates a slice of `array` with `n` elements taken from the beginning.
  8697. *
  8698. * @static
  8699. * @memberOf _
  8700. * @since 0.1.0
  8701. * @category Array
  8702. * @param {Array} array The array to query.
  8703. * @param {number} [n=1] The number of elements to take.
  8704. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8705. * @returns {Array} Returns the slice of `array`.
  8706. * @example
  8707. *
  8708. * _.take([1, 2, 3]);
  8709. * // => [1]
  8710. *
  8711. * _.take([1, 2, 3], 2);
  8712. * // => [1, 2]
  8713. *
  8714. * _.take([1, 2, 3], 5);
  8715. * // => [1, 2, 3]
  8716. *
  8717. * _.take([1, 2, 3], 0);
  8718. * // => []
  8719. */
  8720. function take(array, n, guard) {
  8721. if (!(array && array.length)) {
  8722. return [];
  8723. }
  8724. n = (guard || n === undefined) ? 1 : toInteger(n);
  8725. return baseSlice(array, 0, n < 0 ? 0 : n);
  8726. }
  8727. /**
  8728. * Creates a slice of `array` with `n` elements taken from the end.
  8729. *
  8730. * @static
  8731. * @memberOf _
  8732. * @since 3.0.0
  8733. * @category Array
  8734. * @param {Array} array The array to query.
  8735. * @param {number} [n=1] The number of elements to take.
  8736. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8737. * @returns {Array} Returns the slice of `array`.
  8738. * @example
  8739. *
  8740. * _.takeRight([1, 2, 3]);
  8741. * // => [3]
  8742. *
  8743. * _.takeRight([1, 2, 3], 2);
  8744. * // => [2, 3]
  8745. *
  8746. * _.takeRight([1, 2, 3], 5);
  8747. * // => [1, 2, 3]
  8748. *
  8749. * _.takeRight([1, 2, 3], 0);
  8750. * // => []
  8751. */
  8752. function takeRight(array, n, guard) {
  8753. var length = array == null ? 0 : array.length;
  8754. if (!length) {
  8755. return [];
  8756. }
  8757. n = (guard || n === undefined) ? 1 : toInteger(n);
  8758. n = length - n;
  8759. return baseSlice(array, n < 0 ? 0 : n, length);
  8760. }
  8761. /**
  8762. * Creates a slice of `array` with elements taken from the end. Elements are
  8763. * taken until `predicate` returns falsey. The predicate is invoked with
  8764. * three arguments: (value, index, array).
  8765. *
  8766. * @static
  8767. * @memberOf _
  8768. * @since 3.0.0
  8769. * @category Array
  8770. * @param {Array} array The array to query.
  8771. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8772. * @returns {Array} Returns the slice of `array`.
  8773. * @example
  8774. *
  8775. * var users = [
  8776. * { 'user': 'barney', 'active': true },
  8777. * { 'user': 'fred', 'active': false },
  8778. * { 'user': 'pebbles', 'active': false }
  8779. * ];
  8780. *
  8781. * _.takeRightWhile(users, function(o) { return !o.active; });
  8782. * // => objects for ['fred', 'pebbles']
  8783. *
  8784. * // The `_.matches` iteratee shorthand.
  8785. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8786. * // => objects for ['pebbles']
  8787. *
  8788. * // The `_.matchesProperty` iteratee shorthand.
  8789. * _.takeRightWhile(users, ['active', false]);
  8790. * // => objects for ['fred', 'pebbles']
  8791. *
  8792. * // The `_.property` iteratee shorthand.
  8793. * _.takeRightWhile(users, 'active');
  8794. * // => []
  8795. */
  8796. function takeRightWhile(array, predicate) {
  8797. return (array && array.length)
  8798. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8799. : [];
  8800. }
  8801. /**
  8802. * Creates a slice of `array` with elements taken from the beginning. Elements
  8803. * are taken until `predicate` returns falsey. The predicate is invoked with
  8804. * three arguments: (value, index, array).
  8805. *
  8806. * @static
  8807. * @memberOf _
  8808. * @since 3.0.0
  8809. * @category Array
  8810. * @param {Array} array The array to query.
  8811. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8812. * @returns {Array} Returns the slice of `array`.
  8813. * @example
  8814. *
  8815. * var users = [
  8816. * { 'user': 'barney', 'active': false },
  8817. * { 'user': 'fred', 'active': false },
  8818. * { 'user': 'pebbles', 'active': true }
  8819. * ];
  8820. *
  8821. * _.takeWhile(users, function(o) { return !o.active; });
  8822. * // => objects for ['barney', 'fred']
  8823. *
  8824. * // The `_.matches` iteratee shorthand.
  8825. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8826. * // => objects for ['barney']
  8827. *
  8828. * // The `_.matchesProperty` iteratee shorthand.
  8829. * _.takeWhile(users, ['active', false]);
  8830. * // => objects for ['barney', 'fred']
  8831. *
  8832. * // The `_.property` iteratee shorthand.
  8833. * _.takeWhile(users, 'active');
  8834. * // => []
  8835. */
  8836. function takeWhile(array, predicate) {
  8837. return (array && array.length)
  8838. ? baseWhile(array, getIteratee(predicate, 3))
  8839. : [];
  8840. }
  8841. /**
  8842. * Creates an array of unique values, in order, from all given arrays using
  8843. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8844. * for equality comparisons.
  8845. *
  8846. * @static
  8847. * @memberOf _
  8848. * @since 0.1.0
  8849. * @category Array
  8850. * @param {...Array} [arrays] The arrays to inspect.
  8851. * @returns {Array} Returns the new array of combined values.
  8852. * @example
  8853. *
  8854. * _.union([2], [1, 2]);
  8855. * // => [2, 1]
  8856. */
  8857. var union = baseRest(function(arrays) {
  8858. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8859. });
  8860. /**
  8861. * This method is like `_.union` except that it accepts `iteratee` which is
  8862. * invoked for each element of each `arrays` to generate the criterion by
  8863. * which uniqueness is computed. Result values are chosen from the first
  8864. * array in which the value occurs. The iteratee is invoked with one argument:
  8865. * (value).
  8866. *
  8867. * @static
  8868. * @memberOf _
  8869. * @since 4.0.0
  8870. * @category Array
  8871. * @param {...Array} [arrays] The arrays to inspect.
  8872. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8873. * @returns {Array} Returns the new array of combined values.
  8874. * @example
  8875. *
  8876. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8877. * // => [2.1, 1.2]
  8878. *
  8879. * // The `_.property` iteratee shorthand.
  8880. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8881. * // => [{ 'x': 1 }, { 'x': 2 }]
  8882. */
  8883. var unionBy = baseRest(function(arrays) {
  8884. var iteratee = last(arrays);
  8885. if (isArrayLikeObject(iteratee)) {
  8886. iteratee = undefined;
  8887. }
  8888. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8889. });
  8890. /**
  8891. * This method is like `_.union` except that it accepts `comparator` which
  8892. * is invoked to compare elements of `arrays`. Result values are chosen from
  8893. * the first array in which the value occurs. The comparator is invoked
  8894. * with two arguments: (arrVal, othVal).
  8895. *
  8896. * @static
  8897. * @memberOf _
  8898. * @since 4.0.0
  8899. * @category Array
  8900. * @param {...Array} [arrays] The arrays to inspect.
  8901. * @param {Function} [comparator] The comparator invoked per element.
  8902. * @returns {Array} Returns the new array of combined values.
  8903. * @example
  8904. *
  8905. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8906. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8907. *
  8908. * _.unionWith(objects, others, _.isEqual);
  8909. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8910. */
  8911. var unionWith = baseRest(function(arrays) {
  8912. var comparator = last(arrays);
  8913. comparator = typeof comparator == 'function' ? comparator : undefined;
  8914. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8915. });
  8916. /**
  8917. * Creates a duplicate-free version of an array, using
  8918. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8919. * for equality comparisons, in which only the first occurrence of each element
  8920. * is kept. The order of result values is determined by the order they occur
  8921. * in the array.
  8922. *
  8923. * @static
  8924. * @memberOf _
  8925. * @since 0.1.0
  8926. * @category Array
  8927. * @param {Array} array The array to inspect.
  8928. * @returns {Array} Returns the new duplicate free array.
  8929. * @example
  8930. *
  8931. * _.uniq([2, 1, 2]);
  8932. * // => [2, 1]
  8933. */
  8934. function uniq(array) {
  8935. return (array && array.length) ? baseUniq(array) : [];
  8936. }
  8937. /**
  8938. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8939. * invoked for each element in `array` to generate the criterion by which
  8940. * uniqueness is computed. The order of result values is determined by the
  8941. * order they occur in the array. The iteratee is invoked with one argument:
  8942. * (value).
  8943. *
  8944. * @static
  8945. * @memberOf _
  8946. * @since 4.0.0
  8947. * @category Array
  8948. * @param {Array} array The array to inspect.
  8949. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8950. * @returns {Array} Returns the new duplicate free array.
  8951. * @example
  8952. *
  8953. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8954. * // => [2.1, 1.2]
  8955. *
  8956. * // The `_.property` iteratee shorthand.
  8957. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8958. * // => [{ 'x': 1 }, { 'x': 2 }]
  8959. */
  8960. function uniqBy(array, iteratee) {
  8961. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8962. }
  8963. /**
  8964. * This method is like `_.uniq` except that it accepts `comparator` which
  8965. * is invoked to compare elements of `array`. The order of result values is
  8966. * determined by the order they occur in the array.The comparator is invoked
  8967. * with two arguments: (arrVal, othVal).
  8968. *
  8969. * @static
  8970. * @memberOf _
  8971. * @since 4.0.0
  8972. * @category Array
  8973. * @param {Array} array The array to inspect.
  8974. * @param {Function} [comparator] The comparator invoked per element.
  8975. * @returns {Array} Returns the new duplicate free array.
  8976. * @example
  8977. *
  8978. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8979. *
  8980. * _.uniqWith(objects, _.isEqual);
  8981. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8982. */
  8983. function uniqWith(array, comparator) {
  8984. comparator = typeof comparator == 'function' ? comparator : undefined;
  8985. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8986. }
  8987. /**
  8988. * This method is like `_.zip` except that it accepts an array of grouped
  8989. * elements and creates an array regrouping the elements to their pre-zip
  8990. * configuration.
  8991. *
  8992. * @static
  8993. * @memberOf _
  8994. * @since 1.2.0
  8995. * @category Array
  8996. * @param {Array} array The array of grouped elements to process.
  8997. * @returns {Array} Returns the new array of regrouped elements.
  8998. * @example
  8999. *
  9000. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9001. * // => [['a', 1, true], ['b', 2, false]]
  9002. *
  9003. * _.unzip(zipped);
  9004. * // => [['a', 'b'], [1, 2], [true, false]]
  9005. */
  9006. function unzip(array) {
  9007. if (!(array && array.length)) {
  9008. return [];
  9009. }
  9010. var length = 0;
  9011. array = arrayFilter(array, function(group) {
  9012. if (isArrayLikeObject(group)) {
  9013. length = nativeMax(group.length, length);
  9014. return true;
  9015. }
  9016. });
  9017. return baseTimes(length, function(index) {
  9018. return arrayMap(array, baseProperty(index));
  9019. });
  9020. }
  9021. /**
  9022. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9023. * how regrouped values should be combined. The iteratee is invoked with the
  9024. * elements of each group: (...group).
  9025. *
  9026. * @static
  9027. * @memberOf _
  9028. * @since 3.8.0
  9029. * @category Array
  9030. * @param {Array} array The array of grouped elements to process.
  9031. * @param {Function} [iteratee=_.identity] The function to combine
  9032. * regrouped values.
  9033. * @returns {Array} Returns the new array of regrouped elements.
  9034. * @example
  9035. *
  9036. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9037. * // => [[1, 10, 100], [2, 20, 200]]
  9038. *
  9039. * _.unzipWith(zipped, _.add);
  9040. * // => [3, 30, 300]
  9041. */
  9042. function unzipWith(array, iteratee) {
  9043. if (!(array && array.length)) {
  9044. return [];
  9045. }
  9046. var result = unzip(array);
  9047. if (iteratee == null) {
  9048. return result;
  9049. }
  9050. return arrayMap(result, function(group) {
  9051. return apply(iteratee, undefined, group);
  9052. });
  9053. }
  9054. /**
  9055. * Creates an array excluding all given values using
  9056. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9057. * for equality comparisons.
  9058. *
  9059. * **Note:** Unlike `_.pull`, this method returns a new array.
  9060. *
  9061. * @static
  9062. * @memberOf _
  9063. * @since 0.1.0
  9064. * @category Array
  9065. * @param {Array} array The array to inspect.
  9066. * @param {...*} [values] The values to exclude.
  9067. * @returns {Array} Returns the new array of filtered values.
  9068. * @see _.difference, _.xor
  9069. * @example
  9070. *
  9071. * _.without([2, 1, 2, 3], 1, 2);
  9072. * // => [3]
  9073. */
  9074. var without = baseRest(function(array, values) {
  9075. return isArrayLikeObject(array)
  9076. ? baseDifference(array, values)
  9077. : [];
  9078. });
  9079. /**
  9080. * Creates an array of unique values that is the
  9081. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9082. * of the given arrays. The order of result values is determined by the order
  9083. * they occur in the arrays.
  9084. *
  9085. * @static
  9086. * @memberOf _
  9087. * @since 2.4.0
  9088. * @category Array
  9089. * @param {...Array} [arrays] The arrays to inspect.
  9090. * @returns {Array} Returns the new array of filtered values.
  9091. * @see _.difference, _.without
  9092. * @example
  9093. *
  9094. * _.xor([2, 1], [2, 3]);
  9095. * // => [1, 3]
  9096. */
  9097. var xor = baseRest(function(arrays) {
  9098. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9099. });
  9100. /**
  9101. * This method is like `_.xor` except that it accepts `iteratee` which is
  9102. * invoked for each element of each `arrays` to generate the criterion by
  9103. * which by which they're compared. The order of result values is determined
  9104. * by the order they occur in the arrays. The iteratee is invoked with one
  9105. * argument: (value).
  9106. *
  9107. * @static
  9108. * @memberOf _
  9109. * @since 4.0.0
  9110. * @category Array
  9111. * @param {...Array} [arrays] The arrays to inspect.
  9112. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9113. * @returns {Array} Returns the new array of filtered values.
  9114. * @example
  9115. *
  9116. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9117. * // => [1.2, 3.4]
  9118. *
  9119. * // The `_.property` iteratee shorthand.
  9120. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9121. * // => [{ 'x': 2 }]
  9122. */
  9123. var xorBy = baseRest(function(arrays) {
  9124. var iteratee = last(arrays);
  9125. if (isArrayLikeObject(iteratee)) {
  9126. iteratee = undefined;
  9127. }
  9128. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9129. });
  9130. /**
  9131. * This method is like `_.xor` except that it accepts `comparator` which is
  9132. * invoked to compare elements of `arrays`. The order of result values is
  9133. * determined by the order they occur in the arrays. The comparator is invoked
  9134. * with two arguments: (arrVal, othVal).
  9135. *
  9136. * @static
  9137. * @memberOf _
  9138. * @since 4.0.0
  9139. * @category Array
  9140. * @param {...Array} [arrays] The arrays to inspect.
  9141. * @param {Function} [comparator] The comparator invoked per element.
  9142. * @returns {Array} Returns the new array of filtered values.
  9143. * @example
  9144. *
  9145. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9146. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9147. *
  9148. * _.xorWith(objects, others, _.isEqual);
  9149. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9150. */
  9151. var xorWith = baseRest(function(arrays) {
  9152. var comparator = last(arrays);
  9153. comparator = typeof comparator == 'function' ? comparator : undefined;
  9154. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9155. });
  9156. /**
  9157. * Creates an array of grouped elements, the first of which contains the
  9158. * first elements of the given arrays, the second of which contains the
  9159. * second elements of the given arrays, and so on.
  9160. *
  9161. * @static
  9162. * @memberOf _
  9163. * @since 0.1.0
  9164. * @category Array
  9165. * @param {...Array} [arrays] The arrays to process.
  9166. * @returns {Array} Returns the new array of grouped elements.
  9167. * @example
  9168. *
  9169. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9170. * // => [['a', 1, true], ['b', 2, false]]
  9171. */
  9172. var zip = baseRest(unzip);
  9173. /**
  9174. * This method is like `_.fromPairs` except that it accepts two arrays,
  9175. * one of property identifiers and one of corresponding values.
  9176. *
  9177. * @static
  9178. * @memberOf _
  9179. * @since 0.4.0
  9180. * @category Array
  9181. * @param {Array} [props=[]] The property identifiers.
  9182. * @param {Array} [values=[]] The property values.
  9183. * @returns {Object} Returns the new object.
  9184. * @example
  9185. *
  9186. * _.zipObject(['a', 'b'], [1, 2]);
  9187. * // => { 'a': 1, 'b': 2 }
  9188. */
  9189. function zipObject(props, values) {
  9190. return baseZipObject(props || [], values || [], assignValue);
  9191. }
  9192. /**
  9193. * This method is like `_.zipObject` except that it supports property paths.
  9194. *
  9195. * @static
  9196. * @memberOf _
  9197. * @since 4.1.0
  9198. * @category Array
  9199. * @param {Array} [props=[]] The property identifiers.
  9200. * @param {Array} [values=[]] The property values.
  9201. * @returns {Object} Returns the new object.
  9202. * @example
  9203. *
  9204. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9205. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9206. */
  9207. function zipObjectDeep(props, values) {
  9208. return baseZipObject(props || [], values || [], baseSet);
  9209. }
  9210. /**
  9211. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9212. * how grouped values should be combined. The iteratee is invoked with the
  9213. * elements of each group: (...group).
  9214. *
  9215. * @static
  9216. * @memberOf _
  9217. * @since 3.8.0
  9218. * @category Array
  9219. * @param {...Array} [arrays] The arrays to process.
  9220. * @param {Function} [iteratee=_.identity] The function to combine
  9221. * grouped values.
  9222. * @returns {Array} Returns the new array of grouped elements.
  9223. * @example
  9224. *
  9225. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9226. * return a + b + c;
  9227. * });
  9228. * // => [111, 222]
  9229. */
  9230. var zipWith = baseRest(function(arrays) {
  9231. var length = arrays.length,
  9232. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9233. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9234. return unzipWith(arrays, iteratee);
  9235. });
  9236. /*------------------------------------------------------------------------*/
  9237. /**
  9238. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9239. * chain sequences enabled. The result of such sequences must be unwrapped
  9240. * with `_#value`.
  9241. *
  9242. * @static
  9243. * @memberOf _
  9244. * @since 1.3.0
  9245. * @category Seq
  9246. * @param {*} value The value to wrap.
  9247. * @returns {Object} Returns the new `lodash` wrapper instance.
  9248. * @example
  9249. *
  9250. * var users = [
  9251. * { 'user': 'barney', 'age': 36 },
  9252. * { 'user': 'fred', 'age': 40 },
  9253. * { 'user': 'pebbles', 'age': 1 }
  9254. * ];
  9255. *
  9256. * var youngest = _
  9257. * .chain(users)
  9258. * .sortBy('age')
  9259. * .map(function(o) {
  9260. * return o.user + ' is ' + o.age;
  9261. * })
  9262. * .head()
  9263. * .value();
  9264. * // => 'pebbles is 1'
  9265. */
  9266. function chain(value) {
  9267. var result = lodash(value);
  9268. result.__chain__ = true;
  9269. return result;
  9270. }
  9271. /**
  9272. * This method invokes `interceptor` and returns `value`. The interceptor
  9273. * is invoked with one argument; (value). The purpose of this method is to
  9274. * "tap into" a method chain sequence in order to modify intermediate results.
  9275. *
  9276. * @static
  9277. * @memberOf _
  9278. * @since 0.1.0
  9279. * @category Seq
  9280. * @param {*} value The value to provide to `interceptor`.
  9281. * @param {Function} interceptor The function to invoke.
  9282. * @returns {*} Returns `value`.
  9283. * @example
  9284. *
  9285. * _([1, 2, 3])
  9286. * .tap(function(array) {
  9287. * // Mutate input array.
  9288. * array.pop();
  9289. * })
  9290. * .reverse()
  9291. * .value();
  9292. * // => [2, 1]
  9293. */
  9294. function tap(value, interceptor) {
  9295. interceptor(value);
  9296. return value;
  9297. }
  9298. /**
  9299. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9300. * The purpose of this method is to "pass thru" values replacing intermediate
  9301. * results in a method chain sequence.
  9302. *
  9303. * @static
  9304. * @memberOf _
  9305. * @since 3.0.0
  9306. * @category Seq
  9307. * @param {*} value The value to provide to `interceptor`.
  9308. * @param {Function} interceptor The function to invoke.
  9309. * @returns {*} Returns the result of `interceptor`.
  9310. * @example
  9311. *
  9312. * _(' abc ')
  9313. * .chain()
  9314. * .trim()
  9315. * .thru(function(value) {
  9316. * return [value];
  9317. * })
  9318. * .value();
  9319. * // => ['abc']
  9320. */
  9321. function thru(value, interceptor) {
  9322. return interceptor(value);
  9323. }
  9324. /**
  9325. * This method is the wrapper version of `_.at`.
  9326. *
  9327. * @name at
  9328. * @memberOf _
  9329. * @since 1.0.0
  9330. * @category Seq
  9331. * @param {...(string|string[])} [paths] The property paths to pick.
  9332. * @returns {Object} Returns the new `lodash` wrapper instance.
  9333. * @example
  9334. *
  9335. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9336. *
  9337. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9338. * // => [3, 4]
  9339. */
  9340. var wrapperAt = flatRest(function(paths) {
  9341. var length = paths.length,
  9342. start = length ? paths[0] : 0,
  9343. value = this.__wrapped__,
  9344. interceptor = function(object) { return baseAt(object, paths); };
  9345. if (length > 1 || this.__actions__.length ||
  9346. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9347. return this.thru(interceptor);
  9348. }
  9349. value = value.slice(start, +start + (length ? 1 : 0));
  9350. value.__actions__.push({
  9351. 'func': thru,
  9352. 'args': [interceptor],
  9353. 'thisArg': undefined
  9354. });
  9355. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9356. if (length && !array.length) {
  9357. array.push(undefined);
  9358. }
  9359. return array;
  9360. });
  9361. });
  9362. /**
  9363. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9364. *
  9365. * @name chain
  9366. * @memberOf _
  9367. * @since 0.1.0
  9368. * @category Seq
  9369. * @returns {Object} Returns the new `lodash` wrapper instance.
  9370. * @example
  9371. *
  9372. * var users = [
  9373. * { 'user': 'barney', 'age': 36 },
  9374. * { 'user': 'fred', 'age': 40 }
  9375. * ];
  9376. *
  9377. * // A sequence without explicit chaining.
  9378. * _(users).head();
  9379. * // => { 'user': 'barney', 'age': 36 }
  9380. *
  9381. * // A sequence with explicit chaining.
  9382. * _(users)
  9383. * .chain()
  9384. * .head()
  9385. * .pick('user')
  9386. * .value();
  9387. * // => { 'user': 'barney' }
  9388. */
  9389. function wrapperChain() {
  9390. return chain(this);
  9391. }
  9392. /**
  9393. * Executes the chain sequence and returns the wrapped result.
  9394. *
  9395. * @name commit
  9396. * @memberOf _
  9397. * @since 3.2.0
  9398. * @category Seq
  9399. * @returns {Object} Returns the new `lodash` wrapper instance.
  9400. * @example
  9401. *
  9402. * var array = [1, 2];
  9403. * var wrapped = _(array).push(3);
  9404. *
  9405. * console.log(array);
  9406. * // => [1, 2]
  9407. *
  9408. * wrapped = wrapped.commit();
  9409. * console.log(array);
  9410. * // => [1, 2, 3]
  9411. *
  9412. * wrapped.last();
  9413. * // => 3
  9414. *
  9415. * console.log(array);
  9416. * // => [1, 2, 3]
  9417. */
  9418. function wrapperCommit() {
  9419. return new LodashWrapper(this.value(), this.__chain__);
  9420. }
  9421. /**
  9422. * Gets the next value on a wrapped object following the
  9423. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9424. *
  9425. * @name next
  9426. * @memberOf _
  9427. * @since 4.0.0
  9428. * @category Seq
  9429. * @returns {Object} Returns the next iterator value.
  9430. * @example
  9431. *
  9432. * var wrapped = _([1, 2]);
  9433. *
  9434. * wrapped.next();
  9435. * // => { 'done': false, 'value': 1 }
  9436. *
  9437. * wrapped.next();
  9438. * // => { 'done': false, 'value': 2 }
  9439. *
  9440. * wrapped.next();
  9441. * // => { 'done': true, 'value': undefined }
  9442. */
  9443. function wrapperNext() {
  9444. if (this.__values__ === undefined) {
  9445. this.__values__ = toArray(this.value());
  9446. }
  9447. var done = this.__index__ >= this.__values__.length,
  9448. value = done ? undefined : this.__values__[this.__index__++];
  9449. return { 'done': done, 'value': value };
  9450. }
  9451. /**
  9452. * Enables the wrapper to be iterable.
  9453. *
  9454. * @name Symbol.iterator
  9455. * @memberOf _
  9456. * @since 4.0.0
  9457. * @category Seq
  9458. * @returns {Object} Returns the wrapper object.
  9459. * @example
  9460. *
  9461. * var wrapped = _([1, 2]);
  9462. *
  9463. * wrapped[Symbol.iterator]() === wrapped;
  9464. * // => true
  9465. *
  9466. * Array.from(wrapped);
  9467. * // => [1, 2]
  9468. */
  9469. function wrapperToIterator() {
  9470. return this;
  9471. }
  9472. /**
  9473. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9474. *
  9475. * @name plant
  9476. * @memberOf _
  9477. * @since 3.2.0
  9478. * @category Seq
  9479. * @param {*} value The value to plant.
  9480. * @returns {Object} Returns the new `lodash` wrapper instance.
  9481. * @example
  9482. *
  9483. * function square(n) {
  9484. * return n * n;
  9485. * }
  9486. *
  9487. * var wrapped = _([1, 2]).map(square);
  9488. * var other = wrapped.plant([3, 4]);
  9489. *
  9490. * other.value();
  9491. * // => [9, 16]
  9492. *
  9493. * wrapped.value();
  9494. * // => [1, 4]
  9495. */
  9496. function wrapperPlant(value) {
  9497. var result,
  9498. parent = this;
  9499. while (parent instanceof baseLodash) {
  9500. var clone = wrapperClone(parent);
  9501. clone.__index__ = 0;
  9502. clone.__values__ = undefined;
  9503. if (result) {
  9504. previous.__wrapped__ = clone;
  9505. } else {
  9506. result = clone;
  9507. }
  9508. var previous = clone;
  9509. parent = parent.__wrapped__;
  9510. }
  9511. previous.__wrapped__ = value;
  9512. return result;
  9513. }
  9514. /**
  9515. * This method is the wrapper version of `_.reverse`.
  9516. *
  9517. * **Note:** This method mutates the wrapped array.
  9518. *
  9519. * @name reverse
  9520. * @memberOf _
  9521. * @since 0.1.0
  9522. * @category Seq
  9523. * @returns {Object} Returns the new `lodash` wrapper instance.
  9524. * @example
  9525. *
  9526. * var array = [1, 2, 3];
  9527. *
  9528. * _(array).reverse().value()
  9529. * // => [3, 2, 1]
  9530. *
  9531. * console.log(array);
  9532. * // => [3, 2, 1]
  9533. */
  9534. function wrapperReverse() {
  9535. var value = this.__wrapped__;
  9536. if (value instanceof LazyWrapper) {
  9537. var wrapped = value;
  9538. if (this.__actions__.length) {
  9539. wrapped = new LazyWrapper(this);
  9540. }
  9541. wrapped = wrapped.reverse();
  9542. wrapped.__actions__.push({
  9543. 'func': thru,
  9544. 'args': [reverse],
  9545. 'thisArg': undefined
  9546. });
  9547. return new LodashWrapper(wrapped, this.__chain__);
  9548. }
  9549. return this.thru(reverse);
  9550. }
  9551. /**
  9552. * Executes the chain sequence to resolve the unwrapped value.
  9553. *
  9554. * @name value
  9555. * @memberOf _
  9556. * @since 0.1.0
  9557. * @alias toJSON, valueOf
  9558. * @category Seq
  9559. * @returns {*} Returns the resolved unwrapped value.
  9560. * @example
  9561. *
  9562. * _([1, 2, 3]).value();
  9563. * // => [1, 2, 3]
  9564. */
  9565. function wrapperValue() {
  9566. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9567. }
  9568. /*------------------------------------------------------------------------*/
  9569. /**
  9570. * Creates an object composed of keys generated from the results of running
  9571. * each element of `collection` thru `iteratee`. The corresponding value of
  9572. * each key is the number of times the key was returned by `iteratee`. The
  9573. * iteratee is invoked with one argument: (value).
  9574. *
  9575. * @static
  9576. * @memberOf _
  9577. * @since 0.5.0
  9578. * @category Collection
  9579. * @param {Array|Object} collection The collection to iterate over.
  9580. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9581. * @returns {Object} Returns the composed aggregate object.
  9582. * @example
  9583. *
  9584. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9585. * // => { '4': 1, '6': 2 }
  9586. *
  9587. * // The `_.property` iteratee shorthand.
  9588. * _.countBy(['one', 'two', 'three'], 'length');
  9589. * // => { '3': 2, '5': 1 }
  9590. */
  9591. var countBy = createAggregator(function(result, value, key) {
  9592. if (hasOwnProperty.call(result, key)) {
  9593. ++result[key];
  9594. } else {
  9595. baseAssignValue(result, key, 1);
  9596. }
  9597. });
  9598. /**
  9599. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9600. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9601. * invoked with three arguments: (value, index|key, collection).
  9602. *
  9603. * **Note:** This method returns `true` for
  9604. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9605. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9606. * elements of empty collections.
  9607. *
  9608. * @static
  9609. * @memberOf _
  9610. * @since 0.1.0
  9611. * @category Collection
  9612. * @param {Array|Object} collection The collection to iterate over.
  9613. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9614. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9615. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9616. * else `false`.
  9617. * @example
  9618. *
  9619. * _.every([true, 1, null, 'yes'], Boolean);
  9620. * // => false
  9621. *
  9622. * var users = [
  9623. * { 'user': 'barney', 'age': 36, 'active': false },
  9624. * { 'user': 'fred', 'age': 40, 'active': false }
  9625. * ];
  9626. *
  9627. * // The `_.matches` iteratee shorthand.
  9628. * _.every(users, { 'user': 'barney', 'active': false });
  9629. * // => false
  9630. *
  9631. * // The `_.matchesProperty` iteratee shorthand.
  9632. * _.every(users, ['active', false]);
  9633. * // => true
  9634. *
  9635. * // The `_.property` iteratee shorthand.
  9636. * _.every(users, 'active');
  9637. * // => false
  9638. */
  9639. function every(collection, predicate, guard) {
  9640. var func = isArray(collection) ? arrayEvery : baseEvery;
  9641. if (guard && isIterateeCall(collection, predicate, guard)) {
  9642. predicate = undefined;
  9643. }
  9644. return func(collection, getIteratee(predicate, 3));
  9645. }
  9646. /**
  9647. * Iterates over elements of `collection`, returning an array of all elements
  9648. * `predicate` returns truthy for. The predicate is invoked with three
  9649. * arguments: (value, index|key, collection).
  9650. *
  9651. * **Note:** Unlike `_.remove`, this method returns a new array.
  9652. *
  9653. * @static
  9654. * @memberOf _
  9655. * @since 0.1.0
  9656. * @category Collection
  9657. * @param {Array|Object} collection The collection to iterate over.
  9658. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9659. * @returns {Array} Returns the new filtered array.
  9660. * @see _.reject
  9661. * @example
  9662. *
  9663. * var users = [
  9664. * { 'user': 'barney', 'age': 36, 'active': true },
  9665. * { 'user': 'fred', 'age': 40, 'active': false }
  9666. * ];
  9667. *
  9668. * _.filter(users, function(o) { return !o.active; });
  9669. * // => objects for ['fred']
  9670. *
  9671. * // The `_.matches` iteratee shorthand.
  9672. * _.filter(users, { 'age': 36, 'active': true });
  9673. * // => objects for ['barney']
  9674. *
  9675. * // The `_.matchesProperty` iteratee shorthand.
  9676. * _.filter(users, ['active', false]);
  9677. * // => objects for ['fred']
  9678. *
  9679. * // The `_.property` iteratee shorthand.
  9680. * _.filter(users, 'active');
  9681. * // => objects for ['barney']
  9682. *
  9683. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9684. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9685. * // => objects for ['fred', 'barney']
  9686. */
  9687. function filter(collection, predicate) {
  9688. var func = isArray(collection) ? arrayFilter : baseFilter;
  9689. return func(collection, getIteratee(predicate, 3));
  9690. }
  9691. /**
  9692. * Iterates over elements of `collection`, returning the first element
  9693. * `predicate` returns truthy for. The predicate is invoked with three
  9694. * arguments: (value, index|key, collection).
  9695. *
  9696. * @static
  9697. * @memberOf _
  9698. * @since 0.1.0
  9699. * @category Collection
  9700. * @param {Array|Object} collection The collection to inspect.
  9701. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9702. * @param {number} [fromIndex=0] The index to search from.
  9703. * @returns {*} Returns the matched element, else `undefined`.
  9704. * @example
  9705. *
  9706. * var users = [
  9707. * { 'user': 'barney', 'age': 36, 'active': true },
  9708. * { 'user': 'fred', 'age': 40, 'active': false },
  9709. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9710. * ];
  9711. *
  9712. * _.find(users, function(o) { return o.age < 40; });
  9713. * // => object for 'barney'
  9714. *
  9715. * // The `_.matches` iteratee shorthand.
  9716. * _.find(users, { 'age': 1, 'active': true });
  9717. * // => object for 'pebbles'
  9718. *
  9719. * // The `_.matchesProperty` iteratee shorthand.
  9720. * _.find(users, ['active', false]);
  9721. * // => object for 'fred'
  9722. *
  9723. * // The `_.property` iteratee shorthand.
  9724. * _.find(users, 'active');
  9725. * // => object for 'barney'
  9726. */
  9727. var find = createFind(findIndex);
  9728. /**
  9729. * This method is like `_.find` except that it iterates over elements of
  9730. * `collection` from right to left.
  9731. *
  9732. * @static
  9733. * @memberOf _
  9734. * @since 2.0.0
  9735. * @category Collection
  9736. * @param {Array|Object} collection The collection to inspect.
  9737. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9738. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9739. * @returns {*} Returns the matched element, else `undefined`.
  9740. * @example
  9741. *
  9742. * _.findLast([1, 2, 3, 4], function(n) {
  9743. * return n % 2 == 1;
  9744. * });
  9745. * // => 3
  9746. */
  9747. var findLast = createFind(findLastIndex);
  9748. /**
  9749. * Creates a flattened array of values by running each element in `collection`
  9750. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9751. * with three arguments: (value, index|key, collection).
  9752. *
  9753. * @static
  9754. * @memberOf _
  9755. * @since 4.0.0
  9756. * @category Collection
  9757. * @param {Array|Object} collection The collection to iterate over.
  9758. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9759. * @returns {Array} Returns the new flattened array.
  9760. * @example
  9761. *
  9762. * function duplicate(n) {
  9763. * return [n, n];
  9764. * }
  9765. *
  9766. * _.flatMap([1, 2], duplicate);
  9767. * // => [1, 1, 2, 2]
  9768. */
  9769. function flatMap(collection, iteratee) {
  9770. return baseFlatten(map(collection, iteratee), 1);
  9771. }
  9772. /**
  9773. * This method is like `_.flatMap` except that it recursively flattens the
  9774. * mapped results.
  9775. *
  9776. * @static
  9777. * @memberOf _
  9778. * @since 4.7.0
  9779. * @category Collection
  9780. * @param {Array|Object} collection The collection to iterate over.
  9781. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9782. * @returns {Array} Returns the new flattened array.
  9783. * @example
  9784. *
  9785. * function duplicate(n) {
  9786. * return [[[n, n]]];
  9787. * }
  9788. *
  9789. * _.flatMapDeep([1, 2], duplicate);
  9790. * // => [1, 1, 2, 2]
  9791. */
  9792. function flatMapDeep(collection, iteratee) {
  9793. return baseFlatten(map(collection, iteratee), INFINITY);
  9794. }
  9795. /**
  9796. * This method is like `_.flatMap` except that it recursively flattens the
  9797. * mapped results up to `depth` times.
  9798. *
  9799. * @static
  9800. * @memberOf _
  9801. * @since 4.7.0
  9802. * @category Collection
  9803. * @param {Array|Object} collection The collection to iterate over.
  9804. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9805. * @param {number} [depth=1] The maximum recursion depth.
  9806. * @returns {Array} Returns the new flattened array.
  9807. * @example
  9808. *
  9809. * function duplicate(n) {
  9810. * return [[[n, n]]];
  9811. * }
  9812. *
  9813. * _.flatMapDepth([1, 2], duplicate, 2);
  9814. * // => [[1, 1], [2, 2]]
  9815. */
  9816. function flatMapDepth(collection, iteratee, depth) {
  9817. depth = depth === undefined ? 1 : toInteger(depth);
  9818. return baseFlatten(map(collection, iteratee), depth);
  9819. }
  9820. /**
  9821. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9822. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9823. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9824. *
  9825. * **Note:** As with other "Collections" methods, objects with a "length"
  9826. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9827. * or `_.forOwn` for object iteration.
  9828. *
  9829. * @static
  9830. * @memberOf _
  9831. * @since 0.1.0
  9832. * @alias each
  9833. * @category Collection
  9834. * @param {Array|Object} collection The collection to iterate over.
  9835. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9836. * @returns {Array|Object} Returns `collection`.
  9837. * @see _.forEachRight
  9838. * @example
  9839. *
  9840. * _.forEach([1, 2], function(value) {
  9841. * console.log(value);
  9842. * });
  9843. * // => Logs `1` then `2`.
  9844. *
  9845. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9846. * console.log(key);
  9847. * });
  9848. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9849. */
  9850. function forEach(collection, iteratee) {
  9851. var func = isArray(collection) ? arrayEach : baseEach;
  9852. return func(collection, getIteratee(iteratee, 3));
  9853. }
  9854. /**
  9855. * This method is like `_.forEach` except that it iterates over elements of
  9856. * `collection` from right to left.
  9857. *
  9858. * @static
  9859. * @memberOf _
  9860. * @since 2.0.0
  9861. * @alias eachRight
  9862. * @category Collection
  9863. * @param {Array|Object} collection The collection to iterate over.
  9864. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9865. * @returns {Array|Object} Returns `collection`.
  9866. * @see _.forEach
  9867. * @example
  9868. *
  9869. * _.forEachRight([1, 2], function(value) {
  9870. * console.log(value);
  9871. * });
  9872. * // => Logs `2` then `1`.
  9873. */
  9874. function forEachRight(collection, iteratee) {
  9875. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9876. return func(collection, getIteratee(iteratee, 3));
  9877. }
  9878. /**
  9879. * Creates an object composed of keys generated from the results of running
  9880. * each element of `collection` thru `iteratee`. The order of grouped values
  9881. * is determined by the order they occur in `collection`. The corresponding
  9882. * value of each key is an array of elements responsible for generating the
  9883. * key. The iteratee is invoked with one argument: (value).
  9884. *
  9885. * @static
  9886. * @memberOf _
  9887. * @since 0.1.0
  9888. * @category Collection
  9889. * @param {Array|Object} collection The collection to iterate over.
  9890. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9891. * @returns {Object} Returns the composed aggregate object.
  9892. * @example
  9893. *
  9894. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9895. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9896. *
  9897. * // The `_.property` iteratee shorthand.
  9898. * _.groupBy(['one', 'two', 'three'], 'length');
  9899. * // => { '3': ['one', 'two'], '5': ['three'] }
  9900. */
  9901. var groupBy = createAggregator(function(result, value, key) {
  9902. if (hasOwnProperty.call(result, key)) {
  9903. result[key].push(value);
  9904. } else {
  9905. baseAssignValue(result, key, [value]);
  9906. }
  9907. });
  9908. /**
  9909. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9910. * checked for a substring of `value`, otherwise
  9911. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9912. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9913. * the offset from the end of `collection`.
  9914. *
  9915. * @static
  9916. * @memberOf _
  9917. * @since 0.1.0
  9918. * @category Collection
  9919. * @param {Array|Object|string} collection The collection to inspect.
  9920. * @param {*} value The value to search for.
  9921. * @param {number} [fromIndex=0] The index to search from.
  9922. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9923. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9924. * @example
  9925. *
  9926. * _.includes([1, 2, 3], 1);
  9927. * // => true
  9928. *
  9929. * _.includes([1, 2, 3], 1, 2);
  9930. * // => false
  9931. *
  9932. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9933. * // => true
  9934. *
  9935. * _.includes('abcd', 'bc');
  9936. * // => true
  9937. */
  9938. function includes(collection, value, fromIndex, guard) {
  9939. collection = isArrayLike(collection) ? collection : values(collection);
  9940. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9941. var length = collection.length;
  9942. if (fromIndex < 0) {
  9943. fromIndex = nativeMax(length + fromIndex, 0);
  9944. }
  9945. return isString(collection)
  9946. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9947. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9948. }
  9949. /**
  9950. * Invokes the method at `path` of each element in `collection`, returning
  9951. * an array of the results of each invoked method. Any additional arguments
  9952. * are provided to each invoked method. If `path` is a function, it's invoked
  9953. * for, and `this` bound to, each element in `collection`.
  9954. *
  9955. * @static
  9956. * @memberOf _
  9957. * @since 4.0.0
  9958. * @category Collection
  9959. * @param {Array|Object} collection The collection to iterate over.
  9960. * @param {Array|Function|string} path The path of the method to invoke or
  9961. * the function invoked per iteration.
  9962. * @param {...*} [args] The arguments to invoke each method with.
  9963. * @returns {Array} Returns the array of results.
  9964. * @example
  9965. *
  9966. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9967. * // => [[1, 5, 7], [1, 2, 3]]
  9968. *
  9969. * _.invokeMap([123, 456], String.prototype.split, '');
  9970. * // => [['1', '2', '3'], ['4', '5', '6']]
  9971. */
  9972. var invokeMap = baseRest(function(collection, path, args) {
  9973. var index = -1,
  9974. isFunc = typeof path == 'function',
  9975. result = isArrayLike(collection) ? Array(collection.length) : [];
  9976. baseEach(collection, function(value) {
  9977. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9978. });
  9979. return result;
  9980. });
  9981. /**
  9982. * Creates an object composed of keys generated from the results of running
  9983. * each element of `collection` thru `iteratee`. The corresponding value of
  9984. * each key is the last element responsible for generating the key. The
  9985. * iteratee is invoked with one argument: (value).
  9986. *
  9987. * @static
  9988. * @memberOf _
  9989. * @since 4.0.0
  9990. * @category Collection
  9991. * @param {Array|Object} collection The collection to iterate over.
  9992. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9993. * @returns {Object} Returns the composed aggregate object.
  9994. * @example
  9995. *
  9996. * var array = [
  9997. * { 'dir': 'left', 'code': 97 },
  9998. * { 'dir': 'right', 'code': 100 }
  9999. * ];
  10000. *
  10001. * _.keyBy(array, function(o) {
  10002. * return String.fromCharCode(o.code);
  10003. * });
  10004. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10005. *
  10006. * _.keyBy(array, 'dir');
  10007. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10008. */
  10009. var keyBy = createAggregator(function(result, value, key) {
  10010. baseAssignValue(result, key, value);
  10011. });
  10012. /**
  10013. * Creates an array of values by running each element in `collection` thru
  10014. * `iteratee`. The iteratee is invoked with three arguments:
  10015. * (value, index|key, collection).
  10016. *
  10017. * Many lodash methods are guarded to work as iteratees for methods like
  10018. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10019. *
  10020. * The guarded methods are:
  10021. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10022. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10023. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10024. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10025. *
  10026. * @static
  10027. * @memberOf _
  10028. * @since 0.1.0
  10029. * @category Collection
  10030. * @param {Array|Object} collection The collection to iterate over.
  10031. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10032. * @returns {Array} Returns the new mapped array.
  10033. * @example
  10034. *
  10035. * function square(n) {
  10036. * return n * n;
  10037. * }
  10038. *
  10039. * _.map([4, 8], square);
  10040. * // => [16, 64]
  10041. *
  10042. * _.map({ 'a': 4, 'b': 8 }, square);
  10043. * // => [16, 64] (iteration order is not guaranteed)
  10044. *
  10045. * var users = [
  10046. * { 'user': 'barney' },
  10047. * { 'user': 'fred' }
  10048. * ];
  10049. *
  10050. * // The `_.property` iteratee shorthand.
  10051. * _.map(users, 'user');
  10052. * // => ['barney', 'fred']
  10053. */
  10054. function map(collection, iteratee) {
  10055. var func = isArray(collection) ? arrayMap : baseMap;
  10056. return func(collection, getIteratee(iteratee, 3));
  10057. }
  10058. /**
  10059. * This method is like `_.sortBy` except that it allows specifying the sort
  10060. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10061. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10062. * descending or "asc" for ascending sort order of corresponding values.
  10063. *
  10064. * @static
  10065. * @memberOf _
  10066. * @since 4.0.0
  10067. * @category Collection
  10068. * @param {Array|Object} collection The collection to iterate over.
  10069. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10070. * The iteratees to sort by.
  10071. * @param {string[]} [orders] The sort orders of `iteratees`.
  10072. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10073. * @returns {Array} Returns the new sorted array.
  10074. * @example
  10075. *
  10076. * var users = [
  10077. * { 'user': 'fred', 'age': 48 },
  10078. * { 'user': 'barney', 'age': 34 },
  10079. * { 'user': 'fred', 'age': 40 },
  10080. * { 'user': 'barney', 'age': 36 }
  10081. * ];
  10082. *
  10083. * // Sort by `user` in ascending order and by `age` in descending order.
  10084. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10085. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10086. */
  10087. function orderBy(collection, iteratees, orders, guard) {
  10088. if (collection == null) {
  10089. return [];
  10090. }
  10091. if (!isArray(iteratees)) {
  10092. iteratees = iteratees == null ? [] : [iteratees];
  10093. }
  10094. orders = guard ? undefined : orders;
  10095. if (!isArray(orders)) {
  10096. orders = orders == null ? [] : [orders];
  10097. }
  10098. return baseOrderBy(collection, iteratees, orders);
  10099. }
  10100. /**
  10101. * Creates an array of elements split into two groups, the first of which
  10102. * contains elements `predicate` returns truthy for, the second of which
  10103. * contains elements `predicate` returns falsey for. The predicate is
  10104. * invoked with one argument: (value).
  10105. *
  10106. * @static
  10107. * @memberOf _
  10108. * @since 3.0.0
  10109. * @category Collection
  10110. * @param {Array|Object} collection The collection to iterate over.
  10111. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10112. * @returns {Array} Returns the array of grouped elements.
  10113. * @example
  10114. *
  10115. * var users = [
  10116. * { 'user': 'barney', 'age': 36, 'active': false },
  10117. * { 'user': 'fred', 'age': 40, 'active': true },
  10118. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10119. * ];
  10120. *
  10121. * _.partition(users, function(o) { return o.active; });
  10122. * // => objects for [['fred'], ['barney', 'pebbles']]
  10123. *
  10124. * // The `_.matches` iteratee shorthand.
  10125. * _.partition(users, { 'age': 1, 'active': false });
  10126. * // => objects for [['pebbles'], ['barney', 'fred']]
  10127. *
  10128. * // The `_.matchesProperty` iteratee shorthand.
  10129. * _.partition(users, ['active', false]);
  10130. * // => objects for [['barney', 'pebbles'], ['fred']]
  10131. *
  10132. * // The `_.property` iteratee shorthand.
  10133. * _.partition(users, 'active');
  10134. * // => objects for [['fred'], ['barney', 'pebbles']]
  10135. */
  10136. var partition = createAggregator(function(result, value, key) {
  10137. result[key ? 0 : 1].push(value);
  10138. }, function() { return [[], []]; });
  10139. /**
  10140. * Reduces `collection` to a value which is the accumulated result of running
  10141. * each element in `collection` thru `iteratee`, where each successive
  10142. * invocation is supplied the return value of the previous. If `accumulator`
  10143. * is not given, the first element of `collection` is used as the initial
  10144. * value. The iteratee is invoked with four arguments:
  10145. * (accumulator, value, index|key, collection).
  10146. *
  10147. * Many lodash methods are guarded to work as iteratees for methods like
  10148. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10149. *
  10150. * The guarded methods are:
  10151. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10152. * and `sortBy`
  10153. *
  10154. * @static
  10155. * @memberOf _
  10156. * @since 0.1.0
  10157. * @category Collection
  10158. * @param {Array|Object} collection The collection to iterate over.
  10159. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10160. * @param {*} [accumulator] The initial value.
  10161. * @returns {*} Returns the accumulated value.
  10162. * @see _.reduceRight
  10163. * @example
  10164. *
  10165. * _.reduce([1, 2], function(sum, n) {
  10166. * return sum + n;
  10167. * }, 0);
  10168. * // => 3
  10169. *
  10170. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10171. * (result[value] || (result[value] = [])).push(key);
  10172. * return result;
  10173. * }, {});
  10174. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10175. */
  10176. function reduce(collection, iteratee, accumulator) {
  10177. var func = isArray(collection) ? arrayReduce : baseReduce,
  10178. initAccum = arguments.length < 3;
  10179. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10180. }
  10181. /**
  10182. * This method is like `_.reduce` except that it iterates over elements of
  10183. * `collection` from right to left.
  10184. *
  10185. * @static
  10186. * @memberOf _
  10187. * @since 0.1.0
  10188. * @category Collection
  10189. * @param {Array|Object} collection The collection to iterate over.
  10190. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10191. * @param {*} [accumulator] The initial value.
  10192. * @returns {*} Returns the accumulated value.
  10193. * @see _.reduce
  10194. * @example
  10195. *
  10196. * var array = [[0, 1], [2, 3], [4, 5]];
  10197. *
  10198. * _.reduceRight(array, function(flattened, other) {
  10199. * return flattened.concat(other);
  10200. * }, []);
  10201. * // => [4, 5, 2, 3, 0, 1]
  10202. */
  10203. function reduceRight(collection, iteratee, accumulator) {
  10204. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10205. initAccum = arguments.length < 3;
  10206. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10207. }
  10208. /**
  10209. * The opposite of `_.filter`; this method returns the elements of `collection`
  10210. * that `predicate` does **not** return truthy for.
  10211. *
  10212. * @static
  10213. * @memberOf _
  10214. * @since 0.1.0
  10215. * @category Collection
  10216. * @param {Array|Object} collection The collection to iterate over.
  10217. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10218. * @returns {Array} Returns the new filtered array.
  10219. * @see _.filter
  10220. * @example
  10221. *
  10222. * var users = [
  10223. * { 'user': 'barney', 'age': 36, 'active': false },
  10224. * { 'user': 'fred', 'age': 40, 'active': true }
  10225. * ];
  10226. *
  10227. * _.reject(users, function(o) { return !o.active; });
  10228. * // => objects for ['fred']
  10229. *
  10230. * // The `_.matches` iteratee shorthand.
  10231. * _.reject(users, { 'age': 40, 'active': true });
  10232. * // => objects for ['barney']
  10233. *
  10234. * // The `_.matchesProperty` iteratee shorthand.
  10235. * _.reject(users, ['active', false]);
  10236. * // => objects for ['fred']
  10237. *
  10238. * // The `_.property` iteratee shorthand.
  10239. * _.reject(users, 'active');
  10240. * // => objects for ['barney']
  10241. */
  10242. function reject(collection, predicate) {
  10243. var func = isArray(collection) ? arrayFilter : baseFilter;
  10244. return func(collection, negate(getIteratee(predicate, 3)));
  10245. }
  10246. /**
  10247. * Gets a random element from `collection`.
  10248. *
  10249. * @static
  10250. * @memberOf _
  10251. * @since 2.0.0
  10252. * @category Collection
  10253. * @param {Array|Object} collection The collection to sample.
  10254. * @returns {*} Returns the random element.
  10255. * @example
  10256. *
  10257. * _.sample([1, 2, 3, 4]);
  10258. * // => 2
  10259. */
  10260. function sample(collection) {
  10261. var func = isArray(collection) ? arraySample : baseSample;
  10262. return func(collection);
  10263. }
  10264. /**
  10265. * Gets `n` random elements at unique keys from `collection` up to the
  10266. * size of `collection`.
  10267. *
  10268. * @static
  10269. * @memberOf _
  10270. * @since 4.0.0
  10271. * @category Collection
  10272. * @param {Array|Object} collection The collection to sample.
  10273. * @param {number} [n=1] The number of elements to sample.
  10274. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10275. * @returns {Array} Returns the random elements.
  10276. * @example
  10277. *
  10278. * _.sampleSize([1, 2, 3], 2);
  10279. * // => [3, 1]
  10280. *
  10281. * _.sampleSize([1, 2, 3], 4);
  10282. * // => [2, 3, 1]
  10283. */
  10284. function sampleSize(collection, n, guard) {
  10285. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10286. n = 1;
  10287. } else {
  10288. n = toInteger(n);
  10289. }
  10290. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10291. return func(collection, n);
  10292. }
  10293. /**
  10294. * Creates an array of shuffled values, using a version of the
  10295. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10296. *
  10297. * @static
  10298. * @memberOf _
  10299. * @since 0.1.0
  10300. * @category Collection
  10301. * @param {Array|Object} collection The collection to shuffle.
  10302. * @returns {Array} Returns the new shuffled array.
  10303. * @example
  10304. *
  10305. * _.shuffle([1, 2, 3, 4]);
  10306. * // => [4, 1, 3, 2]
  10307. */
  10308. function shuffle(collection) {
  10309. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10310. return func(collection);
  10311. }
  10312. /**
  10313. * Gets the size of `collection` by returning its length for array-like
  10314. * values or the number of own enumerable string keyed properties for objects.
  10315. *
  10316. * @static
  10317. * @memberOf _
  10318. * @since 0.1.0
  10319. * @category Collection
  10320. * @param {Array|Object|string} collection The collection to inspect.
  10321. * @returns {number} Returns the collection size.
  10322. * @example
  10323. *
  10324. * _.size([1, 2, 3]);
  10325. * // => 3
  10326. *
  10327. * _.size({ 'a': 1, 'b': 2 });
  10328. * // => 2
  10329. *
  10330. * _.size('pebbles');
  10331. * // => 7
  10332. */
  10333. function size(collection) {
  10334. if (collection == null) {
  10335. return 0;
  10336. }
  10337. if (isArrayLike(collection)) {
  10338. return isString(collection) ? stringSize(collection) : collection.length;
  10339. }
  10340. var tag = getTag(collection);
  10341. if (tag == mapTag || tag == setTag) {
  10342. return collection.size;
  10343. }
  10344. return baseKeys(collection).length;
  10345. }
  10346. /**
  10347. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10348. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10349. * invoked with three arguments: (value, index|key, collection).
  10350. *
  10351. * @static
  10352. * @memberOf _
  10353. * @since 0.1.0
  10354. * @category Collection
  10355. * @param {Array|Object} collection The collection to iterate over.
  10356. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10357. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10358. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10359. * else `false`.
  10360. * @example
  10361. *
  10362. * _.some([null, 0, 'yes', false], Boolean);
  10363. * // => true
  10364. *
  10365. * var users = [
  10366. * { 'user': 'barney', 'active': true },
  10367. * { 'user': 'fred', 'active': false }
  10368. * ];
  10369. *
  10370. * // The `_.matches` iteratee shorthand.
  10371. * _.some(users, { 'user': 'barney', 'active': false });
  10372. * // => false
  10373. *
  10374. * // The `_.matchesProperty` iteratee shorthand.
  10375. * _.some(users, ['active', false]);
  10376. * // => true
  10377. *
  10378. * // The `_.property` iteratee shorthand.
  10379. * _.some(users, 'active');
  10380. * // => true
  10381. */
  10382. function some(collection, predicate, guard) {
  10383. var func = isArray(collection) ? arraySome : baseSome;
  10384. if (guard && isIterateeCall(collection, predicate, guard)) {
  10385. predicate = undefined;
  10386. }
  10387. return func(collection, getIteratee(predicate, 3));
  10388. }
  10389. /**
  10390. * Creates an array of elements, sorted in ascending order by the results of
  10391. * running each element in a collection thru each iteratee. This method
  10392. * performs a stable sort, that is, it preserves the original sort order of
  10393. * equal elements. The iteratees are invoked with one argument: (value).
  10394. *
  10395. * @static
  10396. * @memberOf _
  10397. * @since 0.1.0
  10398. * @category Collection
  10399. * @param {Array|Object} collection The collection to iterate over.
  10400. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10401. * The iteratees to sort by.
  10402. * @returns {Array} Returns the new sorted array.
  10403. * @example
  10404. *
  10405. * var users = [
  10406. * { 'user': 'fred', 'age': 48 },
  10407. * { 'user': 'barney', 'age': 36 },
  10408. * { 'user': 'fred', 'age': 30 },
  10409. * { 'user': 'barney', 'age': 34 }
  10410. * ];
  10411. *
  10412. * _.sortBy(users, [function(o) { return o.user; }]);
  10413. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10414. *
  10415. * _.sortBy(users, ['user', 'age']);
  10416. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10417. */
  10418. var sortBy = baseRest(function(collection, iteratees) {
  10419. if (collection == null) {
  10420. return [];
  10421. }
  10422. var length = iteratees.length;
  10423. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10424. iteratees = [];
  10425. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10426. iteratees = [iteratees[0]];
  10427. }
  10428. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10429. });
  10430. /*------------------------------------------------------------------------*/
  10431. /**
  10432. * Gets the timestamp of the number of milliseconds that have elapsed since
  10433. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10434. *
  10435. * @static
  10436. * @memberOf _
  10437. * @since 2.4.0
  10438. * @category Date
  10439. * @returns {number} Returns the timestamp.
  10440. * @example
  10441. *
  10442. * _.defer(function(stamp) {
  10443. * console.log(_.now() - stamp);
  10444. * }, _.now());
  10445. * // => Logs the number of milliseconds it took for the deferred invocation.
  10446. */
  10447. var now = ctxNow || function() {
  10448. return root.Date.now();
  10449. };
  10450. /*------------------------------------------------------------------------*/
  10451. /**
  10452. * The opposite of `_.before`; this method creates a function that invokes
  10453. * `func` once it's called `n` or more times.
  10454. *
  10455. * @static
  10456. * @memberOf _
  10457. * @since 0.1.0
  10458. * @category Function
  10459. * @param {number} n The number of calls before `func` is invoked.
  10460. * @param {Function} func The function to restrict.
  10461. * @returns {Function} Returns the new restricted function.
  10462. * @example
  10463. *
  10464. * var saves = ['profile', 'settings'];
  10465. *
  10466. * var done = _.after(saves.length, function() {
  10467. * console.log('done saving!');
  10468. * });
  10469. *
  10470. * _.forEach(saves, function(type) {
  10471. * asyncSave({ 'type': type, 'complete': done });
  10472. * });
  10473. * // => Logs 'done saving!' after the two async saves have completed.
  10474. */
  10475. function after(n, func) {
  10476. if (typeof func != 'function') {
  10477. throw new TypeError(FUNC_ERROR_TEXT);
  10478. }
  10479. n = toInteger(n);
  10480. return function() {
  10481. if (--n < 1) {
  10482. return func.apply(this, arguments);
  10483. }
  10484. };
  10485. }
  10486. /**
  10487. * Creates a function that invokes `func`, with up to `n` arguments,
  10488. * ignoring any additional arguments.
  10489. *
  10490. * @static
  10491. * @memberOf _
  10492. * @since 3.0.0
  10493. * @category Function
  10494. * @param {Function} func The function to cap arguments for.
  10495. * @param {number} [n=func.length] The arity cap.
  10496. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10497. * @returns {Function} Returns the new capped function.
  10498. * @example
  10499. *
  10500. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10501. * // => [6, 8, 10]
  10502. */
  10503. function ary(func, n, guard) {
  10504. n = guard ? undefined : n;
  10505. n = (func && n == null) ? func.length : n;
  10506. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10507. }
  10508. /**
  10509. * Creates a function that invokes `func`, with the `this` binding and arguments
  10510. * of the created function, while it's called less than `n` times. Subsequent
  10511. * calls to the created function return the result of the last `func` invocation.
  10512. *
  10513. * @static
  10514. * @memberOf _
  10515. * @since 3.0.0
  10516. * @category Function
  10517. * @param {number} n The number of calls at which `func` is no longer invoked.
  10518. * @param {Function} func The function to restrict.
  10519. * @returns {Function} Returns the new restricted function.
  10520. * @example
  10521. *
  10522. * jQuery(element).on('click', _.before(5, addContactToList));
  10523. * // => Allows adding up to 4 contacts to the list.
  10524. */
  10525. function before(n, func) {
  10526. var result;
  10527. if (typeof func != 'function') {
  10528. throw new TypeError(FUNC_ERROR_TEXT);
  10529. }
  10530. n = toInteger(n);
  10531. return function() {
  10532. if (--n > 0) {
  10533. result = func.apply(this, arguments);
  10534. }
  10535. if (n <= 1) {
  10536. func = undefined;
  10537. }
  10538. return result;
  10539. };
  10540. }
  10541. /**
  10542. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10543. * and `partials` prepended to the arguments it receives.
  10544. *
  10545. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10546. * may be used as a placeholder for partially applied arguments.
  10547. *
  10548. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10549. * property of bound functions.
  10550. *
  10551. * @static
  10552. * @memberOf _
  10553. * @since 0.1.0
  10554. * @category Function
  10555. * @param {Function} func The function to bind.
  10556. * @param {*} thisArg The `this` binding of `func`.
  10557. * @param {...*} [partials] The arguments to be partially applied.
  10558. * @returns {Function} Returns the new bound function.
  10559. * @example
  10560. *
  10561. * function greet(greeting, punctuation) {
  10562. * return greeting + ' ' + this.user + punctuation;
  10563. * }
  10564. *
  10565. * var object = { 'user': 'fred' };
  10566. *
  10567. * var bound = _.bind(greet, object, 'hi');
  10568. * bound('!');
  10569. * // => 'hi fred!'
  10570. *
  10571. * // Bound with placeholders.
  10572. * var bound = _.bind(greet, object, _, '!');
  10573. * bound('hi');
  10574. * // => 'hi fred!'
  10575. */
  10576. var bind = baseRest(function(func, thisArg, partials) {
  10577. var bitmask = WRAP_BIND_FLAG;
  10578. if (partials.length) {
  10579. var holders = replaceHolders(partials, getHolder(bind));
  10580. bitmask |= WRAP_PARTIAL_FLAG;
  10581. }
  10582. return createWrap(func, bitmask, thisArg, partials, holders);
  10583. });
  10584. /**
  10585. * Creates a function that invokes the method at `object[key]` with `partials`
  10586. * prepended to the arguments it receives.
  10587. *
  10588. * This method differs from `_.bind` by allowing bound functions to reference
  10589. * methods that may be redefined or don't yet exist. See
  10590. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10591. * for more details.
  10592. *
  10593. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10594. * builds, may be used as a placeholder for partially applied arguments.
  10595. *
  10596. * @static
  10597. * @memberOf _
  10598. * @since 0.10.0
  10599. * @category Function
  10600. * @param {Object} object The object to invoke the method on.
  10601. * @param {string} key The key of the method.
  10602. * @param {...*} [partials] The arguments to be partially applied.
  10603. * @returns {Function} Returns the new bound function.
  10604. * @example
  10605. *
  10606. * var object = {
  10607. * 'user': 'fred',
  10608. * 'greet': function(greeting, punctuation) {
  10609. * return greeting + ' ' + this.user + punctuation;
  10610. * }
  10611. * };
  10612. *
  10613. * var bound = _.bindKey(object, 'greet', 'hi');
  10614. * bound('!');
  10615. * // => 'hi fred!'
  10616. *
  10617. * object.greet = function(greeting, punctuation) {
  10618. * return greeting + 'ya ' + this.user + punctuation;
  10619. * };
  10620. *
  10621. * bound('!');
  10622. * // => 'hiya fred!'
  10623. *
  10624. * // Bound with placeholders.
  10625. * var bound = _.bindKey(object, 'greet', _, '!');
  10626. * bound('hi');
  10627. * // => 'hiya fred!'
  10628. */
  10629. var bindKey = baseRest(function(object, key, partials) {
  10630. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10631. if (partials.length) {
  10632. var holders = replaceHolders(partials, getHolder(bindKey));
  10633. bitmask |= WRAP_PARTIAL_FLAG;
  10634. }
  10635. return createWrap(key, bitmask, object, partials, holders);
  10636. });
  10637. /**
  10638. * Creates a function that accepts arguments of `func` and either invokes
  10639. * `func` returning its result, if at least `arity` number of arguments have
  10640. * been provided, or returns a function that accepts the remaining `func`
  10641. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10642. * is not sufficient.
  10643. *
  10644. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10645. * may be used as a placeholder for provided arguments.
  10646. *
  10647. * **Note:** This method doesn't set the "length" property of curried functions.
  10648. *
  10649. * @static
  10650. * @memberOf _
  10651. * @since 2.0.0
  10652. * @category Function
  10653. * @param {Function} func The function to curry.
  10654. * @param {number} [arity=func.length] The arity of `func`.
  10655. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10656. * @returns {Function} Returns the new curried function.
  10657. * @example
  10658. *
  10659. * var abc = function(a, b, c) {
  10660. * return [a, b, c];
  10661. * };
  10662. *
  10663. * var curried = _.curry(abc);
  10664. *
  10665. * curried(1)(2)(3);
  10666. * // => [1, 2, 3]
  10667. *
  10668. * curried(1, 2)(3);
  10669. * // => [1, 2, 3]
  10670. *
  10671. * curried(1, 2, 3);
  10672. * // => [1, 2, 3]
  10673. *
  10674. * // Curried with placeholders.
  10675. * curried(1)(_, 3)(2);
  10676. * // => [1, 2, 3]
  10677. */
  10678. function curry(func, arity, guard) {
  10679. arity = guard ? undefined : arity;
  10680. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10681. result.placeholder = curry.placeholder;
  10682. return result;
  10683. }
  10684. /**
  10685. * This method is like `_.curry` except that arguments are applied to `func`
  10686. * in the manner of `_.partialRight` instead of `_.partial`.
  10687. *
  10688. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10689. * builds, may be used as a placeholder for provided arguments.
  10690. *
  10691. * **Note:** This method doesn't set the "length" property of curried functions.
  10692. *
  10693. * @static
  10694. * @memberOf _
  10695. * @since 3.0.0
  10696. * @category Function
  10697. * @param {Function} func The function to curry.
  10698. * @param {number} [arity=func.length] The arity of `func`.
  10699. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10700. * @returns {Function} Returns the new curried function.
  10701. * @example
  10702. *
  10703. * var abc = function(a, b, c) {
  10704. * return [a, b, c];
  10705. * };
  10706. *
  10707. * var curried = _.curryRight(abc);
  10708. *
  10709. * curried(3)(2)(1);
  10710. * // => [1, 2, 3]
  10711. *
  10712. * curried(2, 3)(1);
  10713. * // => [1, 2, 3]
  10714. *
  10715. * curried(1, 2, 3);
  10716. * // => [1, 2, 3]
  10717. *
  10718. * // Curried with placeholders.
  10719. * curried(3)(1, _)(2);
  10720. * // => [1, 2, 3]
  10721. */
  10722. function curryRight(func, arity, guard) {
  10723. arity = guard ? undefined : arity;
  10724. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10725. result.placeholder = curryRight.placeholder;
  10726. return result;
  10727. }
  10728. /**
  10729. * Creates a debounced function that delays invoking `func` until after `wait`
  10730. * milliseconds have elapsed since the last time the debounced function was
  10731. * invoked. The debounced function comes with a `cancel` method to cancel
  10732. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10733. * Provide `options` to indicate whether `func` should be invoked on the
  10734. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10735. * with the last arguments provided to the debounced function. Subsequent
  10736. * calls to the debounced function return the result of the last `func`
  10737. * invocation.
  10738. *
  10739. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10740. * invoked on the trailing edge of the timeout only if the debounced function
  10741. * is invoked more than once during the `wait` timeout.
  10742. *
  10743. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10744. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10745. *
  10746. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10747. * for details over the differences between `_.debounce` and `_.throttle`.
  10748. *
  10749. * @static
  10750. * @memberOf _
  10751. * @since 0.1.0
  10752. * @category Function
  10753. * @param {Function} func The function to debounce.
  10754. * @param {number} [wait=0] The number of milliseconds to delay.
  10755. * @param {Object} [options={}] The options object.
  10756. * @param {boolean} [options.leading=false]
  10757. * Specify invoking on the leading edge of the timeout.
  10758. * @param {number} [options.maxWait]
  10759. * The maximum time `func` is allowed to be delayed before it's invoked.
  10760. * @param {boolean} [options.trailing=true]
  10761. * Specify invoking on the trailing edge of the timeout.
  10762. * @returns {Function} Returns the new debounced function.
  10763. * @example
  10764. *
  10765. * // Avoid costly calculations while the window size is in flux.
  10766. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10767. *
  10768. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10769. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10770. * 'leading': true,
  10771. * 'trailing': false
  10772. * }));
  10773. *
  10774. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10775. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10776. * var source = new EventSource('/stream');
  10777. * jQuery(source).on('message', debounced);
  10778. *
  10779. * // Cancel the trailing debounced invocation.
  10780. * jQuery(window).on('popstate', debounced.cancel);
  10781. */
  10782. function debounce(func, wait, options) {
  10783. var lastArgs,
  10784. lastThis,
  10785. maxWait,
  10786. result,
  10787. timerId,
  10788. lastCallTime,
  10789. lastInvokeTime = 0,
  10790. leading = false,
  10791. maxing = false,
  10792. trailing = true;
  10793. if (typeof func != 'function') {
  10794. throw new TypeError(FUNC_ERROR_TEXT);
  10795. }
  10796. wait = toNumber(wait) || 0;
  10797. if (isObject(options)) {
  10798. leading = !!options.leading;
  10799. maxing = 'maxWait' in options;
  10800. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10801. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10802. }
  10803. function invokeFunc(time) {
  10804. var args = lastArgs,
  10805. thisArg = lastThis;
  10806. lastArgs = lastThis = undefined;
  10807. lastInvokeTime = time;
  10808. result = func.apply(thisArg, args);
  10809. return result;
  10810. }
  10811. function leadingEdge(time) {
  10812. // Reset any `maxWait` timer.
  10813. lastInvokeTime = time;
  10814. // Start the timer for the trailing edge.
  10815. timerId = setTimeout(timerExpired, wait);
  10816. // Invoke the leading edge.
  10817. return leading ? invokeFunc(time) : result;
  10818. }
  10819. function remainingWait(time) {
  10820. var timeSinceLastCall = time - lastCallTime,
  10821. timeSinceLastInvoke = time - lastInvokeTime,
  10822. timeWaiting = wait - timeSinceLastCall;
  10823. return maxing
  10824. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10825. : timeWaiting;
  10826. }
  10827. function shouldInvoke(time) {
  10828. var timeSinceLastCall = time - lastCallTime,
  10829. timeSinceLastInvoke = time - lastInvokeTime;
  10830. // Either this is the first call, activity has stopped and we're at the
  10831. // trailing edge, the system time has gone backwards and we're treating
  10832. // it as the trailing edge, or we've hit the `maxWait` limit.
  10833. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10834. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10835. }
  10836. function timerExpired() {
  10837. var time = now();
  10838. if (shouldInvoke(time)) {
  10839. return trailingEdge(time);
  10840. }
  10841. // Restart the timer.
  10842. timerId = setTimeout(timerExpired, remainingWait(time));
  10843. }
  10844. function trailingEdge(time) {
  10845. timerId = undefined;
  10846. // Only invoke if we have `lastArgs` which means `func` has been
  10847. // debounced at least once.
  10848. if (trailing && lastArgs) {
  10849. return invokeFunc(time);
  10850. }
  10851. lastArgs = lastThis = undefined;
  10852. return result;
  10853. }
  10854. function cancel() {
  10855. if (timerId !== undefined) {
  10856. clearTimeout(timerId);
  10857. }
  10858. lastInvokeTime = 0;
  10859. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10860. }
  10861. function flush() {
  10862. return timerId === undefined ? result : trailingEdge(now());
  10863. }
  10864. function debounced() {
  10865. var time = now(),
  10866. isInvoking = shouldInvoke(time);
  10867. lastArgs = arguments;
  10868. lastThis = this;
  10869. lastCallTime = time;
  10870. if (isInvoking) {
  10871. if (timerId === undefined) {
  10872. return leadingEdge(lastCallTime);
  10873. }
  10874. if (maxing) {
  10875. // Handle invocations in a tight loop.
  10876. clearTimeout(timerId);
  10877. timerId = setTimeout(timerExpired, wait);
  10878. return invokeFunc(lastCallTime);
  10879. }
  10880. }
  10881. if (timerId === undefined) {
  10882. timerId = setTimeout(timerExpired, wait);
  10883. }
  10884. return result;
  10885. }
  10886. debounced.cancel = cancel;
  10887. debounced.flush = flush;
  10888. return debounced;
  10889. }
  10890. /**
  10891. * Defers invoking the `func` until the current call stack has cleared. Any
  10892. * additional arguments are provided to `func` when it's invoked.
  10893. *
  10894. * @static
  10895. * @memberOf _
  10896. * @since 0.1.0
  10897. * @category Function
  10898. * @param {Function} func The function to defer.
  10899. * @param {...*} [args] The arguments to invoke `func` with.
  10900. * @returns {number} Returns the timer id.
  10901. * @example
  10902. *
  10903. * _.defer(function(text) {
  10904. * console.log(text);
  10905. * }, 'deferred');
  10906. * // => Logs 'deferred' after one millisecond.
  10907. */
  10908. var defer = baseRest(function(func, args) {
  10909. return baseDelay(func, 1, args);
  10910. });
  10911. /**
  10912. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10913. * provided to `func` when it's invoked.
  10914. *
  10915. * @static
  10916. * @memberOf _
  10917. * @since 0.1.0
  10918. * @category Function
  10919. * @param {Function} func The function to delay.
  10920. * @param {number} wait The number of milliseconds to delay invocation.
  10921. * @param {...*} [args] The arguments to invoke `func` with.
  10922. * @returns {number} Returns the timer id.
  10923. * @example
  10924. *
  10925. * _.delay(function(text) {
  10926. * console.log(text);
  10927. * }, 1000, 'later');
  10928. * // => Logs 'later' after one second.
  10929. */
  10930. var delay = baseRest(function(func, wait, args) {
  10931. return baseDelay(func, toNumber(wait) || 0, args);
  10932. });
  10933. /**
  10934. * Creates a function that invokes `func` with arguments reversed.
  10935. *
  10936. * @static
  10937. * @memberOf _
  10938. * @since 4.0.0
  10939. * @category Function
  10940. * @param {Function} func The function to flip arguments for.
  10941. * @returns {Function} Returns the new flipped function.
  10942. * @example
  10943. *
  10944. * var flipped = _.flip(function() {
  10945. * return _.toArray(arguments);
  10946. * });
  10947. *
  10948. * flipped('a', 'b', 'c', 'd');
  10949. * // => ['d', 'c', 'b', 'a']
  10950. */
  10951. function flip(func) {
  10952. return createWrap(func, WRAP_FLIP_FLAG);
  10953. }
  10954. /**
  10955. * Creates a function that memoizes the result of `func`. If `resolver` is
  10956. * provided, it determines the cache key for storing the result based on the
  10957. * arguments provided to the memoized function. By default, the first argument
  10958. * provided to the memoized function is used as the map cache key. The `func`
  10959. * is invoked with the `this` binding of the memoized function.
  10960. *
  10961. * **Note:** The cache is exposed as the `cache` property on the memoized
  10962. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10963. * constructor with one whose instances implement the
  10964. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10965. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10966. *
  10967. * @static
  10968. * @memberOf _
  10969. * @since 0.1.0
  10970. * @category Function
  10971. * @param {Function} func The function to have its output memoized.
  10972. * @param {Function} [resolver] The function to resolve the cache key.
  10973. * @returns {Function} Returns the new memoized function.
  10974. * @example
  10975. *
  10976. * var object = { 'a': 1, 'b': 2 };
  10977. * var other = { 'c': 3, 'd': 4 };
  10978. *
  10979. * var values = _.memoize(_.values);
  10980. * values(object);
  10981. * // => [1, 2]
  10982. *
  10983. * values(other);
  10984. * // => [3, 4]
  10985. *
  10986. * object.a = 2;
  10987. * values(object);
  10988. * // => [1, 2]
  10989. *
  10990. * // Modify the result cache.
  10991. * values.cache.set(object, ['a', 'b']);
  10992. * values(object);
  10993. * // => ['a', 'b']
  10994. *
  10995. * // Replace `_.memoize.Cache`.
  10996. * _.memoize.Cache = WeakMap;
  10997. */
  10998. function memoize(func, resolver) {
  10999. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11000. throw new TypeError(FUNC_ERROR_TEXT);
  11001. }
  11002. var memoized = function() {
  11003. var args = arguments,
  11004. key = resolver ? resolver.apply(this, args) : args[0],
  11005. cache = memoized.cache;
  11006. if (cache.has(key)) {
  11007. return cache.get(key);
  11008. }
  11009. var result = func.apply(this, args);
  11010. memoized.cache = cache.set(key, result) || cache;
  11011. return result;
  11012. };
  11013. memoized.cache = new (memoize.Cache || MapCache);
  11014. return memoized;
  11015. }
  11016. // Expose `MapCache`.
  11017. memoize.Cache = MapCache;
  11018. /**
  11019. * Creates a function that negates the result of the predicate `func`. The
  11020. * `func` predicate is invoked with the `this` binding and arguments of the
  11021. * created function.
  11022. *
  11023. * @static
  11024. * @memberOf _
  11025. * @since 3.0.0
  11026. * @category Function
  11027. * @param {Function} predicate The predicate to negate.
  11028. * @returns {Function} Returns the new negated function.
  11029. * @example
  11030. *
  11031. * function isEven(n) {
  11032. * return n % 2 == 0;
  11033. * }
  11034. *
  11035. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11036. * // => [1, 3, 5]
  11037. */
  11038. function negate(predicate) {
  11039. if (typeof predicate != 'function') {
  11040. throw new TypeError(FUNC_ERROR_TEXT);
  11041. }
  11042. return function() {
  11043. var args = arguments;
  11044. switch (args.length) {
  11045. case 0: return !predicate.call(this);
  11046. case 1: return !predicate.call(this, args[0]);
  11047. case 2: return !predicate.call(this, args[0], args[1]);
  11048. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11049. }
  11050. return !predicate.apply(this, args);
  11051. };
  11052. }
  11053. /**
  11054. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11055. * to the function return the value of the first invocation. The `func` is
  11056. * invoked with the `this` binding and arguments of the created function.
  11057. *
  11058. * @static
  11059. * @memberOf _
  11060. * @since 0.1.0
  11061. * @category Function
  11062. * @param {Function} func The function to restrict.
  11063. * @returns {Function} Returns the new restricted function.
  11064. * @example
  11065. *
  11066. * var initialize = _.once(createApplication);
  11067. * initialize();
  11068. * initialize();
  11069. * // => `createApplication` is invoked once
  11070. */
  11071. function once(func) {
  11072. return before(2, func);
  11073. }
  11074. /**
  11075. * Creates a function that invokes `func` with its arguments transformed.
  11076. *
  11077. * @static
  11078. * @since 4.0.0
  11079. * @memberOf _
  11080. * @category Function
  11081. * @param {Function} func The function to wrap.
  11082. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11083. * The argument transforms.
  11084. * @returns {Function} Returns the new function.
  11085. * @example
  11086. *
  11087. * function doubled(n) {
  11088. * return n * 2;
  11089. * }
  11090. *
  11091. * function square(n) {
  11092. * return n * n;
  11093. * }
  11094. *
  11095. * var func = _.overArgs(function(x, y) {
  11096. * return [x, y];
  11097. * }, [square, doubled]);
  11098. *
  11099. * func(9, 3);
  11100. * // => [81, 6]
  11101. *
  11102. * func(10, 5);
  11103. * // => [100, 10]
  11104. */
  11105. var overArgs = castRest(function(func, transforms) {
  11106. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11107. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11108. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11109. var funcsLength = transforms.length;
  11110. return baseRest(function(args) {
  11111. var index = -1,
  11112. length = nativeMin(args.length, funcsLength);
  11113. while (++index < length) {
  11114. args[index] = transforms[index].call(this, args[index]);
  11115. }
  11116. return apply(func, this, args);
  11117. });
  11118. });
  11119. /**
  11120. * Creates a function that invokes `func` with `partials` prepended to the
  11121. * arguments it receives. This method is like `_.bind` except it does **not**
  11122. * alter the `this` binding.
  11123. *
  11124. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11125. * builds, may be used as a placeholder for partially applied arguments.
  11126. *
  11127. * **Note:** This method doesn't set the "length" property of partially
  11128. * applied functions.
  11129. *
  11130. * @static
  11131. * @memberOf _
  11132. * @since 0.2.0
  11133. * @category Function
  11134. * @param {Function} func The function to partially apply arguments to.
  11135. * @param {...*} [partials] The arguments to be partially applied.
  11136. * @returns {Function} Returns the new partially applied function.
  11137. * @example
  11138. *
  11139. * function greet(greeting, name) {
  11140. * return greeting + ' ' + name;
  11141. * }
  11142. *
  11143. * var sayHelloTo = _.partial(greet, 'hello');
  11144. * sayHelloTo('fred');
  11145. * // => 'hello fred'
  11146. *
  11147. * // Partially applied with placeholders.
  11148. * var greetFred = _.partial(greet, _, 'fred');
  11149. * greetFred('hi');
  11150. * // => 'hi fred'
  11151. */
  11152. var partial = baseRest(function(func, partials) {
  11153. var holders = replaceHolders(partials, getHolder(partial));
  11154. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11155. });
  11156. /**
  11157. * This method is like `_.partial` except that partially applied arguments
  11158. * are appended to the arguments it receives.
  11159. *
  11160. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11161. * builds, may be used as a placeholder for partially applied arguments.
  11162. *
  11163. * **Note:** This method doesn't set the "length" property of partially
  11164. * applied functions.
  11165. *
  11166. * @static
  11167. * @memberOf _
  11168. * @since 1.0.0
  11169. * @category Function
  11170. * @param {Function} func The function to partially apply arguments to.
  11171. * @param {...*} [partials] The arguments to be partially applied.
  11172. * @returns {Function} Returns the new partially applied function.
  11173. * @example
  11174. *
  11175. * function greet(greeting, name) {
  11176. * return greeting + ' ' + name;
  11177. * }
  11178. *
  11179. * var greetFred = _.partialRight(greet, 'fred');
  11180. * greetFred('hi');
  11181. * // => 'hi fred'
  11182. *
  11183. * // Partially applied with placeholders.
  11184. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11185. * sayHelloTo('fred');
  11186. * // => 'hello fred'
  11187. */
  11188. var partialRight = baseRest(function(func, partials) {
  11189. var holders = replaceHolders(partials, getHolder(partialRight));
  11190. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11191. });
  11192. /**
  11193. * Creates a function that invokes `func` with arguments arranged according
  11194. * to the specified `indexes` where the argument value at the first index is
  11195. * provided as the first argument, the argument value at the second index is
  11196. * provided as the second argument, and so on.
  11197. *
  11198. * @static
  11199. * @memberOf _
  11200. * @since 3.0.0
  11201. * @category Function
  11202. * @param {Function} func The function to rearrange arguments for.
  11203. * @param {...(number|number[])} indexes The arranged argument indexes.
  11204. * @returns {Function} Returns the new function.
  11205. * @example
  11206. *
  11207. * var rearged = _.rearg(function(a, b, c) {
  11208. * return [a, b, c];
  11209. * }, [2, 0, 1]);
  11210. *
  11211. * rearged('b', 'c', 'a')
  11212. * // => ['a', 'b', 'c']
  11213. */
  11214. var rearg = flatRest(function(func, indexes) {
  11215. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11216. });
  11217. /**
  11218. * Creates a function that invokes `func` with the `this` binding of the
  11219. * created function and arguments from `start` and beyond provided as
  11220. * an array.
  11221. *
  11222. * **Note:** This method is based on the
  11223. * [rest parameter](https://mdn.io/rest_parameters).
  11224. *
  11225. * @static
  11226. * @memberOf _
  11227. * @since 4.0.0
  11228. * @category Function
  11229. * @param {Function} func The function to apply a rest parameter to.
  11230. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11231. * @returns {Function} Returns the new function.
  11232. * @example
  11233. *
  11234. * var say = _.rest(function(what, names) {
  11235. * return what + ' ' + _.initial(names).join(', ') +
  11236. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11237. * });
  11238. *
  11239. * say('hello', 'fred', 'barney', 'pebbles');
  11240. * // => 'hello fred, barney, & pebbles'
  11241. */
  11242. function rest(func, start) {
  11243. if (typeof func != 'function') {
  11244. throw new TypeError(FUNC_ERROR_TEXT);
  11245. }
  11246. start = start === undefined ? start : toInteger(start);
  11247. return baseRest(func, start);
  11248. }
  11249. /**
  11250. * Creates a function that invokes `func` with the `this` binding of the
  11251. * create function and an array of arguments much like
  11252. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11253. *
  11254. * **Note:** This method is based on the
  11255. * [spread operator](https://mdn.io/spread_operator).
  11256. *
  11257. * @static
  11258. * @memberOf _
  11259. * @since 3.2.0
  11260. * @category Function
  11261. * @param {Function} func The function to spread arguments over.
  11262. * @param {number} [start=0] The start position of the spread.
  11263. * @returns {Function} Returns the new function.
  11264. * @example
  11265. *
  11266. * var say = _.spread(function(who, what) {
  11267. * return who + ' says ' + what;
  11268. * });
  11269. *
  11270. * say(['fred', 'hello']);
  11271. * // => 'fred says hello'
  11272. *
  11273. * var numbers = Promise.all([
  11274. * Promise.resolve(40),
  11275. * Promise.resolve(36)
  11276. * ]);
  11277. *
  11278. * numbers.then(_.spread(function(x, y) {
  11279. * return x + y;
  11280. * }));
  11281. * // => a Promise of 76
  11282. */
  11283. function spread(func, start) {
  11284. if (typeof func != 'function') {
  11285. throw new TypeError(FUNC_ERROR_TEXT);
  11286. }
  11287. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11288. return baseRest(function(args) {
  11289. var array = args[start],
  11290. otherArgs = castSlice(args, 0, start);
  11291. if (array) {
  11292. arrayPush(otherArgs, array);
  11293. }
  11294. return apply(func, this, otherArgs);
  11295. });
  11296. }
  11297. /**
  11298. * Creates a throttled function that only invokes `func` at most once per
  11299. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11300. * method to cancel delayed `func` invocations and a `flush` method to
  11301. * immediately invoke them. Provide `options` to indicate whether `func`
  11302. * should be invoked on the leading and/or trailing edge of the `wait`
  11303. * timeout. The `func` is invoked with the last arguments provided to the
  11304. * throttled function. Subsequent calls to the throttled function return the
  11305. * result of the last `func` invocation.
  11306. *
  11307. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11308. * invoked on the trailing edge of the timeout only if the throttled function
  11309. * is invoked more than once during the `wait` timeout.
  11310. *
  11311. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11312. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11313. *
  11314. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11315. * for details over the differences between `_.throttle` and `_.debounce`.
  11316. *
  11317. * @static
  11318. * @memberOf _
  11319. * @since 0.1.0
  11320. * @category Function
  11321. * @param {Function} func The function to throttle.
  11322. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11323. * @param {Object} [options={}] The options object.
  11324. * @param {boolean} [options.leading=true]
  11325. * Specify invoking on the leading edge of the timeout.
  11326. * @param {boolean} [options.trailing=true]
  11327. * Specify invoking on the trailing edge of the timeout.
  11328. * @returns {Function} Returns the new throttled function.
  11329. * @example
  11330. *
  11331. * // Avoid excessively updating the position while scrolling.
  11332. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11333. *
  11334. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11335. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11336. * jQuery(element).on('click', throttled);
  11337. *
  11338. * // Cancel the trailing throttled invocation.
  11339. * jQuery(window).on('popstate', throttled.cancel);
  11340. */
  11341. function throttle(func, wait, options) {
  11342. var leading = true,
  11343. trailing = true;
  11344. if (typeof func != 'function') {
  11345. throw new TypeError(FUNC_ERROR_TEXT);
  11346. }
  11347. if (isObject(options)) {
  11348. leading = 'leading' in options ? !!options.leading : leading;
  11349. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11350. }
  11351. return debounce(func, wait, {
  11352. 'leading': leading,
  11353. 'maxWait': wait,
  11354. 'trailing': trailing
  11355. });
  11356. }
  11357. /**
  11358. * Creates a function that accepts up to one argument, ignoring any
  11359. * additional arguments.
  11360. *
  11361. * @static
  11362. * @memberOf _
  11363. * @since 4.0.0
  11364. * @category Function
  11365. * @param {Function} func The function to cap arguments for.
  11366. * @returns {Function} Returns the new capped function.
  11367. * @example
  11368. *
  11369. * _.map(['6', '8', '10'], _.unary(parseInt));
  11370. * // => [6, 8, 10]
  11371. */
  11372. function unary(func) {
  11373. return ary(func, 1);
  11374. }
  11375. /**
  11376. * Creates a function that provides `value` to `wrapper` as its first
  11377. * argument. Any additional arguments provided to the function are appended
  11378. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11379. * binding of the created function.
  11380. *
  11381. * @static
  11382. * @memberOf _
  11383. * @since 0.1.0
  11384. * @category Function
  11385. * @param {*} value The value to wrap.
  11386. * @param {Function} [wrapper=identity] The wrapper function.
  11387. * @returns {Function} Returns the new function.
  11388. * @example
  11389. *
  11390. * var p = _.wrap(_.escape, function(func, text) {
  11391. * return '<p>' + func(text) + '</p>';
  11392. * });
  11393. *
  11394. * p('fred, barney, & pebbles');
  11395. * // => '<p>fred, barney, &amp; pebbles</p>'
  11396. */
  11397. function wrap(value, wrapper) {
  11398. return partial(castFunction(wrapper), value);
  11399. }
  11400. /*------------------------------------------------------------------------*/
  11401. /**
  11402. * Casts `value` as an array if it's not one.
  11403. *
  11404. * @static
  11405. * @memberOf _
  11406. * @since 4.4.0
  11407. * @category Lang
  11408. * @param {*} value The value to inspect.
  11409. * @returns {Array} Returns the cast array.
  11410. * @example
  11411. *
  11412. * _.castArray(1);
  11413. * // => [1]
  11414. *
  11415. * _.castArray({ 'a': 1 });
  11416. * // => [{ 'a': 1 }]
  11417. *
  11418. * _.castArray('abc');
  11419. * // => ['abc']
  11420. *
  11421. * _.castArray(null);
  11422. * // => [null]
  11423. *
  11424. * _.castArray(undefined);
  11425. * // => [undefined]
  11426. *
  11427. * _.castArray();
  11428. * // => []
  11429. *
  11430. * var array = [1, 2, 3];
  11431. * console.log(_.castArray(array) === array);
  11432. * // => true
  11433. */
  11434. function castArray() {
  11435. if (!arguments.length) {
  11436. return [];
  11437. }
  11438. var value = arguments[0];
  11439. return isArray(value) ? value : [value];
  11440. }
  11441. /**
  11442. * Creates a shallow clone of `value`.
  11443. *
  11444. * **Note:** This method is loosely based on the
  11445. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11446. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11447. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11448. * arrays. The own enumerable properties of `arguments` objects are cloned
  11449. * as plain objects. An empty object is returned for uncloneable values such
  11450. * as error objects, functions, DOM nodes, and WeakMaps.
  11451. *
  11452. * @static
  11453. * @memberOf _
  11454. * @since 0.1.0
  11455. * @category Lang
  11456. * @param {*} value The value to clone.
  11457. * @returns {*} Returns the cloned value.
  11458. * @see _.cloneDeep
  11459. * @example
  11460. *
  11461. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11462. *
  11463. * var shallow = _.clone(objects);
  11464. * console.log(shallow[0] === objects[0]);
  11465. * // => true
  11466. */
  11467. function clone(value) {
  11468. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11469. }
  11470. /**
  11471. * This method is like `_.clone` except that it accepts `customizer` which
  11472. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11473. * cloning is handled by the method instead. The `customizer` is invoked with
  11474. * up to four arguments; (value [, index|key, object, stack]).
  11475. *
  11476. * @static
  11477. * @memberOf _
  11478. * @since 4.0.0
  11479. * @category Lang
  11480. * @param {*} value The value to clone.
  11481. * @param {Function} [customizer] The function to customize cloning.
  11482. * @returns {*} Returns the cloned value.
  11483. * @see _.cloneDeepWith
  11484. * @example
  11485. *
  11486. * function customizer(value) {
  11487. * if (_.isElement(value)) {
  11488. * return value.cloneNode(false);
  11489. * }
  11490. * }
  11491. *
  11492. * var el = _.cloneWith(document.body, customizer);
  11493. *
  11494. * console.log(el === document.body);
  11495. * // => false
  11496. * console.log(el.nodeName);
  11497. * // => 'BODY'
  11498. * console.log(el.childNodes.length);
  11499. * // => 0
  11500. */
  11501. function cloneWith(value, customizer) {
  11502. customizer = typeof customizer == 'function' ? customizer : undefined;
  11503. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11504. }
  11505. /**
  11506. * This method is like `_.clone` except that it recursively clones `value`.
  11507. *
  11508. * @static
  11509. * @memberOf _
  11510. * @since 1.0.0
  11511. * @category Lang
  11512. * @param {*} value The value to recursively clone.
  11513. * @returns {*} Returns the deep cloned value.
  11514. * @see _.clone
  11515. * @example
  11516. *
  11517. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11518. *
  11519. * var deep = _.cloneDeep(objects);
  11520. * console.log(deep[0] === objects[0]);
  11521. * // => false
  11522. */
  11523. function cloneDeep(value) {
  11524. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11525. }
  11526. /**
  11527. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11528. *
  11529. * @static
  11530. * @memberOf _
  11531. * @since 4.0.0
  11532. * @category Lang
  11533. * @param {*} value The value to recursively clone.
  11534. * @param {Function} [customizer] The function to customize cloning.
  11535. * @returns {*} Returns the deep cloned value.
  11536. * @see _.cloneWith
  11537. * @example
  11538. *
  11539. * function customizer(value) {
  11540. * if (_.isElement(value)) {
  11541. * return value.cloneNode(true);
  11542. * }
  11543. * }
  11544. *
  11545. * var el = _.cloneDeepWith(document.body, customizer);
  11546. *
  11547. * console.log(el === document.body);
  11548. * // => false
  11549. * console.log(el.nodeName);
  11550. * // => 'BODY'
  11551. * console.log(el.childNodes.length);
  11552. * // => 20
  11553. */
  11554. function cloneDeepWith(value, customizer) {
  11555. customizer = typeof customizer == 'function' ? customizer : undefined;
  11556. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11557. }
  11558. /**
  11559. * Checks if `object` conforms to `source` by invoking the predicate
  11560. * properties of `source` with the corresponding property values of `object`.
  11561. *
  11562. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11563. * partially applied.
  11564. *
  11565. * @static
  11566. * @memberOf _
  11567. * @since 4.14.0
  11568. * @category Lang
  11569. * @param {Object} object The object to inspect.
  11570. * @param {Object} source The object of property predicates to conform to.
  11571. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11572. * @example
  11573. *
  11574. * var object = { 'a': 1, 'b': 2 };
  11575. *
  11576. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11577. * // => true
  11578. *
  11579. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11580. * // => false
  11581. */
  11582. function conformsTo(object, source) {
  11583. return source == null || baseConformsTo(object, source, keys(source));
  11584. }
  11585. /**
  11586. * Performs a
  11587. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11588. * comparison between two values to determine if they are equivalent.
  11589. *
  11590. * @static
  11591. * @memberOf _
  11592. * @since 4.0.0
  11593. * @category Lang
  11594. * @param {*} value The value to compare.
  11595. * @param {*} other The other value to compare.
  11596. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11597. * @example
  11598. *
  11599. * var object = { 'a': 1 };
  11600. * var other = { 'a': 1 };
  11601. *
  11602. * _.eq(object, object);
  11603. * // => true
  11604. *
  11605. * _.eq(object, other);
  11606. * // => false
  11607. *
  11608. * _.eq('a', 'a');
  11609. * // => true
  11610. *
  11611. * _.eq('a', Object('a'));
  11612. * // => false
  11613. *
  11614. * _.eq(NaN, NaN);
  11615. * // => true
  11616. */
  11617. function eq(value, other) {
  11618. return value === other || (value !== value && other !== other);
  11619. }
  11620. /**
  11621. * Checks if `value` is greater than `other`.
  11622. *
  11623. * @static
  11624. * @memberOf _
  11625. * @since 3.9.0
  11626. * @category Lang
  11627. * @param {*} value The value to compare.
  11628. * @param {*} other The other value to compare.
  11629. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11630. * else `false`.
  11631. * @see _.lt
  11632. * @example
  11633. *
  11634. * _.gt(3, 1);
  11635. * // => true
  11636. *
  11637. * _.gt(3, 3);
  11638. * // => false
  11639. *
  11640. * _.gt(1, 3);
  11641. * // => false
  11642. */
  11643. var gt = createRelationalOperation(baseGt);
  11644. /**
  11645. * Checks if `value` is greater than or equal to `other`.
  11646. *
  11647. * @static
  11648. * @memberOf _
  11649. * @since 3.9.0
  11650. * @category Lang
  11651. * @param {*} value The value to compare.
  11652. * @param {*} other The other value to compare.
  11653. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11654. * `other`, else `false`.
  11655. * @see _.lte
  11656. * @example
  11657. *
  11658. * _.gte(3, 1);
  11659. * // => true
  11660. *
  11661. * _.gte(3, 3);
  11662. * // => true
  11663. *
  11664. * _.gte(1, 3);
  11665. * // => false
  11666. */
  11667. var gte = createRelationalOperation(function(value, other) {
  11668. return value >= other;
  11669. });
  11670. /**
  11671. * Checks if `value` is likely an `arguments` object.
  11672. *
  11673. * @static
  11674. * @memberOf _
  11675. * @since 0.1.0
  11676. * @category Lang
  11677. * @param {*} value The value to check.
  11678. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11679. * else `false`.
  11680. * @example
  11681. *
  11682. * _.isArguments(function() { return arguments; }());
  11683. * // => true
  11684. *
  11685. * _.isArguments([1, 2, 3]);
  11686. * // => false
  11687. */
  11688. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11689. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11690. !propertyIsEnumerable.call(value, 'callee');
  11691. };
  11692. /**
  11693. * Checks if `value` is classified as an `Array` object.
  11694. *
  11695. * @static
  11696. * @memberOf _
  11697. * @since 0.1.0
  11698. * @category Lang
  11699. * @param {*} value The value to check.
  11700. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11701. * @example
  11702. *
  11703. * _.isArray([1, 2, 3]);
  11704. * // => true
  11705. *
  11706. * _.isArray(document.body.children);
  11707. * // => false
  11708. *
  11709. * _.isArray('abc');
  11710. * // => false
  11711. *
  11712. * _.isArray(_.noop);
  11713. * // => false
  11714. */
  11715. var isArray = Array.isArray;
  11716. /**
  11717. * Checks if `value` is classified as an `ArrayBuffer` object.
  11718. *
  11719. * @static
  11720. * @memberOf _
  11721. * @since 4.3.0
  11722. * @category Lang
  11723. * @param {*} value The value to check.
  11724. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11725. * @example
  11726. *
  11727. * _.isArrayBuffer(new ArrayBuffer(2));
  11728. * // => true
  11729. *
  11730. * _.isArrayBuffer(new Array(2));
  11731. * // => false
  11732. */
  11733. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11734. /**
  11735. * Checks if `value` is array-like. A value is considered array-like if it's
  11736. * not a function and has a `value.length` that's an integer greater than or
  11737. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11738. *
  11739. * @static
  11740. * @memberOf _
  11741. * @since 4.0.0
  11742. * @category Lang
  11743. * @param {*} value The value to check.
  11744. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11745. * @example
  11746. *
  11747. * _.isArrayLike([1, 2, 3]);
  11748. * // => true
  11749. *
  11750. * _.isArrayLike(document.body.children);
  11751. * // => true
  11752. *
  11753. * _.isArrayLike('abc');
  11754. * // => true
  11755. *
  11756. * _.isArrayLike(_.noop);
  11757. * // => false
  11758. */
  11759. function isArrayLike(value) {
  11760. return value != null && isLength(value.length) && !isFunction(value);
  11761. }
  11762. /**
  11763. * This method is like `_.isArrayLike` except that it also checks if `value`
  11764. * is an object.
  11765. *
  11766. * @static
  11767. * @memberOf _
  11768. * @since 4.0.0
  11769. * @category Lang
  11770. * @param {*} value The value to check.
  11771. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11772. * else `false`.
  11773. * @example
  11774. *
  11775. * _.isArrayLikeObject([1, 2, 3]);
  11776. * // => true
  11777. *
  11778. * _.isArrayLikeObject(document.body.children);
  11779. * // => true
  11780. *
  11781. * _.isArrayLikeObject('abc');
  11782. * // => false
  11783. *
  11784. * _.isArrayLikeObject(_.noop);
  11785. * // => false
  11786. */
  11787. function isArrayLikeObject(value) {
  11788. return isObjectLike(value) && isArrayLike(value);
  11789. }
  11790. /**
  11791. * Checks if `value` is classified as a boolean primitive or object.
  11792. *
  11793. * @static
  11794. * @memberOf _
  11795. * @since 0.1.0
  11796. * @category Lang
  11797. * @param {*} value The value to check.
  11798. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11799. * @example
  11800. *
  11801. * _.isBoolean(false);
  11802. * // => true
  11803. *
  11804. * _.isBoolean(null);
  11805. * // => false
  11806. */
  11807. function isBoolean(value) {
  11808. return value === true || value === false ||
  11809. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11810. }
  11811. /**
  11812. * Checks if `value` is a buffer.
  11813. *
  11814. * @static
  11815. * @memberOf _
  11816. * @since 4.3.0
  11817. * @category Lang
  11818. * @param {*} value The value to check.
  11819. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11820. * @example
  11821. *
  11822. * _.isBuffer(new Buffer(2));
  11823. * // => true
  11824. *
  11825. * _.isBuffer(new Uint8Array(2));
  11826. * // => false
  11827. */
  11828. var isBuffer = nativeIsBuffer || stubFalse;
  11829. /**
  11830. * Checks if `value` is classified as a `Date` object.
  11831. *
  11832. * @static
  11833. * @memberOf _
  11834. * @since 0.1.0
  11835. * @category Lang
  11836. * @param {*} value The value to check.
  11837. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11838. * @example
  11839. *
  11840. * _.isDate(new Date);
  11841. * // => true
  11842. *
  11843. * _.isDate('Mon April 23 2012');
  11844. * // => false
  11845. */
  11846. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11847. /**
  11848. * Checks if `value` is likely a DOM element.
  11849. *
  11850. * @static
  11851. * @memberOf _
  11852. * @since 0.1.0
  11853. * @category Lang
  11854. * @param {*} value The value to check.
  11855. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11856. * @example
  11857. *
  11858. * _.isElement(document.body);
  11859. * // => true
  11860. *
  11861. * _.isElement('<body>');
  11862. * // => false
  11863. */
  11864. function isElement(value) {
  11865. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11866. }
  11867. /**
  11868. * Checks if `value` is an empty object, collection, map, or set.
  11869. *
  11870. * Objects are considered empty if they have no own enumerable string keyed
  11871. * properties.
  11872. *
  11873. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11874. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11875. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11876. *
  11877. * @static
  11878. * @memberOf _
  11879. * @since 0.1.0
  11880. * @category Lang
  11881. * @param {*} value The value to check.
  11882. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11883. * @example
  11884. *
  11885. * _.isEmpty(null);
  11886. * // => true
  11887. *
  11888. * _.isEmpty(true);
  11889. * // => true
  11890. *
  11891. * _.isEmpty(1);
  11892. * // => true
  11893. *
  11894. * _.isEmpty([1, 2, 3]);
  11895. * // => false
  11896. *
  11897. * _.isEmpty({ 'a': 1 });
  11898. * // => false
  11899. */
  11900. function isEmpty(value) {
  11901. if (value == null) {
  11902. return true;
  11903. }
  11904. if (isArrayLike(value) &&
  11905. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11906. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11907. return !value.length;
  11908. }
  11909. var tag = getTag(value);
  11910. if (tag == mapTag || tag == setTag) {
  11911. return !value.size;
  11912. }
  11913. if (isPrototype(value)) {
  11914. return !baseKeys(value).length;
  11915. }
  11916. for (var key in value) {
  11917. if (hasOwnProperty.call(value, key)) {
  11918. return false;
  11919. }
  11920. }
  11921. return true;
  11922. }
  11923. /**
  11924. * Performs a deep comparison between two values to determine if they are
  11925. * equivalent.
  11926. *
  11927. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11928. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11929. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11930. * by their own, not inherited, enumerable properties. Functions and DOM
  11931. * nodes are compared by strict equality, i.e. `===`.
  11932. *
  11933. * @static
  11934. * @memberOf _
  11935. * @since 0.1.0
  11936. * @category Lang
  11937. * @param {*} value The value to compare.
  11938. * @param {*} other The other value to compare.
  11939. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11940. * @example
  11941. *
  11942. * var object = { 'a': 1 };
  11943. * var other = { 'a': 1 };
  11944. *
  11945. * _.isEqual(object, other);
  11946. * // => true
  11947. *
  11948. * object === other;
  11949. * // => false
  11950. */
  11951. function isEqual(value, other) {
  11952. return baseIsEqual(value, other);
  11953. }
  11954. /**
  11955. * This method is like `_.isEqual` except that it accepts `customizer` which
  11956. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11957. * are handled by the method instead. The `customizer` is invoked with up to
  11958. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11959. *
  11960. * @static
  11961. * @memberOf _
  11962. * @since 4.0.0
  11963. * @category Lang
  11964. * @param {*} value The value to compare.
  11965. * @param {*} other The other value to compare.
  11966. * @param {Function} [customizer] The function to customize comparisons.
  11967. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11968. * @example
  11969. *
  11970. * function isGreeting(value) {
  11971. * return /^h(?:i|ello)$/.test(value);
  11972. * }
  11973. *
  11974. * function customizer(objValue, othValue) {
  11975. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11976. * return true;
  11977. * }
  11978. * }
  11979. *
  11980. * var array = ['hello', 'goodbye'];
  11981. * var other = ['hi', 'goodbye'];
  11982. *
  11983. * _.isEqualWith(array, other, customizer);
  11984. * // => true
  11985. */
  11986. function isEqualWith(value, other, customizer) {
  11987. customizer = typeof customizer == 'function' ? customizer : undefined;
  11988. var result = customizer ? customizer(value, other) : undefined;
  11989. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11990. }
  11991. /**
  11992. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11993. * `SyntaxError`, `TypeError`, or `URIError` object.
  11994. *
  11995. * @static
  11996. * @memberOf _
  11997. * @since 3.0.0
  11998. * @category Lang
  11999. * @param {*} value The value to check.
  12000. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12001. * @example
  12002. *
  12003. * _.isError(new Error);
  12004. * // => true
  12005. *
  12006. * _.isError(Error);
  12007. * // => false
  12008. */
  12009. function isError(value) {
  12010. if (!isObjectLike(value)) {
  12011. return false;
  12012. }
  12013. var tag = baseGetTag(value);
  12014. return tag == errorTag || tag == domExcTag ||
  12015. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12016. }
  12017. /**
  12018. * Checks if `value` is a finite primitive number.
  12019. *
  12020. * **Note:** This method is based on
  12021. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12022. *
  12023. * @static
  12024. * @memberOf _
  12025. * @since 0.1.0
  12026. * @category Lang
  12027. * @param {*} value The value to check.
  12028. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12029. * @example
  12030. *
  12031. * _.isFinite(3);
  12032. * // => true
  12033. *
  12034. * _.isFinite(Number.MIN_VALUE);
  12035. * // => true
  12036. *
  12037. * _.isFinite(Infinity);
  12038. * // => false
  12039. *
  12040. * _.isFinite('3');
  12041. * // => false
  12042. */
  12043. function isFinite(value) {
  12044. return typeof value == 'number' && nativeIsFinite(value);
  12045. }
  12046. /**
  12047. * Checks if `value` is classified as a `Function` object.
  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 function, else `false`.
  12055. * @example
  12056. *
  12057. * _.isFunction(_);
  12058. * // => true
  12059. *
  12060. * _.isFunction(/abc/);
  12061. * // => false
  12062. */
  12063. function isFunction(value) {
  12064. if (!isObject(value)) {
  12065. return false;
  12066. }
  12067. // The use of `Object#toString` avoids issues with the `typeof` operator
  12068. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12069. var tag = baseGetTag(value);
  12070. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12071. }
  12072. /**
  12073. * Checks if `value` is an integer.
  12074. *
  12075. * **Note:** This method is based on
  12076. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12077. *
  12078. * @static
  12079. * @memberOf _
  12080. * @since 4.0.0
  12081. * @category Lang
  12082. * @param {*} value The value to check.
  12083. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12084. * @example
  12085. *
  12086. * _.isInteger(3);
  12087. * // => true
  12088. *
  12089. * _.isInteger(Number.MIN_VALUE);
  12090. * // => false
  12091. *
  12092. * _.isInteger(Infinity);
  12093. * // => false
  12094. *
  12095. * _.isInteger('3');
  12096. * // => false
  12097. */
  12098. function isInteger(value) {
  12099. return typeof value == 'number' && value == toInteger(value);
  12100. }
  12101. /**
  12102. * Checks if `value` is a valid array-like length.
  12103. *
  12104. * **Note:** This method is loosely based on
  12105. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12106. *
  12107. * @static
  12108. * @memberOf _
  12109. * @since 4.0.0
  12110. * @category Lang
  12111. * @param {*} value The value to check.
  12112. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12113. * @example
  12114. *
  12115. * _.isLength(3);
  12116. * // => true
  12117. *
  12118. * _.isLength(Number.MIN_VALUE);
  12119. * // => false
  12120. *
  12121. * _.isLength(Infinity);
  12122. * // => false
  12123. *
  12124. * _.isLength('3');
  12125. * // => false
  12126. */
  12127. function isLength(value) {
  12128. return typeof value == 'number' &&
  12129. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12130. }
  12131. /**
  12132. * Checks if `value` is the
  12133. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12134. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12135. *
  12136. * @static
  12137. * @memberOf _
  12138. * @since 0.1.0
  12139. * @category Lang
  12140. * @param {*} value The value to check.
  12141. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12142. * @example
  12143. *
  12144. * _.isObject({});
  12145. * // => true
  12146. *
  12147. * _.isObject([1, 2, 3]);
  12148. * // => true
  12149. *
  12150. * _.isObject(_.noop);
  12151. * // => true
  12152. *
  12153. * _.isObject(null);
  12154. * // => false
  12155. */
  12156. function isObject(value) {
  12157. var type = typeof value;
  12158. return value != null && (type == 'object' || type == 'function');
  12159. }
  12160. /**
  12161. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12162. * and has a `typeof` result of "object".
  12163. *
  12164. * @static
  12165. * @memberOf _
  12166. * @since 4.0.0
  12167. * @category Lang
  12168. * @param {*} value The value to check.
  12169. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12170. * @example
  12171. *
  12172. * _.isObjectLike({});
  12173. * // => true
  12174. *
  12175. * _.isObjectLike([1, 2, 3]);
  12176. * // => true
  12177. *
  12178. * _.isObjectLike(_.noop);
  12179. * // => false
  12180. *
  12181. * _.isObjectLike(null);
  12182. * // => false
  12183. */
  12184. function isObjectLike(value) {
  12185. return value != null && typeof value == 'object';
  12186. }
  12187. /**
  12188. * Checks if `value` is classified as a `Map` object.
  12189. *
  12190. * @static
  12191. * @memberOf _
  12192. * @since 4.3.0
  12193. * @category Lang
  12194. * @param {*} value The value to check.
  12195. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12196. * @example
  12197. *
  12198. * _.isMap(new Map);
  12199. * // => true
  12200. *
  12201. * _.isMap(new WeakMap);
  12202. * // => false
  12203. */
  12204. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12205. /**
  12206. * Performs a partial deep comparison between `object` and `source` to
  12207. * determine if `object` contains equivalent property values.
  12208. *
  12209. * **Note:** This method is equivalent to `_.matches` when `source` is
  12210. * partially applied.
  12211. *
  12212. * Partial comparisons will match empty array and empty object `source`
  12213. * values against any array or object value, respectively. See `_.isEqual`
  12214. * for a list of supported value comparisons.
  12215. *
  12216. * @static
  12217. * @memberOf _
  12218. * @since 3.0.0
  12219. * @category Lang
  12220. * @param {Object} object The object to inspect.
  12221. * @param {Object} source The object of property values to match.
  12222. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12223. * @example
  12224. *
  12225. * var object = { 'a': 1, 'b': 2 };
  12226. *
  12227. * _.isMatch(object, { 'b': 2 });
  12228. * // => true
  12229. *
  12230. * _.isMatch(object, { 'b': 1 });
  12231. * // => false
  12232. */
  12233. function isMatch(object, source) {
  12234. return object === source || baseIsMatch(object, source, getMatchData(source));
  12235. }
  12236. /**
  12237. * This method is like `_.isMatch` except that it accepts `customizer` which
  12238. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12239. * are handled by the method instead. The `customizer` is invoked with five
  12240. * arguments: (objValue, srcValue, index|key, object, source).
  12241. *
  12242. * @static
  12243. * @memberOf _
  12244. * @since 4.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. * @param {Function} [customizer] The function to customize comparisons.
  12249. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12250. * @example
  12251. *
  12252. * function isGreeting(value) {
  12253. * return /^h(?:i|ello)$/.test(value);
  12254. * }
  12255. *
  12256. * function customizer(objValue, srcValue) {
  12257. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12258. * return true;
  12259. * }
  12260. * }
  12261. *
  12262. * var object = { 'greeting': 'hello' };
  12263. * var source = { 'greeting': 'hi' };
  12264. *
  12265. * _.isMatchWith(object, source, customizer);
  12266. * // => true
  12267. */
  12268. function isMatchWith(object, source, customizer) {
  12269. customizer = typeof customizer == 'function' ? customizer : undefined;
  12270. return baseIsMatch(object, source, getMatchData(source), customizer);
  12271. }
  12272. /**
  12273. * Checks if `value` is `NaN`.
  12274. *
  12275. * **Note:** This method is based on
  12276. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12277. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12278. * `undefined` and other non-number values.
  12279. *
  12280. * @static
  12281. * @memberOf _
  12282. * @since 0.1.0
  12283. * @category Lang
  12284. * @param {*} value The value to check.
  12285. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12286. * @example
  12287. *
  12288. * _.isNaN(NaN);
  12289. * // => true
  12290. *
  12291. * _.isNaN(new Number(NaN));
  12292. * // => true
  12293. *
  12294. * isNaN(undefined);
  12295. * // => true
  12296. *
  12297. * _.isNaN(undefined);
  12298. * // => false
  12299. */
  12300. function isNaN(value) {
  12301. // An `NaN` primitive is the only value that is not equal to itself.
  12302. // Perform the `toStringTag` check first to avoid errors with some
  12303. // ActiveX objects in IE.
  12304. return isNumber(value) && value != +value;
  12305. }
  12306. /**
  12307. * Checks if `value` is a pristine native function.
  12308. *
  12309. * **Note:** This method can't reliably detect native functions in the presence
  12310. * of the core-js package because core-js circumvents this kind of detection.
  12311. * Despite multiple requests, the core-js maintainer has made it clear: any
  12312. * attempt to fix the detection will be obstructed. As a result, we're left
  12313. * with little choice but to throw an error. Unfortunately, this also affects
  12314. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12315. * which rely on core-js.
  12316. *
  12317. * @static
  12318. * @memberOf _
  12319. * @since 3.0.0
  12320. * @category Lang
  12321. * @param {*} value The value to check.
  12322. * @returns {boolean} Returns `true` if `value` is a native function,
  12323. * else `false`.
  12324. * @example
  12325. *
  12326. * _.isNative(Array.prototype.push);
  12327. * // => true
  12328. *
  12329. * _.isNative(_);
  12330. * // => false
  12331. */
  12332. function isNative(value) {
  12333. if (isMaskable(value)) {
  12334. throw new Error(CORE_ERROR_TEXT);
  12335. }
  12336. return baseIsNative(value);
  12337. }
  12338. /**
  12339. * Checks if `value` is `null`.
  12340. *
  12341. * @static
  12342. * @memberOf _
  12343. * @since 0.1.0
  12344. * @category Lang
  12345. * @param {*} value The value to check.
  12346. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12347. * @example
  12348. *
  12349. * _.isNull(null);
  12350. * // => true
  12351. *
  12352. * _.isNull(void 0);
  12353. * // => false
  12354. */
  12355. function isNull(value) {
  12356. return value === null;
  12357. }
  12358. /**
  12359. * Checks if `value` is `null` or `undefined`.
  12360. *
  12361. * @static
  12362. * @memberOf _
  12363. * @since 4.0.0
  12364. * @category Lang
  12365. * @param {*} value The value to check.
  12366. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12367. * @example
  12368. *
  12369. * _.isNil(null);
  12370. * // => true
  12371. *
  12372. * _.isNil(void 0);
  12373. * // => true
  12374. *
  12375. * _.isNil(NaN);
  12376. * // => false
  12377. */
  12378. function isNil(value) {
  12379. return value == null;
  12380. }
  12381. /**
  12382. * Checks if `value` is classified as a `Number` primitive or object.
  12383. *
  12384. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12385. * classified as numbers, use the `_.isFinite` method.
  12386. *
  12387. * @static
  12388. * @memberOf _
  12389. * @since 0.1.0
  12390. * @category Lang
  12391. * @param {*} value The value to check.
  12392. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12393. * @example
  12394. *
  12395. * _.isNumber(3);
  12396. * // => true
  12397. *
  12398. * _.isNumber(Number.MIN_VALUE);
  12399. * // => true
  12400. *
  12401. * _.isNumber(Infinity);
  12402. * // => true
  12403. *
  12404. * _.isNumber('3');
  12405. * // => false
  12406. */
  12407. function isNumber(value) {
  12408. return typeof value == 'number' ||
  12409. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12410. }
  12411. /**
  12412. * Checks if `value` is a plain object, that is, an object created by the
  12413. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12414. *
  12415. * @static
  12416. * @memberOf _
  12417. * @since 0.8.0
  12418. * @category Lang
  12419. * @param {*} value The value to check.
  12420. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12421. * @example
  12422. *
  12423. * function Foo() {
  12424. * this.a = 1;
  12425. * }
  12426. *
  12427. * _.isPlainObject(new Foo);
  12428. * // => false
  12429. *
  12430. * _.isPlainObject([1, 2, 3]);
  12431. * // => false
  12432. *
  12433. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12434. * // => true
  12435. *
  12436. * _.isPlainObject(Object.create(null));
  12437. * // => true
  12438. */
  12439. function isPlainObject(value) {
  12440. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12441. return false;
  12442. }
  12443. var proto = getPrototype(value);
  12444. if (proto === null) {
  12445. return true;
  12446. }
  12447. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12448. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12449. funcToString.call(Ctor) == objectCtorString;
  12450. }
  12451. /**
  12452. * Checks if `value` is classified as a `RegExp` object.
  12453. *
  12454. * @static
  12455. * @memberOf _
  12456. * @since 0.1.0
  12457. * @category Lang
  12458. * @param {*} value The value to check.
  12459. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12460. * @example
  12461. *
  12462. * _.isRegExp(/abc/);
  12463. * // => true
  12464. *
  12465. * _.isRegExp('/abc/');
  12466. * // => false
  12467. */
  12468. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12469. /**
  12470. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12471. * double precision number which isn't the result of a rounded unsafe integer.
  12472. *
  12473. * **Note:** This method is based on
  12474. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12475. *
  12476. * @static
  12477. * @memberOf _
  12478. * @since 4.0.0
  12479. * @category Lang
  12480. * @param {*} value The value to check.
  12481. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12482. * @example
  12483. *
  12484. * _.isSafeInteger(3);
  12485. * // => true
  12486. *
  12487. * _.isSafeInteger(Number.MIN_VALUE);
  12488. * // => false
  12489. *
  12490. * _.isSafeInteger(Infinity);
  12491. * // => false
  12492. *
  12493. * _.isSafeInteger('3');
  12494. * // => false
  12495. */
  12496. function isSafeInteger(value) {
  12497. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12498. }
  12499. /**
  12500. * Checks if `value` is classified as a `Set` object.
  12501. *
  12502. * @static
  12503. * @memberOf _
  12504. * @since 4.3.0
  12505. * @category Lang
  12506. * @param {*} value The value to check.
  12507. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12508. * @example
  12509. *
  12510. * _.isSet(new Set);
  12511. * // => true
  12512. *
  12513. * _.isSet(new WeakSet);
  12514. * // => false
  12515. */
  12516. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12517. /**
  12518. * Checks if `value` is classified as a `String` primitive or object.
  12519. *
  12520. * @static
  12521. * @since 0.1.0
  12522. * @memberOf _
  12523. * @category Lang
  12524. * @param {*} value The value to check.
  12525. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12526. * @example
  12527. *
  12528. * _.isString('abc');
  12529. * // => true
  12530. *
  12531. * _.isString(1);
  12532. * // => false
  12533. */
  12534. function isString(value) {
  12535. return typeof value == 'string' ||
  12536. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12537. }
  12538. /**
  12539. * Checks if `value` is classified as a `Symbol` primitive or object.
  12540. *
  12541. * @static
  12542. * @memberOf _
  12543. * @since 4.0.0
  12544. * @category Lang
  12545. * @param {*} value The value to check.
  12546. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12547. * @example
  12548. *
  12549. * _.isSymbol(Symbol.iterator);
  12550. * // => true
  12551. *
  12552. * _.isSymbol('abc');
  12553. * // => false
  12554. */
  12555. function isSymbol(value) {
  12556. return typeof value == 'symbol' ||
  12557. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12558. }
  12559. /**
  12560. * Checks if `value` is classified as a typed array.
  12561. *
  12562. * @static
  12563. * @memberOf _
  12564. * @since 3.0.0
  12565. * @category Lang
  12566. * @param {*} value The value to check.
  12567. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12568. * @example
  12569. *
  12570. * _.isTypedArray(new Uint8Array);
  12571. * // => true
  12572. *
  12573. * _.isTypedArray([]);
  12574. * // => false
  12575. */
  12576. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12577. /**
  12578. * Checks if `value` is `undefined`.
  12579. *
  12580. * @static
  12581. * @since 0.1.0
  12582. * @memberOf _
  12583. * @category Lang
  12584. * @param {*} value The value to check.
  12585. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12586. * @example
  12587. *
  12588. * _.isUndefined(void 0);
  12589. * // => true
  12590. *
  12591. * _.isUndefined(null);
  12592. * // => false
  12593. */
  12594. function isUndefined(value) {
  12595. return value === undefined;
  12596. }
  12597. /**
  12598. * Checks if `value` is classified as a `WeakMap` object.
  12599. *
  12600. * @static
  12601. * @memberOf _
  12602. * @since 4.3.0
  12603. * @category Lang
  12604. * @param {*} value The value to check.
  12605. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12606. * @example
  12607. *
  12608. * _.isWeakMap(new WeakMap);
  12609. * // => true
  12610. *
  12611. * _.isWeakMap(new Map);
  12612. * // => false
  12613. */
  12614. function isWeakMap(value) {
  12615. return isObjectLike(value) && getTag(value) == weakMapTag;
  12616. }
  12617. /**
  12618. * Checks if `value` is classified as a `WeakSet` object.
  12619. *
  12620. * @static
  12621. * @memberOf _
  12622. * @since 4.3.0
  12623. * @category Lang
  12624. * @param {*} value The value to check.
  12625. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12626. * @example
  12627. *
  12628. * _.isWeakSet(new WeakSet);
  12629. * // => true
  12630. *
  12631. * _.isWeakSet(new Set);
  12632. * // => false
  12633. */
  12634. function isWeakSet(value) {
  12635. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12636. }
  12637. /**
  12638. * Checks if `value` is less than `other`.
  12639. *
  12640. * @static
  12641. * @memberOf _
  12642. * @since 3.9.0
  12643. * @category Lang
  12644. * @param {*} value The value to compare.
  12645. * @param {*} other The other value to compare.
  12646. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12647. * else `false`.
  12648. * @see _.gt
  12649. * @example
  12650. *
  12651. * _.lt(1, 3);
  12652. * // => true
  12653. *
  12654. * _.lt(3, 3);
  12655. * // => false
  12656. *
  12657. * _.lt(3, 1);
  12658. * // => false
  12659. */
  12660. var lt = createRelationalOperation(baseLt);
  12661. /**
  12662. * Checks if `value` is less than or equal to `other`.
  12663. *
  12664. * @static
  12665. * @memberOf _
  12666. * @since 3.9.0
  12667. * @category Lang
  12668. * @param {*} value The value to compare.
  12669. * @param {*} other The other value to compare.
  12670. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12671. * `other`, else `false`.
  12672. * @see _.gte
  12673. * @example
  12674. *
  12675. * _.lte(1, 3);
  12676. * // => true
  12677. *
  12678. * _.lte(3, 3);
  12679. * // => true
  12680. *
  12681. * _.lte(3, 1);
  12682. * // => false
  12683. */
  12684. var lte = createRelationalOperation(function(value, other) {
  12685. return value <= other;
  12686. });
  12687. /**
  12688. * Converts `value` to an array.
  12689. *
  12690. * @static
  12691. * @since 0.1.0
  12692. * @memberOf _
  12693. * @category Lang
  12694. * @param {*} value The value to convert.
  12695. * @returns {Array} Returns the converted array.
  12696. * @example
  12697. *
  12698. * _.toArray({ 'a': 1, 'b': 2 });
  12699. * // => [1, 2]
  12700. *
  12701. * _.toArray('abc');
  12702. * // => ['a', 'b', 'c']
  12703. *
  12704. * _.toArray(1);
  12705. * // => []
  12706. *
  12707. * _.toArray(null);
  12708. * // => []
  12709. */
  12710. function toArray(value) {
  12711. if (!value) {
  12712. return [];
  12713. }
  12714. if (isArrayLike(value)) {
  12715. return isString(value) ? stringToArray(value) : copyArray(value);
  12716. }
  12717. if (symIterator && value[symIterator]) {
  12718. return iteratorToArray(value[symIterator]());
  12719. }
  12720. var tag = getTag(value),
  12721. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12722. return func(value);
  12723. }
  12724. /**
  12725. * Converts `value` to a finite number.
  12726. *
  12727. * @static
  12728. * @memberOf _
  12729. * @since 4.12.0
  12730. * @category Lang
  12731. * @param {*} value The value to convert.
  12732. * @returns {number} Returns the converted number.
  12733. * @example
  12734. *
  12735. * _.toFinite(3.2);
  12736. * // => 3.2
  12737. *
  12738. * _.toFinite(Number.MIN_VALUE);
  12739. * // => 5e-324
  12740. *
  12741. * _.toFinite(Infinity);
  12742. * // => 1.7976931348623157e+308
  12743. *
  12744. * _.toFinite('3.2');
  12745. * // => 3.2
  12746. */
  12747. function toFinite(value) {
  12748. if (!value) {
  12749. return value === 0 ? value : 0;
  12750. }
  12751. value = toNumber(value);
  12752. if (value === INFINITY || value === -INFINITY) {
  12753. var sign = (value < 0 ? -1 : 1);
  12754. return sign * MAX_INTEGER;
  12755. }
  12756. return value === value ? value : 0;
  12757. }
  12758. /**
  12759. * Converts `value` to an integer.
  12760. *
  12761. * **Note:** This method is loosely based on
  12762. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12763. *
  12764. * @static
  12765. * @memberOf _
  12766. * @since 4.0.0
  12767. * @category Lang
  12768. * @param {*} value The value to convert.
  12769. * @returns {number} Returns the converted integer.
  12770. * @example
  12771. *
  12772. * _.toInteger(3.2);
  12773. * // => 3
  12774. *
  12775. * _.toInteger(Number.MIN_VALUE);
  12776. * // => 0
  12777. *
  12778. * _.toInteger(Infinity);
  12779. * // => 1.7976931348623157e+308
  12780. *
  12781. * _.toInteger('3.2');
  12782. * // => 3
  12783. */
  12784. function toInteger(value) {
  12785. var result = toFinite(value),
  12786. remainder = result % 1;
  12787. return result === result ? (remainder ? result - remainder : result) : 0;
  12788. }
  12789. /**
  12790. * Converts `value` to an integer suitable for use as the length of an
  12791. * array-like object.
  12792. *
  12793. * **Note:** This method is based on
  12794. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12795. *
  12796. * @static
  12797. * @memberOf _
  12798. * @since 4.0.0
  12799. * @category Lang
  12800. * @param {*} value The value to convert.
  12801. * @returns {number} Returns the converted integer.
  12802. * @example
  12803. *
  12804. * _.toLength(3.2);
  12805. * // => 3
  12806. *
  12807. * _.toLength(Number.MIN_VALUE);
  12808. * // => 0
  12809. *
  12810. * _.toLength(Infinity);
  12811. * // => 4294967295
  12812. *
  12813. * _.toLength('3.2');
  12814. * // => 3
  12815. */
  12816. function toLength(value) {
  12817. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12818. }
  12819. /**
  12820. * Converts `value` to a number.
  12821. *
  12822. * @static
  12823. * @memberOf _
  12824. * @since 4.0.0
  12825. * @category Lang
  12826. * @param {*} value The value to process.
  12827. * @returns {number} Returns the number.
  12828. * @example
  12829. *
  12830. * _.toNumber(3.2);
  12831. * // => 3.2
  12832. *
  12833. * _.toNumber(Number.MIN_VALUE);
  12834. * // => 5e-324
  12835. *
  12836. * _.toNumber(Infinity);
  12837. * // => Infinity
  12838. *
  12839. * _.toNumber('3.2');
  12840. * // => 3.2
  12841. */
  12842. function toNumber(value) {
  12843. if (typeof value == 'number') {
  12844. return value;
  12845. }
  12846. if (isSymbol(value)) {
  12847. return NAN;
  12848. }
  12849. if (isObject(value)) {
  12850. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12851. value = isObject(other) ? (other + '') : other;
  12852. }
  12853. if (typeof value != 'string') {
  12854. return value === 0 ? value : +value;
  12855. }
  12856. value = baseTrim(value);
  12857. var isBinary = reIsBinary.test(value);
  12858. return (isBinary || reIsOctal.test(value))
  12859. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12860. : (reIsBadHex.test(value) ? NAN : +value);
  12861. }
  12862. /**
  12863. * Converts `value` to a plain object flattening inherited enumerable string
  12864. * keyed properties of `value` to own properties of the plain object.
  12865. *
  12866. * @static
  12867. * @memberOf _
  12868. * @since 3.0.0
  12869. * @category Lang
  12870. * @param {*} value The value to convert.
  12871. * @returns {Object} Returns the converted plain object.
  12872. * @example
  12873. *
  12874. * function Foo() {
  12875. * this.b = 2;
  12876. * }
  12877. *
  12878. * Foo.prototype.c = 3;
  12879. *
  12880. * _.assign({ 'a': 1 }, new Foo);
  12881. * // => { 'a': 1, 'b': 2 }
  12882. *
  12883. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12884. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12885. */
  12886. function toPlainObject(value) {
  12887. return copyObject(value, keysIn(value));
  12888. }
  12889. /**
  12890. * Converts `value` to a safe integer. A safe integer can be compared and
  12891. * represented correctly.
  12892. *
  12893. * @static
  12894. * @memberOf _
  12895. * @since 4.0.0
  12896. * @category Lang
  12897. * @param {*} value The value to convert.
  12898. * @returns {number} Returns the converted integer.
  12899. * @example
  12900. *
  12901. * _.toSafeInteger(3.2);
  12902. * // => 3
  12903. *
  12904. * _.toSafeInteger(Number.MIN_VALUE);
  12905. * // => 0
  12906. *
  12907. * _.toSafeInteger(Infinity);
  12908. * // => 9007199254740991
  12909. *
  12910. * _.toSafeInteger('3.2');
  12911. * // => 3
  12912. */
  12913. function toSafeInteger(value) {
  12914. return value
  12915. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12916. : (value === 0 ? value : 0);
  12917. }
  12918. /**
  12919. * Converts `value` to a string. An empty string is returned for `null`
  12920. * and `undefined` values. The sign of `-0` is preserved.
  12921. *
  12922. * @static
  12923. * @memberOf _
  12924. * @since 4.0.0
  12925. * @category Lang
  12926. * @param {*} value The value to convert.
  12927. * @returns {string} Returns the converted string.
  12928. * @example
  12929. *
  12930. * _.toString(null);
  12931. * // => ''
  12932. *
  12933. * _.toString(-0);
  12934. * // => '-0'
  12935. *
  12936. * _.toString([1, 2, 3]);
  12937. * // => '1,2,3'
  12938. */
  12939. function toString(value) {
  12940. return value == null ? '' : baseToString(value);
  12941. }
  12942. /*------------------------------------------------------------------------*/
  12943. /**
  12944. * Assigns own enumerable string keyed properties of source objects to the
  12945. * destination object. Source objects are applied from left to right.
  12946. * Subsequent sources overwrite property assignments of previous sources.
  12947. *
  12948. * **Note:** This method mutates `object` and is loosely based on
  12949. * [`Object.assign`](https://mdn.io/Object/assign).
  12950. *
  12951. * @static
  12952. * @memberOf _
  12953. * @since 0.10.0
  12954. * @category Object
  12955. * @param {Object} object The destination object.
  12956. * @param {...Object} [sources] The source objects.
  12957. * @returns {Object} Returns `object`.
  12958. * @see _.assignIn
  12959. * @example
  12960. *
  12961. * function Foo() {
  12962. * this.a = 1;
  12963. * }
  12964. *
  12965. * function Bar() {
  12966. * this.c = 3;
  12967. * }
  12968. *
  12969. * Foo.prototype.b = 2;
  12970. * Bar.prototype.d = 4;
  12971. *
  12972. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12973. * // => { 'a': 1, 'c': 3 }
  12974. */
  12975. var assign = createAssigner(function(object, source) {
  12976. if (isPrototype(source) || isArrayLike(source)) {
  12977. copyObject(source, keys(source), object);
  12978. return;
  12979. }
  12980. for (var key in source) {
  12981. if (hasOwnProperty.call(source, key)) {
  12982. assignValue(object, key, source[key]);
  12983. }
  12984. }
  12985. });
  12986. /**
  12987. * This method is like `_.assign` except that it iterates over own and
  12988. * inherited source properties.
  12989. *
  12990. * **Note:** This method mutates `object`.
  12991. *
  12992. * @static
  12993. * @memberOf _
  12994. * @since 4.0.0
  12995. * @alias extend
  12996. * @category Object
  12997. * @param {Object} object The destination object.
  12998. * @param {...Object} [sources] The source objects.
  12999. * @returns {Object} Returns `object`.
  13000. * @see _.assign
  13001. * @example
  13002. *
  13003. * function Foo() {
  13004. * this.a = 1;
  13005. * }
  13006. *
  13007. * function Bar() {
  13008. * this.c = 3;
  13009. * }
  13010. *
  13011. * Foo.prototype.b = 2;
  13012. * Bar.prototype.d = 4;
  13013. *
  13014. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13015. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13016. */
  13017. var assignIn = createAssigner(function(object, source) {
  13018. copyObject(source, keysIn(source), object);
  13019. });
  13020. /**
  13021. * This method is like `_.assignIn` except that it accepts `customizer`
  13022. * which is invoked to produce the assigned values. If `customizer` returns
  13023. * `undefined`, assignment is handled by the method instead. The `customizer`
  13024. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13025. *
  13026. * **Note:** This method mutates `object`.
  13027. *
  13028. * @static
  13029. * @memberOf _
  13030. * @since 4.0.0
  13031. * @alias extendWith
  13032. * @category Object
  13033. * @param {Object} object The destination object.
  13034. * @param {...Object} sources The source objects.
  13035. * @param {Function} [customizer] The function to customize assigned values.
  13036. * @returns {Object} Returns `object`.
  13037. * @see _.assignWith
  13038. * @example
  13039. *
  13040. * function customizer(objValue, srcValue) {
  13041. * return _.isUndefined(objValue) ? srcValue : objValue;
  13042. * }
  13043. *
  13044. * var defaults = _.partialRight(_.assignInWith, customizer);
  13045. *
  13046. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13047. * // => { 'a': 1, 'b': 2 }
  13048. */
  13049. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13050. copyObject(source, keysIn(source), object, customizer);
  13051. });
  13052. /**
  13053. * This method is like `_.assign` except that it accepts `customizer`
  13054. * which is invoked to produce the assigned values. If `customizer` returns
  13055. * `undefined`, assignment is handled by the method instead. The `customizer`
  13056. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13057. *
  13058. * **Note:** This method mutates `object`.
  13059. *
  13060. * @static
  13061. * @memberOf _
  13062. * @since 4.0.0
  13063. * @category Object
  13064. * @param {Object} object The destination object.
  13065. * @param {...Object} sources The source objects.
  13066. * @param {Function} [customizer] The function to customize assigned values.
  13067. * @returns {Object} Returns `object`.
  13068. * @see _.assignInWith
  13069. * @example
  13070. *
  13071. * function customizer(objValue, srcValue) {
  13072. * return _.isUndefined(objValue) ? srcValue : objValue;
  13073. * }
  13074. *
  13075. * var defaults = _.partialRight(_.assignWith, customizer);
  13076. *
  13077. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13078. * // => { 'a': 1, 'b': 2 }
  13079. */
  13080. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13081. copyObject(source, keys(source), object, customizer);
  13082. });
  13083. /**
  13084. * Creates an array of values corresponding to `paths` of `object`.
  13085. *
  13086. * @static
  13087. * @memberOf _
  13088. * @since 1.0.0
  13089. * @category Object
  13090. * @param {Object} object The object to iterate over.
  13091. * @param {...(string|string[])} [paths] The property paths to pick.
  13092. * @returns {Array} Returns the picked values.
  13093. * @example
  13094. *
  13095. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13096. *
  13097. * _.at(object, ['a[0].b.c', 'a[1]']);
  13098. * // => [3, 4]
  13099. */
  13100. var at = flatRest(baseAt);
  13101. /**
  13102. * Creates an object that inherits from the `prototype` object. If a
  13103. * `properties` object is given, its own enumerable string keyed properties
  13104. * are assigned to the created object.
  13105. *
  13106. * @static
  13107. * @memberOf _
  13108. * @since 2.3.0
  13109. * @category Object
  13110. * @param {Object} prototype The object to inherit from.
  13111. * @param {Object} [properties] The properties to assign to the object.
  13112. * @returns {Object} Returns the new object.
  13113. * @example
  13114. *
  13115. * function Shape() {
  13116. * this.x = 0;
  13117. * this.y = 0;
  13118. * }
  13119. *
  13120. * function Circle() {
  13121. * Shape.call(this);
  13122. * }
  13123. *
  13124. * Circle.prototype = _.create(Shape.prototype, {
  13125. * 'constructor': Circle
  13126. * });
  13127. *
  13128. * var circle = new Circle;
  13129. * circle instanceof Circle;
  13130. * // => true
  13131. *
  13132. * circle instanceof Shape;
  13133. * // => true
  13134. */
  13135. function create(prototype, properties) {
  13136. var result = baseCreate(prototype);
  13137. return properties == null ? result : baseAssign(result, properties);
  13138. }
  13139. /**
  13140. * Assigns own and inherited enumerable string keyed properties of source
  13141. * objects to the destination object for all destination properties that
  13142. * resolve to `undefined`. Source objects are applied from left to right.
  13143. * Once a property is set, additional values of the same property are ignored.
  13144. *
  13145. * **Note:** This method mutates `object`.
  13146. *
  13147. * @static
  13148. * @since 0.1.0
  13149. * @memberOf _
  13150. * @category Object
  13151. * @param {Object} object The destination object.
  13152. * @param {...Object} [sources] The source objects.
  13153. * @returns {Object} Returns `object`.
  13154. * @see _.defaultsDeep
  13155. * @example
  13156. *
  13157. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13158. * // => { 'a': 1, 'b': 2 }
  13159. */
  13160. var defaults = baseRest(function(object, sources) {
  13161. object = Object(object);
  13162. var index = -1;
  13163. var length = sources.length;
  13164. var guard = length > 2 ? sources[2] : undefined;
  13165. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13166. length = 1;
  13167. }
  13168. while (++index < length) {
  13169. var source = sources[index];
  13170. var props = keysIn(source);
  13171. var propsIndex = -1;
  13172. var propsLength = props.length;
  13173. while (++propsIndex < propsLength) {
  13174. var key = props[propsIndex];
  13175. var value = object[key];
  13176. if (value === undefined ||
  13177. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13178. object[key] = source[key];
  13179. }
  13180. }
  13181. }
  13182. return object;
  13183. });
  13184. /**
  13185. * This method is like `_.defaults` except that it recursively assigns
  13186. * default properties.
  13187. *
  13188. * **Note:** This method mutates `object`.
  13189. *
  13190. * @static
  13191. * @memberOf _
  13192. * @since 3.10.0
  13193. * @category Object
  13194. * @param {Object} object The destination object.
  13195. * @param {...Object} [sources] The source objects.
  13196. * @returns {Object} Returns `object`.
  13197. * @see _.defaults
  13198. * @example
  13199. *
  13200. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13201. * // => { 'a': { 'b': 2, 'c': 3 } }
  13202. */
  13203. var defaultsDeep = baseRest(function(args) {
  13204. args.push(undefined, customDefaultsMerge);
  13205. return apply(mergeWith, undefined, args);
  13206. });
  13207. /**
  13208. * This method is like `_.find` except that it returns the key of the first
  13209. * element `predicate` returns truthy for instead of the element itself.
  13210. *
  13211. * @static
  13212. * @memberOf _
  13213. * @since 1.1.0
  13214. * @category Object
  13215. * @param {Object} object The object to inspect.
  13216. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13217. * @returns {string|undefined} Returns the key of the matched element,
  13218. * else `undefined`.
  13219. * @example
  13220. *
  13221. * var users = {
  13222. * 'barney': { 'age': 36, 'active': true },
  13223. * 'fred': { 'age': 40, 'active': false },
  13224. * 'pebbles': { 'age': 1, 'active': true }
  13225. * };
  13226. *
  13227. * _.findKey(users, function(o) { return o.age < 40; });
  13228. * // => 'barney' (iteration order is not guaranteed)
  13229. *
  13230. * // The `_.matches` iteratee shorthand.
  13231. * _.findKey(users, { 'age': 1, 'active': true });
  13232. * // => 'pebbles'
  13233. *
  13234. * // The `_.matchesProperty` iteratee shorthand.
  13235. * _.findKey(users, ['active', false]);
  13236. * // => 'fred'
  13237. *
  13238. * // The `_.property` iteratee shorthand.
  13239. * _.findKey(users, 'active');
  13240. * // => 'barney'
  13241. */
  13242. function findKey(object, predicate) {
  13243. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13244. }
  13245. /**
  13246. * This method is like `_.findKey` except that it iterates over elements of
  13247. * a collection in the opposite order.
  13248. *
  13249. * @static
  13250. * @memberOf _
  13251. * @since 2.0.0
  13252. * @category Object
  13253. * @param {Object} object The object to inspect.
  13254. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13255. * @returns {string|undefined} Returns the key of the matched element,
  13256. * else `undefined`.
  13257. * @example
  13258. *
  13259. * var users = {
  13260. * 'barney': { 'age': 36, 'active': true },
  13261. * 'fred': { 'age': 40, 'active': false },
  13262. * 'pebbles': { 'age': 1, 'active': true }
  13263. * };
  13264. *
  13265. * _.findLastKey(users, function(o) { return o.age < 40; });
  13266. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13267. *
  13268. * // The `_.matches` iteratee shorthand.
  13269. * _.findLastKey(users, { 'age': 36, 'active': true });
  13270. * // => 'barney'
  13271. *
  13272. * // The `_.matchesProperty` iteratee shorthand.
  13273. * _.findLastKey(users, ['active', false]);
  13274. * // => 'fred'
  13275. *
  13276. * // The `_.property` iteratee shorthand.
  13277. * _.findLastKey(users, 'active');
  13278. * // => 'pebbles'
  13279. */
  13280. function findLastKey(object, predicate) {
  13281. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13282. }
  13283. /**
  13284. * Iterates over own and inherited enumerable string keyed properties of an
  13285. * object and invokes `iteratee` for each property. The iteratee is invoked
  13286. * with three arguments: (value, key, object). Iteratee functions may exit
  13287. * iteration early by explicitly returning `false`.
  13288. *
  13289. * @static
  13290. * @memberOf _
  13291. * @since 0.3.0
  13292. * @category Object
  13293. * @param {Object} object The object to iterate over.
  13294. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13295. * @returns {Object} Returns `object`.
  13296. * @see _.forInRight
  13297. * @example
  13298. *
  13299. * function Foo() {
  13300. * this.a = 1;
  13301. * this.b = 2;
  13302. * }
  13303. *
  13304. * Foo.prototype.c = 3;
  13305. *
  13306. * _.forIn(new Foo, function(value, key) {
  13307. * console.log(key);
  13308. * });
  13309. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13310. */
  13311. function forIn(object, iteratee) {
  13312. return object == null
  13313. ? object
  13314. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13315. }
  13316. /**
  13317. * This method is like `_.forIn` except that it iterates over properties of
  13318. * `object` in the opposite order.
  13319. *
  13320. * @static
  13321. * @memberOf _
  13322. * @since 2.0.0
  13323. * @category Object
  13324. * @param {Object} object The object to iterate over.
  13325. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13326. * @returns {Object} Returns `object`.
  13327. * @see _.forIn
  13328. * @example
  13329. *
  13330. * function Foo() {
  13331. * this.a = 1;
  13332. * this.b = 2;
  13333. * }
  13334. *
  13335. * Foo.prototype.c = 3;
  13336. *
  13337. * _.forInRight(new Foo, function(value, key) {
  13338. * console.log(key);
  13339. * });
  13340. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13341. */
  13342. function forInRight(object, iteratee) {
  13343. return object == null
  13344. ? object
  13345. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13346. }
  13347. /**
  13348. * Iterates over own enumerable string keyed properties of an object and
  13349. * invokes `iteratee` for each property. The iteratee is invoked with three
  13350. * arguments: (value, key, object). Iteratee functions may exit iteration
  13351. * early by explicitly returning `false`.
  13352. *
  13353. * @static
  13354. * @memberOf _
  13355. * @since 0.3.0
  13356. * @category Object
  13357. * @param {Object} object The object to iterate over.
  13358. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13359. * @returns {Object} Returns `object`.
  13360. * @see _.forOwnRight
  13361. * @example
  13362. *
  13363. * function Foo() {
  13364. * this.a = 1;
  13365. * this.b = 2;
  13366. * }
  13367. *
  13368. * Foo.prototype.c = 3;
  13369. *
  13370. * _.forOwn(new Foo, function(value, key) {
  13371. * console.log(key);
  13372. * });
  13373. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13374. */
  13375. function forOwn(object, iteratee) {
  13376. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13377. }
  13378. /**
  13379. * This method is like `_.forOwn` except that it iterates over properties of
  13380. * `object` in the opposite order.
  13381. *
  13382. * @static
  13383. * @memberOf _
  13384. * @since 2.0.0
  13385. * @category Object
  13386. * @param {Object} object The object to iterate over.
  13387. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13388. * @returns {Object} Returns `object`.
  13389. * @see _.forOwn
  13390. * @example
  13391. *
  13392. * function Foo() {
  13393. * this.a = 1;
  13394. * this.b = 2;
  13395. * }
  13396. *
  13397. * Foo.prototype.c = 3;
  13398. *
  13399. * _.forOwnRight(new Foo, function(value, key) {
  13400. * console.log(key);
  13401. * });
  13402. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13403. */
  13404. function forOwnRight(object, iteratee) {
  13405. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13406. }
  13407. /**
  13408. * Creates an array of function property names from own enumerable properties
  13409. * of `object`.
  13410. *
  13411. * @static
  13412. * @since 0.1.0
  13413. * @memberOf _
  13414. * @category Object
  13415. * @param {Object} object The object to inspect.
  13416. * @returns {Array} Returns the function names.
  13417. * @see _.functionsIn
  13418. * @example
  13419. *
  13420. * function Foo() {
  13421. * this.a = _.constant('a');
  13422. * this.b = _.constant('b');
  13423. * }
  13424. *
  13425. * Foo.prototype.c = _.constant('c');
  13426. *
  13427. * _.functions(new Foo);
  13428. * // => ['a', 'b']
  13429. */
  13430. function functions(object) {
  13431. return object == null ? [] : baseFunctions(object, keys(object));
  13432. }
  13433. /**
  13434. * Creates an array of function property names from own and inherited
  13435. * enumerable properties of `object`.
  13436. *
  13437. * @static
  13438. * @memberOf _
  13439. * @since 4.0.0
  13440. * @category Object
  13441. * @param {Object} object The object to inspect.
  13442. * @returns {Array} Returns the function names.
  13443. * @see _.functions
  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. * _.functionsIn(new Foo);
  13454. * // => ['a', 'b', 'c']
  13455. */
  13456. function functionsIn(object) {
  13457. return object == null ? [] : baseFunctions(object, keysIn(object));
  13458. }
  13459. /**
  13460. * Gets the value at `path` of `object`. If the resolved value is
  13461. * `undefined`, the `defaultValue` is returned in its place.
  13462. *
  13463. * @static
  13464. * @memberOf _
  13465. * @since 3.7.0
  13466. * @category Object
  13467. * @param {Object} object The object to query.
  13468. * @param {Array|string} path The path of the property to get.
  13469. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13470. * @returns {*} Returns the resolved value.
  13471. * @example
  13472. *
  13473. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13474. *
  13475. * _.get(object, 'a[0].b.c');
  13476. * // => 3
  13477. *
  13478. * _.get(object, ['a', '0', 'b', 'c']);
  13479. * // => 3
  13480. *
  13481. * _.get(object, 'a.b.c', 'default');
  13482. * // => 'default'
  13483. */
  13484. function get(object, path, defaultValue) {
  13485. var result = object == null ? undefined : baseGet(object, path);
  13486. return result === undefined ? defaultValue : result;
  13487. }
  13488. /**
  13489. * Checks if `path` is a direct property of `object`.
  13490. *
  13491. * @static
  13492. * @since 0.1.0
  13493. * @memberOf _
  13494. * @category Object
  13495. * @param {Object} object The object to query.
  13496. * @param {Array|string} path The path to check.
  13497. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13498. * @example
  13499. *
  13500. * var object = { 'a': { 'b': 2 } };
  13501. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13502. *
  13503. * _.has(object, 'a');
  13504. * // => true
  13505. *
  13506. * _.has(object, 'a.b');
  13507. * // => true
  13508. *
  13509. * _.has(object, ['a', 'b']);
  13510. * // => true
  13511. *
  13512. * _.has(other, 'a');
  13513. * // => false
  13514. */
  13515. function has(object, path) {
  13516. return object != null && hasPath(object, path, baseHas);
  13517. }
  13518. /**
  13519. * Checks if `path` is a direct or inherited property of `object`.
  13520. *
  13521. * @static
  13522. * @memberOf _
  13523. * @since 4.0.0
  13524. * @category Object
  13525. * @param {Object} object The object to query.
  13526. * @param {Array|string} path The path to check.
  13527. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13528. * @example
  13529. *
  13530. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13531. *
  13532. * _.hasIn(object, 'a');
  13533. * // => true
  13534. *
  13535. * _.hasIn(object, 'a.b');
  13536. * // => true
  13537. *
  13538. * _.hasIn(object, ['a', 'b']);
  13539. * // => true
  13540. *
  13541. * _.hasIn(object, 'b');
  13542. * // => false
  13543. */
  13544. function hasIn(object, path) {
  13545. return object != null && hasPath(object, path, baseHasIn);
  13546. }
  13547. /**
  13548. * Creates an object composed of the inverted keys and values of `object`.
  13549. * If `object` contains duplicate values, subsequent values overwrite
  13550. * property assignments of previous values.
  13551. *
  13552. * @static
  13553. * @memberOf _
  13554. * @since 0.7.0
  13555. * @category Object
  13556. * @param {Object} object The object to invert.
  13557. * @returns {Object} Returns the new inverted object.
  13558. * @example
  13559. *
  13560. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13561. *
  13562. * _.invert(object);
  13563. * // => { '1': 'c', '2': 'b' }
  13564. */
  13565. var invert = createInverter(function(result, value, key) {
  13566. if (value != null &&
  13567. typeof value.toString != 'function') {
  13568. value = nativeObjectToString.call(value);
  13569. }
  13570. result[value] = key;
  13571. }, constant(identity));
  13572. /**
  13573. * This method is like `_.invert` except that the inverted object is generated
  13574. * from the results of running each element of `object` thru `iteratee`. The
  13575. * corresponding inverted value of each inverted key is an array of keys
  13576. * responsible for generating the inverted value. The iteratee is invoked
  13577. * with one argument: (value).
  13578. *
  13579. * @static
  13580. * @memberOf _
  13581. * @since 4.1.0
  13582. * @category Object
  13583. * @param {Object} object The object to invert.
  13584. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13585. * @returns {Object} Returns the new inverted object.
  13586. * @example
  13587. *
  13588. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13589. *
  13590. * _.invertBy(object);
  13591. * // => { '1': ['a', 'c'], '2': ['b'] }
  13592. *
  13593. * _.invertBy(object, function(value) {
  13594. * return 'group' + value;
  13595. * });
  13596. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13597. */
  13598. var invertBy = createInverter(function(result, value, key) {
  13599. if (value != null &&
  13600. typeof value.toString != 'function') {
  13601. value = nativeObjectToString.call(value);
  13602. }
  13603. if (hasOwnProperty.call(result, value)) {
  13604. result[value].push(key);
  13605. } else {
  13606. result[value] = [key];
  13607. }
  13608. }, getIteratee);
  13609. /**
  13610. * Invokes the method at `path` of `object`.
  13611. *
  13612. * @static
  13613. * @memberOf _
  13614. * @since 4.0.0
  13615. * @category Object
  13616. * @param {Object} object The object to query.
  13617. * @param {Array|string} path The path of the method to invoke.
  13618. * @param {...*} [args] The arguments to invoke the method with.
  13619. * @returns {*} Returns the result of the invoked method.
  13620. * @example
  13621. *
  13622. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13623. *
  13624. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13625. * // => [2, 3]
  13626. */
  13627. var invoke = baseRest(baseInvoke);
  13628. /**
  13629. * Creates an array of the own enumerable property names of `object`.
  13630. *
  13631. * **Note:** Non-object values are coerced to objects. See the
  13632. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13633. * for more details.
  13634. *
  13635. * @static
  13636. * @since 0.1.0
  13637. * @memberOf _
  13638. * @category Object
  13639. * @param {Object} object The object to query.
  13640. * @returns {Array} Returns the array of property names.
  13641. * @example
  13642. *
  13643. * function Foo() {
  13644. * this.a = 1;
  13645. * this.b = 2;
  13646. * }
  13647. *
  13648. * Foo.prototype.c = 3;
  13649. *
  13650. * _.keys(new Foo);
  13651. * // => ['a', 'b'] (iteration order is not guaranteed)
  13652. *
  13653. * _.keys('hi');
  13654. * // => ['0', '1']
  13655. */
  13656. function keys(object) {
  13657. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13658. }
  13659. /**
  13660. * Creates an array of the own and inherited enumerable property names of `object`.
  13661. *
  13662. * **Note:** Non-object values are coerced to objects.
  13663. *
  13664. * @static
  13665. * @memberOf _
  13666. * @since 3.0.0
  13667. * @category Object
  13668. * @param {Object} object The object to query.
  13669. * @returns {Array} Returns the array of property names.
  13670. * @example
  13671. *
  13672. * function Foo() {
  13673. * this.a = 1;
  13674. * this.b = 2;
  13675. * }
  13676. *
  13677. * Foo.prototype.c = 3;
  13678. *
  13679. * _.keysIn(new Foo);
  13680. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13681. */
  13682. function keysIn(object) {
  13683. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13684. }
  13685. /**
  13686. * The opposite of `_.mapValues`; this method creates an object with the
  13687. * same values as `object` and keys generated by running each own enumerable
  13688. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13689. * with three arguments: (value, key, object).
  13690. *
  13691. * @static
  13692. * @memberOf _
  13693. * @since 3.8.0
  13694. * @category Object
  13695. * @param {Object} object The object to iterate over.
  13696. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13697. * @returns {Object} Returns the new mapped object.
  13698. * @see _.mapValues
  13699. * @example
  13700. *
  13701. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13702. * return key + value;
  13703. * });
  13704. * // => { 'a1': 1, 'b2': 2 }
  13705. */
  13706. function mapKeys(object, iteratee) {
  13707. var result = {};
  13708. iteratee = getIteratee(iteratee, 3);
  13709. baseForOwn(object, function(value, key, object) {
  13710. baseAssignValue(result, iteratee(value, key, object), value);
  13711. });
  13712. return result;
  13713. }
  13714. /**
  13715. * Creates an object with the same keys as `object` and values generated
  13716. * by running each own enumerable string keyed property of `object` thru
  13717. * `iteratee`. The iteratee is invoked with three arguments:
  13718. * (value, key, object).
  13719. *
  13720. * @static
  13721. * @memberOf _
  13722. * @since 2.4.0
  13723. * @category Object
  13724. * @param {Object} object The object to iterate over.
  13725. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13726. * @returns {Object} Returns the new mapped object.
  13727. * @see _.mapKeys
  13728. * @example
  13729. *
  13730. * var users = {
  13731. * 'fred': { 'user': 'fred', 'age': 40 },
  13732. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13733. * };
  13734. *
  13735. * _.mapValues(users, function(o) { return o.age; });
  13736. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13737. *
  13738. * // The `_.property` iteratee shorthand.
  13739. * _.mapValues(users, 'age');
  13740. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13741. */
  13742. function mapValues(object, iteratee) {
  13743. var result = {};
  13744. iteratee = getIteratee(iteratee, 3);
  13745. baseForOwn(object, function(value, key, object) {
  13746. baseAssignValue(result, key, iteratee(value, key, object));
  13747. });
  13748. return result;
  13749. }
  13750. /**
  13751. * This method is like `_.assign` except that it recursively merges own and
  13752. * inherited enumerable string keyed properties of source objects into the
  13753. * destination object. Source properties that resolve to `undefined` are
  13754. * skipped if a destination value exists. Array and plain object properties
  13755. * are merged recursively. Other objects and value types are overridden by
  13756. * assignment. Source objects are applied from left to right. Subsequent
  13757. * sources overwrite property assignments of previous sources.
  13758. *
  13759. * **Note:** This method mutates `object`.
  13760. *
  13761. * @static
  13762. * @memberOf _
  13763. * @since 0.5.0
  13764. * @category Object
  13765. * @param {Object} object The destination object.
  13766. * @param {...Object} [sources] The source objects.
  13767. * @returns {Object} Returns `object`.
  13768. * @example
  13769. *
  13770. * var object = {
  13771. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13772. * };
  13773. *
  13774. * var other = {
  13775. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13776. * };
  13777. *
  13778. * _.merge(object, other);
  13779. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13780. */
  13781. var merge = createAssigner(function(object, source, srcIndex) {
  13782. baseMerge(object, source, srcIndex);
  13783. });
  13784. /**
  13785. * This method is like `_.merge` except that it accepts `customizer` which
  13786. * is invoked to produce the merged values of the destination and source
  13787. * properties. If `customizer` returns `undefined`, merging is handled by the
  13788. * method instead. The `customizer` is invoked with six arguments:
  13789. * (objValue, srcValue, key, object, source, stack).
  13790. *
  13791. * **Note:** This method mutates `object`.
  13792. *
  13793. * @static
  13794. * @memberOf _
  13795. * @since 4.0.0
  13796. * @category Object
  13797. * @param {Object} object The destination object.
  13798. * @param {...Object} sources The source objects.
  13799. * @param {Function} customizer The function to customize assigned values.
  13800. * @returns {Object} Returns `object`.
  13801. * @example
  13802. *
  13803. * function customizer(objValue, srcValue) {
  13804. * if (_.isArray(objValue)) {
  13805. * return objValue.concat(srcValue);
  13806. * }
  13807. * }
  13808. *
  13809. * var object = { 'a': [1], 'b': [2] };
  13810. * var other = { 'a': [3], 'b': [4] };
  13811. *
  13812. * _.mergeWith(object, other, customizer);
  13813. * // => { 'a': [1, 3], 'b': [2, 4] }
  13814. */
  13815. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13816. baseMerge(object, source, srcIndex, customizer);
  13817. });
  13818. /**
  13819. * The opposite of `_.pick`; this method creates an object composed of the
  13820. * own and inherited enumerable property paths of `object` that are not omitted.
  13821. *
  13822. * **Note:** This method is considerably slower than `_.pick`.
  13823. *
  13824. * @static
  13825. * @since 0.1.0
  13826. * @memberOf _
  13827. * @category Object
  13828. * @param {Object} object The source object.
  13829. * @param {...(string|string[])} [paths] The property paths to omit.
  13830. * @returns {Object} Returns the new object.
  13831. * @example
  13832. *
  13833. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13834. *
  13835. * _.omit(object, ['a', 'c']);
  13836. * // => { 'b': '2' }
  13837. */
  13838. var omit = flatRest(function(object, paths) {
  13839. var result = {};
  13840. if (object == null) {
  13841. return result;
  13842. }
  13843. var isDeep = false;
  13844. paths = arrayMap(paths, function(path) {
  13845. path = castPath(path, object);
  13846. isDeep || (isDeep = path.length > 1);
  13847. return path;
  13848. });
  13849. copyObject(object, getAllKeysIn(object), result);
  13850. if (isDeep) {
  13851. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13852. }
  13853. var length = paths.length;
  13854. while (length--) {
  13855. baseUnset(result, paths[length]);
  13856. }
  13857. return result;
  13858. });
  13859. /**
  13860. * The opposite of `_.pickBy`; this method creates an object composed of
  13861. * the own and inherited enumerable string keyed properties of `object` that
  13862. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13863. * arguments: (value, key).
  13864. *
  13865. * @static
  13866. * @memberOf _
  13867. * @since 4.0.0
  13868. * @category Object
  13869. * @param {Object} object The source object.
  13870. * @param {Function} [predicate=_.identity] The function invoked per property.
  13871. * @returns {Object} Returns the new object.
  13872. * @example
  13873. *
  13874. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13875. *
  13876. * _.omitBy(object, _.isNumber);
  13877. * // => { 'b': '2' }
  13878. */
  13879. function omitBy(object, predicate) {
  13880. return pickBy(object, negate(getIteratee(predicate)));
  13881. }
  13882. /**
  13883. * Creates an object composed of the picked `object` properties.
  13884. *
  13885. * @static
  13886. * @since 0.1.0
  13887. * @memberOf _
  13888. * @category Object
  13889. * @param {Object} object The source object.
  13890. * @param {...(string|string[])} [paths] The property paths to pick.
  13891. * @returns {Object} Returns the new object.
  13892. * @example
  13893. *
  13894. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13895. *
  13896. * _.pick(object, ['a', 'c']);
  13897. * // => { 'a': 1, 'c': 3 }
  13898. */
  13899. var pick = flatRest(function(object, paths) {
  13900. return object == null ? {} : basePick(object, paths);
  13901. });
  13902. /**
  13903. * Creates an object composed of the `object` properties `predicate` returns
  13904. * truthy for. The predicate is invoked with two arguments: (value, key).
  13905. *
  13906. * @static
  13907. * @memberOf _
  13908. * @since 4.0.0
  13909. * @category Object
  13910. * @param {Object} object The source object.
  13911. * @param {Function} [predicate=_.identity] The function invoked per property.
  13912. * @returns {Object} Returns the new object.
  13913. * @example
  13914. *
  13915. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13916. *
  13917. * _.pickBy(object, _.isNumber);
  13918. * // => { 'a': 1, 'c': 3 }
  13919. */
  13920. function pickBy(object, predicate) {
  13921. if (object == null) {
  13922. return {};
  13923. }
  13924. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13925. return [prop];
  13926. });
  13927. predicate = getIteratee(predicate);
  13928. return basePickBy(object, props, function(value, path) {
  13929. return predicate(value, path[0]);
  13930. });
  13931. }
  13932. /**
  13933. * This method is like `_.get` except that if the resolved value is a
  13934. * function it's invoked with the `this` binding of its parent object and
  13935. * its result is returned.
  13936. *
  13937. * @static
  13938. * @since 0.1.0
  13939. * @memberOf _
  13940. * @category Object
  13941. * @param {Object} object The object to query.
  13942. * @param {Array|string} path The path of the property to resolve.
  13943. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13944. * @returns {*} Returns the resolved value.
  13945. * @example
  13946. *
  13947. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13948. *
  13949. * _.result(object, 'a[0].b.c1');
  13950. * // => 3
  13951. *
  13952. * _.result(object, 'a[0].b.c2');
  13953. * // => 4
  13954. *
  13955. * _.result(object, 'a[0].b.c3', 'default');
  13956. * // => 'default'
  13957. *
  13958. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13959. * // => 'default'
  13960. */
  13961. function result(object, path, defaultValue) {
  13962. path = castPath(path, object);
  13963. var index = -1,
  13964. length = path.length;
  13965. // Ensure the loop is entered when path is empty.
  13966. if (!length) {
  13967. length = 1;
  13968. object = undefined;
  13969. }
  13970. while (++index < length) {
  13971. var value = object == null ? undefined : object[toKey(path[index])];
  13972. if (value === undefined) {
  13973. index = length;
  13974. value = defaultValue;
  13975. }
  13976. object = isFunction(value) ? value.call(object) : value;
  13977. }
  13978. return object;
  13979. }
  13980. /**
  13981. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13982. * it's created. Arrays are created for missing index properties while objects
  13983. * are created for all other missing properties. Use `_.setWith` to customize
  13984. * `path` creation.
  13985. *
  13986. * **Note:** This method mutates `object`.
  13987. *
  13988. * @static
  13989. * @memberOf _
  13990. * @since 3.7.0
  13991. * @category Object
  13992. * @param {Object} object The object to modify.
  13993. * @param {Array|string} path The path of the property to set.
  13994. * @param {*} value The value to set.
  13995. * @returns {Object} Returns `object`.
  13996. * @example
  13997. *
  13998. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13999. *
  14000. * _.set(object, 'a[0].b.c', 4);
  14001. * console.log(object.a[0].b.c);
  14002. * // => 4
  14003. *
  14004. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14005. * console.log(object.x[0].y.z);
  14006. * // => 5
  14007. */
  14008. function set(object, path, value) {
  14009. return object == null ? object : baseSet(object, path, value);
  14010. }
  14011. /**
  14012. * This method is like `_.set` except that it accepts `customizer` which is
  14013. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14014. * path creation is handled by the method instead. The `customizer` is invoked
  14015. * with three arguments: (nsValue, key, nsObject).
  14016. *
  14017. * **Note:** This method mutates `object`.
  14018. *
  14019. * @static
  14020. * @memberOf _
  14021. * @since 4.0.0
  14022. * @category Object
  14023. * @param {Object} object The object to modify.
  14024. * @param {Array|string} path The path of the property to set.
  14025. * @param {*} value The value to set.
  14026. * @param {Function} [customizer] The function to customize assigned values.
  14027. * @returns {Object} Returns `object`.
  14028. * @example
  14029. *
  14030. * var object = {};
  14031. *
  14032. * _.setWith(object, '[0][1]', 'a', Object);
  14033. * // => { '0': { '1': 'a' } }
  14034. */
  14035. function setWith(object, path, value, customizer) {
  14036. customizer = typeof customizer == 'function' ? customizer : undefined;
  14037. return object == null ? object : baseSet(object, path, value, customizer);
  14038. }
  14039. /**
  14040. * Creates an array of own enumerable string keyed-value pairs for `object`
  14041. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14042. * entries are returned.
  14043. *
  14044. * @static
  14045. * @memberOf _
  14046. * @since 4.0.0
  14047. * @alias entries
  14048. * @category Object
  14049. * @param {Object} object The object to query.
  14050. * @returns {Array} Returns the key-value pairs.
  14051. * @example
  14052. *
  14053. * function Foo() {
  14054. * this.a = 1;
  14055. * this.b = 2;
  14056. * }
  14057. *
  14058. * Foo.prototype.c = 3;
  14059. *
  14060. * _.toPairs(new Foo);
  14061. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14062. */
  14063. var toPairs = createToPairs(keys);
  14064. /**
  14065. * Creates an array of own and inherited enumerable string keyed-value pairs
  14066. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14067. * or set, its entries are returned.
  14068. *
  14069. * @static
  14070. * @memberOf _
  14071. * @since 4.0.0
  14072. * @alias entriesIn
  14073. * @category Object
  14074. * @param {Object} object The object to query.
  14075. * @returns {Array} Returns the key-value pairs.
  14076. * @example
  14077. *
  14078. * function Foo() {
  14079. * this.a = 1;
  14080. * this.b = 2;
  14081. * }
  14082. *
  14083. * Foo.prototype.c = 3;
  14084. *
  14085. * _.toPairsIn(new Foo);
  14086. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14087. */
  14088. var toPairsIn = createToPairs(keysIn);
  14089. /**
  14090. * An alternative to `_.reduce`; this method transforms `object` to a new
  14091. * `accumulator` object which is the result of running each of its own
  14092. * enumerable string keyed properties thru `iteratee`, with each invocation
  14093. * potentially mutating the `accumulator` object. If `accumulator` is not
  14094. * provided, a new object with the same `[[Prototype]]` will be used. The
  14095. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14096. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14097. *
  14098. * @static
  14099. * @memberOf _
  14100. * @since 1.3.0
  14101. * @category Object
  14102. * @param {Object} object The object to iterate over.
  14103. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14104. * @param {*} [accumulator] The custom accumulator value.
  14105. * @returns {*} Returns the accumulated value.
  14106. * @example
  14107. *
  14108. * _.transform([2, 3, 4], function(result, n) {
  14109. * result.push(n *= n);
  14110. * return n % 2 == 0;
  14111. * }, []);
  14112. * // => [4, 9]
  14113. *
  14114. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14115. * (result[value] || (result[value] = [])).push(key);
  14116. * }, {});
  14117. * // => { '1': ['a', 'c'], '2': ['b'] }
  14118. */
  14119. function transform(object, iteratee, accumulator) {
  14120. var isArr = isArray(object),
  14121. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14122. iteratee = getIteratee(iteratee, 4);
  14123. if (accumulator == null) {
  14124. var Ctor = object && object.constructor;
  14125. if (isArrLike) {
  14126. accumulator = isArr ? new Ctor : [];
  14127. }
  14128. else if (isObject(object)) {
  14129. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14130. }
  14131. else {
  14132. accumulator = {};
  14133. }
  14134. }
  14135. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14136. return iteratee(accumulator, value, index, object);
  14137. });
  14138. return accumulator;
  14139. }
  14140. /**
  14141. * Removes the property at `path` of `object`.
  14142. *
  14143. * **Note:** This method mutates `object`.
  14144. *
  14145. * @static
  14146. * @memberOf _
  14147. * @since 4.0.0
  14148. * @category Object
  14149. * @param {Object} object The object to modify.
  14150. * @param {Array|string} path The path of the property to unset.
  14151. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14152. * @example
  14153. *
  14154. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14155. * _.unset(object, 'a[0].b.c');
  14156. * // => true
  14157. *
  14158. * console.log(object);
  14159. * // => { 'a': [{ 'b': {} }] };
  14160. *
  14161. * _.unset(object, ['a', '0', 'b', 'c']);
  14162. * // => true
  14163. *
  14164. * console.log(object);
  14165. * // => { 'a': [{ 'b': {} }] };
  14166. */
  14167. function unset(object, path) {
  14168. return object == null ? true : baseUnset(object, path);
  14169. }
  14170. /**
  14171. * This method is like `_.set` except that accepts `updater` to produce the
  14172. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14173. * is invoked with one argument: (value).
  14174. *
  14175. * **Note:** This method mutates `object`.
  14176. *
  14177. * @static
  14178. * @memberOf _
  14179. * @since 4.6.0
  14180. * @category Object
  14181. * @param {Object} object The object to modify.
  14182. * @param {Array|string} path The path of the property to set.
  14183. * @param {Function} updater The function to produce the updated value.
  14184. * @returns {Object} Returns `object`.
  14185. * @example
  14186. *
  14187. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14188. *
  14189. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14190. * console.log(object.a[0].b.c);
  14191. * // => 9
  14192. *
  14193. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14194. * console.log(object.x[0].y.z);
  14195. * // => 0
  14196. */
  14197. function update(object, path, updater) {
  14198. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14199. }
  14200. /**
  14201. * This method is like `_.update` except that it accepts `customizer` which is
  14202. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14203. * path creation is handled by the method instead. The `customizer` is invoked
  14204. * with three arguments: (nsValue, key, nsObject).
  14205. *
  14206. * **Note:** This method mutates `object`.
  14207. *
  14208. * @static
  14209. * @memberOf _
  14210. * @since 4.6.0
  14211. * @category Object
  14212. * @param {Object} object The object to modify.
  14213. * @param {Array|string} path The path of the property to set.
  14214. * @param {Function} updater The function to produce the updated value.
  14215. * @param {Function} [customizer] The function to customize assigned values.
  14216. * @returns {Object} Returns `object`.
  14217. * @example
  14218. *
  14219. * var object = {};
  14220. *
  14221. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14222. * // => { '0': { '1': 'a' } }
  14223. */
  14224. function updateWith(object, path, updater, customizer) {
  14225. customizer = typeof customizer == 'function' ? customizer : undefined;
  14226. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14227. }
  14228. /**
  14229. * Creates an array of the own enumerable string keyed property values of `object`.
  14230. *
  14231. * **Note:** Non-object values are coerced to objects.
  14232. *
  14233. * @static
  14234. * @since 0.1.0
  14235. * @memberOf _
  14236. * @category Object
  14237. * @param {Object} object The object to query.
  14238. * @returns {Array} Returns the array of property values.
  14239. * @example
  14240. *
  14241. * function Foo() {
  14242. * this.a = 1;
  14243. * this.b = 2;
  14244. * }
  14245. *
  14246. * Foo.prototype.c = 3;
  14247. *
  14248. * _.values(new Foo);
  14249. * // => [1, 2] (iteration order is not guaranteed)
  14250. *
  14251. * _.values('hi');
  14252. * // => ['h', 'i']
  14253. */
  14254. function values(object) {
  14255. return object == null ? [] : baseValues(object, keys(object));
  14256. }
  14257. /**
  14258. * Creates an array of the own and inherited enumerable string keyed property
  14259. * values of `object`.
  14260. *
  14261. * **Note:** Non-object values are coerced to objects.
  14262. *
  14263. * @static
  14264. * @memberOf _
  14265. * @since 3.0.0
  14266. * @category Object
  14267. * @param {Object} object The object to query.
  14268. * @returns {Array} Returns the array of property values.
  14269. * @example
  14270. *
  14271. * function Foo() {
  14272. * this.a = 1;
  14273. * this.b = 2;
  14274. * }
  14275. *
  14276. * Foo.prototype.c = 3;
  14277. *
  14278. * _.valuesIn(new Foo);
  14279. * // => [1, 2, 3] (iteration order is not guaranteed)
  14280. */
  14281. function valuesIn(object) {
  14282. return object == null ? [] : baseValues(object, keysIn(object));
  14283. }
  14284. /*------------------------------------------------------------------------*/
  14285. /**
  14286. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14287. *
  14288. * @static
  14289. * @memberOf _
  14290. * @since 4.0.0
  14291. * @category Number
  14292. * @param {number} number The number to clamp.
  14293. * @param {number} [lower] The lower bound.
  14294. * @param {number} upper The upper bound.
  14295. * @returns {number} Returns the clamped number.
  14296. * @example
  14297. *
  14298. * _.clamp(-10, -5, 5);
  14299. * // => -5
  14300. *
  14301. * _.clamp(10, -5, 5);
  14302. * // => 5
  14303. */
  14304. function clamp(number, lower, upper) {
  14305. if (upper === undefined) {
  14306. upper = lower;
  14307. lower = undefined;
  14308. }
  14309. if (upper !== undefined) {
  14310. upper = toNumber(upper);
  14311. upper = upper === upper ? upper : 0;
  14312. }
  14313. if (lower !== undefined) {
  14314. lower = toNumber(lower);
  14315. lower = lower === lower ? lower : 0;
  14316. }
  14317. return baseClamp(toNumber(number), lower, upper);
  14318. }
  14319. /**
  14320. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14321. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14322. * If `start` is greater than `end` the params are swapped to support
  14323. * negative ranges.
  14324. *
  14325. * @static
  14326. * @memberOf _
  14327. * @since 3.3.0
  14328. * @category Number
  14329. * @param {number} number The number to check.
  14330. * @param {number} [start=0] The start of the range.
  14331. * @param {number} end The end of the range.
  14332. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14333. * @see _.range, _.rangeRight
  14334. * @example
  14335. *
  14336. * _.inRange(3, 2, 4);
  14337. * // => true
  14338. *
  14339. * _.inRange(4, 8);
  14340. * // => true
  14341. *
  14342. * _.inRange(4, 2);
  14343. * // => false
  14344. *
  14345. * _.inRange(2, 2);
  14346. * // => false
  14347. *
  14348. * _.inRange(1.2, 2);
  14349. * // => true
  14350. *
  14351. * _.inRange(5.2, 4);
  14352. * // => false
  14353. *
  14354. * _.inRange(-3, -2, -6);
  14355. * // => true
  14356. */
  14357. function inRange(number, start, end) {
  14358. start = toFinite(start);
  14359. if (end === undefined) {
  14360. end = start;
  14361. start = 0;
  14362. } else {
  14363. end = toFinite(end);
  14364. }
  14365. number = toNumber(number);
  14366. return baseInRange(number, start, end);
  14367. }
  14368. /**
  14369. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14370. * If only one argument is provided a number between `0` and the given number
  14371. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14372. * floats, a floating-point number is returned instead of an integer.
  14373. *
  14374. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14375. * floating-point values which can produce unexpected results.
  14376. *
  14377. * @static
  14378. * @memberOf _
  14379. * @since 0.7.0
  14380. * @category Number
  14381. * @param {number} [lower=0] The lower bound.
  14382. * @param {number} [upper=1] The upper bound.
  14383. * @param {boolean} [floating] Specify returning a floating-point number.
  14384. * @returns {number} Returns the random number.
  14385. * @example
  14386. *
  14387. * _.random(0, 5);
  14388. * // => an integer between 0 and 5
  14389. *
  14390. * _.random(5);
  14391. * // => also an integer between 0 and 5
  14392. *
  14393. * _.random(5, true);
  14394. * // => a floating-point number between 0 and 5
  14395. *
  14396. * _.random(1.2, 5.2);
  14397. * // => a floating-point number between 1.2 and 5.2
  14398. */
  14399. function random(lower, upper, floating) {
  14400. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14401. upper = floating = undefined;
  14402. }
  14403. if (floating === undefined) {
  14404. if (typeof upper == 'boolean') {
  14405. floating = upper;
  14406. upper = undefined;
  14407. }
  14408. else if (typeof lower == 'boolean') {
  14409. floating = lower;
  14410. lower = undefined;
  14411. }
  14412. }
  14413. if (lower === undefined && upper === undefined) {
  14414. lower = 0;
  14415. upper = 1;
  14416. }
  14417. else {
  14418. lower = toFinite(lower);
  14419. if (upper === undefined) {
  14420. upper = lower;
  14421. lower = 0;
  14422. } else {
  14423. upper = toFinite(upper);
  14424. }
  14425. }
  14426. if (lower > upper) {
  14427. var temp = lower;
  14428. lower = upper;
  14429. upper = temp;
  14430. }
  14431. if (floating || lower % 1 || upper % 1) {
  14432. var rand = nativeRandom();
  14433. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14434. }
  14435. return baseRandom(lower, upper);
  14436. }
  14437. /*------------------------------------------------------------------------*/
  14438. /**
  14439. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14440. *
  14441. * @static
  14442. * @memberOf _
  14443. * @since 3.0.0
  14444. * @category String
  14445. * @param {string} [string=''] The string to convert.
  14446. * @returns {string} Returns the camel cased string.
  14447. * @example
  14448. *
  14449. * _.camelCase('Foo Bar');
  14450. * // => 'fooBar'
  14451. *
  14452. * _.camelCase('--foo-bar--');
  14453. * // => 'fooBar'
  14454. *
  14455. * _.camelCase('__FOO_BAR__');
  14456. * // => 'fooBar'
  14457. */
  14458. var camelCase = createCompounder(function(result, word, index) {
  14459. word = word.toLowerCase();
  14460. return result + (index ? capitalize(word) : word);
  14461. });
  14462. /**
  14463. * Converts the first character of `string` to upper case and the remaining
  14464. * to lower case.
  14465. *
  14466. * @static
  14467. * @memberOf _
  14468. * @since 3.0.0
  14469. * @category String
  14470. * @param {string} [string=''] The string to capitalize.
  14471. * @returns {string} Returns the capitalized string.
  14472. * @example
  14473. *
  14474. * _.capitalize('FRED');
  14475. * // => 'Fred'
  14476. */
  14477. function capitalize(string) {
  14478. return upperFirst(toString(string).toLowerCase());
  14479. }
  14480. /**
  14481. * Deburrs `string` by converting
  14482. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14483. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14484. * letters to basic Latin letters and removing
  14485. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14486. *
  14487. * @static
  14488. * @memberOf _
  14489. * @since 3.0.0
  14490. * @category String
  14491. * @param {string} [string=''] The string to deburr.
  14492. * @returns {string} Returns the deburred string.
  14493. * @example
  14494. *
  14495. * _.deburr('déjà vu');
  14496. * // => 'deja vu'
  14497. */
  14498. function deburr(string) {
  14499. string = toString(string);
  14500. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14501. }
  14502. /**
  14503. * Checks if `string` ends with the given target string.
  14504. *
  14505. * @static
  14506. * @memberOf _
  14507. * @since 3.0.0
  14508. * @category String
  14509. * @param {string} [string=''] The string to inspect.
  14510. * @param {string} [target] The string to search for.
  14511. * @param {number} [position=string.length] The position to search up to.
  14512. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14513. * else `false`.
  14514. * @example
  14515. *
  14516. * _.endsWith('abc', 'c');
  14517. * // => true
  14518. *
  14519. * _.endsWith('abc', 'b');
  14520. * // => false
  14521. *
  14522. * _.endsWith('abc', 'b', 2);
  14523. * // => true
  14524. */
  14525. function endsWith(string, target, position) {
  14526. string = toString(string);
  14527. target = baseToString(target);
  14528. var length = string.length;
  14529. position = position === undefined
  14530. ? length
  14531. : baseClamp(toInteger(position), 0, length);
  14532. var end = position;
  14533. position -= target.length;
  14534. return position >= 0 && string.slice(position, end) == target;
  14535. }
  14536. /**
  14537. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14538. * corresponding HTML entities.
  14539. *
  14540. * **Note:** No other characters are escaped. To escape additional
  14541. * characters use a third-party library like [_he_](https://mths.be/he).
  14542. *
  14543. * Though the ">" character is escaped for symmetry, characters like
  14544. * ">" and "/" don't need escaping in HTML and have no special meaning
  14545. * unless they're part of a tag or unquoted attribute value. See
  14546. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14547. * (under "semi-related fun fact") for more details.
  14548. *
  14549. * When working with HTML you should always
  14550. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14551. * XSS vectors.
  14552. *
  14553. * @static
  14554. * @since 0.1.0
  14555. * @memberOf _
  14556. * @category String
  14557. * @param {string} [string=''] The string to escape.
  14558. * @returns {string} Returns the escaped string.
  14559. * @example
  14560. *
  14561. * _.escape('fred, barney, & pebbles');
  14562. * // => 'fred, barney, &amp; pebbles'
  14563. */
  14564. function escape(string) {
  14565. string = toString(string);
  14566. return (string && reHasUnescapedHtml.test(string))
  14567. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14568. : string;
  14569. }
  14570. /**
  14571. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14572. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14573. *
  14574. * @static
  14575. * @memberOf _
  14576. * @since 3.0.0
  14577. * @category String
  14578. * @param {string} [string=''] The string to escape.
  14579. * @returns {string} Returns the escaped string.
  14580. * @example
  14581. *
  14582. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14583. * // => '\[lodash\]\(https://lodash\.com/\)'
  14584. */
  14585. function escapeRegExp(string) {
  14586. string = toString(string);
  14587. return (string && reHasRegExpChar.test(string))
  14588. ? string.replace(reRegExpChar, '\\$&')
  14589. : string;
  14590. }
  14591. /**
  14592. * Converts `string` to
  14593. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14594. *
  14595. * @static
  14596. * @memberOf _
  14597. * @since 3.0.0
  14598. * @category String
  14599. * @param {string} [string=''] The string to convert.
  14600. * @returns {string} Returns the kebab cased string.
  14601. * @example
  14602. *
  14603. * _.kebabCase('Foo Bar');
  14604. * // => 'foo-bar'
  14605. *
  14606. * _.kebabCase('fooBar');
  14607. * // => 'foo-bar'
  14608. *
  14609. * _.kebabCase('__FOO_BAR__');
  14610. * // => 'foo-bar'
  14611. */
  14612. var kebabCase = createCompounder(function(result, word, index) {
  14613. return result + (index ? '-' : '') + word.toLowerCase();
  14614. });
  14615. /**
  14616. * Converts `string`, as space separated words, to lower case.
  14617. *
  14618. * @static
  14619. * @memberOf _
  14620. * @since 4.0.0
  14621. * @category String
  14622. * @param {string} [string=''] The string to convert.
  14623. * @returns {string} Returns the lower cased string.
  14624. * @example
  14625. *
  14626. * _.lowerCase('--Foo-Bar--');
  14627. * // => 'foo bar'
  14628. *
  14629. * _.lowerCase('fooBar');
  14630. * // => 'foo bar'
  14631. *
  14632. * _.lowerCase('__FOO_BAR__');
  14633. * // => 'foo bar'
  14634. */
  14635. var lowerCase = createCompounder(function(result, word, index) {
  14636. return result + (index ? ' ' : '') + word.toLowerCase();
  14637. });
  14638. /**
  14639. * Converts the first character of `string` to lower case.
  14640. *
  14641. * @static
  14642. * @memberOf _
  14643. * @since 4.0.0
  14644. * @category String
  14645. * @param {string} [string=''] The string to convert.
  14646. * @returns {string} Returns the converted string.
  14647. * @example
  14648. *
  14649. * _.lowerFirst('Fred');
  14650. * // => 'fred'
  14651. *
  14652. * _.lowerFirst('FRED');
  14653. * // => 'fRED'
  14654. */
  14655. var lowerFirst = createCaseFirst('toLowerCase');
  14656. /**
  14657. * Pads `string` on the left and right sides if it's shorter than `length`.
  14658. * Padding characters are truncated if they can't be evenly divided by `length`.
  14659. *
  14660. * @static
  14661. * @memberOf _
  14662. * @since 3.0.0
  14663. * @category String
  14664. * @param {string} [string=''] The string to pad.
  14665. * @param {number} [length=0] The padding length.
  14666. * @param {string} [chars=' '] The string used as padding.
  14667. * @returns {string} Returns the padded string.
  14668. * @example
  14669. *
  14670. * _.pad('abc', 8);
  14671. * // => ' abc '
  14672. *
  14673. * _.pad('abc', 8, '_-');
  14674. * // => '_-abc_-_'
  14675. *
  14676. * _.pad('abc', 3);
  14677. * // => 'abc'
  14678. */
  14679. function pad(string, length, chars) {
  14680. string = toString(string);
  14681. length = toInteger(length);
  14682. var strLength = length ? stringSize(string) : 0;
  14683. if (!length || strLength >= length) {
  14684. return string;
  14685. }
  14686. var mid = (length - strLength) / 2;
  14687. return (
  14688. createPadding(nativeFloor(mid), chars) +
  14689. string +
  14690. createPadding(nativeCeil(mid), chars)
  14691. );
  14692. }
  14693. /**
  14694. * Pads `string` on the right side if it's shorter than `length`. Padding
  14695. * characters are truncated if they exceed `length`.
  14696. *
  14697. * @static
  14698. * @memberOf _
  14699. * @since 4.0.0
  14700. * @category String
  14701. * @param {string} [string=''] The string to pad.
  14702. * @param {number} [length=0] The padding length.
  14703. * @param {string} [chars=' '] The string used as padding.
  14704. * @returns {string} Returns the padded string.
  14705. * @example
  14706. *
  14707. * _.padEnd('abc', 6);
  14708. * // => 'abc '
  14709. *
  14710. * _.padEnd('abc', 6, '_-');
  14711. * // => 'abc_-_'
  14712. *
  14713. * _.padEnd('abc', 3);
  14714. * // => 'abc'
  14715. */
  14716. function padEnd(string, length, chars) {
  14717. string = toString(string);
  14718. length = toInteger(length);
  14719. var strLength = length ? stringSize(string) : 0;
  14720. return (length && strLength < length)
  14721. ? (string + createPadding(length - strLength, chars))
  14722. : string;
  14723. }
  14724. /**
  14725. * Pads `string` on the left side if it's shorter than `length`. Padding
  14726. * characters are truncated if they exceed `length`.
  14727. *
  14728. * @static
  14729. * @memberOf _
  14730. * @since 4.0.0
  14731. * @category String
  14732. * @param {string} [string=''] The string to pad.
  14733. * @param {number} [length=0] The padding length.
  14734. * @param {string} [chars=' '] The string used as padding.
  14735. * @returns {string} Returns the padded string.
  14736. * @example
  14737. *
  14738. * _.padStart('abc', 6);
  14739. * // => ' abc'
  14740. *
  14741. * _.padStart('abc', 6, '_-');
  14742. * // => '_-_abc'
  14743. *
  14744. * _.padStart('abc', 3);
  14745. * // => 'abc'
  14746. */
  14747. function padStart(string, length, chars) {
  14748. string = toString(string);
  14749. length = toInteger(length);
  14750. var strLength = length ? stringSize(string) : 0;
  14751. return (length && strLength < length)
  14752. ? (createPadding(length - strLength, chars) + string)
  14753. : string;
  14754. }
  14755. /**
  14756. * Converts `string` to an integer of the specified radix. If `radix` is
  14757. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14758. * hexadecimal, in which case a `radix` of `16` is used.
  14759. *
  14760. * **Note:** This method aligns with the
  14761. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14762. *
  14763. * @static
  14764. * @memberOf _
  14765. * @since 1.1.0
  14766. * @category String
  14767. * @param {string} string The string to convert.
  14768. * @param {number} [radix=10] The radix to interpret `value` by.
  14769. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14770. * @returns {number} Returns the converted integer.
  14771. * @example
  14772. *
  14773. * _.parseInt('08');
  14774. * // => 8
  14775. *
  14776. * _.map(['6', '08', '10'], _.parseInt);
  14777. * // => [6, 8, 10]
  14778. */
  14779. function parseInt(string, radix, guard) {
  14780. if (guard || radix == null) {
  14781. radix = 0;
  14782. } else if (radix) {
  14783. radix = +radix;
  14784. }
  14785. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14786. }
  14787. /**
  14788. * Repeats the given string `n` times.
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 3.0.0
  14793. * @category String
  14794. * @param {string} [string=''] The string to repeat.
  14795. * @param {number} [n=1] The number of times to repeat the string.
  14796. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14797. * @returns {string} Returns the repeated string.
  14798. * @example
  14799. *
  14800. * _.repeat('*', 3);
  14801. * // => '***'
  14802. *
  14803. * _.repeat('abc', 2);
  14804. * // => 'abcabc'
  14805. *
  14806. * _.repeat('abc', 0);
  14807. * // => ''
  14808. */
  14809. function repeat(string, n, guard) {
  14810. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14811. n = 1;
  14812. } else {
  14813. n = toInteger(n);
  14814. }
  14815. return baseRepeat(toString(string), n);
  14816. }
  14817. /**
  14818. * Replaces matches for `pattern` in `string` with `replacement`.
  14819. *
  14820. * **Note:** This method is based on
  14821. * [`String#replace`](https://mdn.io/String/replace).
  14822. *
  14823. * @static
  14824. * @memberOf _
  14825. * @since 4.0.0
  14826. * @category String
  14827. * @param {string} [string=''] The string to modify.
  14828. * @param {RegExp|string} pattern The pattern to replace.
  14829. * @param {Function|string} replacement The match replacement.
  14830. * @returns {string} Returns the modified string.
  14831. * @example
  14832. *
  14833. * _.replace('Hi Fred', 'Fred', 'Barney');
  14834. * // => 'Hi Barney'
  14835. */
  14836. function replace() {
  14837. var args = arguments,
  14838. string = toString(args[0]);
  14839. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14840. }
  14841. /**
  14842. * Converts `string` to
  14843. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14844. *
  14845. * @static
  14846. * @memberOf _
  14847. * @since 3.0.0
  14848. * @category String
  14849. * @param {string} [string=''] The string to convert.
  14850. * @returns {string} Returns the snake cased string.
  14851. * @example
  14852. *
  14853. * _.snakeCase('Foo Bar');
  14854. * // => 'foo_bar'
  14855. *
  14856. * _.snakeCase('fooBar');
  14857. * // => 'foo_bar'
  14858. *
  14859. * _.snakeCase('--FOO-BAR--');
  14860. * // => 'foo_bar'
  14861. */
  14862. var snakeCase = createCompounder(function(result, word, index) {
  14863. return result + (index ? '_' : '') + word.toLowerCase();
  14864. });
  14865. /**
  14866. * Splits `string` by `separator`.
  14867. *
  14868. * **Note:** This method is based on
  14869. * [`String#split`](https://mdn.io/String/split).
  14870. *
  14871. * @static
  14872. * @memberOf _
  14873. * @since 4.0.0
  14874. * @category String
  14875. * @param {string} [string=''] The string to split.
  14876. * @param {RegExp|string} separator The separator pattern to split by.
  14877. * @param {number} [limit] The length to truncate results to.
  14878. * @returns {Array} Returns the string segments.
  14879. * @example
  14880. *
  14881. * _.split('a-b-c', '-', 2);
  14882. * // => ['a', 'b']
  14883. */
  14884. function split(string, separator, limit) {
  14885. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14886. separator = limit = undefined;
  14887. }
  14888. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14889. if (!limit) {
  14890. return [];
  14891. }
  14892. string = toString(string);
  14893. if (string && (
  14894. typeof separator == 'string' ||
  14895. (separator != null && !isRegExp(separator))
  14896. )) {
  14897. separator = baseToString(separator);
  14898. if (!separator && hasUnicode(string)) {
  14899. return castSlice(stringToArray(string), 0, limit);
  14900. }
  14901. }
  14902. return string.split(separator, limit);
  14903. }
  14904. /**
  14905. * Converts `string` to
  14906. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14907. *
  14908. * @static
  14909. * @memberOf _
  14910. * @since 3.1.0
  14911. * @category String
  14912. * @param {string} [string=''] The string to convert.
  14913. * @returns {string} Returns the start cased string.
  14914. * @example
  14915. *
  14916. * _.startCase('--foo-bar--');
  14917. * // => 'Foo Bar'
  14918. *
  14919. * _.startCase('fooBar');
  14920. * // => 'Foo Bar'
  14921. *
  14922. * _.startCase('__FOO_BAR__');
  14923. * // => 'FOO BAR'
  14924. */
  14925. var startCase = createCompounder(function(result, word, index) {
  14926. return result + (index ? ' ' : '') + upperFirst(word);
  14927. });
  14928. /**
  14929. * Checks if `string` starts with the given target string.
  14930. *
  14931. * @static
  14932. * @memberOf _
  14933. * @since 3.0.0
  14934. * @category String
  14935. * @param {string} [string=''] The string to inspect.
  14936. * @param {string} [target] The string to search for.
  14937. * @param {number} [position=0] The position to search from.
  14938. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14939. * else `false`.
  14940. * @example
  14941. *
  14942. * _.startsWith('abc', 'a');
  14943. * // => true
  14944. *
  14945. * _.startsWith('abc', 'b');
  14946. * // => false
  14947. *
  14948. * _.startsWith('abc', 'b', 1);
  14949. * // => true
  14950. */
  14951. function startsWith(string, target, position) {
  14952. string = toString(string);
  14953. position = position == null
  14954. ? 0
  14955. : baseClamp(toInteger(position), 0, string.length);
  14956. target = baseToString(target);
  14957. return string.slice(position, position + target.length) == target;
  14958. }
  14959. /**
  14960. * Creates a compiled template function that can interpolate data properties
  14961. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14962. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14963. * properties may be accessed as free variables in the template. If a setting
  14964. * object is given, it takes precedence over `_.templateSettings` values.
  14965. *
  14966. * **Note:** In the development build `_.template` utilizes
  14967. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14968. * for easier debugging.
  14969. *
  14970. * For more information on precompiling templates see
  14971. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14972. *
  14973. * For more information on Chrome extension sandboxes see
  14974. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14975. *
  14976. * @static
  14977. * @since 0.1.0
  14978. * @memberOf _
  14979. * @category String
  14980. * @param {string} [string=''] The template string.
  14981. * @param {Object} [options={}] The options object.
  14982. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14983. * The HTML "escape" delimiter.
  14984. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14985. * The "evaluate" delimiter.
  14986. * @param {Object} [options.imports=_.templateSettings.imports]
  14987. * An object to import into the template as free variables.
  14988. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14989. * The "interpolate" delimiter.
  14990. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14991. * The sourceURL of the compiled template.
  14992. * @param {string} [options.variable='obj']
  14993. * The data object variable name.
  14994. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14995. * @returns {Function} Returns the compiled template function.
  14996. * @example
  14997. *
  14998. * // Use the "interpolate" delimiter to create a compiled template.
  14999. * var compiled = _.template('hello <%= user %>!');
  15000. * compiled({ 'user': 'fred' });
  15001. * // => 'hello fred!'
  15002. *
  15003. * // Use the HTML "escape" delimiter to escape data property values.
  15004. * var compiled = _.template('<b><%- value %></b>');
  15005. * compiled({ 'value': '<script>' });
  15006. * // => '<b>&lt;script&gt;</b>'
  15007. *
  15008. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15009. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15010. * compiled({ 'users': ['fred', 'barney'] });
  15011. * // => '<li>fred</li><li>barney</li>'
  15012. *
  15013. * // Use the internal `print` function in "evaluate" delimiters.
  15014. * var compiled = _.template('<% print("hello " + user); %>!');
  15015. * compiled({ 'user': 'barney' });
  15016. * // => 'hello barney!'
  15017. *
  15018. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15019. * // Disable support by replacing the "interpolate" delimiter.
  15020. * var compiled = _.template('hello ${ user }!');
  15021. * compiled({ 'user': 'pebbles' });
  15022. * // => 'hello pebbles!'
  15023. *
  15024. * // Use backslashes to treat delimiters as plain text.
  15025. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15026. * compiled({ 'value': 'ignored' });
  15027. * // => '<%- value %>'
  15028. *
  15029. * // Use the `imports` option to import `jQuery` as `jq`.
  15030. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15031. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15032. * compiled({ 'users': ['fred', 'barney'] });
  15033. * // => '<li>fred</li><li>barney</li>'
  15034. *
  15035. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15036. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15037. * compiled(data);
  15038. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15039. *
  15040. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15041. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15042. * compiled.source;
  15043. * // => function(data) {
  15044. * // var __t, __p = '';
  15045. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15046. * // return __p;
  15047. * // }
  15048. *
  15049. * // Use custom template delimiters.
  15050. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15051. * var compiled = _.template('hello {{ user }}!');
  15052. * compiled({ 'user': 'mustache' });
  15053. * // => 'hello mustache!'
  15054. *
  15055. * // Use the `source` property to inline compiled templates for meaningful
  15056. * // line numbers in error messages and stack traces.
  15057. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15058. * var JST = {\
  15059. * "main": ' + _.template(mainText).source + '\
  15060. * };\
  15061. * ');
  15062. */
  15063. function template(string, options, guard) {
  15064. // Based on John Resig's `tmpl` implementation
  15065. // (http://ejohn.org/blog/javascript-micro-templating/)
  15066. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15067. var settings = lodash.templateSettings;
  15068. if (guard && isIterateeCall(string, options, guard)) {
  15069. options = undefined;
  15070. }
  15071. string = toString(string);
  15072. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15073. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15074. importsKeys = keys(imports),
  15075. importsValues = baseValues(imports, importsKeys);
  15076. var isEscaping,
  15077. isEvaluating,
  15078. index = 0,
  15079. interpolate = options.interpolate || reNoMatch,
  15080. source = "__p += '";
  15081. // Compile the regexp to match each delimiter.
  15082. var reDelimiters = RegExp(
  15083. (options.escape || reNoMatch).source + '|' +
  15084. interpolate.source + '|' +
  15085. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15086. (options.evaluate || reNoMatch).source + '|$'
  15087. , 'g');
  15088. // Use a sourceURL for easier debugging.
  15089. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15090. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15091. // and escape the comment, thus injecting code that gets evaled.
  15092. var sourceURL = '//# sourceURL=' +
  15093. (hasOwnProperty.call(options, 'sourceURL')
  15094. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15095. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15096. ) + '\n';
  15097. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15098. interpolateValue || (interpolateValue = esTemplateValue);
  15099. // Escape characters that can't be included in string literals.
  15100. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15101. // Replace delimiters with snippets.
  15102. if (escapeValue) {
  15103. isEscaping = true;
  15104. source += "' +\n__e(" + escapeValue + ") +\n'";
  15105. }
  15106. if (evaluateValue) {
  15107. isEvaluating = true;
  15108. source += "';\n" + evaluateValue + ";\n__p += '";
  15109. }
  15110. if (interpolateValue) {
  15111. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15112. }
  15113. index = offset + match.length;
  15114. // The JS engine embedded in Adobe products needs `match` returned in
  15115. // order to produce the correct `offset` value.
  15116. return match;
  15117. });
  15118. source += "';\n";
  15119. // If `variable` is not specified wrap a with-statement around the generated
  15120. // code to add the data object to the top of the scope chain.
  15121. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15122. if (!variable) {
  15123. source = 'with (obj) {\n' + source + '\n}\n';
  15124. }
  15125. // Throw an error if a forbidden character was found in `variable`, to prevent
  15126. // potential command injection attacks.
  15127. else if (reForbiddenIdentifierChars.test(variable)) {
  15128. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15129. }
  15130. // Cleanup code by stripping empty strings.
  15131. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15132. .replace(reEmptyStringMiddle, '$1')
  15133. .replace(reEmptyStringTrailing, '$1;');
  15134. // Frame code as the function body.
  15135. source = 'function(' + (variable || 'obj') + ') {\n' +
  15136. (variable
  15137. ? ''
  15138. : 'obj || (obj = {});\n'
  15139. ) +
  15140. "var __t, __p = ''" +
  15141. (isEscaping
  15142. ? ', __e = _.escape'
  15143. : ''
  15144. ) +
  15145. (isEvaluating
  15146. ? ', __j = Array.prototype.join;\n' +
  15147. "function print() { __p += __j.call(arguments, '') }\n"
  15148. : ';\n'
  15149. ) +
  15150. source +
  15151. 'return __p\n}';
  15152. var result = attempt(function() {
  15153. return Function(importsKeys, sourceURL + 'return ' + source)
  15154. .apply(undefined, importsValues);
  15155. });
  15156. // Provide the compiled function's source by its `toString` method or
  15157. // the `source` property as a convenience for inlining compiled templates.
  15158. result.source = source;
  15159. if (isError(result)) {
  15160. throw result;
  15161. }
  15162. return result;
  15163. }
  15164. /**
  15165. * Converts `string`, as a whole, to lower case just like
  15166. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15167. *
  15168. * @static
  15169. * @memberOf _
  15170. * @since 4.0.0
  15171. * @category String
  15172. * @param {string} [string=''] The string to convert.
  15173. * @returns {string} Returns the lower cased string.
  15174. * @example
  15175. *
  15176. * _.toLower('--Foo-Bar--');
  15177. * // => '--foo-bar--'
  15178. *
  15179. * _.toLower('fooBar');
  15180. * // => 'foobar'
  15181. *
  15182. * _.toLower('__FOO_BAR__');
  15183. * // => '__foo_bar__'
  15184. */
  15185. function toLower(value) {
  15186. return toString(value).toLowerCase();
  15187. }
  15188. /**
  15189. * Converts `string`, as a whole, to upper case just like
  15190. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15191. *
  15192. * @static
  15193. * @memberOf _
  15194. * @since 4.0.0
  15195. * @category String
  15196. * @param {string} [string=''] The string to convert.
  15197. * @returns {string} Returns the upper cased string.
  15198. * @example
  15199. *
  15200. * _.toUpper('--foo-bar--');
  15201. * // => '--FOO-BAR--'
  15202. *
  15203. * _.toUpper('fooBar');
  15204. * // => 'FOOBAR'
  15205. *
  15206. * _.toUpper('__foo_bar__');
  15207. * // => '__FOO_BAR__'
  15208. */
  15209. function toUpper(value) {
  15210. return toString(value).toUpperCase();
  15211. }
  15212. /**
  15213. * Removes leading and trailing whitespace or specified characters from `string`.
  15214. *
  15215. * @static
  15216. * @memberOf _
  15217. * @since 3.0.0
  15218. * @category String
  15219. * @param {string} [string=''] The string to trim.
  15220. * @param {string} [chars=whitespace] The characters to trim.
  15221. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15222. * @returns {string} Returns the trimmed string.
  15223. * @example
  15224. *
  15225. * _.trim(' abc ');
  15226. * // => 'abc'
  15227. *
  15228. * _.trim('-_-abc-_-', '_-');
  15229. * // => 'abc'
  15230. *
  15231. * _.map([' foo ', ' bar '], _.trim);
  15232. * // => ['foo', 'bar']
  15233. */
  15234. function trim(string, chars, guard) {
  15235. string = toString(string);
  15236. if (string && (guard || chars === undefined)) {
  15237. return baseTrim(string);
  15238. }
  15239. if (!string || !(chars = baseToString(chars))) {
  15240. return string;
  15241. }
  15242. var strSymbols = stringToArray(string),
  15243. chrSymbols = stringToArray(chars),
  15244. start = charsStartIndex(strSymbols, chrSymbols),
  15245. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15246. return castSlice(strSymbols, start, end).join('');
  15247. }
  15248. /**
  15249. * Removes trailing whitespace or specified characters from `string`.
  15250. *
  15251. * @static
  15252. * @memberOf _
  15253. * @since 4.0.0
  15254. * @category String
  15255. * @param {string} [string=''] The string to trim.
  15256. * @param {string} [chars=whitespace] The characters to trim.
  15257. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15258. * @returns {string} Returns the trimmed string.
  15259. * @example
  15260. *
  15261. * _.trimEnd(' abc ');
  15262. * // => ' abc'
  15263. *
  15264. * _.trimEnd('-_-abc-_-', '_-');
  15265. * // => '-_-abc'
  15266. */
  15267. function trimEnd(string, chars, guard) {
  15268. string = toString(string);
  15269. if (string && (guard || chars === undefined)) {
  15270. return string.slice(0, trimmedEndIndex(string) + 1);
  15271. }
  15272. if (!string || !(chars = baseToString(chars))) {
  15273. return string;
  15274. }
  15275. var strSymbols = stringToArray(string),
  15276. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15277. return castSlice(strSymbols, 0, end).join('');
  15278. }
  15279. /**
  15280. * Removes leading whitespace or specified characters from `string`.
  15281. *
  15282. * @static
  15283. * @memberOf _
  15284. * @since 4.0.0
  15285. * @category String
  15286. * @param {string} [string=''] The string to trim.
  15287. * @param {string} [chars=whitespace] The characters to trim.
  15288. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15289. * @returns {string} Returns the trimmed string.
  15290. * @example
  15291. *
  15292. * _.trimStart(' abc ');
  15293. * // => 'abc '
  15294. *
  15295. * _.trimStart('-_-abc-_-', '_-');
  15296. * // => 'abc-_-'
  15297. */
  15298. function trimStart(string, chars, guard) {
  15299. string = toString(string);
  15300. if (string && (guard || chars === undefined)) {
  15301. return string.replace(reTrimStart, '');
  15302. }
  15303. if (!string || !(chars = baseToString(chars))) {
  15304. return string;
  15305. }
  15306. var strSymbols = stringToArray(string),
  15307. start = charsStartIndex(strSymbols, stringToArray(chars));
  15308. return castSlice(strSymbols, start).join('');
  15309. }
  15310. /**
  15311. * Truncates `string` if it's longer than the given maximum string length.
  15312. * The last characters of the truncated string are replaced with the omission
  15313. * string which defaults to "...".
  15314. *
  15315. * @static
  15316. * @memberOf _
  15317. * @since 4.0.0
  15318. * @category String
  15319. * @param {string} [string=''] The string to truncate.
  15320. * @param {Object} [options={}] The options object.
  15321. * @param {number} [options.length=30] The maximum string length.
  15322. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15323. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15324. * @returns {string} Returns the truncated string.
  15325. * @example
  15326. *
  15327. * _.truncate('hi-diddly-ho there, neighborino');
  15328. * // => 'hi-diddly-ho there, neighbo...'
  15329. *
  15330. * _.truncate('hi-diddly-ho there, neighborino', {
  15331. * 'length': 24,
  15332. * 'separator': ' '
  15333. * });
  15334. * // => 'hi-diddly-ho there,...'
  15335. *
  15336. * _.truncate('hi-diddly-ho there, neighborino', {
  15337. * 'length': 24,
  15338. * 'separator': /,? +/
  15339. * });
  15340. * // => 'hi-diddly-ho there...'
  15341. *
  15342. * _.truncate('hi-diddly-ho there, neighborino', {
  15343. * 'omission': ' [...]'
  15344. * });
  15345. * // => 'hi-diddly-ho there, neig [...]'
  15346. */
  15347. function truncate(string, options) {
  15348. var length = DEFAULT_TRUNC_LENGTH,
  15349. omission = DEFAULT_TRUNC_OMISSION;
  15350. if (isObject(options)) {
  15351. var separator = 'separator' in options ? options.separator : separator;
  15352. length = 'length' in options ? toInteger(options.length) : length;
  15353. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15354. }
  15355. string = toString(string);
  15356. var strLength = string.length;
  15357. if (hasUnicode(string)) {
  15358. var strSymbols = stringToArray(string);
  15359. strLength = strSymbols.length;
  15360. }
  15361. if (length >= strLength) {
  15362. return string;
  15363. }
  15364. var end = length - stringSize(omission);
  15365. if (end < 1) {
  15366. return omission;
  15367. }
  15368. var result = strSymbols
  15369. ? castSlice(strSymbols, 0, end).join('')
  15370. : string.slice(0, end);
  15371. if (separator === undefined) {
  15372. return result + omission;
  15373. }
  15374. if (strSymbols) {
  15375. end += (result.length - end);
  15376. }
  15377. if (isRegExp(separator)) {
  15378. if (string.slice(end).search(separator)) {
  15379. var match,
  15380. substring = result;
  15381. if (!separator.global) {
  15382. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15383. }
  15384. separator.lastIndex = 0;
  15385. while ((match = separator.exec(substring))) {
  15386. var newEnd = match.index;
  15387. }
  15388. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15389. }
  15390. } else if (string.indexOf(baseToString(separator), end) != end) {
  15391. var index = result.lastIndexOf(separator);
  15392. if (index > -1) {
  15393. result = result.slice(0, index);
  15394. }
  15395. }
  15396. return result + omission;
  15397. }
  15398. /**
  15399. * The inverse of `_.escape`; this method converts the HTML entities
  15400. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15401. * their corresponding characters.
  15402. *
  15403. * **Note:** No other HTML entities are unescaped. To unescape additional
  15404. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15405. *
  15406. * @static
  15407. * @memberOf _
  15408. * @since 0.6.0
  15409. * @category String
  15410. * @param {string} [string=''] The string to unescape.
  15411. * @returns {string} Returns the unescaped string.
  15412. * @example
  15413. *
  15414. * _.unescape('fred, barney, &amp; pebbles');
  15415. * // => 'fred, barney, & pebbles'
  15416. */
  15417. function unescape(string) {
  15418. string = toString(string);
  15419. return (string && reHasEscapedHtml.test(string))
  15420. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15421. : string;
  15422. }
  15423. /**
  15424. * Converts `string`, as space separated words, to upper case.
  15425. *
  15426. * @static
  15427. * @memberOf _
  15428. * @since 4.0.0
  15429. * @category String
  15430. * @param {string} [string=''] The string to convert.
  15431. * @returns {string} Returns the upper cased string.
  15432. * @example
  15433. *
  15434. * _.upperCase('--foo-bar');
  15435. * // => 'FOO BAR'
  15436. *
  15437. * _.upperCase('fooBar');
  15438. * // => 'FOO BAR'
  15439. *
  15440. * _.upperCase('__foo_bar__');
  15441. * // => 'FOO BAR'
  15442. */
  15443. var upperCase = createCompounder(function(result, word, index) {
  15444. return result + (index ? ' ' : '') + word.toUpperCase();
  15445. });
  15446. /**
  15447. * Converts the first character of `string` to upper case.
  15448. *
  15449. * @static
  15450. * @memberOf _
  15451. * @since 4.0.0
  15452. * @category String
  15453. * @param {string} [string=''] The string to convert.
  15454. * @returns {string} Returns the converted string.
  15455. * @example
  15456. *
  15457. * _.upperFirst('fred');
  15458. * // => 'Fred'
  15459. *
  15460. * _.upperFirst('FRED');
  15461. * // => 'FRED'
  15462. */
  15463. var upperFirst = createCaseFirst('toUpperCase');
  15464. /**
  15465. * Splits `string` into an array of its words.
  15466. *
  15467. * @static
  15468. * @memberOf _
  15469. * @since 3.0.0
  15470. * @category String
  15471. * @param {string} [string=''] The string to inspect.
  15472. * @param {RegExp|string} [pattern] The pattern to match words.
  15473. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15474. * @returns {Array} Returns the words of `string`.
  15475. * @example
  15476. *
  15477. * _.words('fred, barney, & pebbles');
  15478. * // => ['fred', 'barney', 'pebbles']
  15479. *
  15480. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15481. * // => ['fred', 'barney', '&', 'pebbles']
  15482. */
  15483. function words(string, pattern, guard) {
  15484. string = toString(string);
  15485. pattern = guard ? undefined : pattern;
  15486. if (pattern === undefined) {
  15487. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15488. }
  15489. return string.match(pattern) || [];
  15490. }
  15491. /*------------------------------------------------------------------------*/
  15492. /**
  15493. * Attempts to invoke `func`, returning either the result or the caught error
  15494. * object. Any additional arguments are provided to `func` when it's invoked.
  15495. *
  15496. * @static
  15497. * @memberOf _
  15498. * @since 3.0.0
  15499. * @category Util
  15500. * @param {Function} func The function to attempt.
  15501. * @param {...*} [args] The arguments to invoke `func` with.
  15502. * @returns {*} Returns the `func` result or error object.
  15503. * @example
  15504. *
  15505. * // Avoid throwing errors for invalid selectors.
  15506. * var elements = _.attempt(function(selector) {
  15507. * return document.querySelectorAll(selector);
  15508. * }, '>_>');
  15509. *
  15510. * if (_.isError(elements)) {
  15511. * elements = [];
  15512. * }
  15513. */
  15514. var attempt = baseRest(function(func, args) {
  15515. try {
  15516. return apply(func, undefined, args);
  15517. } catch (e) {
  15518. return isError(e) ? e : new Error(e);
  15519. }
  15520. });
  15521. /**
  15522. * Binds methods of an object to the object itself, overwriting the existing
  15523. * method.
  15524. *
  15525. * **Note:** This method doesn't set the "length" property of bound functions.
  15526. *
  15527. * @static
  15528. * @since 0.1.0
  15529. * @memberOf _
  15530. * @category Util
  15531. * @param {Object} object The object to bind and assign the bound methods to.
  15532. * @param {...(string|string[])} methodNames The object method names to bind.
  15533. * @returns {Object} Returns `object`.
  15534. * @example
  15535. *
  15536. * var view = {
  15537. * 'label': 'docs',
  15538. * 'click': function() {
  15539. * console.log('clicked ' + this.label);
  15540. * }
  15541. * };
  15542. *
  15543. * _.bindAll(view, ['click']);
  15544. * jQuery(element).on('click', view.click);
  15545. * // => Logs 'clicked docs' when clicked.
  15546. */
  15547. var bindAll = flatRest(function(object, methodNames) {
  15548. arrayEach(methodNames, function(key) {
  15549. key = toKey(key);
  15550. baseAssignValue(object, key, bind(object[key], object));
  15551. });
  15552. return object;
  15553. });
  15554. /**
  15555. * Creates a function that iterates over `pairs` and invokes the corresponding
  15556. * function of the first predicate to return truthy. The predicate-function
  15557. * pairs are invoked with the `this` binding and arguments of the created
  15558. * function.
  15559. *
  15560. * @static
  15561. * @memberOf _
  15562. * @since 4.0.0
  15563. * @category Util
  15564. * @param {Array} pairs The predicate-function pairs.
  15565. * @returns {Function} Returns the new composite function.
  15566. * @example
  15567. *
  15568. * var func = _.cond([
  15569. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15570. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15571. * [_.stubTrue, _.constant('no match')]
  15572. * ]);
  15573. *
  15574. * func({ 'a': 1, 'b': 2 });
  15575. * // => 'matches A'
  15576. *
  15577. * func({ 'a': 0, 'b': 1 });
  15578. * // => 'matches B'
  15579. *
  15580. * func({ 'a': '1', 'b': '2' });
  15581. * // => 'no match'
  15582. */
  15583. function cond(pairs) {
  15584. var length = pairs == null ? 0 : pairs.length,
  15585. toIteratee = getIteratee();
  15586. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15587. if (typeof pair[1] != 'function') {
  15588. throw new TypeError(FUNC_ERROR_TEXT);
  15589. }
  15590. return [toIteratee(pair[0]), pair[1]];
  15591. });
  15592. return baseRest(function(args) {
  15593. var index = -1;
  15594. while (++index < length) {
  15595. var pair = pairs[index];
  15596. if (apply(pair[0], this, args)) {
  15597. return apply(pair[1], this, args);
  15598. }
  15599. }
  15600. });
  15601. }
  15602. /**
  15603. * Creates a function that invokes the predicate properties of `source` with
  15604. * the corresponding property values of a given object, returning `true` if
  15605. * all predicates return truthy, else `false`.
  15606. *
  15607. * **Note:** The created function is equivalent to `_.conformsTo` with
  15608. * `source` partially applied.
  15609. *
  15610. * @static
  15611. * @memberOf _
  15612. * @since 4.0.0
  15613. * @category Util
  15614. * @param {Object} source The object of property predicates to conform to.
  15615. * @returns {Function} Returns the new spec function.
  15616. * @example
  15617. *
  15618. * var objects = [
  15619. * { 'a': 2, 'b': 1 },
  15620. * { 'a': 1, 'b': 2 }
  15621. * ];
  15622. *
  15623. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15624. * // => [{ 'a': 1, 'b': 2 }]
  15625. */
  15626. function conforms(source) {
  15627. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15628. }
  15629. /**
  15630. * Creates a function that returns `value`.
  15631. *
  15632. * @static
  15633. * @memberOf _
  15634. * @since 2.4.0
  15635. * @category Util
  15636. * @param {*} value The value to return from the new function.
  15637. * @returns {Function} Returns the new constant function.
  15638. * @example
  15639. *
  15640. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15641. *
  15642. * console.log(objects);
  15643. * // => [{ 'a': 1 }, { 'a': 1 }]
  15644. *
  15645. * console.log(objects[0] === objects[1]);
  15646. * // => true
  15647. */
  15648. function constant(value) {
  15649. return function() {
  15650. return value;
  15651. };
  15652. }
  15653. /**
  15654. * Checks `value` to determine whether a default value should be returned in
  15655. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15656. * or `undefined`.
  15657. *
  15658. * @static
  15659. * @memberOf _
  15660. * @since 4.14.0
  15661. * @category Util
  15662. * @param {*} value The value to check.
  15663. * @param {*} defaultValue The default value.
  15664. * @returns {*} Returns the resolved value.
  15665. * @example
  15666. *
  15667. * _.defaultTo(1, 10);
  15668. * // => 1
  15669. *
  15670. * _.defaultTo(undefined, 10);
  15671. * // => 10
  15672. */
  15673. function defaultTo(value, defaultValue) {
  15674. return (value == null || value !== value) ? defaultValue : value;
  15675. }
  15676. /**
  15677. * Creates a function that returns the result of invoking the given functions
  15678. * with the `this` binding of the created function, where each successive
  15679. * invocation is supplied the return value of the previous.
  15680. *
  15681. * @static
  15682. * @memberOf _
  15683. * @since 3.0.0
  15684. * @category Util
  15685. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15686. * @returns {Function} Returns the new composite function.
  15687. * @see _.flowRight
  15688. * @example
  15689. *
  15690. * function square(n) {
  15691. * return n * n;
  15692. * }
  15693. *
  15694. * var addSquare = _.flow([_.add, square]);
  15695. * addSquare(1, 2);
  15696. * // => 9
  15697. */
  15698. var flow = createFlow();
  15699. /**
  15700. * This method is like `_.flow` except that it creates a function that
  15701. * invokes the given functions from right to left.
  15702. *
  15703. * @static
  15704. * @since 3.0.0
  15705. * @memberOf _
  15706. * @category Util
  15707. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15708. * @returns {Function} Returns the new composite function.
  15709. * @see _.flow
  15710. * @example
  15711. *
  15712. * function square(n) {
  15713. * return n * n;
  15714. * }
  15715. *
  15716. * var addSquare = _.flowRight([square, _.add]);
  15717. * addSquare(1, 2);
  15718. * // => 9
  15719. */
  15720. var flowRight = createFlow(true);
  15721. /**
  15722. * This method returns the first argument it receives.
  15723. *
  15724. * @static
  15725. * @since 0.1.0
  15726. * @memberOf _
  15727. * @category Util
  15728. * @param {*} value Any value.
  15729. * @returns {*} Returns `value`.
  15730. * @example
  15731. *
  15732. * var object = { 'a': 1 };
  15733. *
  15734. * console.log(_.identity(object) === object);
  15735. * // => true
  15736. */
  15737. function identity(value) {
  15738. return value;
  15739. }
  15740. /**
  15741. * Creates a function that invokes `func` with the arguments of the created
  15742. * function. If `func` is a property name, the created function returns the
  15743. * property value for a given element. If `func` is an array or object, the
  15744. * created function returns `true` for elements that contain the equivalent
  15745. * source properties, otherwise it returns `false`.
  15746. *
  15747. * @static
  15748. * @since 4.0.0
  15749. * @memberOf _
  15750. * @category Util
  15751. * @param {*} [func=_.identity] The value to convert to a callback.
  15752. * @returns {Function} Returns the callback.
  15753. * @example
  15754. *
  15755. * var users = [
  15756. * { 'user': 'barney', 'age': 36, 'active': true },
  15757. * { 'user': 'fred', 'age': 40, 'active': false }
  15758. * ];
  15759. *
  15760. * // The `_.matches` iteratee shorthand.
  15761. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15762. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15763. *
  15764. * // The `_.matchesProperty` iteratee shorthand.
  15765. * _.filter(users, _.iteratee(['user', 'fred']));
  15766. * // => [{ 'user': 'fred', 'age': 40 }]
  15767. *
  15768. * // The `_.property` iteratee shorthand.
  15769. * _.map(users, _.iteratee('user'));
  15770. * // => ['barney', 'fred']
  15771. *
  15772. * // Create custom iteratee shorthands.
  15773. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15774. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15775. * return func.test(string);
  15776. * };
  15777. * });
  15778. *
  15779. * _.filter(['abc', 'def'], /ef/);
  15780. * // => ['def']
  15781. */
  15782. function iteratee(func) {
  15783. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15784. }
  15785. /**
  15786. * Creates a function that performs a partial deep comparison between a given
  15787. * object and `source`, returning `true` if the given object has equivalent
  15788. * property values, else `false`.
  15789. *
  15790. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15791. * partially applied.
  15792. *
  15793. * Partial comparisons will match empty array and empty object `source`
  15794. * values against any array or object value, respectively. See `_.isEqual`
  15795. * for a list of supported value comparisons.
  15796. *
  15797. * **Note:** Multiple values can be checked by combining several matchers
  15798. * using `_.overSome`
  15799. *
  15800. * @static
  15801. * @memberOf _
  15802. * @since 3.0.0
  15803. * @category Util
  15804. * @param {Object} source The object of property values to match.
  15805. * @returns {Function} Returns the new spec function.
  15806. * @example
  15807. *
  15808. * var objects = [
  15809. * { 'a': 1, 'b': 2, 'c': 3 },
  15810. * { 'a': 4, 'b': 5, 'c': 6 }
  15811. * ];
  15812. *
  15813. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15814. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15815. *
  15816. * // Checking for several possible values
  15817. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15818. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15819. */
  15820. function matches(source) {
  15821. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15822. }
  15823. /**
  15824. * Creates a function that performs a partial deep comparison between the
  15825. * value at `path` of a given object to `srcValue`, returning `true` if the
  15826. * object value is equivalent, else `false`.
  15827. *
  15828. * **Note:** Partial comparisons will match empty array and empty object
  15829. * `srcValue` values against any array or object value, respectively. See
  15830. * `_.isEqual` for a list of supported value comparisons.
  15831. *
  15832. * **Note:** Multiple values can be checked by combining several matchers
  15833. * using `_.overSome`
  15834. *
  15835. * @static
  15836. * @memberOf _
  15837. * @since 3.2.0
  15838. * @category Util
  15839. * @param {Array|string} path The path of the property to get.
  15840. * @param {*} srcValue The value to match.
  15841. * @returns {Function} Returns the new spec function.
  15842. * @example
  15843. *
  15844. * var objects = [
  15845. * { 'a': 1, 'b': 2, 'c': 3 },
  15846. * { 'a': 4, 'b': 5, 'c': 6 }
  15847. * ];
  15848. *
  15849. * _.find(objects, _.matchesProperty('a', 4));
  15850. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15851. *
  15852. * // Checking for several possible values
  15853. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15854. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15855. */
  15856. function matchesProperty(path, srcValue) {
  15857. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15858. }
  15859. /**
  15860. * Creates a function that invokes the method at `path` of a given object.
  15861. * Any additional arguments are provided to the invoked method.
  15862. *
  15863. * @static
  15864. * @memberOf _
  15865. * @since 3.7.0
  15866. * @category Util
  15867. * @param {Array|string} path The path of the method to invoke.
  15868. * @param {...*} [args] The arguments to invoke the method with.
  15869. * @returns {Function} Returns the new invoker function.
  15870. * @example
  15871. *
  15872. * var objects = [
  15873. * { 'a': { 'b': _.constant(2) } },
  15874. * { 'a': { 'b': _.constant(1) } }
  15875. * ];
  15876. *
  15877. * _.map(objects, _.method('a.b'));
  15878. * // => [2, 1]
  15879. *
  15880. * _.map(objects, _.method(['a', 'b']));
  15881. * // => [2, 1]
  15882. */
  15883. var method = baseRest(function(path, args) {
  15884. return function(object) {
  15885. return baseInvoke(object, path, args);
  15886. };
  15887. });
  15888. /**
  15889. * The opposite of `_.method`; this method creates a function that invokes
  15890. * the method at a given path of `object`. Any additional arguments are
  15891. * provided to the invoked method.
  15892. *
  15893. * @static
  15894. * @memberOf _
  15895. * @since 3.7.0
  15896. * @category Util
  15897. * @param {Object} object The object to query.
  15898. * @param {...*} [args] The arguments to invoke the method with.
  15899. * @returns {Function} Returns the new invoker function.
  15900. * @example
  15901. *
  15902. * var array = _.times(3, _.constant),
  15903. * object = { 'a': array, 'b': array, 'c': array };
  15904. *
  15905. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15906. * // => [2, 0]
  15907. *
  15908. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15909. * // => [2, 0]
  15910. */
  15911. var methodOf = baseRest(function(object, args) {
  15912. return function(path) {
  15913. return baseInvoke(object, path, args);
  15914. };
  15915. });
  15916. /**
  15917. * Adds all own enumerable string keyed function properties of a source
  15918. * object to the destination object. If `object` is a function, then methods
  15919. * are added to its prototype as well.
  15920. *
  15921. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15922. * avoid conflicts caused by modifying the original.
  15923. *
  15924. * @static
  15925. * @since 0.1.0
  15926. * @memberOf _
  15927. * @category Util
  15928. * @param {Function|Object} [object=lodash] The destination object.
  15929. * @param {Object} source The object of functions to add.
  15930. * @param {Object} [options={}] The options object.
  15931. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15932. * @returns {Function|Object} Returns `object`.
  15933. * @example
  15934. *
  15935. * function vowels(string) {
  15936. * return _.filter(string, function(v) {
  15937. * return /[aeiou]/i.test(v);
  15938. * });
  15939. * }
  15940. *
  15941. * _.mixin({ 'vowels': vowels });
  15942. * _.vowels('fred');
  15943. * // => ['e']
  15944. *
  15945. * _('fred').vowels().value();
  15946. * // => ['e']
  15947. *
  15948. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15949. * _('fred').vowels();
  15950. * // => ['e']
  15951. */
  15952. function mixin(object, source, options) {
  15953. var props = keys(source),
  15954. methodNames = baseFunctions(source, props);
  15955. if (options == null &&
  15956. !(isObject(source) && (methodNames.length || !props.length))) {
  15957. options = source;
  15958. source = object;
  15959. object = this;
  15960. methodNames = baseFunctions(source, keys(source));
  15961. }
  15962. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15963. isFunc = isFunction(object);
  15964. arrayEach(methodNames, function(methodName) {
  15965. var func = source[methodName];
  15966. object[methodName] = func;
  15967. if (isFunc) {
  15968. object.prototype[methodName] = function() {
  15969. var chainAll = this.__chain__;
  15970. if (chain || chainAll) {
  15971. var result = object(this.__wrapped__),
  15972. actions = result.__actions__ = copyArray(this.__actions__);
  15973. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15974. result.__chain__ = chainAll;
  15975. return result;
  15976. }
  15977. return func.apply(object, arrayPush([this.value()], arguments));
  15978. };
  15979. }
  15980. });
  15981. return object;
  15982. }
  15983. /**
  15984. * Reverts the `_` variable to its previous value and returns a reference to
  15985. * the `lodash` function.
  15986. *
  15987. * @static
  15988. * @since 0.1.0
  15989. * @memberOf _
  15990. * @category Util
  15991. * @returns {Function} Returns the `lodash` function.
  15992. * @example
  15993. *
  15994. * var lodash = _.noConflict();
  15995. */
  15996. function noConflict() {
  15997. if (root._ === this) {
  15998. root._ = oldDash;
  15999. }
  16000. return this;
  16001. }
  16002. /**
  16003. * This method returns `undefined`.
  16004. *
  16005. * @static
  16006. * @memberOf _
  16007. * @since 2.3.0
  16008. * @category Util
  16009. * @example
  16010. *
  16011. * _.times(2, _.noop);
  16012. * // => [undefined, undefined]
  16013. */
  16014. function noop() {
  16015. // No operation performed.
  16016. }
  16017. /**
  16018. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16019. * the nth argument from the end is returned.
  16020. *
  16021. * @static
  16022. * @memberOf _
  16023. * @since 4.0.0
  16024. * @category Util
  16025. * @param {number} [n=0] The index of the argument to return.
  16026. * @returns {Function} Returns the new pass-thru function.
  16027. * @example
  16028. *
  16029. * var func = _.nthArg(1);
  16030. * func('a', 'b', 'c', 'd');
  16031. * // => 'b'
  16032. *
  16033. * var func = _.nthArg(-2);
  16034. * func('a', 'b', 'c', 'd');
  16035. * // => 'c'
  16036. */
  16037. function nthArg(n) {
  16038. n = toInteger(n);
  16039. return baseRest(function(args) {
  16040. return baseNth(args, n);
  16041. });
  16042. }
  16043. /**
  16044. * Creates a function that invokes `iteratees` with the arguments it receives
  16045. * and returns their results.
  16046. *
  16047. * @static
  16048. * @memberOf _
  16049. * @since 4.0.0
  16050. * @category Util
  16051. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16052. * The iteratees to invoke.
  16053. * @returns {Function} Returns the new function.
  16054. * @example
  16055. *
  16056. * var func = _.over([Math.max, Math.min]);
  16057. *
  16058. * func(1, 2, 3, 4);
  16059. * // => [4, 1]
  16060. */
  16061. var over = createOver(arrayMap);
  16062. /**
  16063. * Creates a function that checks if **all** of the `predicates` return
  16064. * truthy when invoked with the arguments it receives.
  16065. *
  16066. * Following shorthands are possible for providing predicates.
  16067. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16068. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16069. *
  16070. * @static
  16071. * @memberOf _
  16072. * @since 4.0.0
  16073. * @category Util
  16074. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16075. * The predicates to check.
  16076. * @returns {Function} Returns the new function.
  16077. * @example
  16078. *
  16079. * var func = _.overEvery([Boolean, isFinite]);
  16080. *
  16081. * func('1');
  16082. * // => true
  16083. *
  16084. * func(null);
  16085. * // => false
  16086. *
  16087. * func(NaN);
  16088. * // => false
  16089. */
  16090. var overEvery = createOver(arrayEvery);
  16091. /**
  16092. * Creates a function that checks if **any** of the `predicates` return
  16093. * truthy when invoked with the arguments it receives.
  16094. *
  16095. * Following shorthands are possible for providing predicates.
  16096. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16097. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16098. *
  16099. * @static
  16100. * @memberOf _
  16101. * @since 4.0.0
  16102. * @category Util
  16103. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16104. * The predicates to check.
  16105. * @returns {Function} Returns the new function.
  16106. * @example
  16107. *
  16108. * var func = _.overSome([Boolean, isFinite]);
  16109. *
  16110. * func('1');
  16111. * // => true
  16112. *
  16113. * func(null);
  16114. * // => true
  16115. *
  16116. * func(NaN);
  16117. * // => false
  16118. *
  16119. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16120. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16121. */
  16122. var overSome = createOver(arraySome);
  16123. /**
  16124. * Creates a function that returns the value at `path` of a given object.
  16125. *
  16126. * @static
  16127. * @memberOf _
  16128. * @since 2.4.0
  16129. * @category Util
  16130. * @param {Array|string} path The path of the property to get.
  16131. * @returns {Function} Returns the new accessor function.
  16132. * @example
  16133. *
  16134. * var objects = [
  16135. * { 'a': { 'b': 2 } },
  16136. * { 'a': { 'b': 1 } }
  16137. * ];
  16138. *
  16139. * _.map(objects, _.property('a.b'));
  16140. * // => [2, 1]
  16141. *
  16142. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16143. * // => [1, 2]
  16144. */
  16145. function property(path) {
  16146. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16147. }
  16148. /**
  16149. * The opposite of `_.property`; this method creates a function that returns
  16150. * the value at a given path of `object`.
  16151. *
  16152. * @static
  16153. * @memberOf _
  16154. * @since 3.0.0
  16155. * @category Util
  16156. * @param {Object} object The object to query.
  16157. * @returns {Function} Returns the new accessor function.
  16158. * @example
  16159. *
  16160. * var array = [0, 1, 2],
  16161. * object = { 'a': array, 'b': array, 'c': array };
  16162. *
  16163. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16164. * // => [2, 0]
  16165. *
  16166. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16167. * // => [2, 0]
  16168. */
  16169. function propertyOf(object) {
  16170. return function(path) {
  16171. return object == null ? undefined : baseGet(object, path);
  16172. };
  16173. }
  16174. /**
  16175. * Creates an array of numbers (positive and/or negative) progressing from
  16176. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16177. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16178. * it's set to `start` with `start` then set to `0`.
  16179. *
  16180. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16181. * floating-point values which can produce unexpected results.
  16182. *
  16183. * @static
  16184. * @since 0.1.0
  16185. * @memberOf _
  16186. * @category Util
  16187. * @param {number} [start=0] The start of the range.
  16188. * @param {number} end The end of the range.
  16189. * @param {number} [step=1] The value to increment or decrement by.
  16190. * @returns {Array} Returns the range of numbers.
  16191. * @see _.inRange, _.rangeRight
  16192. * @example
  16193. *
  16194. * _.range(4);
  16195. * // => [0, 1, 2, 3]
  16196. *
  16197. * _.range(-4);
  16198. * // => [0, -1, -2, -3]
  16199. *
  16200. * _.range(1, 5);
  16201. * // => [1, 2, 3, 4]
  16202. *
  16203. * _.range(0, 20, 5);
  16204. * // => [0, 5, 10, 15]
  16205. *
  16206. * _.range(0, -4, -1);
  16207. * // => [0, -1, -2, -3]
  16208. *
  16209. * _.range(1, 4, 0);
  16210. * // => [1, 1, 1]
  16211. *
  16212. * _.range(0);
  16213. * // => []
  16214. */
  16215. var range = createRange();
  16216. /**
  16217. * This method is like `_.range` except that it populates values in
  16218. * descending order.
  16219. *
  16220. * @static
  16221. * @memberOf _
  16222. * @since 4.0.0
  16223. * @category Util
  16224. * @param {number} [start=0] The start of the range.
  16225. * @param {number} end The end of the range.
  16226. * @param {number} [step=1] The value to increment or decrement by.
  16227. * @returns {Array} Returns the range of numbers.
  16228. * @see _.inRange, _.range
  16229. * @example
  16230. *
  16231. * _.rangeRight(4);
  16232. * // => [3, 2, 1, 0]
  16233. *
  16234. * _.rangeRight(-4);
  16235. * // => [-3, -2, -1, 0]
  16236. *
  16237. * _.rangeRight(1, 5);
  16238. * // => [4, 3, 2, 1]
  16239. *
  16240. * _.rangeRight(0, 20, 5);
  16241. * // => [15, 10, 5, 0]
  16242. *
  16243. * _.rangeRight(0, -4, -1);
  16244. * // => [-3, -2, -1, 0]
  16245. *
  16246. * _.rangeRight(1, 4, 0);
  16247. * // => [1, 1, 1]
  16248. *
  16249. * _.rangeRight(0);
  16250. * // => []
  16251. */
  16252. var rangeRight = createRange(true);
  16253. /**
  16254. * This method returns a new empty array.
  16255. *
  16256. * @static
  16257. * @memberOf _
  16258. * @since 4.13.0
  16259. * @category Util
  16260. * @returns {Array} Returns the new empty array.
  16261. * @example
  16262. *
  16263. * var arrays = _.times(2, _.stubArray);
  16264. *
  16265. * console.log(arrays);
  16266. * // => [[], []]
  16267. *
  16268. * console.log(arrays[0] === arrays[1]);
  16269. * // => false
  16270. */
  16271. function stubArray() {
  16272. return [];
  16273. }
  16274. /**
  16275. * This method returns `false`.
  16276. *
  16277. * @static
  16278. * @memberOf _
  16279. * @since 4.13.0
  16280. * @category Util
  16281. * @returns {boolean} Returns `false`.
  16282. * @example
  16283. *
  16284. * _.times(2, _.stubFalse);
  16285. * // => [false, false]
  16286. */
  16287. function stubFalse() {
  16288. return false;
  16289. }
  16290. /**
  16291. * This method returns a new empty object.
  16292. *
  16293. * @static
  16294. * @memberOf _
  16295. * @since 4.13.0
  16296. * @category Util
  16297. * @returns {Object} Returns the new empty object.
  16298. * @example
  16299. *
  16300. * var objects = _.times(2, _.stubObject);
  16301. *
  16302. * console.log(objects);
  16303. * // => [{}, {}]
  16304. *
  16305. * console.log(objects[0] === objects[1]);
  16306. * // => false
  16307. */
  16308. function stubObject() {
  16309. return {};
  16310. }
  16311. /**
  16312. * This method returns an empty string.
  16313. *
  16314. * @static
  16315. * @memberOf _
  16316. * @since 4.13.0
  16317. * @category Util
  16318. * @returns {string} Returns the empty string.
  16319. * @example
  16320. *
  16321. * _.times(2, _.stubString);
  16322. * // => ['', '']
  16323. */
  16324. function stubString() {
  16325. return '';
  16326. }
  16327. /**
  16328. * This method returns `true`.
  16329. *
  16330. * @static
  16331. * @memberOf _
  16332. * @since 4.13.0
  16333. * @category Util
  16334. * @returns {boolean} Returns `true`.
  16335. * @example
  16336. *
  16337. * _.times(2, _.stubTrue);
  16338. * // => [true, true]
  16339. */
  16340. function stubTrue() {
  16341. return true;
  16342. }
  16343. /**
  16344. * Invokes the iteratee `n` times, returning an array of the results of
  16345. * each invocation. The iteratee is invoked with one argument; (index).
  16346. *
  16347. * @static
  16348. * @since 0.1.0
  16349. * @memberOf _
  16350. * @category Util
  16351. * @param {number} n The number of times to invoke `iteratee`.
  16352. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16353. * @returns {Array} Returns the array of results.
  16354. * @example
  16355. *
  16356. * _.times(3, String);
  16357. * // => ['0', '1', '2']
  16358. *
  16359. * _.times(4, _.constant(0));
  16360. * // => [0, 0, 0, 0]
  16361. */
  16362. function times(n, iteratee) {
  16363. n = toInteger(n);
  16364. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16365. return [];
  16366. }
  16367. var index = MAX_ARRAY_LENGTH,
  16368. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16369. iteratee = getIteratee(iteratee);
  16370. n -= MAX_ARRAY_LENGTH;
  16371. var result = baseTimes(length, iteratee);
  16372. while (++index < n) {
  16373. iteratee(index);
  16374. }
  16375. return result;
  16376. }
  16377. /**
  16378. * Converts `value` to a property path array.
  16379. *
  16380. * @static
  16381. * @memberOf _
  16382. * @since 4.0.0
  16383. * @category Util
  16384. * @param {*} value The value to convert.
  16385. * @returns {Array} Returns the new property path array.
  16386. * @example
  16387. *
  16388. * _.toPath('a.b.c');
  16389. * // => ['a', 'b', 'c']
  16390. *
  16391. * _.toPath('a[0].b.c');
  16392. * // => ['a', '0', 'b', 'c']
  16393. */
  16394. function toPath(value) {
  16395. if (isArray(value)) {
  16396. return arrayMap(value, toKey);
  16397. }
  16398. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16399. }
  16400. /**
  16401. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16402. *
  16403. * @static
  16404. * @since 0.1.0
  16405. * @memberOf _
  16406. * @category Util
  16407. * @param {string} [prefix=''] The value to prefix the ID with.
  16408. * @returns {string} Returns the unique ID.
  16409. * @example
  16410. *
  16411. * _.uniqueId('contact_');
  16412. * // => 'contact_104'
  16413. *
  16414. * _.uniqueId();
  16415. * // => '105'
  16416. */
  16417. function uniqueId(prefix) {
  16418. var id = ++idCounter;
  16419. return toString(prefix) + id;
  16420. }
  16421. /*------------------------------------------------------------------------*/
  16422. /**
  16423. * Adds two numbers.
  16424. *
  16425. * @static
  16426. * @memberOf _
  16427. * @since 3.4.0
  16428. * @category Math
  16429. * @param {number} augend The first number in an addition.
  16430. * @param {number} addend The second number in an addition.
  16431. * @returns {number} Returns the total.
  16432. * @example
  16433. *
  16434. * _.add(6, 4);
  16435. * // => 10
  16436. */
  16437. var add = createMathOperation(function(augend, addend) {
  16438. return augend + addend;
  16439. }, 0);
  16440. /**
  16441. * Computes `number` rounded up to `precision`.
  16442. *
  16443. * @static
  16444. * @memberOf _
  16445. * @since 3.10.0
  16446. * @category Math
  16447. * @param {number} number The number to round up.
  16448. * @param {number} [precision=0] The precision to round up to.
  16449. * @returns {number} Returns the rounded up number.
  16450. * @example
  16451. *
  16452. * _.ceil(4.006);
  16453. * // => 5
  16454. *
  16455. * _.ceil(6.004, 2);
  16456. * // => 6.01
  16457. *
  16458. * _.ceil(6040, -2);
  16459. * // => 6100
  16460. */
  16461. var ceil = createRound('ceil');
  16462. /**
  16463. * Divide two numbers.
  16464. *
  16465. * @static
  16466. * @memberOf _
  16467. * @since 4.7.0
  16468. * @category Math
  16469. * @param {number} dividend The first number in a division.
  16470. * @param {number} divisor The second number in a division.
  16471. * @returns {number} Returns the quotient.
  16472. * @example
  16473. *
  16474. * _.divide(6, 4);
  16475. * // => 1.5
  16476. */
  16477. var divide = createMathOperation(function(dividend, divisor) {
  16478. return dividend / divisor;
  16479. }, 1);
  16480. /**
  16481. * Computes `number` rounded down to `precision`.
  16482. *
  16483. * @static
  16484. * @memberOf _
  16485. * @since 3.10.0
  16486. * @category Math
  16487. * @param {number} number The number to round down.
  16488. * @param {number} [precision=0] The precision to round down to.
  16489. * @returns {number} Returns the rounded down number.
  16490. * @example
  16491. *
  16492. * _.floor(4.006);
  16493. * // => 4
  16494. *
  16495. * _.floor(0.046, 2);
  16496. * // => 0.04
  16497. *
  16498. * _.floor(4060, -2);
  16499. * // => 4000
  16500. */
  16501. var floor = createRound('floor');
  16502. /**
  16503. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16504. * `undefined` is returned.
  16505. *
  16506. * @static
  16507. * @since 0.1.0
  16508. * @memberOf _
  16509. * @category Math
  16510. * @param {Array} array The array to iterate over.
  16511. * @returns {*} Returns the maximum value.
  16512. * @example
  16513. *
  16514. * _.max([4, 2, 8, 6]);
  16515. * // => 8
  16516. *
  16517. * _.max([]);
  16518. * // => undefined
  16519. */
  16520. function max(array) {
  16521. return (array && array.length)
  16522. ? baseExtremum(array, identity, baseGt)
  16523. : undefined;
  16524. }
  16525. /**
  16526. * This method is like `_.max` except that it accepts `iteratee` which is
  16527. * invoked for each element in `array` to generate the criterion by which
  16528. * the value is ranked. The iteratee is invoked with one argument: (value).
  16529. *
  16530. * @static
  16531. * @memberOf _
  16532. * @since 4.0.0
  16533. * @category Math
  16534. * @param {Array} array The array to iterate over.
  16535. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16536. * @returns {*} Returns the maximum value.
  16537. * @example
  16538. *
  16539. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16540. *
  16541. * _.maxBy(objects, function(o) { return o.n; });
  16542. * // => { 'n': 2 }
  16543. *
  16544. * // The `_.property` iteratee shorthand.
  16545. * _.maxBy(objects, 'n');
  16546. * // => { 'n': 2 }
  16547. */
  16548. function maxBy(array, iteratee) {
  16549. return (array && array.length)
  16550. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16551. : undefined;
  16552. }
  16553. /**
  16554. * Computes the mean of the values in `array`.
  16555. *
  16556. * @static
  16557. * @memberOf _
  16558. * @since 4.0.0
  16559. * @category Math
  16560. * @param {Array} array The array to iterate over.
  16561. * @returns {number} Returns the mean.
  16562. * @example
  16563. *
  16564. * _.mean([4, 2, 8, 6]);
  16565. * // => 5
  16566. */
  16567. function mean(array) {
  16568. return baseMean(array, identity);
  16569. }
  16570. /**
  16571. * This method is like `_.mean` except that it accepts `iteratee` which is
  16572. * invoked for each element in `array` to generate the value to be averaged.
  16573. * The iteratee is invoked with one argument: (value).
  16574. *
  16575. * @static
  16576. * @memberOf _
  16577. * @since 4.7.0
  16578. * @category Math
  16579. * @param {Array} array The array to iterate over.
  16580. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16581. * @returns {number} Returns the mean.
  16582. * @example
  16583. *
  16584. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16585. *
  16586. * _.meanBy(objects, function(o) { return o.n; });
  16587. * // => 5
  16588. *
  16589. * // The `_.property` iteratee shorthand.
  16590. * _.meanBy(objects, 'n');
  16591. * // => 5
  16592. */
  16593. function meanBy(array, iteratee) {
  16594. return baseMean(array, getIteratee(iteratee, 2));
  16595. }
  16596. /**
  16597. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16598. * `undefined` is returned.
  16599. *
  16600. * @static
  16601. * @since 0.1.0
  16602. * @memberOf _
  16603. * @category Math
  16604. * @param {Array} array The array to iterate over.
  16605. * @returns {*} Returns the minimum value.
  16606. * @example
  16607. *
  16608. * _.min([4, 2, 8, 6]);
  16609. * // => 2
  16610. *
  16611. * _.min([]);
  16612. * // => undefined
  16613. */
  16614. function min(array) {
  16615. return (array && array.length)
  16616. ? baseExtremum(array, identity, baseLt)
  16617. : undefined;
  16618. }
  16619. /**
  16620. * This method is like `_.min` except that it accepts `iteratee` which is
  16621. * invoked for each element in `array` to generate the criterion by which
  16622. * the value is ranked. The iteratee is invoked with one argument: (value).
  16623. *
  16624. * @static
  16625. * @memberOf _
  16626. * @since 4.0.0
  16627. * @category Math
  16628. * @param {Array} array The array to iterate over.
  16629. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16630. * @returns {*} Returns the minimum value.
  16631. * @example
  16632. *
  16633. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16634. *
  16635. * _.minBy(objects, function(o) { return o.n; });
  16636. * // => { 'n': 1 }
  16637. *
  16638. * // The `_.property` iteratee shorthand.
  16639. * _.minBy(objects, 'n');
  16640. * // => { 'n': 1 }
  16641. */
  16642. function minBy(array, iteratee) {
  16643. return (array && array.length)
  16644. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16645. : undefined;
  16646. }
  16647. /**
  16648. * Multiply two numbers.
  16649. *
  16650. * @static
  16651. * @memberOf _
  16652. * @since 4.7.0
  16653. * @category Math
  16654. * @param {number} multiplier The first number in a multiplication.
  16655. * @param {number} multiplicand The second number in a multiplication.
  16656. * @returns {number} Returns the product.
  16657. * @example
  16658. *
  16659. * _.multiply(6, 4);
  16660. * // => 24
  16661. */
  16662. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16663. return multiplier * multiplicand;
  16664. }, 1);
  16665. /**
  16666. * Computes `number` rounded to `precision`.
  16667. *
  16668. * @static
  16669. * @memberOf _
  16670. * @since 3.10.0
  16671. * @category Math
  16672. * @param {number} number The number to round.
  16673. * @param {number} [precision=0] The precision to round to.
  16674. * @returns {number} Returns the rounded number.
  16675. * @example
  16676. *
  16677. * _.round(4.006);
  16678. * // => 4
  16679. *
  16680. * _.round(4.006, 2);
  16681. * // => 4.01
  16682. *
  16683. * _.round(4060, -2);
  16684. * // => 4100
  16685. */
  16686. var round = createRound('round');
  16687. /**
  16688. * Subtract two numbers.
  16689. *
  16690. * @static
  16691. * @memberOf _
  16692. * @since 4.0.0
  16693. * @category Math
  16694. * @param {number} minuend The first number in a subtraction.
  16695. * @param {number} subtrahend The second number in a subtraction.
  16696. * @returns {number} Returns the difference.
  16697. * @example
  16698. *
  16699. * _.subtract(6, 4);
  16700. * // => 2
  16701. */
  16702. var subtract = createMathOperation(function(minuend, subtrahend) {
  16703. return minuend - subtrahend;
  16704. }, 0);
  16705. /**
  16706. * Computes the sum of the values in `array`.
  16707. *
  16708. * @static
  16709. * @memberOf _
  16710. * @since 3.4.0
  16711. * @category Math
  16712. * @param {Array} array The array to iterate over.
  16713. * @returns {number} Returns the sum.
  16714. * @example
  16715. *
  16716. * _.sum([4, 2, 8, 6]);
  16717. * // => 20
  16718. */
  16719. function sum(array) {
  16720. return (array && array.length)
  16721. ? baseSum(array, identity)
  16722. : 0;
  16723. }
  16724. /**
  16725. * This method is like `_.sum` except that it accepts `iteratee` which is
  16726. * invoked for each element in `array` to generate the value to be summed.
  16727. * The iteratee is invoked with one argument: (value).
  16728. *
  16729. * @static
  16730. * @memberOf _
  16731. * @since 4.0.0
  16732. * @category Math
  16733. * @param {Array} array The array to iterate over.
  16734. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16735. * @returns {number} Returns the sum.
  16736. * @example
  16737. *
  16738. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16739. *
  16740. * _.sumBy(objects, function(o) { return o.n; });
  16741. * // => 20
  16742. *
  16743. * // The `_.property` iteratee shorthand.
  16744. * _.sumBy(objects, 'n');
  16745. * // => 20
  16746. */
  16747. function sumBy(array, iteratee) {
  16748. return (array && array.length)
  16749. ? baseSum(array, getIteratee(iteratee, 2))
  16750. : 0;
  16751. }
  16752. /*------------------------------------------------------------------------*/
  16753. // Add methods that return wrapped values in chain sequences.
  16754. lodash.after = after;
  16755. lodash.ary = ary;
  16756. lodash.assign = assign;
  16757. lodash.assignIn = assignIn;
  16758. lodash.assignInWith = assignInWith;
  16759. lodash.assignWith = assignWith;
  16760. lodash.at = at;
  16761. lodash.before = before;
  16762. lodash.bind = bind;
  16763. lodash.bindAll = bindAll;
  16764. lodash.bindKey = bindKey;
  16765. lodash.castArray = castArray;
  16766. lodash.chain = chain;
  16767. lodash.chunk = chunk;
  16768. lodash.compact = compact;
  16769. lodash.concat = concat;
  16770. lodash.cond = cond;
  16771. lodash.conforms = conforms;
  16772. lodash.constant = constant;
  16773. lodash.countBy = countBy;
  16774. lodash.create = create;
  16775. lodash.curry = curry;
  16776. lodash.curryRight = curryRight;
  16777. lodash.debounce = debounce;
  16778. lodash.defaults = defaults;
  16779. lodash.defaultsDeep = defaultsDeep;
  16780. lodash.defer = defer;
  16781. lodash.delay = delay;
  16782. lodash.difference = difference;
  16783. lodash.differenceBy = differenceBy;
  16784. lodash.differenceWith = differenceWith;
  16785. lodash.drop = drop;
  16786. lodash.dropRight = dropRight;
  16787. lodash.dropRightWhile = dropRightWhile;
  16788. lodash.dropWhile = dropWhile;
  16789. lodash.fill = fill;
  16790. lodash.filter = filter;
  16791. lodash.flatMap = flatMap;
  16792. lodash.flatMapDeep = flatMapDeep;
  16793. lodash.flatMapDepth = flatMapDepth;
  16794. lodash.flatten = flatten;
  16795. lodash.flattenDeep = flattenDeep;
  16796. lodash.flattenDepth = flattenDepth;
  16797. lodash.flip = flip;
  16798. lodash.flow = flow;
  16799. lodash.flowRight = flowRight;
  16800. lodash.fromPairs = fromPairs;
  16801. lodash.functions = functions;
  16802. lodash.functionsIn = functionsIn;
  16803. lodash.groupBy = groupBy;
  16804. lodash.initial = initial;
  16805. lodash.intersection = intersection;
  16806. lodash.intersectionBy = intersectionBy;
  16807. lodash.intersectionWith = intersectionWith;
  16808. lodash.invert = invert;
  16809. lodash.invertBy = invertBy;
  16810. lodash.invokeMap = invokeMap;
  16811. lodash.iteratee = iteratee;
  16812. lodash.keyBy = keyBy;
  16813. lodash.keys = keys;
  16814. lodash.keysIn = keysIn;
  16815. lodash.map = map;
  16816. lodash.mapKeys = mapKeys;
  16817. lodash.mapValues = mapValues;
  16818. lodash.matches = matches;
  16819. lodash.matchesProperty = matchesProperty;
  16820. lodash.memoize = memoize;
  16821. lodash.merge = merge;
  16822. lodash.mergeWith = mergeWith;
  16823. lodash.method = method;
  16824. lodash.methodOf = methodOf;
  16825. lodash.mixin = mixin;
  16826. lodash.negate = negate;
  16827. lodash.nthArg = nthArg;
  16828. lodash.omit = omit;
  16829. lodash.omitBy = omitBy;
  16830. lodash.once = once;
  16831. lodash.orderBy = orderBy;
  16832. lodash.over = over;
  16833. lodash.overArgs = overArgs;
  16834. lodash.overEvery = overEvery;
  16835. lodash.overSome = overSome;
  16836. lodash.partial = partial;
  16837. lodash.partialRight = partialRight;
  16838. lodash.partition = partition;
  16839. lodash.pick = pick;
  16840. lodash.pickBy = pickBy;
  16841. lodash.property = property;
  16842. lodash.propertyOf = propertyOf;
  16843. lodash.pull = pull;
  16844. lodash.pullAll = pullAll;
  16845. lodash.pullAllBy = pullAllBy;
  16846. lodash.pullAllWith = pullAllWith;
  16847. lodash.pullAt = pullAt;
  16848. lodash.range = range;
  16849. lodash.rangeRight = rangeRight;
  16850. lodash.rearg = rearg;
  16851. lodash.reject = reject;
  16852. lodash.remove = remove;
  16853. lodash.rest = rest;
  16854. lodash.reverse = reverse;
  16855. lodash.sampleSize = sampleSize;
  16856. lodash.set = set;
  16857. lodash.setWith = setWith;
  16858. lodash.shuffle = shuffle;
  16859. lodash.slice = slice;
  16860. lodash.sortBy = sortBy;
  16861. lodash.sortedUniq = sortedUniq;
  16862. lodash.sortedUniqBy = sortedUniqBy;
  16863. lodash.split = split;
  16864. lodash.spread = spread;
  16865. lodash.tail = tail;
  16866. lodash.take = take;
  16867. lodash.takeRight = takeRight;
  16868. lodash.takeRightWhile = takeRightWhile;
  16869. lodash.takeWhile = takeWhile;
  16870. lodash.tap = tap;
  16871. lodash.throttle = throttle;
  16872. lodash.thru = thru;
  16873. lodash.toArray = toArray;
  16874. lodash.toPairs = toPairs;
  16875. lodash.toPairsIn = toPairsIn;
  16876. lodash.toPath = toPath;
  16877. lodash.toPlainObject = toPlainObject;
  16878. lodash.transform = transform;
  16879. lodash.unary = unary;
  16880. lodash.union = union;
  16881. lodash.unionBy = unionBy;
  16882. lodash.unionWith = unionWith;
  16883. lodash.uniq = uniq;
  16884. lodash.uniqBy = uniqBy;
  16885. lodash.uniqWith = uniqWith;
  16886. lodash.unset = unset;
  16887. lodash.unzip = unzip;
  16888. lodash.unzipWith = unzipWith;
  16889. lodash.update = update;
  16890. lodash.updateWith = updateWith;
  16891. lodash.values = values;
  16892. lodash.valuesIn = valuesIn;
  16893. lodash.without = without;
  16894. lodash.words = words;
  16895. lodash.wrap = wrap;
  16896. lodash.xor = xor;
  16897. lodash.xorBy = xorBy;
  16898. lodash.xorWith = xorWith;
  16899. lodash.zip = zip;
  16900. lodash.zipObject = zipObject;
  16901. lodash.zipObjectDeep = zipObjectDeep;
  16902. lodash.zipWith = zipWith;
  16903. // Add aliases.
  16904. lodash.entries = toPairs;
  16905. lodash.entriesIn = toPairsIn;
  16906. lodash.extend = assignIn;
  16907. lodash.extendWith = assignInWith;
  16908. // Add methods to `lodash.prototype`.
  16909. mixin(lodash, lodash);
  16910. /*------------------------------------------------------------------------*/
  16911. // Add methods that return unwrapped values in chain sequences.
  16912. lodash.add = add;
  16913. lodash.attempt = attempt;
  16914. lodash.camelCase = camelCase;
  16915. lodash.capitalize = capitalize;
  16916. lodash.ceil = ceil;
  16917. lodash.clamp = clamp;
  16918. lodash.clone = clone;
  16919. lodash.cloneDeep = cloneDeep;
  16920. lodash.cloneDeepWith = cloneDeepWith;
  16921. lodash.cloneWith = cloneWith;
  16922. lodash.conformsTo = conformsTo;
  16923. lodash.deburr = deburr;
  16924. lodash.defaultTo = defaultTo;
  16925. lodash.divide = divide;
  16926. lodash.endsWith = endsWith;
  16927. lodash.eq = eq;
  16928. lodash.escape = escape;
  16929. lodash.escapeRegExp = escapeRegExp;
  16930. lodash.every = every;
  16931. lodash.find = find;
  16932. lodash.findIndex = findIndex;
  16933. lodash.findKey = findKey;
  16934. lodash.findLast = findLast;
  16935. lodash.findLastIndex = findLastIndex;
  16936. lodash.findLastKey = findLastKey;
  16937. lodash.floor = floor;
  16938. lodash.forEach = forEach;
  16939. lodash.forEachRight = forEachRight;
  16940. lodash.forIn = forIn;
  16941. lodash.forInRight = forInRight;
  16942. lodash.forOwn = forOwn;
  16943. lodash.forOwnRight = forOwnRight;
  16944. lodash.get = get;
  16945. lodash.gt = gt;
  16946. lodash.gte = gte;
  16947. lodash.has = has;
  16948. lodash.hasIn = hasIn;
  16949. lodash.head = head;
  16950. lodash.identity = identity;
  16951. lodash.includes = includes;
  16952. lodash.indexOf = indexOf;
  16953. lodash.inRange = inRange;
  16954. lodash.invoke = invoke;
  16955. lodash.isArguments = isArguments;
  16956. lodash.isArray = isArray;
  16957. lodash.isArrayBuffer = isArrayBuffer;
  16958. lodash.isArrayLike = isArrayLike;
  16959. lodash.isArrayLikeObject = isArrayLikeObject;
  16960. lodash.isBoolean = isBoolean;
  16961. lodash.isBuffer = isBuffer;
  16962. lodash.isDate = isDate;
  16963. lodash.isElement = isElement;
  16964. lodash.isEmpty = isEmpty;
  16965. lodash.isEqual = isEqual;
  16966. lodash.isEqualWith = isEqualWith;
  16967. lodash.isError = isError;
  16968. lodash.isFinite = isFinite;
  16969. lodash.isFunction = isFunction;
  16970. lodash.isInteger = isInteger;
  16971. lodash.isLength = isLength;
  16972. lodash.isMap = isMap;
  16973. lodash.isMatch = isMatch;
  16974. lodash.isMatchWith = isMatchWith;
  16975. lodash.isNaN = isNaN;
  16976. lodash.isNative = isNative;
  16977. lodash.isNil = isNil;
  16978. lodash.isNull = isNull;
  16979. lodash.isNumber = isNumber;
  16980. lodash.isObject = isObject;
  16981. lodash.isObjectLike = isObjectLike;
  16982. lodash.isPlainObject = isPlainObject;
  16983. lodash.isRegExp = isRegExp;
  16984. lodash.isSafeInteger = isSafeInteger;
  16985. lodash.isSet = isSet;
  16986. lodash.isString = isString;
  16987. lodash.isSymbol = isSymbol;
  16988. lodash.isTypedArray = isTypedArray;
  16989. lodash.isUndefined = isUndefined;
  16990. lodash.isWeakMap = isWeakMap;
  16991. lodash.isWeakSet = isWeakSet;
  16992. lodash.join = join;
  16993. lodash.kebabCase = kebabCase;
  16994. lodash.last = last;
  16995. lodash.lastIndexOf = lastIndexOf;
  16996. lodash.lowerCase = lowerCase;
  16997. lodash.lowerFirst = lowerFirst;
  16998. lodash.lt = lt;
  16999. lodash.lte = lte;
  17000. lodash.max = max;
  17001. lodash.maxBy = maxBy;
  17002. lodash.mean = mean;
  17003. lodash.meanBy = meanBy;
  17004. lodash.min = min;
  17005. lodash.minBy = minBy;
  17006. lodash.stubArray = stubArray;
  17007. lodash.stubFalse = stubFalse;
  17008. lodash.stubObject = stubObject;
  17009. lodash.stubString = stubString;
  17010. lodash.stubTrue = stubTrue;
  17011. lodash.multiply = multiply;
  17012. lodash.nth = nth;
  17013. lodash.noConflict = noConflict;
  17014. lodash.noop = noop;
  17015. lodash.now = now;
  17016. lodash.pad = pad;
  17017. lodash.padEnd = padEnd;
  17018. lodash.padStart = padStart;
  17019. lodash.parseInt = parseInt;
  17020. lodash.random = random;
  17021. lodash.reduce = reduce;
  17022. lodash.reduceRight = reduceRight;
  17023. lodash.repeat = repeat;
  17024. lodash.replace = replace;
  17025. lodash.result = result;
  17026. lodash.round = round;
  17027. lodash.runInContext = runInContext;
  17028. lodash.sample = sample;
  17029. lodash.size = size;
  17030. lodash.snakeCase = snakeCase;
  17031. lodash.some = some;
  17032. lodash.sortedIndex = sortedIndex;
  17033. lodash.sortedIndexBy = sortedIndexBy;
  17034. lodash.sortedIndexOf = sortedIndexOf;
  17035. lodash.sortedLastIndex = sortedLastIndex;
  17036. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17037. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17038. lodash.startCase = startCase;
  17039. lodash.startsWith = startsWith;
  17040. lodash.subtract = subtract;
  17041. lodash.sum = sum;
  17042. lodash.sumBy = sumBy;
  17043. lodash.template = template;
  17044. lodash.times = times;
  17045. lodash.toFinite = toFinite;
  17046. lodash.toInteger = toInteger;
  17047. lodash.toLength = toLength;
  17048. lodash.toLower = toLower;
  17049. lodash.toNumber = toNumber;
  17050. lodash.toSafeInteger = toSafeInteger;
  17051. lodash.toString = toString;
  17052. lodash.toUpper = toUpper;
  17053. lodash.trim = trim;
  17054. lodash.trimEnd = trimEnd;
  17055. lodash.trimStart = trimStart;
  17056. lodash.truncate = truncate;
  17057. lodash.unescape = unescape;
  17058. lodash.uniqueId = uniqueId;
  17059. lodash.upperCase = upperCase;
  17060. lodash.upperFirst = upperFirst;
  17061. // Add aliases.
  17062. lodash.each = forEach;
  17063. lodash.eachRight = forEachRight;
  17064. lodash.first = head;
  17065. mixin(lodash, (function() {
  17066. var source = {};
  17067. baseForOwn(lodash, function(func, methodName) {
  17068. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17069. source[methodName] = func;
  17070. }
  17071. });
  17072. return source;
  17073. }()), { 'chain': false });
  17074. /*------------------------------------------------------------------------*/
  17075. /**
  17076. * The semantic version number.
  17077. *
  17078. * @static
  17079. * @memberOf _
  17080. * @type {string}
  17081. */
  17082. lodash.VERSION = VERSION;
  17083. // Assign default placeholders.
  17084. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17085. lodash[methodName].placeholder = lodash;
  17086. });
  17087. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17088. arrayEach(['drop', 'take'], function(methodName, index) {
  17089. LazyWrapper.prototype[methodName] = function(n) {
  17090. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17091. var result = (this.__filtered__ && !index)
  17092. ? new LazyWrapper(this)
  17093. : this.clone();
  17094. if (result.__filtered__) {
  17095. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17096. } else {
  17097. result.__views__.push({
  17098. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17099. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17100. });
  17101. }
  17102. return result;
  17103. };
  17104. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17105. return this.reverse()[methodName](n).reverse();
  17106. };
  17107. });
  17108. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17109. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17110. var type = index + 1,
  17111. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17112. LazyWrapper.prototype[methodName] = function(iteratee) {
  17113. var result = this.clone();
  17114. result.__iteratees__.push({
  17115. 'iteratee': getIteratee(iteratee, 3),
  17116. 'type': type
  17117. });
  17118. result.__filtered__ = result.__filtered__ || isFilter;
  17119. return result;
  17120. };
  17121. });
  17122. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17123. arrayEach(['head', 'last'], function(methodName, index) {
  17124. var takeName = 'take' + (index ? 'Right' : '');
  17125. LazyWrapper.prototype[methodName] = function() {
  17126. return this[takeName](1).value()[0];
  17127. };
  17128. });
  17129. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17130. arrayEach(['initial', 'tail'], function(methodName, index) {
  17131. var dropName = 'drop' + (index ? '' : 'Right');
  17132. LazyWrapper.prototype[methodName] = function() {
  17133. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17134. };
  17135. });
  17136. LazyWrapper.prototype.compact = function() {
  17137. return this.filter(identity);
  17138. };
  17139. LazyWrapper.prototype.find = function(predicate) {
  17140. return this.filter(predicate).head();
  17141. };
  17142. LazyWrapper.prototype.findLast = function(predicate) {
  17143. return this.reverse().find(predicate);
  17144. };
  17145. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17146. if (typeof path == 'function') {
  17147. return new LazyWrapper(this);
  17148. }
  17149. return this.map(function(value) {
  17150. return baseInvoke(value, path, args);
  17151. });
  17152. });
  17153. LazyWrapper.prototype.reject = function(predicate) {
  17154. return this.filter(negate(getIteratee(predicate)));
  17155. };
  17156. LazyWrapper.prototype.slice = function(start, end) {
  17157. start = toInteger(start);
  17158. var result = this;
  17159. if (result.__filtered__ && (start > 0 || end < 0)) {
  17160. return new LazyWrapper(result);
  17161. }
  17162. if (start < 0) {
  17163. result = result.takeRight(-start);
  17164. } else if (start) {
  17165. result = result.drop(start);
  17166. }
  17167. if (end !== undefined) {
  17168. end = toInteger(end);
  17169. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17170. }
  17171. return result;
  17172. };
  17173. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17174. return this.reverse().takeWhile(predicate).reverse();
  17175. };
  17176. LazyWrapper.prototype.toArray = function() {
  17177. return this.take(MAX_ARRAY_LENGTH);
  17178. };
  17179. // Add `LazyWrapper` methods to `lodash.prototype`.
  17180. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17181. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17182. isTaker = /^(?:head|last)$/.test(methodName),
  17183. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17184. retUnwrapped = isTaker || /^find/.test(methodName);
  17185. if (!lodashFunc) {
  17186. return;
  17187. }
  17188. lodash.prototype[methodName] = function() {
  17189. var value = this.__wrapped__,
  17190. args = isTaker ? [1] : arguments,
  17191. isLazy = value instanceof LazyWrapper,
  17192. iteratee = args[0],
  17193. useLazy = isLazy || isArray(value);
  17194. var interceptor = function(value) {
  17195. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17196. return (isTaker && chainAll) ? result[0] : result;
  17197. };
  17198. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17199. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17200. isLazy = useLazy = false;
  17201. }
  17202. var chainAll = this.__chain__,
  17203. isHybrid = !!this.__actions__.length,
  17204. isUnwrapped = retUnwrapped && !chainAll,
  17205. onlyLazy = isLazy && !isHybrid;
  17206. if (!retUnwrapped && useLazy) {
  17207. value = onlyLazy ? value : new LazyWrapper(this);
  17208. var result = func.apply(value, args);
  17209. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17210. return new LodashWrapper(result, chainAll);
  17211. }
  17212. if (isUnwrapped && onlyLazy) {
  17213. return func.apply(this, args);
  17214. }
  17215. result = this.thru(interceptor);
  17216. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17217. };
  17218. });
  17219. // Add `Array` methods to `lodash.prototype`.
  17220. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17221. var func = arrayProto[methodName],
  17222. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17223. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17224. lodash.prototype[methodName] = function() {
  17225. var args = arguments;
  17226. if (retUnwrapped && !this.__chain__) {
  17227. var value = this.value();
  17228. return func.apply(isArray(value) ? value : [], args);
  17229. }
  17230. return this[chainName](function(value) {
  17231. return func.apply(isArray(value) ? value : [], args);
  17232. });
  17233. };
  17234. });
  17235. // Map minified method names to their real names.
  17236. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17237. var lodashFunc = lodash[methodName];
  17238. if (lodashFunc) {
  17239. var key = lodashFunc.name + '';
  17240. if (!hasOwnProperty.call(realNames, key)) {
  17241. realNames[key] = [];
  17242. }
  17243. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17244. }
  17245. });
  17246. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17247. 'name': 'wrapper',
  17248. 'func': undefined
  17249. }];
  17250. // Add methods to `LazyWrapper`.
  17251. LazyWrapper.prototype.clone = lazyClone;
  17252. LazyWrapper.prototype.reverse = lazyReverse;
  17253. LazyWrapper.prototype.value = lazyValue;
  17254. // Add chain sequence methods to the `lodash` wrapper.
  17255. lodash.prototype.at = wrapperAt;
  17256. lodash.prototype.chain = wrapperChain;
  17257. lodash.prototype.commit = wrapperCommit;
  17258. lodash.prototype.next = wrapperNext;
  17259. lodash.prototype.plant = wrapperPlant;
  17260. lodash.prototype.reverse = wrapperReverse;
  17261. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17262. // Add lazy aliases.
  17263. lodash.prototype.first = lodash.prototype.head;
  17264. if (symIterator) {
  17265. lodash.prototype[symIterator] = wrapperToIterator;
  17266. }
  17267. return lodash;
  17268. });
  17269. /*--------------------------------------------------------------------------*/
  17270. // Export lodash.
  17271. var _ = runInContext();
  17272. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17273. if (true) {
  17274. // Expose Lodash on the global object to prevent errors when Lodash is
  17275. // loaded by a script tag in the presence of an AMD loader.
  17276. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17277. // Use `_.noConflict` to remove Lodash from the global object.
  17278. root._ = _;
  17279. // Define as an anonymous module so, through path mapping, it can be
  17280. // referenced as the "underscore" module.
  17281. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17282. return _;
  17283. }).call(exports, __webpack_require__, exports, module),
  17284. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17285. }
  17286. // Check for `exports` after `define` in case a build optimizer adds it.
  17287. else {}
  17288. }.call(this));
  17289. /***/ }),
  17290. /***/ "./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":
  17291. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17292. !*** ./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 ***!
  17293. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17294. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17295. "use strict";
  17296. __webpack_require__.r(__webpack_exports__);
  17297. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17298. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17299. /* harmony export */ });
  17300. /* 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");
  17301. /* 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__);
  17302. /* 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");
  17303. var options = {};
  17304. options.insert = "head";
  17305. options.singleton = false;
  17306. 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);
  17307. /* 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 || {});
  17308. /***/ }),
  17309. /***/ "./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":
  17310. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17311. !*** ./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 ***!
  17312. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17313. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17314. "use strict";
  17315. __webpack_require__.r(__webpack_exports__);
  17316. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17317. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17318. /* harmony export */ });
  17319. /* 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");
  17320. /* 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__);
  17321. /* 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");
  17322. var options = {};
  17323. options.insert = "head";
  17324. options.singleton = false;
  17325. 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);
  17326. /* 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 || {});
  17327. /***/ }),
  17328. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17329. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17330. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17331. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17332. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17333. "use strict";
  17334. __webpack_require__.r(__webpack_exports__);
  17335. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17336. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17337. /* harmony export */ });
  17338. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17339. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17340. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17341. var options = {};
  17342. options.insert = "head";
  17343. options.singleton = false;
  17344. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17345. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17346. /***/ }),
  17347. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17348. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17349. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17350. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17352. "use strict";
  17353. __webpack_require__.r(__webpack_exports__);
  17354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17356. /* harmony export */ });
  17357. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17358. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17359. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17360. var options = {};
  17361. options.insert = "head";
  17362. options.singleton = false;
  17363. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17364. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17365. /***/ }),
  17366. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17367. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17368. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17369. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17370. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17371. "use strict";
  17372. __webpack_require__.r(__webpack_exports__);
  17373. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17374. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17375. /* harmony export */ });
  17376. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17377. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17378. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17379. var options = {};
  17380. options.insert = "head";
  17381. options.singleton = false;
  17382. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17383. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17384. /***/ }),
  17385. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17386. /*!******************************************************!*\
  17387. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17388. \******************************************************/
  17389. /***/ ((__unused_webpack_module, exports) => {
  17390. "use strict";
  17391. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17392. // runtime helper for setting properties on components
  17393. // in a tree-shakable way
  17394. exports["default"] = (sfc, props) => {
  17395. const target = sfc.__vccOpts || sfc;
  17396. for (const [key, val] of props) {
  17397. target[key] = val;
  17398. }
  17399. return target;
  17400. };
  17401. /***/ }),
  17402. /***/ "./resources/js/components/AppButtonLink.vue":
  17403. /*!***************************************************!*\
  17404. !*** ./resources/js/components/AppButtonLink.vue ***!
  17405. \***************************************************/
  17406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17407. "use strict";
  17408. __webpack_require__.r(__webpack_exports__);
  17409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17410. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17411. /* harmony export */ });
  17412. /* 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");
  17413. /* 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");
  17414. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17415. ;
  17416. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17417. /* hot reload */
  17418. if (false) {}
  17419. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17420. /***/ }),
  17421. /***/ "./resources/js/components/AppFooter.vue":
  17422. /*!***********************************************!*\
  17423. !*** ./resources/js/components/AppFooter.vue ***!
  17424. \***********************************************/
  17425. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17426. "use strict";
  17427. __webpack_require__.r(__webpack_exports__);
  17428. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17429. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17430. /* harmony export */ });
  17431. /* harmony import */ var _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");
  17432. /* 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");
  17433. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17434. const script = {}
  17435. ;
  17436. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17437. /* hot reload */
  17438. if (false) {}
  17439. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17440. /***/ }),
  17441. /***/ "./resources/js/components/AppMessage.vue":
  17442. /*!************************************************!*\
  17443. !*** ./resources/js/components/AppMessage.vue ***!
  17444. \************************************************/
  17445. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17446. "use strict";
  17447. __webpack_require__.r(__webpack_exports__);
  17448. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17449. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17450. /* harmony export */ });
  17451. /* 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");
  17452. /* 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");
  17453. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17454. ;
  17455. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17456. /* hot reload */
  17457. if (false) {}
  17458. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17459. /***/ }),
  17460. /***/ "./resources/js/components/AppPagination.vue":
  17461. /*!***************************************************!*\
  17462. !*** ./resources/js/components/AppPagination.vue ***!
  17463. \***************************************************/
  17464. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17465. "use strict";
  17466. __webpack_require__.r(__webpack_exports__);
  17467. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17468. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17469. /* harmony export */ });
  17470. /* 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");
  17471. /* 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");
  17472. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17473. ;
  17474. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17475. /* hot reload */
  17476. if (false) {}
  17477. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17478. /***/ }),
  17479. /***/ "./resources/js/components/AppSidebar.vue":
  17480. /*!************************************************!*\
  17481. !*** ./resources/js/components/AppSidebar.vue ***!
  17482. \************************************************/
  17483. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17484. "use strict";
  17485. __webpack_require__.r(__webpack_exports__);
  17486. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17487. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17488. /* harmony export */ });
  17489. /* harmony import */ var _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");
  17490. /* 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");
  17491. /* 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");
  17492. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17493. ;
  17494. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17495. /* hot reload */
  17496. if (false) {}
  17497. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17498. /***/ }),
  17499. /***/ "./resources/js/components/AppSubSidebar.vue":
  17500. /*!***************************************************!*\
  17501. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17502. \***************************************************/
  17503. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17504. "use strict";
  17505. __webpack_require__.r(__webpack_exports__);
  17506. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17507. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17508. /* harmony export */ });
  17509. /* 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");
  17510. /* 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");
  17511. /* 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");
  17512. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17513. ;
  17514. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17515. /* hot reload */
  17516. if (false) {}
  17517. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17518. /***/ }),
  17519. /***/ "./resources/js/components/AppTopBar.vue":
  17520. /*!***********************************************!*\
  17521. !*** ./resources/js/components/AppTopBar.vue ***!
  17522. \***********************************************/
  17523. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17524. "use strict";
  17525. __webpack_require__.r(__webpack_exports__);
  17526. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17527. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17528. /* harmony export */ });
  17529. /* 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");
  17530. /* 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");
  17531. /* 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");
  17532. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17533. ;
  17534. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17535. /* hot reload */
  17536. if (false) {}
  17537. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17538. /***/ }),
  17539. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17540. /*!**************************************************!*\
  17541. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17542. \**************************************************/
  17543. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17544. "use strict";
  17545. __webpack_require__.r(__webpack_exports__);
  17546. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17547. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17548. /* harmony export */ });
  17549. /* 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");
  17550. /* 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");
  17551. /* 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");
  17552. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17553. ;
  17554. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17555. /* hot reload */
  17556. if (false) {}
  17557. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17558. /***/ }),
  17559. /***/ "./resources/js/pages/User/Index.vue":
  17560. /*!*******************************************!*\
  17561. !*** ./resources/js/pages/User/Index.vue ***!
  17562. \*******************************************/
  17563. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17564. "use strict";
  17565. __webpack_require__.r(__webpack_exports__);
  17566. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17567. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17568. /* harmony export */ });
  17569. /* harmony import */ var _Index_vue_vue_type_template_id_01ddde92__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=01ddde92 */ "./resources/js/pages/User/Index.vue?vue&type=template&id=01ddde92");
  17570. /* 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");
  17571. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17572. ;
  17573. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_aguh_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_01ddde92__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/User/Index.vue"]])
  17574. /* hot reload */
  17575. if (false) {}
  17576. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17577. /***/ }),
  17578. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17579. /*!**************************************************************************************!*\
  17580. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17581. \**************************************************************************************/
  17582. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17583. "use strict";
  17584. __webpack_require__.r(__webpack_exports__);
  17585. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17586. /* 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"])
  17587. /* harmony export */ });
  17588. /* 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");
  17589. /***/ }),
  17590. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17591. /*!***********************************************************************************!*\
  17592. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17593. \***********************************************************************************/
  17594. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17595. "use strict";
  17596. __webpack_require__.r(__webpack_exports__);
  17597. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17598. /* 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"])
  17599. /* harmony export */ });
  17600. /* 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");
  17601. /***/ }),
  17602. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17603. /*!**************************************************************************************!*\
  17604. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17605. \**************************************************************************************/
  17606. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17607. "use strict";
  17608. __webpack_require__.r(__webpack_exports__);
  17609. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17610. /* 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"])
  17611. /* harmony export */ });
  17612. /* 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");
  17613. /***/ }),
  17614. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17615. /*!***********************************************************************************!*\
  17616. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17617. \***********************************************************************************/
  17618. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17619. "use strict";
  17620. __webpack_require__.r(__webpack_exports__);
  17621. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17622. /* 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"])
  17623. /* harmony export */ });
  17624. /* 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");
  17625. /***/ }),
  17626. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17627. /*!**************************************************************************************!*\
  17628. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17629. \**************************************************************************************/
  17630. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17631. "use strict";
  17632. __webpack_require__.r(__webpack_exports__);
  17633. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17634. /* 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"])
  17635. /* harmony export */ });
  17636. /* 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");
  17637. /***/ }),
  17638. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17639. /*!**********************************************************************************!*\
  17640. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17641. \**********************************************************************************/
  17642. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17643. "use strict";
  17644. __webpack_require__.r(__webpack_exports__);
  17645. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17646. /* 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"])
  17647. /* harmony export */ });
  17648. /* 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");
  17649. /***/ }),
  17650. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17651. /*!*************************************************************************************!*\
  17652. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17653. \*************************************************************************************/
  17654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17655. "use strict";
  17656. __webpack_require__.r(__webpack_exports__);
  17657. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17658. /* 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"])
  17659. /* harmony export */ });
  17660. /* 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");
  17661. /***/ }),
  17662. /***/ "./resources/js/pages/User/Index.vue?vue&type=script&setup=true&lang=js":
  17663. /*!******************************************************************************!*\
  17664. !*** ./resources/js/pages/User/Index.vue?vue&type=script&setup=true&lang=js ***!
  17665. \******************************************************************************/
  17666. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17667. "use strict";
  17668. __webpack_require__.r(__webpack_exports__);
  17669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17670. /* 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"])
  17671. /* harmony export */ });
  17672. /* 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");
  17673. /***/ }),
  17674. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17675. /*!*********************************************************************************!*\
  17676. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17677. \*********************************************************************************/
  17678. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17679. "use strict";
  17680. __webpack_require__.r(__webpack_exports__);
  17681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17682. /* 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)
  17683. /* harmony export */ });
  17684. /* 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");
  17685. /***/ }),
  17686. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17687. /*!*****************************************************************************************!*\
  17688. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17689. \*****************************************************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* 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)
  17695. /* harmony export */ });
  17696. /* 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");
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17699. /*!******************************************************************************!*\
  17700. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17701. \******************************************************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* 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)
  17707. /* harmony export */ });
  17708. /* 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");
  17709. /***/ }),
  17710. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17711. /*!*********************************************************************************!*\
  17712. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17713. \*********************************************************************************/
  17714. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17715. "use strict";
  17716. __webpack_require__.r(__webpack_exports__);
  17717. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17718. /* 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)
  17719. /* harmony export */ });
  17720. /* 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");
  17721. /***/ }),
  17722. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17723. /*!******************************************************************************************!*\
  17724. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17725. \******************************************************************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* 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)
  17731. /* harmony export */ });
  17732. /* 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");
  17733. /***/ }),
  17734. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17735. /*!*********************************************************************************************!*\
  17736. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17737. \*********************************************************************************************/
  17738. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17739. "use strict";
  17740. __webpack_require__.r(__webpack_exports__);
  17741. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17742. /* 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)
  17743. /* harmony export */ });
  17744. /* 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");
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17747. /*!*****************************************************************************************!*\
  17748. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17749. \*****************************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17754. /* 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)
  17755. /* harmony export */ });
  17756. /* 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");
  17757. /***/ }),
  17758. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17759. /*!********************************************************************************************!*\
  17760. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17761. \********************************************************************************************/
  17762. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17763. "use strict";
  17764. __webpack_require__.r(__webpack_exports__);
  17765. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17766. /* 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)
  17767. /* harmony export */ });
  17768. /* 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");
  17769. /***/ }),
  17770. /***/ "./resources/js/pages/User/Index.vue?vue&type=template&id=01ddde92":
  17771. /*!*************************************************************************!*\
  17772. !*** ./resources/js/pages/User/Index.vue?vue&type=template&id=01ddde92 ***!
  17773. \*************************************************************************/
  17774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17778. /* 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_01ddde92__WEBPACK_IMPORTED_MODULE_0__.render)
  17779. /* harmony export */ });
  17780. /* 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_01ddde92__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=01ddde92 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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=01ddde92");
  17781. /***/ }),
  17782. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17783. /*!********************************************************************************************************!*\
  17784. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17785. \********************************************************************************************************/
  17786. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17787. "use strict";
  17788. __webpack_require__.r(__webpack_exports__);
  17789. /* 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");
  17790. /***/ }),
  17791. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17792. /*!*********************************************************************************************************!*\
  17793. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17794. \*********************************************************************************************************/
  17795. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17796. "use strict";
  17797. __webpack_require__.r(__webpack_exports__);
  17798. /* 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");
  17799. /***/ }),
  17800. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17801. /*!************************************************************************************************************!*\
  17802. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17803. \************************************************************************************************************/
  17804. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17805. "use strict";
  17806. __webpack_require__.r(__webpack_exports__);
  17807. /* 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");
  17808. /***/ }),
  17809. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17810. /*!********************************************************************************************************!*\
  17811. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17812. \********************************************************************************************************/
  17813. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17814. "use strict";
  17815. __webpack_require__.r(__webpack_exports__);
  17816. /* 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");
  17817. /***/ }),
  17818. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17819. /*!***********************************************************************************************************!*\
  17820. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17821. \***********************************************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* 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");
  17826. /***/ })
  17827. }]);