resources_js_pages_user_Index_vue.js 693KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_user_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!**********************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \**********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/user/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. users: Object,
  281. initialSearch: String
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props.initialSearch),
  288. search = _useSearchText.search;
  289. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  290. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  291. search: search.value
  292. }), {
  293. preserveState: true
  294. });
  295. });
  296. var __returned__ = {
  297. props: props,
  298. search: search,
  299. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  300. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  301. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  302. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  303. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  304. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  305. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  306. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  307. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  308. };
  309. Object.defineProperty(__returned__, '__isScriptSetup', {
  310. enumerable: false,
  311. value: true
  312. });
  313. return __returned__;
  314. }
  315. });
  316. /***/ }),
  317. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  318. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  319. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  320. \***********************************************************************************************************************************************************************************************************************************************************************************/
  321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  322. "use strict";
  323. __webpack_require__.r(__webpack_exports__);
  324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  325. /* harmony export */ "render": () => (/* binding */ render)
  326. /* harmony export */ });
  327. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  328. var _hoisted_1 = {
  329. key: 1,
  330. "class": "p-button-label"
  331. };
  332. var _hoisted_2 = {
  333. key: 1,
  334. "class": "p-button-label"
  335. };
  336. function render(_ctx, _cache, $props, $setup, $data, $options) {
  337. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  338. key: 0,
  339. "class": "p-button p-component",
  340. as: "button",
  341. type: "button"
  342. }, {
  343. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  344. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  345. key: 0,
  346. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  347. }, null, 2
  348. /* CLASS */
  349. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  350. /* TEXT */
  351. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  352. }),
  353. _: 1
  354. /* STABLE */
  355. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  356. key: 1,
  357. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  358. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  359. key: 0,
  360. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  361. }, null, 2
  362. /* CLASS */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  364. /* TEXT */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  366. /* CLASS */
  367. ));
  368. }
  369. /***/ }),
  370. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  371. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  372. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  373. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  374. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  375. "use strict";
  376. __webpack_require__.r(__webpack_exports__);
  377. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  378. /* harmony export */ "render": () => (/* binding */ render)
  379. /* harmony export */ });
  380. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  381. var _withScopeId = function _withScopeId(n) {
  382. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  383. };
  384. var _hoisted_1 = {
  385. "class": "layout-footer"
  386. };
  387. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  388. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  389. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  390. href: "https://dijitalcode.com",
  391. target: "_blank",
  392. "class": "font-medium ml-2"
  393. }, "DijitalCODE", -1
  394. /* HOISTED */
  395. );
  396. });
  397. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  398. function render(_ctx, _cache) {
  399. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  400. }
  401. /***/ }),
  402. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  403. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  404. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  405. \********************************************************************************************************************************************************************************************************************************************************************************/
  406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  407. "use strict";
  408. __webpack_require__.r(__webpack_exports__);
  409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  410. /* harmony export */ "render": () => (/* binding */ render)
  411. /* harmony export */ });
  412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  413. var _hoisted_1 = {
  414. key: 0
  415. };
  416. var _hoisted_2 = {
  417. key: 1
  418. };
  419. function render(_ctx, _cache, $props, $setup, $data, $options) {
  420. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  421. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  422. key: 0,
  423. severity: "success",
  424. onClose: $setup.onClose
  425. }, {
  426. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  427. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  428. /* TEXT */
  429. )];
  430. }),
  431. _: 1
  432. /* STABLE */
  433. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  434. key: 1,
  435. severity: "error",
  436. onClose: $setup.onClose
  437. }, {
  438. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  439. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  440. /* TEXT */
  441. )];
  442. }),
  443. _: 1
  444. /* STABLE */
  445. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  446. key: 2,
  447. severity: "error",
  448. onClose: $setup.onClose
  449. }, {
  450. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  451. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  452. /* TEXT */
  453. ))];
  454. }),
  455. _: 1
  456. /* STABLE */
  457. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  458. /* STABLE_FRAGMENT */
  459. );
  460. }
  461. /***/ }),
  462. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  463. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  464. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  465. \***********************************************************************************************************************************************************************************************************************************************************************************/
  466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  467. "use strict";
  468. __webpack_require__.r(__webpack_exports__);
  469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  470. /* harmony export */ "render": () => (/* binding */ render)
  471. /* harmony export */ });
  472. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  473. var _hoisted_1 = {
  474. key: 0,
  475. "class": "p-paginator p-component flex justify-content-start"
  476. };
  477. var _hoisted_2 = {
  478. "class": "p-paginator-pages"
  479. };
  480. var _hoisted_3 = ["innerHTML"];
  481. function render(_ctx, _cache, $props, $setup, $data, $options) {
  482. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  483. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  484. key: "link-".concat(key),
  485. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  486. 'p-disabled': link
  487. }]),
  488. innerHTML: link.label
  489. }, null, 10
  490. /* CLASS, PROPS */
  491. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  492. key: "link-".concat(key),
  493. href: link.url,
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  495. 'p-highlight': link.active
  496. }, "p-paginator-page p-paginator-element p-link"]),
  497. innerHTML: link.label
  498. }, null, 8
  499. /* PROPS */
  500. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  501. /* STABLE_FRAGMENT */
  502. );
  503. }), 256
  504. /* UNKEYED_FRAGMENT */
  505. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  506. }
  507. /***/ }),
  508. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  509. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  510. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  511. \********************************************************************************************************************************************************************************************************************************************************************************************/
  512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  513. "use strict";
  514. __webpack_require__.r(__webpack_exports__);
  515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  516. /* harmony export */ "render": () => (/* binding */ render)
  517. /* harmony export */ });
  518. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  519. function render(_ctx, _cache, $props, $setup, $data, $options) {
  520. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  521. "class": "layout-menu",
  522. items: $props.menu,
  523. root: true
  524. }, null, 8
  525. /* PROPS */
  526. , ["items"])]);
  527. }
  528. /***/ }),
  529. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  530. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  532. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  534. "use strict";
  535. __webpack_require__.r(__webpack_exports__);
  536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  537. /* harmony export */ "render": () => (/* binding */ render)
  538. /* harmony export */ });
  539. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  540. var _withScopeId = function _withScopeId(n) {
  541. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  542. };
  543. var _hoisted_1 = {
  544. key: 0
  545. };
  546. var _hoisted_2 = ["aria-label"];
  547. var _hoisted_3 = ["aria-label"];
  548. function render(_ctx, _cache, $props, $setup, $data, $options) {
  549. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  550. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  551. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  552. key: i,
  553. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  554. 'layout-menuitem-category': $props.root
  555. }]),
  556. role: "none"
  557. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  558. key: 0
  559. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  560. "class": "layout-menuitem-root-text",
  561. "aria-label": item.label
  562. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  563. /* TEXT, PROPS */
  564. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  565. items: item.items
  566. }, null, 8
  567. /* PROPS */
  568. , ["items"])], 64
  569. /* STABLE_FRAGMENT */
  570. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  571. key: 1
  572. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  573. key: 0,
  574. role: "menuitem",
  575. href: item.to,
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  577. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  578. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  579. }]),
  580. "aria-label": item.label
  581. }, {
  582. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  583. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  585. }, null, 2
  586. /* CLASS */
  587. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  588. /* TEXT */
  589. )];
  590. }),
  591. _: 2
  592. /* DYNAMIC */
  593. }, 1032
  594. /* PROPS, DYNAMIC_SLOTS */
  595. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  596. key: 1,
  597. href: "#",
  598. role: "menuitem",
  599. "aria-label": item.label
  600. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  601. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  602. }, null, 2
  603. /* CLASS */
  604. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  605. /* TEXT */
  606. )], 8
  607. /* PROPS */
  608. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  609. items: item.items
  610. }, null, 8
  611. /* PROPS */
  612. , ["items"])], 64
  613. /* STABLE_FRAGMENT */
  614. ))], 2
  615. /* CLASS */
  616. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  617. /* STABLE_FRAGMENT */
  618. );
  619. }), 256
  620. /* UNKEYED_FRAGMENT */
  621. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  622. }
  623. /***/ }),
  624. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  625. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  626. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  627. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  629. "use strict";
  630. __webpack_require__.r(__webpack_exports__);
  631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  632. /* harmony export */ "render": () => (/* binding */ render)
  633. /* harmony export */ });
  634. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  635. var _withScopeId = function _withScopeId(n) {
  636. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  637. };
  638. var _hoisted_1 = {
  639. "class": "layout-topbar"
  640. };
  641. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  643. alt: "Logo",
  644. src: "/images/logo.svg",
  645. "class": "md:mr-3"
  646. }, null, -1
  647. /* HOISTED */
  648. );
  649. });
  650. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  652. /* HOISTED */
  653. );
  654. });
  655. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  656. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  657. "class": "pi pi-bars"
  658. }, null, -1
  659. /* HOISTED */
  660. );
  661. });
  662. var _hoisted_5 = [_hoisted_4];
  663. var _hoisted_6 = {
  664. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  665. };
  666. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": "pi pi-ellipsis-v"
  669. }, null, -1
  670. /* HOISTED */
  671. );
  672. });
  673. var _hoisted_8 = [_hoisted_7];
  674. var _hoisted_9 = {
  675. "class": "layout-topbar-menu hidden lg:flex origin-top"
  676. };
  677. var _hoisted_10 = {
  678. "class": "align-self-center"
  679. };
  680. var _hoisted_11 = {
  681. "class": "hidden lg:inline"
  682. };
  683. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  684. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": "pi pi-user"
  686. }, null, -1
  687. /* HOISTED */
  688. );
  689. });
  690. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  691. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  692. /* HOISTED */
  693. );
  694. });
  695. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  696. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  697. "class": "pi pi-sign-out"
  698. }, null, -1
  699. /* HOISTED */
  700. );
  701. });
  702. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  703. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  704. /* HOISTED */
  705. );
  706. });
  707. function render(_ctx, _cache, $props, $setup, $data, $options) {
  708. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  709. 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"], {
  710. href: "/",
  711. "class": "layout-topbar-logo"
  712. }, {
  713. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  714. return [_hoisted_2, _hoisted_3];
  715. }),
  716. _: 1
  717. /* STABLE */
  718. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  719. "class": "p-link layout-menu-button layout-topbar-button",
  720. onClick: _cache[0] || (_cache[0] = function ($event) {
  721. return _ctx.$emit('menu-toggle', $event);
  722. })
  723. }, _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, {
  724. selector: '@next',
  725. enterClass: 'hidden',
  726. enterActiveClass: 'scalein',
  727. leaveToClass: 'hidden',
  728. leaveActiveClass: 'fadeout',
  729. hideOnOutsideClick: true
  730. }]]), (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
  731. /* TEXT */
  732. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  733. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  734. "class": "p-link layout-topbar-button"
  735. }, {
  736. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  737. return [_hoisted_12, _hoisted_13];
  738. }),
  739. _: 1
  740. /* STABLE */
  741. }, 8
  742. /* PROPS */
  743. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  744. href: _ctx.route('logout'),
  745. as: "button",
  746. method: "post",
  747. "class": "p-link layout-topbar-button"
  748. }, {
  749. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  750. return [_hoisted_14, _hoisted_15];
  751. }),
  752. _: 1
  753. /* STABLE */
  754. }, 8
  755. /* PROPS */
  756. , ["href"])])])]);
  757. }
  758. /***/ }),
  759. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  760. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  761. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  762. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  763. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  764. "use strict";
  765. __webpack_require__.r(__webpack_exports__);
  766. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  767. /* harmony export */ "render": () => (/* binding */ render)
  768. /* harmony export */ });
  769. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  770. var _withScopeId = function _withScopeId(n) {
  771. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  772. };
  773. var _hoisted_1 = {
  774. "class": "layout-sidebar"
  775. };
  776. var _hoisted_2 = {
  777. "class": "layout-main-container"
  778. };
  779. var _hoisted_3 = {
  780. "class": "layout-main"
  781. };
  782. var _hoisted_4 = {
  783. key: 0,
  784. "class": "layout-mask p-component-overlay"
  785. };
  786. function render(_ctx, _cache, $props, $setup, $data, $options) {
  787. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  788. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  789. onClick: $setup.onWrapperClick
  790. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  791. onMenuToggle: $setup.onMenuToggle
  792. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  793. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  794. }, null, 8
  795. /* PROPS */
  796. , ["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, {
  797. name: "layout-mask"
  798. }, {
  799. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  800. 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)];
  801. }),
  802. _: 1
  803. /* STABLE */
  804. })], 2
  805. /* CLASS */
  806. );
  807. }
  808. /***/ }),
  809. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  810. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  811. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  812. \***************************************************************************************************************************************************************************************************************************************************************************/
  813. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  814. "use strict";
  815. __webpack_require__.r(__webpack_exports__);
  816. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  817. /* harmony export */ "render": () => (/* binding */ render)
  818. /* harmony export */ });
  819. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  820. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  821. /* HOISTED */
  822. );
  823. var _hoisted_2 = {
  824. "class": "grid"
  825. };
  826. var _hoisted_3 = {
  827. "class": "col-12 md:col-8"
  828. };
  829. var _hoisted_4 = {
  830. "class": "flex align-items-center"
  831. };
  832. var _hoisted_5 = {
  833. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  834. };
  835. function render(_ctx, _cache, $props, $setup, $data, $options) {
  836. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  837. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  838. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  839. 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"], {
  840. title: "Daftar User"
  841. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  842. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  843. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  844. responsiveLayout: "scroll",
  845. columnResizeMode: "expand",
  846. value: $props.users.data,
  847. rowHover: true,
  848. stripedRows: true
  849. }, {
  850. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  851. 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, {
  852. "class": "w-full md:w-27rem",
  853. placeholder: "cari, contoh: 08xx, tina, tina@xx.com",
  854. modelValue: $setup.search,
  855. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  856. return $setup.search = $event;
  857. })
  858. }, null, 8
  859. /* PROPS */
  860. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  861. label: "Tambah User",
  862. icon: "pi pi-pencil",
  863. "class": "p-button-outlined",
  864. href: _ctx.route('users.create')
  865. }, null, 8
  866. /* PROPS */
  867. , ["href"])])])];
  868. }),
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. 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) {
  871. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  872. field: value.field,
  873. header: value.header,
  874. key: value.field
  875. }, null, 8
  876. /* PROPS */
  877. , ["field", "header"]);
  878. }), 128
  879. /* KEYED_FRAGMENT */
  880. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  881. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  882. var data = _ref.data;
  883. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  884. icon: "pi pi-pencil",
  885. "class": "p-button-icon-only p-button-rounded p-button-text",
  886. href: _ctx.route('users.edit', data.id)
  887. }, null, 8
  888. /* PROPS */
  889. , ["href"])];
  890. }),
  891. _: 1
  892. /* STABLE */
  893. })];
  894. }),
  895. _: 1
  896. /* STABLE */
  897. }, 8
  898. /* PROPS */
  899. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  900. links: $props.users.links
  901. }, null, 8
  902. /* PROPS */
  903. , ["links"])];
  904. }),
  905. _: 1
  906. /* STABLE */
  907. })], 64
  908. /* STABLE_FRAGMENT */
  909. );
  910. }
  911. /***/ }),
  912. /***/ "./resources/js/components/useSearchText.js":
  913. /*!**************************************************!*\
  914. !*** ./resources/js/components/useSearchText.js ***!
  915. \**************************************************/
  916. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  917. "use strict";
  918. __webpack_require__.r(__webpack_exports__);
  919. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  920. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  921. /* harmony export */ });
  922. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  923. function useSearchText(initialSearch) {
  924. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(initialSearch);
  925. return {
  926. search: search
  927. };
  928. }
  929. /***/ }),
  930. /***/ "./resources/js/pages/user/tableHeader.js":
  931. /*!************************************************!*\
  932. !*** ./resources/js/pages/user/tableHeader.js ***!
  933. \************************************************/
  934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  935. "use strict";
  936. __webpack_require__.r(__webpack_exports__);
  937. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  938. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  939. /* harmony export */ });
  940. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  941. field: 'name',
  942. header: 'Nama'
  943. }, {
  944. field: 'phone',
  945. header: 'No HP'
  946. }, {
  947. field: 'email',
  948. header: 'Email'
  949. }, {
  950. field: 'role',
  951. header: 'Hak Akses'
  952. }, {
  953. field: 'status',
  954. header: 'Status'
  955. }]);
  956. /***/ }),
  957. /***/ "./resources/js/utils/menu.js":
  958. /*!************************************!*\
  959. !*** ./resources/js/utils/menu.js ***!
  960. \************************************/
  961. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  962. "use strict";
  963. __webpack_require__.r(__webpack_exports__);
  964. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  965. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  966. /* harmony export */ });
  967. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  968. // Admin
  969. 1: [{
  970. label: 'Home',
  971. items: [{
  972. label: 'Dashboard',
  973. icon: 'pi pi-home',
  974. to: '/dashboards',
  975. component: 'home/Index'
  976. }]
  977. }, {
  978. label: 'Master',
  979. items: [{
  980. label: 'User',
  981. icon: 'pi pi-user',
  982. to: '/users',
  983. component: 'user/Index'
  984. }]
  985. }],
  986. // Supervisor
  987. 2: [{
  988. label: 'Home',
  989. items: [{
  990. label: 'Dashboard',
  991. icon: 'pi pi-home',
  992. to: '/dashboards',
  993. component: 'home/Index'
  994. }]
  995. }, {
  996. label: 'Menu',
  997. items: [{
  998. label: 'Pengeluaran',
  999. icon: 'pi pi-wallet',
  1000. to: '/expenses',
  1001. component: 'expense/Index'
  1002. }, {
  1003. label: 'Laporan',
  1004. icon: 'pi pi-book',
  1005. items: [{
  1006. label: 'Mutasi',
  1007. icon: 'pi pi-circle',
  1008. to: '/reports/mutations',
  1009. component: 'mutation/Report'
  1010. }]
  1011. }]
  1012. }, {
  1013. label: 'Master',
  1014. items: [{
  1015. label: 'Jenis Kendaraan',
  1016. icon: 'pi pi-car',
  1017. to: '/type-vehicles',
  1018. component: 'typevehicle/Index'
  1019. }, {
  1020. label: 'Jenis Member',
  1021. icon: 'pi pi-id-card',
  1022. to: '/type-members',
  1023. component: 'typemember/Index'
  1024. }]
  1025. }, {
  1026. label: 'Pengaturan',
  1027. items: [{
  1028. label: 'Tarif Parkir',
  1029. icon: 'pi pi-car',
  1030. to: '/parking-fees/create',
  1031. component: 'parkingfee/Create'
  1032. }]
  1033. }],
  1034. // Operator
  1035. 3: [{
  1036. label: 'Home',
  1037. items: [{
  1038. label: 'Dashboard',
  1039. icon: 'pi pi-home',
  1040. to: '/dashboards',
  1041. component: 'home/Index'
  1042. }]
  1043. }, {
  1044. label: 'Menu',
  1045. items: [{
  1046. label: 'Pengeluaran',
  1047. icon: 'pi pi-wallet',
  1048. to: '/expenses',
  1049. component: 'expense/Index'
  1050. }, {
  1051. label: 'Member',
  1052. icon: 'pi pi-id-card',
  1053. to: '/members',
  1054. component: 'member/Index'
  1055. }, {
  1056. label: 'Top Up',
  1057. icon: 'pi pi-car',
  1058. to: '/top-ups',
  1059. component: 'topup/Index'
  1060. }]
  1061. }]
  1062. });
  1063. /***/ }),
  1064. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1065. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1066. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1067. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1068. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1069. "use strict";
  1070. __webpack_require__.r(__webpack_exports__);
  1071. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1072. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1073. /* harmony export */ });
  1074. /* 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");
  1075. /* 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__);
  1076. // Imports
  1077. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1078. // Module
  1079. ___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}", ""]);
  1080. // Exports
  1081. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1082. /***/ }),
  1083. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1084. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1085. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1086. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1087. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1088. "use strict";
  1089. __webpack_require__.r(__webpack_exports__);
  1090. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1091. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1092. /* harmony export */ });
  1093. /* 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");
  1094. /* 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__);
  1095. // Imports
  1096. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1097. // Module
  1098. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1099. // Exports
  1100. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1101. /***/ }),
  1102. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1103. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1104. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1105. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1106. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1107. "use strict";
  1108. __webpack_require__.r(__webpack_exports__);
  1109. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1110. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1111. /* harmony export */ });
  1112. /* 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");
  1113. /* 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__);
  1114. // Imports
  1115. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1116. // Module
  1117. ___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}", ""]);
  1118. // Exports
  1119. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1120. /***/ }),
  1121. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1122. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1123. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1124. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1125. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1126. "use strict";
  1127. __webpack_require__.r(__webpack_exports__);
  1128. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1129. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1130. /* harmony export */ });
  1131. /* 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");
  1132. /* 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__);
  1133. // Imports
  1134. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1135. // Module
  1136. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1137. // Exports
  1138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1139. /***/ }),
  1140. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1141. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1142. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1143. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1144. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1145. "use strict";
  1146. __webpack_require__.r(__webpack_exports__);
  1147. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1148. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1149. /* harmony export */ });
  1150. /* 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");
  1151. /* 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__);
  1152. // Imports
  1153. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1154. // Module
  1155. ___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}", ""]);
  1156. // Exports
  1157. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1158. /***/ }),
  1159. /***/ "./node_modules/lodash/lodash.js":
  1160. /*!***************************************!*\
  1161. !*** ./node_modules/lodash/lodash.js ***!
  1162. \***************************************/
  1163. /***/ (function(module, exports, __webpack_require__) {
  1164. /* module decorator */ module = __webpack_require__.nmd(module);
  1165. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1166. * @license
  1167. * Lodash <https://lodash.com/>
  1168. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1169. * Released under MIT license <https://lodash.com/license>
  1170. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1171. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1172. */
  1173. ;(function() {
  1174. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1175. var undefined;
  1176. /** Used as the semantic version number. */
  1177. var VERSION = '4.17.21';
  1178. /** Used as the size to enable large array optimizations. */
  1179. var LARGE_ARRAY_SIZE = 200;
  1180. /** Error message constants. */
  1181. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1182. FUNC_ERROR_TEXT = 'Expected a function',
  1183. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1184. /** Used to stand-in for `undefined` hash values. */
  1185. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1186. /** Used as the maximum memoize cache size. */
  1187. var MAX_MEMOIZE_SIZE = 500;
  1188. /** Used as the internal argument placeholder. */
  1189. var PLACEHOLDER = '__lodash_placeholder__';
  1190. /** Used to compose bitmasks for cloning. */
  1191. var CLONE_DEEP_FLAG = 1,
  1192. CLONE_FLAT_FLAG = 2,
  1193. CLONE_SYMBOLS_FLAG = 4;
  1194. /** Used to compose bitmasks for value comparisons. */
  1195. var COMPARE_PARTIAL_FLAG = 1,
  1196. COMPARE_UNORDERED_FLAG = 2;
  1197. /** Used to compose bitmasks for function metadata. */
  1198. var WRAP_BIND_FLAG = 1,
  1199. WRAP_BIND_KEY_FLAG = 2,
  1200. WRAP_CURRY_BOUND_FLAG = 4,
  1201. WRAP_CURRY_FLAG = 8,
  1202. WRAP_CURRY_RIGHT_FLAG = 16,
  1203. WRAP_PARTIAL_FLAG = 32,
  1204. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1205. WRAP_ARY_FLAG = 128,
  1206. WRAP_REARG_FLAG = 256,
  1207. WRAP_FLIP_FLAG = 512;
  1208. /** Used as default options for `_.truncate`. */
  1209. var DEFAULT_TRUNC_LENGTH = 30,
  1210. DEFAULT_TRUNC_OMISSION = '...';
  1211. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1212. var HOT_COUNT = 800,
  1213. HOT_SPAN = 16;
  1214. /** Used to indicate the type of lazy iteratees. */
  1215. var LAZY_FILTER_FLAG = 1,
  1216. LAZY_MAP_FLAG = 2,
  1217. LAZY_WHILE_FLAG = 3;
  1218. /** Used as references for various `Number` constants. */
  1219. var INFINITY = 1 / 0,
  1220. MAX_SAFE_INTEGER = 9007199254740991,
  1221. MAX_INTEGER = 1.7976931348623157e+308,
  1222. NAN = 0 / 0;
  1223. /** Used as references for the maximum length and index of an array. */
  1224. var MAX_ARRAY_LENGTH = 4294967295,
  1225. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1226. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1227. /** Used to associate wrap methods with their bit flags. */
  1228. var wrapFlags = [
  1229. ['ary', WRAP_ARY_FLAG],
  1230. ['bind', WRAP_BIND_FLAG],
  1231. ['bindKey', WRAP_BIND_KEY_FLAG],
  1232. ['curry', WRAP_CURRY_FLAG],
  1233. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1234. ['flip', WRAP_FLIP_FLAG],
  1235. ['partial', WRAP_PARTIAL_FLAG],
  1236. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1237. ['rearg', WRAP_REARG_FLAG]
  1238. ];
  1239. /** `Object#toString` result references. */
  1240. var argsTag = '[object Arguments]',
  1241. arrayTag = '[object Array]',
  1242. asyncTag = '[object AsyncFunction]',
  1243. boolTag = '[object Boolean]',
  1244. dateTag = '[object Date]',
  1245. domExcTag = '[object DOMException]',
  1246. errorTag = '[object Error]',
  1247. funcTag = '[object Function]',
  1248. genTag = '[object GeneratorFunction]',
  1249. mapTag = '[object Map]',
  1250. numberTag = '[object Number]',
  1251. nullTag = '[object Null]',
  1252. objectTag = '[object Object]',
  1253. promiseTag = '[object Promise]',
  1254. proxyTag = '[object Proxy]',
  1255. regexpTag = '[object RegExp]',
  1256. setTag = '[object Set]',
  1257. stringTag = '[object String]',
  1258. symbolTag = '[object Symbol]',
  1259. undefinedTag = '[object Undefined]',
  1260. weakMapTag = '[object WeakMap]',
  1261. weakSetTag = '[object WeakSet]';
  1262. var arrayBufferTag = '[object ArrayBuffer]',
  1263. dataViewTag = '[object DataView]',
  1264. float32Tag = '[object Float32Array]',
  1265. float64Tag = '[object Float64Array]',
  1266. int8Tag = '[object Int8Array]',
  1267. int16Tag = '[object Int16Array]',
  1268. int32Tag = '[object Int32Array]',
  1269. uint8Tag = '[object Uint8Array]',
  1270. uint8ClampedTag = '[object Uint8ClampedArray]',
  1271. uint16Tag = '[object Uint16Array]',
  1272. uint32Tag = '[object Uint32Array]';
  1273. /** Used to match empty string literals in compiled template source. */
  1274. var reEmptyStringLeading = /\b__p \+= '';/g,
  1275. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1276. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1277. /** Used to match HTML entities and HTML characters. */
  1278. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1279. reUnescapedHtml = /[&<>"']/g,
  1280. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1281. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1282. /** Used to match template delimiters. */
  1283. var reEscape = /<%-([\s\S]+?)%>/g,
  1284. reEvaluate = /<%([\s\S]+?)%>/g,
  1285. reInterpolate = /<%=([\s\S]+?)%>/g;
  1286. /** Used to match property names within property paths. */
  1287. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1288. reIsPlainProp = /^\w*$/,
  1289. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1290. /**
  1291. * Used to match `RegExp`
  1292. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1293. */
  1294. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1295. reHasRegExpChar = RegExp(reRegExpChar.source);
  1296. /** Used to match leading whitespace. */
  1297. var reTrimStart = /^\s+/;
  1298. /** Used to match a single whitespace character. */
  1299. var reWhitespace = /\s/;
  1300. /** Used to match wrap detail comments. */
  1301. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1302. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1303. reSplitDetails = /,? & /;
  1304. /** Used to match words composed of alphanumeric characters. */
  1305. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1306. /**
  1307. * Used to validate the `validate` option in `_.template` variable.
  1308. *
  1309. * Forbids characters which could potentially change the meaning of the function argument definition:
  1310. * - "()," (modification of function parameters)
  1311. * - "=" (default value)
  1312. * - "[]{}" (destructuring of function parameters)
  1313. * - "/" (beginning of a comment)
  1314. * - whitespace
  1315. */
  1316. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1317. /** Used to match backslashes in property paths. */
  1318. var reEscapeChar = /\\(\\)?/g;
  1319. /**
  1320. * Used to match
  1321. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1322. */
  1323. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1324. /** Used to match `RegExp` flags from their coerced string values. */
  1325. var reFlags = /\w*$/;
  1326. /** Used to detect bad signed hexadecimal string values. */
  1327. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1328. /** Used to detect binary string values. */
  1329. var reIsBinary = /^0b[01]+$/i;
  1330. /** Used to detect host constructors (Safari). */
  1331. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1332. /** Used to detect octal string values. */
  1333. var reIsOctal = /^0o[0-7]+$/i;
  1334. /** Used to detect unsigned integer values. */
  1335. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1336. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1337. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1338. /** Used to ensure capturing order of template delimiters. */
  1339. var reNoMatch = /($^)/;
  1340. /** Used to match unescaped characters in compiled string literals. */
  1341. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1342. /** Used to compose unicode character classes. */
  1343. var rsAstralRange = '\\ud800-\\udfff',
  1344. rsComboMarksRange = '\\u0300-\\u036f',
  1345. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1346. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1347. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1348. rsDingbatRange = '\\u2700-\\u27bf',
  1349. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1350. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1351. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1352. rsPunctuationRange = '\\u2000-\\u206f',
  1353. 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',
  1354. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1355. rsVarRange = '\\ufe0e\\ufe0f',
  1356. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1357. /** Used to compose unicode capture groups. */
  1358. var rsApos = "['\u2019]",
  1359. rsAstral = '[' + rsAstralRange + ']',
  1360. rsBreak = '[' + rsBreakRange + ']',
  1361. rsCombo = '[' + rsComboRange + ']',
  1362. rsDigits = '\\d+',
  1363. rsDingbat = '[' + rsDingbatRange + ']',
  1364. rsLower = '[' + rsLowerRange + ']',
  1365. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1366. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1367. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1368. rsNonAstral = '[^' + rsAstralRange + ']',
  1369. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1370. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1371. rsUpper = '[' + rsUpperRange + ']',
  1372. rsZWJ = '\\u200d';
  1373. /** Used to compose unicode regexes. */
  1374. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1375. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1376. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1377. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1378. reOptMod = rsModifier + '?',
  1379. rsOptVar = '[' + rsVarRange + ']?',
  1380. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1381. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1382. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1383. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1384. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1385. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1386. /** Used to match apostrophes. */
  1387. var reApos = RegExp(rsApos, 'g');
  1388. /**
  1389. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1390. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1391. */
  1392. var reComboMark = RegExp(rsCombo, 'g');
  1393. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1394. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1395. /** Used to match complex or compound words. */
  1396. var reUnicodeWord = RegExp([
  1397. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1398. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1399. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1400. rsUpper + '+' + rsOptContrUpper,
  1401. rsOrdUpper,
  1402. rsOrdLower,
  1403. rsDigits,
  1404. rsEmoji
  1405. ].join('|'), 'g');
  1406. /** 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/). */
  1407. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1408. /** Used to detect strings that need a more robust regexp to match words. */
  1409. 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 ]/;
  1410. /** Used to assign default `context` object properties. */
  1411. var contextProps = [
  1412. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1413. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1414. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1415. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1416. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1417. ];
  1418. /** Used to make template sourceURLs easier to identify. */
  1419. var templateCounter = -1;
  1420. /** Used to identify `toStringTag` values of typed arrays. */
  1421. var typedArrayTags = {};
  1422. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1423. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1424. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1425. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1426. typedArrayTags[uint32Tag] = true;
  1427. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1428. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1429. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1430. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1431. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1432. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1433. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1434. typedArrayTags[weakMapTag] = false;
  1435. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1436. var cloneableTags = {};
  1437. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1438. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1439. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1440. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1441. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1442. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1443. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1444. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1445. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1446. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1447. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1448. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1449. cloneableTags[weakMapTag] = false;
  1450. /** Used to map Latin Unicode letters to basic Latin letters. */
  1451. var deburredLetters = {
  1452. // Latin-1 Supplement block.
  1453. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1454. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1455. '\xc7': 'C', '\xe7': 'c',
  1456. '\xd0': 'D', '\xf0': 'd',
  1457. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1458. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1459. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1460. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1461. '\xd1': 'N', '\xf1': 'n',
  1462. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1463. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1464. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1465. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1466. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1467. '\xc6': 'Ae', '\xe6': 'ae',
  1468. '\xde': 'Th', '\xfe': 'th',
  1469. '\xdf': 'ss',
  1470. // Latin Extended-A block.
  1471. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1472. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1473. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1474. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1475. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1476. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1477. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1478. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1479. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1480. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1481. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1482. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1483. '\u0134': 'J', '\u0135': 'j',
  1484. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1485. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1486. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1487. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1488. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1489. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1490. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1491. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1492. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1493. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1494. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1495. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1496. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1497. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1498. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1499. '\u0174': 'W', '\u0175': 'w',
  1500. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1501. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1502. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1503. '\u0132': 'IJ', '\u0133': 'ij',
  1504. '\u0152': 'Oe', '\u0153': 'oe',
  1505. '\u0149': "'n", '\u017f': 's'
  1506. };
  1507. /** Used to map characters to HTML entities. */
  1508. var htmlEscapes = {
  1509. '&': '&amp;',
  1510. '<': '&lt;',
  1511. '>': '&gt;',
  1512. '"': '&quot;',
  1513. "'": '&#39;'
  1514. };
  1515. /** Used to map HTML entities to characters. */
  1516. var htmlUnescapes = {
  1517. '&amp;': '&',
  1518. '&lt;': '<',
  1519. '&gt;': '>',
  1520. '&quot;': '"',
  1521. '&#39;': "'"
  1522. };
  1523. /** Used to escape characters for inclusion in compiled string literals. */
  1524. var stringEscapes = {
  1525. '\\': '\\',
  1526. "'": "'",
  1527. '\n': 'n',
  1528. '\r': 'r',
  1529. '\u2028': 'u2028',
  1530. '\u2029': 'u2029'
  1531. };
  1532. /** Built-in method references without a dependency on `root`. */
  1533. var freeParseFloat = parseFloat,
  1534. freeParseInt = parseInt;
  1535. /** Detect free variable `global` from Node.js. */
  1536. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1537. /** Detect free variable `self`. */
  1538. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1539. /** Used as a reference to the global object. */
  1540. var root = freeGlobal || freeSelf || Function('return this')();
  1541. /** Detect free variable `exports`. */
  1542. var freeExports = true && exports && !exports.nodeType && exports;
  1543. /** Detect free variable `module`. */
  1544. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1545. /** Detect the popular CommonJS extension `module.exports`. */
  1546. var moduleExports = freeModule && freeModule.exports === freeExports;
  1547. /** Detect free variable `process` from Node.js. */
  1548. var freeProcess = moduleExports && freeGlobal.process;
  1549. /** Used to access faster Node.js helpers. */
  1550. var nodeUtil = (function() {
  1551. try {
  1552. // Use `util.types` for Node.js 10+.
  1553. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1554. if (types) {
  1555. return types;
  1556. }
  1557. // Legacy `process.binding('util')` for Node.js < 10.
  1558. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1559. } catch (e) {}
  1560. }());
  1561. /* Node.js helper references. */
  1562. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1563. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1564. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1565. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1566. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1567. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1568. /*--------------------------------------------------------------------------*/
  1569. /**
  1570. * A faster alternative to `Function#apply`, this function invokes `func`
  1571. * with the `this` binding of `thisArg` and the arguments of `args`.
  1572. *
  1573. * @private
  1574. * @param {Function} func The function to invoke.
  1575. * @param {*} thisArg The `this` binding of `func`.
  1576. * @param {Array} args The arguments to invoke `func` with.
  1577. * @returns {*} Returns the result of `func`.
  1578. */
  1579. function apply(func, thisArg, args) {
  1580. switch (args.length) {
  1581. case 0: return func.call(thisArg);
  1582. case 1: return func.call(thisArg, args[0]);
  1583. case 2: return func.call(thisArg, args[0], args[1]);
  1584. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1585. }
  1586. return func.apply(thisArg, args);
  1587. }
  1588. /**
  1589. * A specialized version of `baseAggregator` for arrays.
  1590. *
  1591. * @private
  1592. * @param {Array} [array] The array to iterate over.
  1593. * @param {Function} setter The function to set `accumulator` values.
  1594. * @param {Function} iteratee The iteratee to transform keys.
  1595. * @param {Object} accumulator The initial aggregated object.
  1596. * @returns {Function} Returns `accumulator`.
  1597. */
  1598. function arrayAggregator(array, setter, iteratee, accumulator) {
  1599. var index = -1,
  1600. length = array == null ? 0 : array.length;
  1601. while (++index < length) {
  1602. var value = array[index];
  1603. setter(accumulator, value, iteratee(value), array);
  1604. }
  1605. return accumulator;
  1606. }
  1607. /**
  1608. * A specialized version of `_.forEach` for arrays without support for
  1609. * iteratee shorthands.
  1610. *
  1611. * @private
  1612. * @param {Array} [array] The array to iterate over.
  1613. * @param {Function} iteratee The function invoked per iteration.
  1614. * @returns {Array} Returns `array`.
  1615. */
  1616. function arrayEach(array, iteratee) {
  1617. var index = -1,
  1618. length = array == null ? 0 : array.length;
  1619. while (++index < length) {
  1620. if (iteratee(array[index], index, array) === false) {
  1621. break;
  1622. }
  1623. }
  1624. return array;
  1625. }
  1626. /**
  1627. * A specialized version of `_.forEachRight` for arrays without support for
  1628. * iteratee shorthands.
  1629. *
  1630. * @private
  1631. * @param {Array} [array] The array to iterate over.
  1632. * @param {Function} iteratee The function invoked per iteration.
  1633. * @returns {Array} Returns `array`.
  1634. */
  1635. function arrayEachRight(array, iteratee) {
  1636. var length = array == null ? 0 : array.length;
  1637. while (length--) {
  1638. if (iteratee(array[length], length, array) === false) {
  1639. break;
  1640. }
  1641. }
  1642. return array;
  1643. }
  1644. /**
  1645. * A specialized version of `_.every` for arrays without support for
  1646. * iteratee shorthands.
  1647. *
  1648. * @private
  1649. * @param {Array} [array] The array to iterate over.
  1650. * @param {Function} predicate The function invoked per iteration.
  1651. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1652. * else `false`.
  1653. */
  1654. function arrayEvery(array, predicate) {
  1655. var index = -1,
  1656. length = array == null ? 0 : array.length;
  1657. while (++index < length) {
  1658. if (!predicate(array[index], index, array)) {
  1659. return false;
  1660. }
  1661. }
  1662. return true;
  1663. }
  1664. /**
  1665. * A specialized version of `_.filter` for arrays without support for
  1666. * iteratee shorthands.
  1667. *
  1668. * @private
  1669. * @param {Array} [array] The array to iterate over.
  1670. * @param {Function} predicate The function invoked per iteration.
  1671. * @returns {Array} Returns the new filtered array.
  1672. */
  1673. function arrayFilter(array, predicate) {
  1674. var index = -1,
  1675. length = array == null ? 0 : array.length,
  1676. resIndex = 0,
  1677. result = [];
  1678. while (++index < length) {
  1679. var value = array[index];
  1680. if (predicate(value, index, array)) {
  1681. result[resIndex++] = value;
  1682. }
  1683. }
  1684. return result;
  1685. }
  1686. /**
  1687. * A specialized version of `_.includes` for arrays without support for
  1688. * specifying an index to search from.
  1689. *
  1690. * @private
  1691. * @param {Array} [array] The array to inspect.
  1692. * @param {*} target The value to search for.
  1693. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1694. */
  1695. function arrayIncludes(array, value) {
  1696. var length = array == null ? 0 : array.length;
  1697. return !!length && baseIndexOf(array, value, 0) > -1;
  1698. }
  1699. /**
  1700. * This function is like `arrayIncludes` except that it accepts a comparator.
  1701. *
  1702. * @private
  1703. * @param {Array} [array] The array to inspect.
  1704. * @param {*} target The value to search for.
  1705. * @param {Function} comparator The comparator invoked per element.
  1706. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1707. */
  1708. function arrayIncludesWith(array, value, comparator) {
  1709. var index = -1,
  1710. length = array == null ? 0 : array.length;
  1711. while (++index < length) {
  1712. if (comparator(value, array[index])) {
  1713. return true;
  1714. }
  1715. }
  1716. return false;
  1717. }
  1718. /**
  1719. * A specialized version of `_.map` for arrays without support for iteratee
  1720. * shorthands.
  1721. *
  1722. * @private
  1723. * @param {Array} [array] The array to iterate over.
  1724. * @param {Function} iteratee The function invoked per iteration.
  1725. * @returns {Array} Returns the new mapped array.
  1726. */
  1727. function arrayMap(array, iteratee) {
  1728. var index = -1,
  1729. length = array == null ? 0 : array.length,
  1730. result = Array(length);
  1731. while (++index < length) {
  1732. result[index] = iteratee(array[index], index, array);
  1733. }
  1734. return result;
  1735. }
  1736. /**
  1737. * Appends the elements of `values` to `array`.
  1738. *
  1739. * @private
  1740. * @param {Array} array The array to modify.
  1741. * @param {Array} values The values to append.
  1742. * @returns {Array} Returns `array`.
  1743. */
  1744. function arrayPush(array, values) {
  1745. var index = -1,
  1746. length = values.length,
  1747. offset = array.length;
  1748. while (++index < length) {
  1749. array[offset + index] = values[index];
  1750. }
  1751. return array;
  1752. }
  1753. /**
  1754. * A specialized version of `_.reduce` for arrays without support for
  1755. * iteratee shorthands.
  1756. *
  1757. * @private
  1758. * @param {Array} [array] The array to iterate over.
  1759. * @param {Function} iteratee The function invoked per iteration.
  1760. * @param {*} [accumulator] The initial value.
  1761. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1762. * the initial value.
  1763. * @returns {*} Returns the accumulated value.
  1764. */
  1765. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1766. var index = -1,
  1767. length = array == null ? 0 : array.length;
  1768. if (initAccum && length) {
  1769. accumulator = array[++index];
  1770. }
  1771. while (++index < length) {
  1772. accumulator = iteratee(accumulator, array[index], index, array);
  1773. }
  1774. return accumulator;
  1775. }
  1776. /**
  1777. * A specialized version of `_.reduceRight` for arrays without support for
  1778. * iteratee shorthands.
  1779. *
  1780. * @private
  1781. * @param {Array} [array] The array to iterate over.
  1782. * @param {Function} iteratee The function invoked per iteration.
  1783. * @param {*} [accumulator] The initial value.
  1784. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1785. * the initial value.
  1786. * @returns {*} Returns the accumulated value.
  1787. */
  1788. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1789. var length = array == null ? 0 : array.length;
  1790. if (initAccum && length) {
  1791. accumulator = array[--length];
  1792. }
  1793. while (length--) {
  1794. accumulator = iteratee(accumulator, array[length], length, array);
  1795. }
  1796. return accumulator;
  1797. }
  1798. /**
  1799. * A specialized version of `_.some` for arrays without support for iteratee
  1800. * shorthands.
  1801. *
  1802. * @private
  1803. * @param {Array} [array] The array to iterate over.
  1804. * @param {Function} predicate The function invoked per iteration.
  1805. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1806. * else `false`.
  1807. */
  1808. function arraySome(array, predicate) {
  1809. var index = -1,
  1810. length = array == null ? 0 : array.length;
  1811. while (++index < length) {
  1812. if (predicate(array[index], index, array)) {
  1813. return true;
  1814. }
  1815. }
  1816. return false;
  1817. }
  1818. /**
  1819. * Gets the size of an ASCII `string`.
  1820. *
  1821. * @private
  1822. * @param {string} string The string inspect.
  1823. * @returns {number} Returns the string size.
  1824. */
  1825. var asciiSize = baseProperty('length');
  1826. /**
  1827. * Converts an ASCII `string` to an array.
  1828. *
  1829. * @private
  1830. * @param {string} string The string to convert.
  1831. * @returns {Array} Returns the converted array.
  1832. */
  1833. function asciiToArray(string) {
  1834. return string.split('');
  1835. }
  1836. /**
  1837. * Splits an ASCII `string` into an array of its words.
  1838. *
  1839. * @private
  1840. * @param {string} The string to inspect.
  1841. * @returns {Array} Returns the words of `string`.
  1842. */
  1843. function asciiWords(string) {
  1844. return string.match(reAsciiWord) || [];
  1845. }
  1846. /**
  1847. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1848. * without support for iteratee shorthands, which iterates over `collection`
  1849. * using `eachFunc`.
  1850. *
  1851. * @private
  1852. * @param {Array|Object} collection The collection to inspect.
  1853. * @param {Function} predicate The function invoked per iteration.
  1854. * @param {Function} eachFunc The function to iterate over `collection`.
  1855. * @returns {*} Returns the found element or its key, else `undefined`.
  1856. */
  1857. function baseFindKey(collection, predicate, eachFunc) {
  1858. var result;
  1859. eachFunc(collection, function(value, key, collection) {
  1860. if (predicate(value, key, collection)) {
  1861. result = key;
  1862. return false;
  1863. }
  1864. });
  1865. return result;
  1866. }
  1867. /**
  1868. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1869. * support for iteratee shorthands.
  1870. *
  1871. * @private
  1872. * @param {Array} array The array to inspect.
  1873. * @param {Function} predicate The function invoked per iteration.
  1874. * @param {number} fromIndex The index to search from.
  1875. * @param {boolean} [fromRight] Specify iterating from right to left.
  1876. * @returns {number} Returns the index of the matched value, else `-1`.
  1877. */
  1878. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1879. var length = array.length,
  1880. index = fromIndex + (fromRight ? 1 : -1);
  1881. while ((fromRight ? index-- : ++index < length)) {
  1882. if (predicate(array[index], index, array)) {
  1883. return index;
  1884. }
  1885. }
  1886. return -1;
  1887. }
  1888. /**
  1889. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1890. *
  1891. * @private
  1892. * @param {Array} array The array to inspect.
  1893. * @param {*} value The value to search for.
  1894. * @param {number} fromIndex The index to search from.
  1895. * @returns {number} Returns the index of the matched value, else `-1`.
  1896. */
  1897. function baseIndexOf(array, value, fromIndex) {
  1898. return value === value
  1899. ? strictIndexOf(array, value, fromIndex)
  1900. : baseFindIndex(array, baseIsNaN, fromIndex);
  1901. }
  1902. /**
  1903. * This function is like `baseIndexOf` except that it accepts a comparator.
  1904. *
  1905. * @private
  1906. * @param {Array} array The array to inspect.
  1907. * @param {*} value The value to search for.
  1908. * @param {number} fromIndex The index to search from.
  1909. * @param {Function} comparator The comparator invoked per element.
  1910. * @returns {number} Returns the index of the matched value, else `-1`.
  1911. */
  1912. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1913. var index = fromIndex - 1,
  1914. length = array.length;
  1915. while (++index < length) {
  1916. if (comparator(array[index], value)) {
  1917. return index;
  1918. }
  1919. }
  1920. return -1;
  1921. }
  1922. /**
  1923. * The base implementation of `_.isNaN` without support for number objects.
  1924. *
  1925. * @private
  1926. * @param {*} value The value to check.
  1927. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1928. */
  1929. function baseIsNaN(value) {
  1930. return value !== value;
  1931. }
  1932. /**
  1933. * The base implementation of `_.mean` and `_.meanBy` without support for
  1934. * iteratee shorthands.
  1935. *
  1936. * @private
  1937. * @param {Array} array The array to iterate over.
  1938. * @param {Function} iteratee The function invoked per iteration.
  1939. * @returns {number} Returns the mean.
  1940. */
  1941. function baseMean(array, iteratee) {
  1942. var length = array == null ? 0 : array.length;
  1943. return length ? (baseSum(array, iteratee) / length) : NAN;
  1944. }
  1945. /**
  1946. * The base implementation of `_.property` without support for deep paths.
  1947. *
  1948. * @private
  1949. * @param {string} key The key of the property to get.
  1950. * @returns {Function} Returns the new accessor function.
  1951. */
  1952. function baseProperty(key) {
  1953. return function(object) {
  1954. return object == null ? undefined : object[key];
  1955. };
  1956. }
  1957. /**
  1958. * The base implementation of `_.propertyOf` without support for deep paths.
  1959. *
  1960. * @private
  1961. * @param {Object} object The object to query.
  1962. * @returns {Function} Returns the new accessor function.
  1963. */
  1964. function basePropertyOf(object) {
  1965. return function(key) {
  1966. return object == null ? undefined : object[key];
  1967. };
  1968. }
  1969. /**
  1970. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1971. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1972. *
  1973. * @private
  1974. * @param {Array|Object} collection The collection to iterate over.
  1975. * @param {Function} iteratee The function invoked per iteration.
  1976. * @param {*} accumulator The initial value.
  1977. * @param {boolean} initAccum Specify using the first or last element of
  1978. * `collection` as the initial value.
  1979. * @param {Function} eachFunc The function to iterate over `collection`.
  1980. * @returns {*} Returns the accumulated value.
  1981. */
  1982. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1983. eachFunc(collection, function(value, index, collection) {
  1984. accumulator = initAccum
  1985. ? (initAccum = false, value)
  1986. : iteratee(accumulator, value, index, collection);
  1987. });
  1988. return accumulator;
  1989. }
  1990. /**
  1991. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1992. * sort order of `array` and replaces criteria objects with their corresponding
  1993. * values.
  1994. *
  1995. * @private
  1996. * @param {Array} array The array to sort.
  1997. * @param {Function} comparer The function to define sort order.
  1998. * @returns {Array} Returns `array`.
  1999. */
  2000. function baseSortBy(array, comparer) {
  2001. var length = array.length;
  2002. array.sort(comparer);
  2003. while (length--) {
  2004. array[length] = array[length].value;
  2005. }
  2006. return array;
  2007. }
  2008. /**
  2009. * The base implementation of `_.sum` and `_.sumBy` without support for
  2010. * iteratee shorthands.
  2011. *
  2012. * @private
  2013. * @param {Array} array The array to iterate over.
  2014. * @param {Function} iteratee The function invoked per iteration.
  2015. * @returns {number} Returns the sum.
  2016. */
  2017. function baseSum(array, iteratee) {
  2018. var result,
  2019. index = -1,
  2020. length = array.length;
  2021. while (++index < length) {
  2022. var current = iteratee(array[index]);
  2023. if (current !== undefined) {
  2024. result = result === undefined ? current : (result + current);
  2025. }
  2026. }
  2027. return result;
  2028. }
  2029. /**
  2030. * The base implementation of `_.times` without support for iteratee shorthands
  2031. * or max array length checks.
  2032. *
  2033. * @private
  2034. * @param {number} n The number of times to invoke `iteratee`.
  2035. * @param {Function} iteratee The function invoked per iteration.
  2036. * @returns {Array} Returns the array of results.
  2037. */
  2038. function baseTimes(n, iteratee) {
  2039. var index = -1,
  2040. result = Array(n);
  2041. while (++index < n) {
  2042. result[index] = iteratee(index);
  2043. }
  2044. return result;
  2045. }
  2046. /**
  2047. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2048. * of key-value pairs for `object` corresponding to the property names of `props`.
  2049. *
  2050. * @private
  2051. * @param {Object} object The object to query.
  2052. * @param {Array} props The property names to get values for.
  2053. * @returns {Object} Returns the key-value pairs.
  2054. */
  2055. function baseToPairs(object, props) {
  2056. return arrayMap(props, function(key) {
  2057. return [key, object[key]];
  2058. });
  2059. }
  2060. /**
  2061. * The base implementation of `_.trim`.
  2062. *
  2063. * @private
  2064. * @param {string} string The string to trim.
  2065. * @returns {string} Returns the trimmed string.
  2066. */
  2067. function baseTrim(string) {
  2068. return string
  2069. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2070. : string;
  2071. }
  2072. /**
  2073. * The base implementation of `_.unary` without support for storing metadata.
  2074. *
  2075. * @private
  2076. * @param {Function} func The function to cap arguments for.
  2077. * @returns {Function} Returns the new capped function.
  2078. */
  2079. function baseUnary(func) {
  2080. return function(value) {
  2081. return func(value);
  2082. };
  2083. }
  2084. /**
  2085. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2086. * array of `object` property values corresponding to the property names
  2087. * of `props`.
  2088. *
  2089. * @private
  2090. * @param {Object} object The object to query.
  2091. * @param {Array} props The property names to get values for.
  2092. * @returns {Object} Returns the array of property values.
  2093. */
  2094. function baseValues(object, props) {
  2095. return arrayMap(props, function(key) {
  2096. return object[key];
  2097. });
  2098. }
  2099. /**
  2100. * Checks if a `cache` value for `key` exists.
  2101. *
  2102. * @private
  2103. * @param {Object} cache The cache to query.
  2104. * @param {string} key The key of the entry to check.
  2105. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2106. */
  2107. function cacheHas(cache, key) {
  2108. return cache.has(key);
  2109. }
  2110. /**
  2111. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2112. * that is not found in the character symbols.
  2113. *
  2114. * @private
  2115. * @param {Array} strSymbols The string symbols to inspect.
  2116. * @param {Array} chrSymbols The character symbols to find.
  2117. * @returns {number} Returns the index of the first unmatched string symbol.
  2118. */
  2119. function charsStartIndex(strSymbols, chrSymbols) {
  2120. var index = -1,
  2121. length = strSymbols.length;
  2122. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2123. return index;
  2124. }
  2125. /**
  2126. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2127. * that is not found in the character symbols.
  2128. *
  2129. * @private
  2130. * @param {Array} strSymbols The string symbols to inspect.
  2131. * @param {Array} chrSymbols The character symbols to find.
  2132. * @returns {number} Returns the index of the last unmatched string symbol.
  2133. */
  2134. function charsEndIndex(strSymbols, chrSymbols) {
  2135. var index = strSymbols.length;
  2136. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2137. return index;
  2138. }
  2139. /**
  2140. * Gets the number of `placeholder` occurrences in `array`.
  2141. *
  2142. * @private
  2143. * @param {Array} array The array to inspect.
  2144. * @param {*} placeholder The placeholder to search for.
  2145. * @returns {number} Returns the placeholder count.
  2146. */
  2147. function countHolders(array, placeholder) {
  2148. var length = array.length,
  2149. result = 0;
  2150. while (length--) {
  2151. if (array[length] === placeholder) {
  2152. ++result;
  2153. }
  2154. }
  2155. return result;
  2156. }
  2157. /**
  2158. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2159. * letters to basic Latin letters.
  2160. *
  2161. * @private
  2162. * @param {string} letter The matched letter to deburr.
  2163. * @returns {string} Returns the deburred letter.
  2164. */
  2165. var deburrLetter = basePropertyOf(deburredLetters);
  2166. /**
  2167. * Used by `_.escape` to convert characters to HTML entities.
  2168. *
  2169. * @private
  2170. * @param {string} chr The matched character to escape.
  2171. * @returns {string} Returns the escaped character.
  2172. */
  2173. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2174. /**
  2175. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2176. *
  2177. * @private
  2178. * @param {string} chr The matched character to escape.
  2179. * @returns {string} Returns the escaped character.
  2180. */
  2181. function escapeStringChar(chr) {
  2182. return '\\' + stringEscapes[chr];
  2183. }
  2184. /**
  2185. * Gets the value at `key` of `object`.
  2186. *
  2187. * @private
  2188. * @param {Object} [object] The object to query.
  2189. * @param {string} key The key of the property to get.
  2190. * @returns {*} Returns the property value.
  2191. */
  2192. function getValue(object, key) {
  2193. return object == null ? undefined : object[key];
  2194. }
  2195. /**
  2196. * Checks if `string` contains Unicode symbols.
  2197. *
  2198. * @private
  2199. * @param {string} string The string to inspect.
  2200. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2201. */
  2202. function hasUnicode(string) {
  2203. return reHasUnicode.test(string);
  2204. }
  2205. /**
  2206. * Checks if `string` contains a word composed of Unicode symbols.
  2207. *
  2208. * @private
  2209. * @param {string} string The string to inspect.
  2210. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2211. */
  2212. function hasUnicodeWord(string) {
  2213. return reHasUnicodeWord.test(string);
  2214. }
  2215. /**
  2216. * Converts `iterator` to an array.
  2217. *
  2218. * @private
  2219. * @param {Object} iterator The iterator to convert.
  2220. * @returns {Array} Returns the converted array.
  2221. */
  2222. function iteratorToArray(iterator) {
  2223. var data,
  2224. result = [];
  2225. while (!(data = iterator.next()).done) {
  2226. result.push(data.value);
  2227. }
  2228. return result;
  2229. }
  2230. /**
  2231. * Converts `map` to its key-value pairs.
  2232. *
  2233. * @private
  2234. * @param {Object} map The map to convert.
  2235. * @returns {Array} Returns the key-value pairs.
  2236. */
  2237. function mapToArray(map) {
  2238. var index = -1,
  2239. result = Array(map.size);
  2240. map.forEach(function(value, key) {
  2241. result[++index] = [key, value];
  2242. });
  2243. return result;
  2244. }
  2245. /**
  2246. * Creates a unary function that invokes `func` with its argument transformed.
  2247. *
  2248. * @private
  2249. * @param {Function} func The function to wrap.
  2250. * @param {Function} transform The argument transform.
  2251. * @returns {Function} Returns the new function.
  2252. */
  2253. function overArg(func, transform) {
  2254. return function(arg) {
  2255. return func(transform(arg));
  2256. };
  2257. }
  2258. /**
  2259. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2260. * and returns an array of their indexes.
  2261. *
  2262. * @private
  2263. * @param {Array} array The array to modify.
  2264. * @param {*} placeholder The placeholder to replace.
  2265. * @returns {Array} Returns the new array of placeholder indexes.
  2266. */
  2267. function replaceHolders(array, placeholder) {
  2268. var index = -1,
  2269. length = array.length,
  2270. resIndex = 0,
  2271. result = [];
  2272. while (++index < length) {
  2273. var value = array[index];
  2274. if (value === placeholder || value === PLACEHOLDER) {
  2275. array[index] = PLACEHOLDER;
  2276. result[resIndex++] = index;
  2277. }
  2278. }
  2279. return result;
  2280. }
  2281. /**
  2282. * Converts `set` to an array of its values.
  2283. *
  2284. * @private
  2285. * @param {Object} set The set to convert.
  2286. * @returns {Array} Returns the values.
  2287. */
  2288. function setToArray(set) {
  2289. var index = -1,
  2290. result = Array(set.size);
  2291. set.forEach(function(value) {
  2292. result[++index] = value;
  2293. });
  2294. return result;
  2295. }
  2296. /**
  2297. * Converts `set` to its value-value pairs.
  2298. *
  2299. * @private
  2300. * @param {Object} set The set to convert.
  2301. * @returns {Array} Returns the value-value pairs.
  2302. */
  2303. function setToPairs(set) {
  2304. var index = -1,
  2305. result = Array(set.size);
  2306. set.forEach(function(value) {
  2307. result[++index] = [value, value];
  2308. });
  2309. return result;
  2310. }
  2311. /**
  2312. * A specialized version of `_.indexOf` which performs strict equality
  2313. * comparisons of values, i.e. `===`.
  2314. *
  2315. * @private
  2316. * @param {Array} array The array to inspect.
  2317. * @param {*} value The value to search for.
  2318. * @param {number} fromIndex The index to search from.
  2319. * @returns {number} Returns the index of the matched value, else `-1`.
  2320. */
  2321. function strictIndexOf(array, value, fromIndex) {
  2322. var index = fromIndex - 1,
  2323. length = array.length;
  2324. while (++index < length) {
  2325. if (array[index] === value) {
  2326. return index;
  2327. }
  2328. }
  2329. return -1;
  2330. }
  2331. /**
  2332. * A specialized version of `_.lastIndexOf` which performs strict equality
  2333. * comparisons of values, i.e. `===`.
  2334. *
  2335. * @private
  2336. * @param {Array} array The array to inspect.
  2337. * @param {*} value The value to search for.
  2338. * @param {number} fromIndex The index to search from.
  2339. * @returns {number} Returns the index of the matched value, else `-1`.
  2340. */
  2341. function strictLastIndexOf(array, value, fromIndex) {
  2342. var index = fromIndex + 1;
  2343. while (index--) {
  2344. if (array[index] === value) {
  2345. return index;
  2346. }
  2347. }
  2348. return index;
  2349. }
  2350. /**
  2351. * Gets the number of symbols in `string`.
  2352. *
  2353. * @private
  2354. * @param {string} string The string to inspect.
  2355. * @returns {number} Returns the string size.
  2356. */
  2357. function stringSize(string) {
  2358. return hasUnicode(string)
  2359. ? unicodeSize(string)
  2360. : asciiSize(string);
  2361. }
  2362. /**
  2363. * Converts `string` to an array.
  2364. *
  2365. * @private
  2366. * @param {string} string The string to convert.
  2367. * @returns {Array} Returns the converted array.
  2368. */
  2369. function stringToArray(string) {
  2370. return hasUnicode(string)
  2371. ? unicodeToArray(string)
  2372. : asciiToArray(string);
  2373. }
  2374. /**
  2375. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2376. * character of `string`.
  2377. *
  2378. * @private
  2379. * @param {string} string The string to inspect.
  2380. * @returns {number} Returns the index of the last non-whitespace character.
  2381. */
  2382. function trimmedEndIndex(string) {
  2383. var index = string.length;
  2384. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2385. return index;
  2386. }
  2387. /**
  2388. * Used by `_.unescape` to convert HTML entities to characters.
  2389. *
  2390. * @private
  2391. * @param {string} chr The matched character to unescape.
  2392. * @returns {string} Returns the unescaped character.
  2393. */
  2394. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2395. /**
  2396. * Gets the size of a Unicode `string`.
  2397. *
  2398. * @private
  2399. * @param {string} string The string inspect.
  2400. * @returns {number} Returns the string size.
  2401. */
  2402. function unicodeSize(string) {
  2403. var result = reUnicode.lastIndex = 0;
  2404. while (reUnicode.test(string)) {
  2405. ++result;
  2406. }
  2407. return result;
  2408. }
  2409. /**
  2410. * Converts a Unicode `string` to an array.
  2411. *
  2412. * @private
  2413. * @param {string} string The string to convert.
  2414. * @returns {Array} Returns the converted array.
  2415. */
  2416. function unicodeToArray(string) {
  2417. return string.match(reUnicode) || [];
  2418. }
  2419. /**
  2420. * Splits a Unicode `string` into an array of its words.
  2421. *
  2422. * @private
  2423. * @param {string} The string to inspect.
  2424. * @returns {Array} Returns the words of `string`.
  2425. */
  2426. function unicodeWords(string) {
  2427. return string.match(reUnicodeWord) || [];
  2428. }
  2429. /*--------------------------------------------------------------------------*/
  2430. /**
  2431. * Create a new pristine `lodash` function using the `context` object.
  2432. *
  2433. * @static
  2434. * @memberOf _
  2435. * @since 1.1.0
  2436. * @category Util
  2437. * @param {Object} [context=root] The context object.
  2438. * @returns {Function} Returns a new `lodash` function.
  2439. * @example
  2440. *
  2441. * _.mixin({ 'foo': _.constant('foo') });
  2442. *
  2443. * var lodash = _.runInContext();
  2444. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2445. *
  2446. * _.isFunction(_.foo);
  2447. * // => true
  2448. * _.isFunction(_.bar);
  2449. * // => false
  2450. *
  2451. * lodash.isFunction(lodash.foo);
  2452. * // => false
  2453. * lodash.isFunction(lodash.bar);
  2454. * // => true
  2455. *
  2456. * // Create a suped-up `defer` in Node.js.
  2457. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2458. */
  2459. var runInContext = (function runInContext(context) {
  2460. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2461. /** Built-in constructor references. */
  2462. var Array = context.Array,
  2463. Date = context.Date,
  2464. Error = context.Error,
  2465. Function = context.Function,
  2466. Math = context.Math,
  2467. Object = context.Object,
  2468. RegExp = context.RegExp,
  2469. String = context.String,
  2470. TypeError = context.TypeError;
  2471. /** Used for built-in method references. */
  2472. var arrayProto = Array.prototype,
  2473. funcProto = Function.prototype,
  2474. objectProto = Object.prototype;
  2475. /** Used to detect overreaching core-js shims. */
  2476. var coreJsData = context['__core-js_shared__'];
  2477. /** Used to resolve the decompiled source of functions. */
  2478. var funcToString = funcProto.toString;
  2479. /** Used to check objects for own properties. */
  2480. var hasOwnProperty = objectProto.hasOwnProperty;
  2481. /** Used to generate unique IDs. */
  2482. var idCounter = 0;
  2483. /** Used to detect methods masquerading as native. */
  2484. var maskSrcKey = (function() {
  2485. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2486. return uid ? ('Symbol(src)_1.' + uid) : '';
  2487. }());
  2488. /**
  2489. * Used to resolve the
  2490. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2491. * of values.
  2492. */
  2493. var nativeObjectToString = objectProto.toString;
  2494. /** Used to infer the `Object` constructor. */
  2495. var objectCtorString = funcToString.call(Object);
  2496. /** Used to restore the original `_` reference in `_.noConflict`. */
  2497. var oldDash = root._;
  2498. /** Used to detect if a method is native. */
  2499. var reIsNative = RegExp('^' +
  2500. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2501. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2502. );
  2503. /** Built-in value references. */
  2504. var Buffer = moduleExports ? context.Buffer : undefined,
  2505. Symbol = context.Symbol,
  2506. Uint8Array = context.Uint8Array,
  2507. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2508. getPrototype = overArg(Object.getPrototypeOf, Object),
  2509. objectCreate = Object.create,
  2510. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2511. splice = arrayProto.splice,
  2512. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2513. symIterator = Symbol ? Symbol.iterator : undefined,
  2514. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2515. var defineProperty = (function() {
  2516. try {
  2517. var func = getNative(Object, 'defineProperty');
  2518. func({}, '', {});
  2519. return func;
  2520. } catch (e) {}
  2521. }());
  2522. /** Mocked built-ins. */
  2523. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2524. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2525. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2526. /* Built-in method references for those with the same name as other `lodash` methods. */
  2527. var nativeCeil = Math.ceil,
  2528. nativeFloor = Math.floor,
  2529. nativeGetSymbols = Object.getOwnPropertySymbols,
  2530. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2531. nativeIsFinite = context.isFinite,
  2532. nativeJoin = arrayProto.join,
  2533. nativeKeys = overArg(Object.keys, Object),
  2534. nativeMax = Math.max,
  2535. nativeMin = Math.min,
  2536. nativeNow = Date.now,
  2537. nativeParseInt = context.parseInt,
  2538. nativeRandom = Math.random,
  2539. nativeReverse = arrayProto.reverse;
  2540. /* Built-in method references that are verified to be native. */
  2541. var DataView = getNative(context, 'DataView'),
  2542. Map = getNative(context, 'Map'),
  2543. Promise = getNative(context, 'Promise'),
  2544. Set = getNative(context, 'Set'),
  2545. WeakMap = getNative(context, 'WeakMap'),
  2546. nativeCreate = getNative(Object, 'create');
  2547. /** Used to store function metadata. */
  2548. var metaMap = WeakMap && new WeakMap;
  2549. /** Used to lookup unminified function names. */
  2550. var realNames = {};
  2551. /** Used to detect maps, sets, and weakmaps. */
  2552. var dataViewCtorString = toSource(DataView),
  2553. mapCtorString = toSource(Map),
  2554. promiseCtorString = toSource(Promise),
  2555. setCtorString = toSource(Set),
  2556. weakMapCtorString = toSource(WeakMap);
  2557. /** Used to convert symbols to primitives and strings. */
  2558. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2559. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2560. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2561. /*------------------------------------------------------------------------*/
  2562. /**
  2563. * Creates a `lodash` object which wraps `value` to enable implicit method
  2564. * chain sequences. Methods that operate on and return arrays, collections,
  2565. * and functions can be chained together. Methods that retrieve a single value
  2566. * or may return a primitive value will automatically end the chain sequence
  2567. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2568. * with `_#value`.
  2569. *
  2570. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2571. * enabled using `_.chain`.
  2572. *
  2573. * The execution of chained methods is lazy, that is, it's deferred until
  2574. * `_#value` is implicitly or explicitly called.
  2575. *
  2576. * Lazy evaluation allows several methods to support shortcut fusion.
  2577. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2578. * the creation of intermediate arrays and can greatly reduce the number of
  2579. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2580. * fusion if the section is applied to an array and iteratees accept only
  2581. * one argument. The heuristic for whether a section qualifies for shortcut
  2582. * fusion is subject to change.
  2583. *
  2584. * Chaining is supported in custom builds as long as the `_#value` method is
  2585. * directly or indirectly included in the build.
  2586. *
  2587. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2588. *
  2589. * The wrapper `Array` methods are:
  2590. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2591. *
  2592. * The wrapper `String` methods are:
  2593. * `replace` and `split`
  2594. *
  2595. * The wrapper methods that support shortcut fusion are:
  2596. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2597. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2598. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2599. *
  2600. * The chainable wrapper methods are:
  2601. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2602. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2603. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2604. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2605. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2606. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2607. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2608. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2609. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2610. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2611. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2612. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2613. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2614. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2615. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2616. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2617. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2618. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2619. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2620. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2621. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2622. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2623. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2624. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2625. *
  2626. * The wrapper methods that are **not** chainable by default are:
  2627. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2628. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2629. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2630. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2631. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2632. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2633. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2634. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2635. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2636. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2637. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2638. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2639. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2640. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2641. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2642. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2643. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2644. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2645. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2646. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2647. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2648. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2649. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2650. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2651. * `upperFirst`, `value`, and `words`
  2652. *
  2653. * @name _
  2654. * @constructor
  2655. * @category Seq
  2656. * @param {*} value The value to wrap in a `lodash` instance.
  2657. * @returns {Object} Returns the new `lodash` wrapper instance.
  2658. * @example
  2659. *
  2660. * function square(n) {
  2661. * return n * n;
  2662. * }
  2663. *
  2664. * var wrapped = _([1, 2, 3]);
  2665. *
  2666. * // Returns an unwrapped value.
  2667. * wrapped.reduce(_.add);
  2668. * // => 6
  2669. *
  2670. * // Returns a wrapped value.
  2671. * var squares = wrapped.map(square);
  2672. *
  2673. * _.isArray(squares);
  2674. * // => false
  2675. *
  2676. * _.isArray(squares.value());
  2677. * // => true
  2678. */
  2679. function lodash(value) {
  2680. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2681. if (value instanceof LodashWrapper) {
  2682. return value;
  2683. }
  2684. if (hasOwnProperty.call(value, '__wrapped__')) {
  2685. return wrapperClone(value);
  2686. }
  2687. }
  2688. return new LodashWrapper(value);
  2689. }
  2690. /**
  2691. * The base implementation of `_.create` without support for assigning
  2692. * properties to the created object.
  2693. *
  2694. * @private
  2695. * @param {Object} proto The object to inherit from.
  2696. * @returns {Object} Returns the new object.
  2697. */
  2698. var baseCreate = (function() {
  2699. function object() {}
  2700. return function(proto) {
  2701. if (!isObject(proto)) {
  2702. return {};
  2703. }
  2704. if (objectCreate) {
  2705. return objectCreate(proto);
  2706. }
  2707. object.prototype = proto;
  2708. var result = new object;
  2709. object.prototype = undefined;
  2710. return result;
  2711. };
  2712. }());
  2713. /**
  2714. * The function whose prototype chain sequence wrappers inherit from.
  2715. *
  2716. * @private
  2717. */
  2718. function baseLodash() {
  2719. // No operation performed.
  2720. }
  2721. /**
  2722. * The base constructor for creating `lodash` wrapper objects.
  2723. *
  2724. * @private
  2725. * @param {*} value The value to wrap.
  2726. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2727. */
  2728. function LodashWrapper(value, chainAll) {
  2729. this.__wrapped__ = value;
  2730. this.__actions__ = [];
  2731. this.__chain__ = !!chainAll;
  2732. this.__index__ = 0;
  2733. this.__values__ = undefined;
  2734. }
  2735. /**
  2736. * By default, the template delimiters used by lodash are like those in
  2737. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2738. * following template settings to use alternative delimiters.
  2739. *
  2740. * @static
  2741. * @memberOf _
  2742. * @type {Object}
  2743. */
  2744. lodash.templateSettings = {
  2745. /**
  2746. * Used to detect `data` property values to be HTML-escaped.
  2747. *
  2748. * @memberOf _.templateSettings
  2749. * @type {RegExp}
  2750. */
  2751. 'escape': reEscape,
  2752. /**
  2753. * Used to detect code to be evaluated.
  2754. *
  2755. * @memberOf _.templateSettings
  2756. * @type {RegExp}
  2757. */
  2758. 'evaluate': reEvaluate,
  2759. /**
  2760. * Used to detect `data` property values to inject.
  2761. *
  2762. * @memberOf _.templateSettings
  2763. * @type {RegExp}
  2764. */
  2765. 'interpolate': reInterpolate,
  2766. /**
  2767. * Used to reference the data object in the template text.
  2768. *
  2769. * @memberOf _.templateSettings
  2770. * @type {string}
  2771. */
  2772. 'variable': '',
  2773. /**
  2774. * Used to import variables into the compiled template.
  2775. *
  2776. * @memberOf _.templateSettings
  2777. * @type {Object}
  2778. */
  2779. 'imports': {
  2780. /**
  2781. * A reference to the `lodash` function.
  2782. *
  2783. * @memberOf _.templateSettings.imports
  2784. * @type {Function}
  2785. */
  2786. '_': lodash
  2787. }
  2788. };
  2789. // Ensure wrappers are instances of `baseLodash`.
  2790. lodash.prototype = baseLodash.prototype;
  2791. lodash.prototype.constructor = lodash;
  2792. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2793. LodashWrapper.prototype.constructor = LodashWrapper;
  2794. /*------------------------------------------------------------------------*/
  2795. /**
  2796. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2797. *
  2798. * @private
  2799. * @constructor
  2800. * @param {*} value The value to wrap.
  2801. */
  2802. function LazyWrapper(value) {
  2803. this.__wrapped__ = value;
  2804. this.__actions__ = [];
  2805. this.__dir__ = 1;
  2806. this.__filtered__ = false;
  2807. this.__iteratees__ = [];
  2808. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2809. this.__views__ = [];
  2810. }
  2811. /**
  2812. * Creates a clone of the lazy wrapper object.
  2813. *
  2814. * @private
  2815. * @name clone
  2816. * @memberOf LazyWrapper
  2817. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2818. */
  2819. function lazyClone() {
  2820. var result = new LazyWrapper(this.__wrapped__);
  2821. result.__actions__ = copyArray(this.__actions__);
  2822. result.__dir__ = this.__dir__;
  2823. result.__filtered__ = this.__filtered__;
  2824. result.__iteratees__ = copyArray(this.__iteratees__);
  2825. result.__takeCount__ = this.__takeCount__;
  2826. result.__views__ = copyArray(this.__views__);
  2827. return result;
  2828. }
  2829. /**
  2830. * Reverses the direction of lazy iteration.
  2831. *
  2832. * @private
  2833. * @name reverse
  2834. * @memberOf LazyWrapper
  2835. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2836. */
  2837. function lazyReverse() {
  2838. if (this.__filtered__) {
  2839. var result = new LazyWrapper(this);
  2840. result.__dir__ = -1;
  2841. result.__filtered__ = true;
  2842. } else {
  2843. result = this.clone();
  2844. result.__dir__ *= -1;
  2845. }
  2846. return result;
  2847. }
  2848. /**
  2849. * Extracts the unwrapped value from its lazy wrapper.
  2850. *
  2851. * @private
  2852. * @name value
  2853. * @memberOf LazyWrapper
  2854. * @returns {*} Returns the unwrapped value.
  2855. */
  2856. function lazyValue() {
  2857. var array = this.__wrapped__.value(),
  2858. dir = this.__dir__,
  2859. isArr = isArray(array),
  2860. isRight = dir < 0,
  2861. arrLength = isArr ? array.length : 0,
  2862. view = getView(0, arrLength, this.__views__),
  2863. start = view.start,
  2864. end = view.end,
  2865. length = end - start,
  2866. index = isRight ? end : (start - 1),
  2867. iteratees = this.__iteratees__,
  2868. iterLength = iteratees.length,
  2869. resIndex = 0,
  2870. takeCount = nativeMin(length, this.__takeCount__);
  2871. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2872. return baseWrapperValue(array, this.__actions__);
  2873. }
  2874. var result = [];
  2875. outer:
  2876. while (length-- && resIndex < takeCount) {
  2877. index += dir;
  2878. var iterIndex = -1,
  2879. value = array[index];
  2880. while (++iterIndex < iterLength) {
  2881. var data = iteratees[iterIndex],
  2882. iteratee = data.iteratee,
  2883. type = data.type,
  2884. computed = iteratee(value);
  2885. if (type == LAZY_MAP_FLAG) {
  2886. value = computed;
  2887. } else if (!computed) {
  2888. if (type == LAZY_FILTER_FLAG) {
  2889. continue outer;
  2890. } else {
  2891. break outer;
  2892. }
  2893. }
  2894. }
  2895. result[resIndex++] = value;
  2896. }
  2897. return result;
  2898. }
  2899. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2900. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2901. LazyWrapper.prototype.constructor = LazyWrapper;
  2902. /*------------------------------------------------------------------------*/
  2903. /**
  2904. * Creates a hash object.
  2905. *
  2906. * @private
  2907. * @constructor
  2908. * @param {Array} [entries] The key-value pairs to cache.
  2909. */
  2910. function Hash(entries) {
  2911. var index = -1,
  2912. length = entries == null ? 0 : entries.length;
  2913. this.clear();
  2914. while (++index < length) {
  2915. var entry = entries[index];
  2916. this.set(entry[0], entry[1]);
  2917. }
  2918. }
  2919. /**
  2920. * Removes all key-value entries from the hash.
  2921. *
  2922. * @private
  2923. * @name clear
  2924. * @memberOf Hash
  2925. */
  2926. function hashClear() {
  2927. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2928. this.size = 0;
  2929. }
  2930. /**
  2931. * Removes `key` and its value from the hash.
  2932. *
  2933. * @private
  2934. * @name delete
  2935. * @memberOf Hash
  2936. * @param {Object} hash The hash to modify.
  2937. * @param {string} key The key of the value to remove.
  2938. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2939. */
  2940. function hashDelete(key) {
  2941. var result = this.has(key) && delete this.__data__[key];
  2942. this.size -= result ? 1 : 0;
  2943. return result;
  2944. }
  2945. /**
  2946. * Gets the hash value for `key`.
  2947. *
  2948. * @private
  2949. * @name get
  2950. * @memberOf Hash
  2951. * @param {string} key The key of the value to get.
  2952. * @returns {*} Returns the entry value.
  2953. */
  2954. function hashGet(key) {
  2955. var data = this.__data__;
  2956. if (nativeCreate) {
  2957. var result = data[key];
  2958. return result === HASH_UNDEFINED ? undefined : result;
  2959. }
  2960. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2961. }
  2962. /**
  2963. * Checks if a hash value for `key` exists.
  2964. *
  2965. * @private
  2966. * @name has
  2967. * @memberOf Hash
  2968. * @param {string} key The key of the entry to check.
  2969. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2970. */
  2971. function hashHas(key) {
  2972. var data = this.__data__;
  2973. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2974. }
  2975. /**
  2976. * Sets the hash `key` to `value`.
  2977. *
  2978. * @private
  2979. * @name set
  2980. * @memberOf Hash
  2981. * @param {string} key The key of the value to set.
  2982. * @param {*} value The value to set.
  2983. * @returns {Object} Returns the hash instance.
  2984. */
  2985. function hashSet(key, value) {
  2986. var data = this.__data__;
  2987. this.size += this.has(key) ? 0 : 1;
  2988. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2989. return this;
  2990. }
  2991. // Add methods to `Hash`.
  2992. Hash.prototype.clear = hashClear;
  2993. Hash.prototype['delete'] = hashDelete;
  2994. Hash.prototype.get = hashGet;
  2995. Hash.prototype.has = hashHas;
  2996. Hash.prototype.set = hashSet;
  2997. /*------------------------------------------------------------------------*/
  2998. /**
  2999. * Creates an list cache object.
  3000. *
  3001. * @private
  3002. * @constructor
  3003. * @param {Array} [entries] The key-value pairs to cache.
  3004. */
  3005. function ListCache(entries) {
  3006. var index = -1,
  3007. length = entries == null ? 0 : entries.length;
  3008. this.clear();
  3009. while (++index < length) {
  3010. var entry = entries[index];
  3011. this.set(entry[0], entry[1]);
  3012. }
  3013. }
  3014. /**
  3015. * Removes all key-value entries from the list cache.
  3016. *
  3017. * @private
  3018. * @name clear
  3019. * @memberOf ListCache
  3020. */
  3021. function listCacheClear() {
  3022. this.__data__ = [];
  3023. this.size = 0;
  3024. }
  3025. /**
  3026. * Removes `key` and its value from the list cache.
  3027. *
  3028. * @private
  3029. * @name delete
  3030. * @memberOf ListCache
  3031. * @param {string} key The key of the value to remove.
  3032. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3033. */
  3034. function listCacheDelete(key) {
  3035. var data = this.__data__,
  3036. index = assocIndexOf(data, key);
  3037. if (index < 0) {
  3038. return false;
  3039. }
  3040. var lastIndex = data.length - 1;
  3041. if (index == lastIndex) {
  3042. data.pop();
  3043. } else {
  3044. splice.call(data, index, 1);
  3045. }
  3046. --this.size;
  3047. return true;
  3048. }
  3049. /**
  3050. * Gets the list cache value for `key`.
  3051. *
  3052. * @private
  3053. * @name get
  3054. * @memberOf ListCache
  3055. * @param {string} key The key of the value to get.
  3056. * @returns {*} Returns the entry value.
  3057. */
  3058. function listCacheGet(key) {
  3059. var data = this.__data__,
  3060. index = assocIndexOf(data, key);
  3061. return index < 0 ? undefined : data[index][1];
  3062. }
  3063. /**
  3064. * Checks if a list cache value for `key` exists.
  3065. *
  3066. * @private
  3067. * @name has
  3068. * @memberOf ListCache
  3069. * @param {string} key The key of the entry to check.
  3070. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3071. */
  3072. function listCacheHas(key) {
  3073. return assocIndexOf(this.__data__, key) > -1;
  3074. }
  3075. /**
  3076. * Sets the list cache `key` to `value`.
  3077. *
  3078. * @private
  3079. * @name set
  3080. * @memberOf ListCache
  3081. * @param {string} key The key of the value to set.
  3082. * @param {*} value The value to set.
  3083. * @returns {Object} Returns the list cache instance.
  3084. */
  3085. function listCacheSet(key, value) {
  3086. var data = this.__data__,
  3087. index = assocIndexOf(data, key);
  3088. if (index < 0) {
  3089. ++this.size;
  3090. data.push([key, value]);
  3091. } else {
  3092. data[index][1] = value;
  3093. }
  3094. return this;
  3095. }
  3096. // Add methods to `ListCache`.
  3097. ListCache.prototype.clear = listCacheClear;
  3098. ListCache.prototype['delete'] = listCacheDelete;
  3099. ListCache.prototype.get = listCacheGet;
  3100. ListCache.prototype.has = listCacheHas;
  3101. ListCache.prototype.set = listCacheSet;
  3102. /*------------------------------------------------------------------------*/
  3103. /**
  3104. * Creates a map cache object to store key-value pairs.
  3105. *
  3106. * @private
  3107. * @constructor
  3108. * @param {Array} [entries] The key-value pairs to cache.
  3109. */
  3110. function MapCache(entries) {
  3111. var index = -1,
  3112. length = entries == null ? 0 : entries.length;
  3113. this.clear();
  3114. while (++index < length) {
  3115. var entry = entries[index];
  3116. this.set(entry[0], entry[1]);
  3117. }
  3118. }
  3119. /**
  3120. * Removes all key-value entries from the map.
  3121. *
  3122. * @private
  3123. * @name clear
  3124. * @memberOf MapCache
  3125. */
  3126. function mapCacheClear() {
  3127. this.size = 0;
  3128. this.__data__ = {
  3129. 'hash': new Hash,
  3130. 'map': new (Map || ListCache),
  3131. 'string': new Hash
  3132. };
  3133. }
  3134. /**
  3135. * Removes `key` and its value from the map.
  3136. *
  3137. * @private
  3138. * @name delete
  3139. * @memberOf MapCache
  3140. * @param {string} key The key of the value to remove.
  3141. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3142. */
  3143. function mapCacheDelete(key) {
  3144. var result = getMapData(this, key)['delete'](key);
  3145. this.size -= result ? 1 : 0;
  3146. return result;
  3147. }
  3148. /**
  3149. * Gets the map value for `key`.
  3150. *
  3151. * @private
  3152. * @name get
  3153. * @memberOf MapCache
  3154. * @param {string} key The key of the value to get.
  3155. * @returns {*} Returns the entry value.
  3156. */
  3157. function mapCacheGet(key) {
  3158. return getMapData(this, key).get(key);
  3159. }
  3160. /**
  3161. * Checks if a map value for `key` exists.
  3162. *
  3163. * @private
  3164. * @name has
  3165. * @memberOf MapCache
  3166. * @param {string} key The key of the entry to check.
  3167. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3168. */
  3169. function mapCacheHas(key) {
  3170. return getMapData(this, key).has(key);
  3171. }
  3172. /**
  3173. * Sets the map `key` to `value`.
  3174. *
  3175. * @private
  3176. * @name set
  3177. * @memberOf MapCache
  3178. * @param {string} key The key of the value to set.
  3179. * @param {*} value The value to set.
  3180. * @returns {Object} Returns the map cache instance.
  3181. */
  3182. function mapCacheSet(key, value) {
  3183. var data = getMapData(this, key),
  3184. size = data.size;
  3185. data.set(key, value);
  3186. this.size += data.size == size ? 0 : 1;
  3187. return this;
  3188. }
  3189. // Add methods to `MapCache`.
  3190. MapCache.prototype.clear = mapCacheClear;
  3191. MapCache.prototype['delete'] = mapCacheDelete;
  3192. MapCache.prototype.get = mapCacheGet;
  3193. MapCache.prototype.has = mapCacheHas;
  3194. MapCache.prototype.set = mapCacheSet;
  3195. /*------------------------------------------------------------------------*/
  3196. /**
  3197. *
  3198. * Creates an array cache object to store unique values.
  3199. *
  3200. * @private
  3201. * @constructor
  3202. * @param {Array} [values] The values to cache.
  3203. */
  3204. function SetCache(values) {
  3205. var index = -1,
  3206. length = values == null ? 0 : values.length;
  3207. this.__data__ = new MapCache;
  3208. while (++index < length) {
  3209. this.add(values[index]);
  3210. }
  3211. }
  3212. /**
  3213. * Adds `value` to the array cache.
  3214. *
  3215. * @private
  3216. * @name add
  3217. * @memberOf SetCache
  3218. * @alias push
  3219. * @param {*} value The value to cache.
  3220. * @returns {Object} Returns the cache instance.
  3221. */
  3222. function setCacheAdd(value) {
  3223. this.__data__.set(value, HASH_UNDEFINED);
  3224. return this;
  3225. }
  3226. /**
  3227. * Checks if `value` is in the array cache.
  3228. *
  3229. * @private
  3230. * @name has
  3231. * @memberOf SetCache
  3232. * @param {*} value The value to search for.
  3233. * @returns {number} Returns `true` if `value` is found, else `false`.
  3234. */
  3235. function setCacheHas(value) {
  3236. return this.__data__.has(value);
  3237. }
  3238. // Add methods to `SetCache`.
  3239. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3240. SetCache.prototype.has = setCacheHas;
  3241. /*------------------------------------------------------------------------*/
  3242. /**
  3243. * Creates a stack cache object to store key-value pairs.
  3244. *
  3245. * @private
  3246. * @constructor
  3247. * @param {Array} [entries] The key-value pairs to cache.
  3248. */
  3249. function Stack(entries) {
  3250. var data = this.__data__ = new ListCache(entries);
  3251. this.size = data.size;
  3252. }
  3253. /**
  3254. * Removes all key-value entries from the stack.
  3255. *
  3256. * @private
  3257. * @name clear
  3258. * @memberOf Stack
  3259. */
  3260. function stackClear() {
  3261. this.__data__ = new ListCache;
  3262. this.size = 0;
  3263. }
  3264. /**
  3265. * Removes `key` and its value from the stack.
  3266. *
  3267. * @private
  3268. * @name delete
  3269. * @memberOf Stack
  3270. * @param {string} key The key of the value to remove.
  3271. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3272. */
  3273. function stackDelete(key) {
  3274. var data = this.__data__,
  3275. result = data['delete'](key);
  3276. this.size = data.size;
  3277. return result;
  3278. }
  3279. /**
  3280. * Gets the stack value for `key`.
  3281. *
  3282. * @private
  3283. * @name get
  3284. * @memberOf Stack
  3285. * @param {string} key The key of the value to get.
  3286. * @returns {*} Returns the entry value.
  3287. */
  3288. function stackGet(key) {
  3289. return this.__data__.get(key);
  3290. }
  3291. /**
  3292. * Checks if a stack value for `key` exists.
  3293. *
  3294. * @private
  3295. * @name has
  3296. * @memberOf Stack
  3297. * @param {string} key The key of the entry to check.
  3298. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3299. */
  3300. function stackHas(key) {
  3301. return this.__data__.has(key);
  3302. }
  3303. /**
  3304. * Sets the stack `key` to `value`.
  3305. *
  3306. * @private
  3307. * @name set
  3308. * @memberOf Stack
  3309. * @param {string} key The key of the value to set.
  3310. * @param {*} value The value to set.
  3311. * @returns {Object} Returns the stack cache instance.
  3312. */
  3313. function stackSet(key, value) {
  3314. var data = this.__data__;
  3315. if (data instanceof ListCache) {
  3316. var pairs = data.__data__;
  3317. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3318. pairs.push([key, value]);
  3319. this.size = ++data.size;
  3320. return this;
  3321. }
  3322. data = this.__data__ = new MapCache(pairs);
  3323. }
  3324. data.set(key, value);
  3325. this.size = data.size;
  3326. return this;
  3327. }
  3328. // Add methods to `Stack`.
  3329. Stack.prototype.clear = stackClear;
  3330. Stack.prototype['delete'] = stackDelete;
  3331. Stack.prototype.get = stackGet;
  3332. Stack.prototype.has = stackHas;
  3333. Stack.prototype.set = stackSet;
  3334. /*------------------------------------------------------------------------*/
  3335. /**
  3336. * Creates an array of the enumerable property names of the array-like `value`.
  3337. *
  3338. * @private
  3339. * @param {*} value The value to query.
  3340. * @param {boolean} inherited Specify returning inherited property names.
  3341. * @returns {Array} Returns the array of property names.
  3342. */
  3343. function arrayLikeKeys(value, inherited) {
  3344. var isArr = isArray(value),
  3345. isArg = !isArr && isArguments(value),
  3346. isBuff = !isArr && !isArg && isBuffer(value),
  3347. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3348. skipIndexes = isArr || isArg || isBuff || isType,
  3349. result = skipIndexes ? baseTimes(value.length, String) : [],
  3350. length = result.length;
  3351. for (var key in value) {
  3352. if ((inherited || hasOwnProperty.call(value, key)) &&
  3353. !(skipIndexes && (
  3354. // Safari 9 has enumerable `arguments.length` in strict mode.
  3355. key == 'length' ||
  3356. // Node.js 0.10 has enumerable non-index properties on buffers.
  3357. (isBuff && (key == 'offset' || key == 'parent')) ||
  3358. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3359. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3360. // Skip index properties.
  3361. isIndex(key, length)
  3362. ))) {
  3363. result.push(key);
  3364. }
  3365. }
  3366. return result;
  3367. }
  3368. /**
  3369. * A specialized version of `_.sample` for arrays.
  3370. *
  3371. * @private
  3372. * @param {Array} array The array to sample.
  3373. * @returns {*} Returns the random element.
  3374. */
  3375. function arraySample(array) {
  3376. var length = array.length;
  3377. return length ? array[baseRandom(0, length - 1)] : undefined;
  3378. }
  3379. /**
  3380. * A specialized version of `_.sampleSize` for arrays.
  3381. *
  3382. * @private
  3383. * @param {Array} array The array to sample.
  3384. * @param {number} n The number of elements to sample.
  3385. * @returns {Array} Returns the random elements.
  3386. */
  3387. function arraySampleSize(array, n) {
  3388. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3389. }
  3390. /**
  3391. * A specialized version of `_.shuffle` for arrays.
  3392. *
  3393. * @private
  3394. * @param {Array} array The array to shuffle.
  3395. * @returns {Array} Returns the new shuffled array.
  3396. */
  3397. function arrayShuffle(array) {
  3398. return shuffleSelf(copyArray(array));
  3399. }
  3400. /**
  3401. * This function is like `assignValue` except that it doesn't assign
  3402. * `undefined` values.
  3403. *
  3404. * @private
  3405. * @param {Object} object The object to modify.
  3406. * @param {string} key The key of the property to assign.
  3407. * @param {*} value The value to assign.
  3408. */
  3409. function assignMergeValue(object, key, value) {
  3410. if ((value !== undefined && !eq(object[key], value)) ||
  3411. (value === undefined && !(key in object))) {
  3412. baseAssignValue(object, key, value);
  3413. }
  3414. }
  3415. /**
  3416. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3417. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3418. * for equality comparisons.
  3419. *
  3420. * @private
  3421. * @param {Object} object The object to modify.
  3422. * @param {string} key The key of the property to assign.
  3423. * @param {*} value The value to assign.
  3424. */
  3425. function assignValue(object, key, value) {
  3426. var objValue = object[key];
  3427. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3428. (value === undefined && !(key in object))) {
  3429. baseAssignValue(object, key, value);
  3430. }
  3431. }
  3432. /**
  3433. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3434. *
  3435. * @private
  3436. * @param {Array} array The array to inspect.
  3437. * @param {*} key The key to search for.
  3438. * @returns {number} Returns the index of the matched value, else `-1`.
  3439. */
  3440. function assocIndexOf(array, key) {
  3441. var length = array.length;
  3442. while (length--) {
  3443. if (eq(array[length][0], key)) {
  3444. return length;
  3445. }
  3446. }
  3447. return -1;
  3448. }
  3449. /**
  3450. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3451. * by `iteratee` and values set by `setter`.
  3452. *
  3453. * @private
  3454. * @param {Array|Object} collection The collection to iterate over.
  3455. * @param {Function} setter The function to set `accumulator` values.
  3456. * @param {Function} iteratee The iteratee to transform keys.
  3457. * @param {Object} accumulator The initial aggregated object.
  3458. * @returns {Function} Returns `accumulator`.
  3459. */
  3460. function baseAggregator(collection, setter, iteratee, accumulator) {
  3461. baseEach(collection, function(value, key, collection) {
  3462. setter(accumulator, value, iteratee(value), collection);
  3463. });
  3464. return accumulator;
  3465. }
  3466. /**
  3467. * The base implementation of `_.assign` without support for multiple sources
  3468. * or `customizer` functions.
  3469. *
  3470. * @private
  3471. * @param {Object} object The destination object.
  3472. * @param {Object} source The source object.
  3473. * @returns {Object} Returns `object`.
  3474. */
  3475. function baseAssign(object, source) {
  3476. return object && copyObject(source, keys(source), object);
  3477. }
  3478. /**
  3479. * The base implementation of `_.assignIn` without support for multiple sources
  3480. * or `customizer` functions.
  3481. *
  3482. * @private
  3483. * @param {Object} object The destination object.
  3484. * @param {Object} source The source object.
  3485. * @returns {Object} Returns `object`.
  3486. */
  3487. function baseAssignIn(object, source) {
  3488. return object && copyObject(source, keysIn(source), object);
  3489. }
  3490. /**
  3491. * The base implementation of `assignValue` and `assignMergeValue` without
  3492. * value checks.
  3493. *
  3494. * @private
  3495. * @param {Object} object The object to modify.
  3496. * @param {string} key The key of the property to assign.
  3497. * @param {*} value The value to assign.
  3498. */
  3499. function baseAssignValue(object, key, value) {
  3500. if (key == '__proto__' && defineProperty) {
  3501. defineProperty(object, key, {
  3502. 'configurable': true,
  3503. 'enumerable': true,
  3504. 'value': value,
  3505. 'writable': true
  3506. });
  3507. } else {
  3508. object[key] = value;
  3509. }
  3510. }
  3511. /**
  3512. * The base implementation of `_.at` without support for individual paths.
  3513. *
  3514. * @private
  3515. * @param {Object} object The object to iterate over.
  3516. * @param {string[]} paths The property paths to pick.
  3517. * @returns {Array} Returns the picked elements.
  3518. */
  3519. function baseAt(object, paths) {
  3520. var index = -1,
  3521. length = paths.length,
  3522. result = Array(length),
  3523. skip = object == null;
  3524. while (++index < length) {
  3525. result[index] = skip ? undefined : get(object, paths[index]);
  3526. }
  3527. return result;
  3528. }
  3529. /**
  3530. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3531. *
  3532. * @private
  3533. * @param {number} number The number to clamp.
  3534. * @param {number} [lower] The lower bound.
  3535. * @param {number} upper The upper bound.
  3536. * @returns {number} Returns the clamped number.
  3537. */
  3538. function baseClamp(number, lower, upper) {
  3539. if (number === number) {
  3540. if (upper !== undefined) {
  3541. number = number <= upper ? number : upper;
  3542. }
  3543. if (lower !== undefined) {
  3544. number = number >= lower ? number : lower;
  3545. }
  3546. }
  3547. return number;
  3548. }
  3549. /**
  3550. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3551. * traversed objects.
  3552. *
  3553. * @private
  3554. * @param {*} value The value to clone.
  3555. * @param {boolean} bitmask The bitmask flags.
  3556. * 1 - Deep clone
  3557. * 2 - Flatten inherited properties
  3558. * 4 - Clone symbols
  3559. * @param {Function} [customizer] The function to customize cloning.
  3560. * @param {string} [key] The key of `value`.
  3561. * @param {Object} [object] The parent object of `value`.
  3562. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3563. * @returns {*} Returns the cloned value.
  3564. */
  3565. function baseClone(value, bitmask, customizer, key, object, stack) {
  3566. var result,
  3567. isDeep = bitmask & CLONE_DEEP_FLAG,
  3568. isFlat = bitmask & CLONE_FLAT_FLAG,
  3569. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3570. if (customizer) {
  3571. result = object ? customizer(value, key, object, stack) : customizer(value);
  3572. }
  3573. if (result !== undefined) {
  3574. return result;
  3575. }
  3576. if (!isObject(value)) {
  3577. return value;
  3578. }
  3579. var isArr = isArray(value);
  3580. if (isArr) {
  3581. result = initCloneArray(value);
  3582. if (!isDeep) {
  3583. return copyArray(value, result);
  3584. }
  3585. } else {
  3586. var tag = getTag(value),
  3587. isFunc = tag == funcTag || tag == genTag;
  3588. if (isBuffer(value)) {
  3589. return cloneBuffer(value, isDeep);
  3590. }
  3591. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3592. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3593. if (!isDeep) {
  3594. return isFlat
  3595. ? copySymbolsIn(value, baseAssignIn(result, value))
  3596. : copySymbols(value, baseAssign(result, value));
  3597. }
  3598. } else {
  3599. if (!cloneableTags[tag]) {
  3600. return object ? value : {};
  3601. }
  3602. result = initCloneByTag(value, tag, isDeep);
  3603. }
  3604. }
  3605. // Check for circular references and return its corresponding clone.
  3606. stack || (stack = new Stack);
  3607. var stacked = stack.get(value);
  3608. if (stacked) {
  3609. return stacked;
  3610. }
  3611. stack.set(value, result);
  3612. if (isSet(value)) {
  3613. value.forEach(function(subValue) {
  3614. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3615. });
  3616. } else if (isMap(value)) {
  3617. value.forEach(function(subValue, key) {
  3618. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3619. });
  3620. }
  3621. var keysFunc = isFull
  3622. ? (isFlat ? getAllKeysIn : getAllKeys)
  3623. : (isFlat ? keysIn : keys);
  3624. var props = isArr ? undefined : keysFunc(value);
  3625. arrayEach(props || value, function(subValue, key) {
  3626. if (props) {
  3627. key = subValue;
  3628. subValue = value[key];
  3629. }
  3630. // Recursively populate clone (susceptible to call stack limits).
  3631. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3632. });
  3633. return result;
  3634. }
  3635. /**
  3636. * The base implementation of `_.conforms` which doesn't clone `source`.
  3637. *
  3638. * @private
  3639. * @param {Object} source The object of property predicates to conform to.
  3640. * @returns {Function} Returns the new spec function.
  3641. */
  3642. function baseConforms(source) {
  3643. var props = keys(source);
  3644. return function(object) {
  3645. return baseConformsTo(object, source, props);
  3646. };
  3647. }
  3648. /**
  3649. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3650. *
  3651. * @private
  3652. * @param {Object} object The object to inspect.
  3653. * @param {Object} source The object of property predicates to conform to.
  3654. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3655. */
  3656. function baseConformsTo(object, source, props) {
  3657. var length = props.length;
  3658. if (object == null) {
  3659. return !length;
  3660. }
  3661. object = Object(object);
  3662. while (length--) {
  3663. var key = props[length],
  3664. predicate = source[key],
  3665. value = object[key];
  3666. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3667. return false;
  3668. }
  3669. }
  3670. return true;
  3671. }
  3672. /**
  3673. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3674. * to provide to `func`.
  3675. *
  3676. * @private
  3677. * @param {Function} func The function to delay.
  3678. * @param {number} wait The number of milliseconds to delay invocation.
  3679. * @param {Array} args The arguments to provide to `func`.
  3680. * @returns {number|Object} Returns the timer id or timeout object.
  3681. */
  3682. function baseDelay(func, wait, args) {
  3683. if (typeof func != 'function') {
  3684. throw new TypeError(FUNC_ERROR_TEXT);
  3685. }
  3686. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3687. }
  3688. /**
  3689. * The base implementation of methods like `_.difference` without support
  3690. * for excluding multiple arrays or iteratee shorthands.
  3691. *
  3692. * @private
  3693. * @param {Array} array The array to inspect.
  3694. * @param {Array} values The values to exclude.
  3695. * @param {Function} [iteratee] The iteratee invoked per element.
  3696. * @param {Function} [comparator] The comparator invoked per element.
  3697. * @returns {Array} Returns the new array of filtered values.
  3698. */
  3699. function baseDifference(array, values, iteratee, comparator) {
  3700. var index = -1,
  3701. includes = arrayIncludes,
  3702. isCommon = true,
  3703. length = array.length,
  3704. result = [],
  3705. valuesLength = values.length;
  3706. if (!length) {
  3707. return result;
  3708. }
  3709. if (iteratee) {
  3710. values = arrayMap(values, baseUnary(iteratee));
  3711. }
  3712. if (comparator) {
  3713. includes = arrayIncludesWith;
  3714. isCommon = false;
  3715. }
  3716. else if (values.length >= LARGE_ARRAY_SIZE) {
  3717. includes = cacheHas;
  3718. isCommon = false;
  3719. values = new SetCache(values);
  3720. }
  3721. outer:
  3722. while (++index < length) {
  3723. var value = array[index],
  3724. computed = iteratee == null ? value : iteratee(value);
  3725. value = (comparator || value !== 0) ? value : 0;
  3726. if (isCommon && computed === computed) {
  3727. var valuesIndex = valuesLength;
  3728. while (valuesIndex--) {
  3729. if (values[valuesIndex] === computed) {
  3730. continue outer;
  3731. }
  3732. }
  3733. result.push(value);
  3734. }
  3735. else if (!includes(values, computed, comparator)) {
  3736. result.push(value);
  3737. }
  3738. }
  3739. return result;
  3740. }
  3741. /**
  3742. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3743. *
  3744. * @private
  3745. * @param {Array|Object} collection The collection to iterate over.
  3746. * @param {Function} iteratee The function invoked per iteration.
  3747. * @returns {Array|Object} Returns `collection`.
  3748. */
  3749. var baseEach = createBaseEach(baseForOwn);
  3750. /**
  3751. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3752. *
  3753. * @private
  3754. * @param {Array|Object} collection The collection to iterate over.
  3755. * @param {Function} iteratee The function invoked per iteration.
  3756. * @returns {Array|Object} Returns `collection`.
  3757. */
  3758. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3759. /**
  3760. * The base implementation of `_.every` without support for iteratee shorthands.
  3761. *
  3762. * @private
  3763. * @param {Array|Object} collection The collection to iterate over.
  3764. * @param {Function} predicate The function invoked per iteration.
  3765. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3766. * else `false`
  3767. */
  3768. function baseEvery(collection, predicate) {
  3769. var result = true;
  3770. baseEach(collection, function(value, index, collection) {
  3771. result = !!predicate(value, index, collection);
  3772. return result;
  3773. });
  3774. return result;
  3775. }
  3776. /**
  3777. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3778. * `comparator` to determine the extremum value.
  3779. *
  3780. * @private
  3781. * @param {Array} array The array to iterate over.
  3782. * @param {Function} iteratee The iteratee invoked per iteration.
  3783. * @param {Function} comparator The comparator used to compare values.
  3784. * @returns {*} Returns the extremum value.
  3785. */
  3786. function baseExtremum(array, iteratee, comparator) {
  3787. var index = -1,
  3788. length = array.length;
  3789. while (++index < length) {
  3790. var value = array[index],
  3791. current = iteratee(value);
  3792. if (current != null && (computed === undefined
  3793. ? (current === current && !isSymbol(current))
  3794. : comparator(current, computed)
  3795. )) {
  3796. var computed = current,
  3797. result = value;
  3798. }
  3799. }
  3800. return result;
  3801. }
  3802. /**
  3803. * The base implementation of `_.fill` without an iteratee call guard.
  3804. *
  3805. * @private
  3806. * @param {Array} array The array to fill.
  3807. * @param {*} value The value to fill `array` with.
  3808. * @param {number} [start=0] The start position.
  3809. * @param {number} [end=array.length] The end position.
  3810. * @returns {Array} Returns `array`.
  3811. */
  3812. function baseFill(array, value, start, end) {
  3813. var length = array.length;
  3814. start = toInteger(start);
  3815. if (start < 0) {
  3816. start = -start > length ? 0 : (length + start);
  3817. }
  3818. end = (end === undefined || end > length) ? length : toInteger(end);
  3819. if (end < 0) {
  3820. end += length;
  3821. }
  3822. end = start > end ? 0 : toLength(end);
  3823. while (start < end) {
  3824. array[start++] = value;
  3825. }
  3826. return array;
  3827. }
  3828. /**
  3829. * The base implementation of `_.filter` without support for iteratee shorthands.
  3830. *
  3831. * @private
  3832. * @param {Array|Object} collection The collection to iterate over.
  3833. * @param {Function} predicate The function invoked per iteration.
  3834. * @returns {Array} Returns the new filtered array.
  3835. */
  3836. function baseFilter(collection, predicate) {
  3837. var result = [];
  3838. baseEach(collection, function(value, index, collection) {
  3839. if (predicate(value, index, collection)) {
  3840. result.push(value);
  3841. }
  3842. });
  3843. return result;
  3844. }
  3845. /**
  3846. * The base implementation of `_.flatten` with support for restricting flattening.
  3847. *
  3848. * @private
  3849. * @param {Array} array The array to flatten.
  3850. * @param {number} depth The maximum recursion depth.
  3851. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3852. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3853. * @param {Array} [result=[]] The initial result value.
  3854. * @returns {Array} Returns the new flattened array.
  3855. */
  3856. function baseFlatten(array, depth, predicate, isStrict, result) {
  3857. var index = -1,
  3858. length = array.length;
  3859. predicate || (predicate = isFlattenable);
  3860. result || (result = []);
  3861. while (++index < length) {
  3862. var value = array[index];
  3863. if (depth > 0 && predicate(value)) {
  3864. if (depth > 1) {
  3865. // Recursively flatten arrays (susceptible to call stack limits).
  3866. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3867. } else {
  3868. arrayPush(result, value);
  3869. }
  3870. } else if (!isStrict) {
  3871. result[result.length] = value;
  3872. }
  3873. }
  3874. return result;
  3875. }
  3876. /**
  3877. * The base implementation of `baseForOwn` which iterates over `object`
  3878. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3879. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3880. *
  3881. * @private
  3882. * @param {Object} object The object to iterate over.
  3883. * @param {Function} iteratee The function invoked per iteration.
  3884. * @param {Function} keysFunc The function to get the keys of `object`.
  3885. * @returns {Object} Returns `object`.
  3886. */
  3887. var baseFor = createBaseFor();
  3888. /**
  3889. * This function is like `baseFor` except that it iterates over properties
  3890. * in the opposite order.
  3891. *
  3892. * @private
  3893. * @param {Object} object The object to iterate over.
  3894. * @param {Function} iteratee The function invoked per iteration.
  3895. * @param {Function} keysFunc The function to get the keys of `object`.
  3896. * @returns {Object} Returns `object`.
  3897. */
  3898. var baseForRight = createBaseFor(true);
  3899. /**
  3900. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3901. *
  3902. * @private
  3903. * @param {Object} object The object to iterate over.
  3904. * @param {Function} iteratee The function invoked per iteration.
  3905. * @returns {Object} Returns `object`.
  3906. */
  3907. function baseForOwn(object, iteratee) {
  3908. return object && baseFor(object, iteratee, keys);
  3909. }
  3910. /**
  3911. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3912. *
  3913. * @private
  3914. * @param {Object} object The object to iterate over.
  3915. * @param {Function} iteratee The function invoked per iteration.
  3916. * @returns {Object} Returns `object`.
  3917. */
  3918. function baseForOwnRight(object, iteratee) {
  3919. return object && baseForRight(object, iteratee, keys);
  3920. }
  3921. /**
  3922. * The base implementation of `_.functions` which creates an array of
  3923. * `object` function property names filtered from `props`.
  3924. *
  3925. * @private
  3926. * @param {Object} object The object to inspect.
  3927. * @param {Array} props The property names to filter.
  3928. * @returns {Array} Returns the function names.
  3929. */
  3930. function baseFunctions(object, props) {
  3931. return arrayFilter(props, function(key) {
  3932. return isFunction(object[key]);
  3933. });
  3934. }
  3935. /**
  3936. * The base implementation of `_.get` without support for default values.
  3937. *
  3938. * @private
  3939. * @param {Object} object The object to query.
  3940. * @param {Array|string} path The path of the property to get.
  3941. * @returns {*} Returns the resolved value.
  3942. */
  3943. function baseGet(object, path) {
  3944. path = castPath(path, object);
  3945. var index = 0,
  3946. length = path.length;
  3947. while (object != null && index < length) {
  3948. object = object[toKey(path[index++])];
  3949. }
  3950. return (index && index == length) ? object : undefined;
  3951. }
  3952. /**
  3953. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3954. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3955. * symbols of `object`.
  3956. *
  3957. * @private
  3958. * @param {Object} object The object to query.
  3959. * @param {Function} keysFunc The function to get the keys of `object`.
  3960. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3961. * @returns {Array} Returns the array of property names and symbols.
  3962. */
  3963. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3964. var result = keysFunc(object);
  3965. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3966. }
  3967. /**
  3968. * The base implementation of `getTag` without fallbacks for buggy environments.
  3969. *
  3970. * @private
  3971. * @param {*} value The value to query.
  3972. * @returns {string} Returns the `toStringTag`.
  3973. */
  3974. function baseGetTag(value) {
  3975. if (value == null) {
  3976. return value === undefined ? undefinedTag : nullTag;
  3977. }
  3978. return (symToStringTag && symToStringTag in Object(value))
  3979. ? getRawTag(value)
  3980. : objectToString(value);
  3981. }
  3982. /**
  3983. * The base implementation of `_.gt` which doesn't coerce arguments.
  3984. *
  3985. * @private
  3986. * @param {*} value The value to compare.
  3987. * @param {*} other The other value to compare.
  3988. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3989. * else `false`.
  3990. */
  3991. function baseGt(value, other) {
  3992. return value > other;
  3993. }
  3994. /**
  3995. * The base implementation of `_.has` without support for deep paths.
  3996. *
  3997. * @private
  3998. * @param {Object} [object] The object to query.
  3999. * @param {Array|string} key The key to check.
  4000. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4001. */
  4002. function baseHas(object, key) {
  4003. return object != null && hasOwnProperty.call(object, key);
  4004. }
  4005. /**
  4006. * The base implementation of `_.hasIn` without support for deep paths.
  4007. *
  4008. * @private
  4009. * @param {Object} [object] The object to query.
  4010. * @param {Array|string} key The key to check.
  4011. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4012. */
  4013. function baseHasIn(object, key) {
  4014. return object != null && key in Object(object);
  4015. }
  4016. /**
  4017. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4018. *
  4019. * @private
  4020. * @param {number} number The number to check.
  4021. * @param {number} start The start of the range.
  4022. * @param {number} end The end of the range.
  4023. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4024. */
  4025. function baseInRange(number, start, end) {
  4026. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4027. }
  4028. /**
  4029. * The base implementation of methods like `_.intersection`, without support
  4030. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4031. *
  4032. * @private
  4033. * @param {Array} arrays The arrays to inspect.
  4034. * @param {Function} [iteratee] The iteratee invoked per element.
  4035. * @param {Function} [comparator] The comparator invoked per element.
  4036. * @returns {Array} Returns the new array of shared values.
  4037. */
  4038. function baseIntersection(arrays, iteratee, comparator) {
  4039. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4040. length = arrays[0].length,
  4041. othLength = arrays.length,
  4042. othIndex = othLength,
  4043. caches = Array(othLength),
  4044. maxLength = Infinity,
  4045. result = [];
  4046. while (othIndex--) {
  4047. var array = arrays[othIndex];
  4048. if (othIndex && iteratee) {
  4049. array = arrayMap(array, baseUnary(iteratee));
  4050. }
  4051. maxLength = nativeMin(array.length, maxLength);
  4052. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4053. ? new SetCache(othIndex && array)
  4054. : undefined;
  4055. }
  4056. array = arrays[0];
  4057. var index = -1,
  4058. seen = caches[0];
  4059. outer:
  4060. while (++index < length && result.length < maxLength) {
  4061. var value = array[index],
  4062. computed = iteratee ? iteratee(value) : value;
  4063. value = (comparator || value !== 0) ? value : 0;
  4064. if (!(seen
  4065. ? cacheHas(seen, computed)
  4066. : includes(result, computed, comparator)
  4067. )) {
  4068. othIndex = othLength;
  4069. while (--othIndex) {
  4070. var cache = caches[othIndex];
  4071. if (!(cache
  4072. ? cacheHas(cache, computed)
  4073. : includes(arrays[othIndex], computed, comparator))
  4074. ) {
  4075. continue outer;
  4076. }
  4077. }
  4078. if (seen) {
  4079. seen.push(computed);
  4080. }
  4081. result.push(value);
  4082. }
  4083. }
  4084. return result;
  4085. }
  4086. /**
  4087. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4088. * `object` with values transformed by `iteratee` and set by `setter`.
  4089. *
  4090. * @private
  4091. * @param {Object} object The object to iterate over.
  4092. * @param {Function} setter The function to set `accumulator` values.
  4093. * @param {Function} iteratee The iteratee to transform values.
  4094. * @param {Object} accumulator The initial inverted object.
  4095. * @returns {Function} Returns `accumulator`.
  4096. */
  4097. function baseInverter(object, setter, iteratee, accumulator) {
  4098. baseForOwn(object, function(value, key, object) {
  4099. setter(accumulator, iteratee(value), key, object);
  4100. });
  4101. return accumulator;
  4102. }
  4103. /**
  4104. * The base implementation of `_.invoke` without support for individual
  4105. * method arguments.
  4106. *
  4107. * @private
  4108. * @param {Object} object The object to query.
  4109. * @param {Array|string} path The path of the method to invoke.
  4110. * @param {Array} args The arguments to invoke the method with.
  4111. * @returns {*} Returns the result of the invoked method.
  4112. */
  4113. function baseInvoke(object, path, args) {
  4114. path = castPath(path, object);
  4115. object = parent(object, path);
  4116. var func = object == null ? object : object[toKey(last(path))];
  4117. return func == null ? undefined : apply(func, object, args);
  4118. }
  4119. /**
  4120. * The base implementation of `_.isArguments`.
  4121. *
  4122. * @private
  4123. * @param {*} value The value to check.
  4124. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4125. */
  4126. function baseIsArguments(value) {
  4127. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4128. }
  4129. /**
  4130. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4131. *
  4132. * @private
  4133. * @param {*} value The value to check.
  4134. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4135. */
  4136. function baseIsArrayBuffer(value) {
  4137. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4138. }
  4139. /**
  4140. * The base implementation of `_.isDate` without Node.js optimizations.
  4141. *
  4142. * @private
  4143. * @param {*} value The value to check.
  4144. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4145. */
  4146. function baseIsDate(value) {
  4147. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4148. }
  4149. /**
  4150. * The base implementation of `_.isEqual` which supports partial comparisons
  4151. * and tracks traversed objects.
  4152. *
  4153. * @private
  4154. * @param {*} value The value to compare.
  4155. * @param {*} other The other value to compare.
  4156. * @param {boolean} bitmask The bitmask flags.
  4157. * 1 - Unordered comparison
  4158. * 2 - Partial comparison
  4159. * @param {Function} [customizer] The function to customize comparisons.
  4160. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4161. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4162. */
  4163. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4164. if (value === other) {
  4165. return true;
  4166. }
  4167. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4168. return value !== value && other !== other;
  4169. }
  4170. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4171. }
  4172. /**
  4173. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4174. * deep comparisons and tracks traversed objects enabling objects with circular
  4175. * references to be compared.
  4176. *
  4177. * @private
  4178. * @param {Object} object The object to compare.
  4179. * @param {Object} other The other object to compare.
  4180. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4181. * @param {Function} customizer The function to customize comparisons.
  4182. * @param {Function} equalFunc The function to determine equivalents of values.
  4183. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4184. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4185. */
  4186. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4187. var objIsArr = isArray(object),
  4188. othIsArr = isArray(other),
  4189. objTag = objIsArr ? arrayTag : getTag(object),
  4190. othTag = othIsArr ? arrayTag : getTag(other);
  4191. objTag = objTag == argsTag ? objectTag : objTag;
  4192. othTag = othTag == argsTag ? objectTag : othTag;
  4193. var objIsObj = objTag == objectTag,
  4194. othIsObj = othTag == objectTag,
  4195. isSameTag = objTag == othTag;
  4196. if (isSameTag && isBuffer(object)) {
  4197. if (!isBuffer(other)) {
  4198. return false;
  4199. }
  4200. objIsArr = true;
  4201. objIsObj = false;
  4202. }
  4203. if (isSameTag && !objIsObj) {
  4204. stack || (stack = new Stack);
  4205. return (objIsArr || isTypedArray(object))
  4206. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4207. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4208. }
  4209. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4210. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4211. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4212. if (objIsWrapped || othIsWrapped) {
  4213. var objUnwrapped = objIsWrapped ? object.value() : object,
  4214. othUnwrapped = othIsWrapped ? other.value() : other;
  4215. stack || (stack = new Stack);
  4216. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4217. }
  4218. }
  4219. if (!isSameTag) {
  4220. return false;
  4221. }
  4222. stack || (stack = new Stack);
  4223. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4224. }
  4225. /**
  4226. * The base implementation of `_.isMap` without Node.js optimizations.
  4227. *
  4228. * @private
  4229. * @param {*} value The value to check.
  4230. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4231. */
  4232. function baseIsMap(value) {
  4233. return isObjectLike(value) && getTag(value) == mapTag;
  4234. }
  4235. /**
  4236. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4237. *
  4238. * @private
  4239. * @param {Object} object The object to inspect.
  4240. * @param {Object} source The object of property values to match.
  4241. * @param {Array} matchData The property names, values, and compare flags to match.
  4242. * @param {Function} [customizer] The function to customize comparisons.
  4243. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4244. */
  4245. function baseIsMatch(object, source, matchData, customizer) {
  4246. var index = matchData.length,
  4247. length = index,
  4248. noCustomizer = !customizer;
  4249. if (object == null) {
  4250. return !length;
  4251. }
  4252. object = Object(object);
  4253. while (index--) {
  4254. var data = matchData[index];
  4255. if ((noCustomizer && data[2])
  4256. ? data[1] !== object[data[0]]
  4257. : !(data[0] in object)
  4258. ) {
  4259. return false;
  4260. }
  4261. }
  4262. while (++index < length) {
  4263. data = matchData[index];
  4264. var key = data[0],
  4265. objValue = object[key],
  4266. srcValue = data[1];
  4267. if (noCustomizer && data[2]) {
  4268. if (objValue === undefined && !(key in object)) {
  4269. return false;
  4270. }
  4271. } else {
  4272. var stack = new Stack;
  4273. if (customizer) {
  4274. var result = customizer(objValue, srcValue, key, object, source, stack);
  4275. }
  4276. if (!(result === undefined
  4277. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4278. : result
  4279. )) {
  4280. return false;
  4281. }
  4282. }
  4283. }
  4284. return true;
  4285. }
  4286. /**
  4287. * The base implementation of `_.isNative` without bad shim checks.
  4288. *
  4289. * @private
  4290. * @param {*} value The value to check.
  4291. * @returns {boolean} Returns `true` if `value` is a native function,
  4292. * else `false`.
  4293. */
  4294. function baseIsNative(value) {
  4295. if (!isObject(value) || isMasked(value)) {
  4296. return false;
  4297. }
  4298. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4299. return pattern.test(toSource(value));
  4300. }
  4301. /**
  4302. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4303. *
  4304. * @private
  4305. * @param {*} value The value to check.
  4306. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4307. */
  4308. function baseIsRegExp(value) {
  4309. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4310. }
  4311. /**
  4312. * The base implementation of `_.isSet` without Node.js optimizations.
  4313. *
  4314. * @private
  4315. * @param {*} value The value to check.
  4316. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4317. */
  4318. function baseIsSet(value) {
  4319. return isObjectLike(value) && getTag(value) == setTag;
  4320. }
  4321. /**
  4322. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4323. *
  4324. * @private
  4325. * @param {*} value The value to check.
  4326. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4327. */
  4328. function baseIsTypedArray(value) {
  4329. return isObjectLike(value) &&
  4330. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4331. }
  4332. /**
  4333. * The base implementation of `_.iteratee`.
  4334. *
  4335. * @private
  4336. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4337. * @returns {Function} Returns the iteratee.
  4338. */
  4339. function baseIteratee(value) {
  4340. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4341. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4342. if (typeof value == 'function') {
  4343. return value;
  4344. }
  4345. if (value == null) {
  4346. return identity;
  4347. }
  4348. if (typeof value == 'object') {
  4349. return isArray(value)
  4350. ? baseMatchesProperty(value[0], value[1])
  4351. : baseMatches(value);
  4352. }
  4353. return property(value);
  4354. }
  4355. /**
  4356. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4357. *
  4358. * @private
  4359. * @param {Object} object The object to query.
  4360. * @returns {Array} Returns the array of property names.
  4361. */
  4362. function baseKeys(object) {
  4363. if (!isPrototype(object)) {
  4364. return nativeKeys(object);
  4365. }
  4366. var result = [];
  4367. for (var key in Object(object)) {
  4368. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4369. result.push(key);
  4370. }
  4371. }
  4372. return result;
  4373. }
  4374. /**
  4375. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4376. *
  4377. * @private
  4378. * @param {Object} object The object to query.
  4379. * @returns {Array} Returns the array of property names.
  4380. */
  4381. function baseKeysIn(object) {
  4382. if (!isObject(object)) {
  4383. return nativeKeysIn(object);
  4384. }
  4385. var isProto = isPrototype(object),
  4386. result = [];
  4387. for (var key in object) {
  4388. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4389. result.push(key);
  4390. }
  4391. }
  4392. return result;
  4393. }
  4394. /**
  4395. * The base implementation of `_.lt` which doesn't coerce arguments.
  4396. *
  4397. * @private
  4398. * @param {*} value The value to compare.
  4399. * @param {*} other The other value to compare.
  4400. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4401. * else `false`.
  4402. */
  4403. function baseLt(value, other) {
  4404. return value < other;
  4405. }
  4406. /**
  4407. * The base implementation of `_.map` without support for iteratee shorthands.
  4408. *
  4409. * @private
  4410. * @param {Array|Object} collection The collection to iterate over.
  4411. * @param {Function} iteratee The function invoked per iteration.
  4412. * @returns {Array} Returns the new mapped array.
  4413. */
  4414. function baseMap(collection, iteratee) {
  4415. var index = -1,
  4416. result = isArrayLike(collection) ? Array(collection.length) : [];
  4417. baseEach(collection, function(value, key, collection) {
  4418. result[++index] = iteratee(value, key, collection);
  4419. });
  4420. return result;
  4421. }
  4422. /**
  4423. * The base implementation of `_.matches` which doesn't clone `source`.
  4424. *
  4425. * @private
  4426. * @param {Object} source The object of property values to match.
  4427. * @returns {Function} Returns the new spec function.
  4428. */
  4429. function baseMatches(source) {
  4430. var matchData = getMatchData(source);
  4431. if (matchData.length == 1 && matchData[0][2]) {
  4432. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4433. }
  4434. return function(object) {
  4435. return object === source || baseIsMatch(object, source, matchData);
  4436. };
  4437. }
  4438. /**
  4439. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4440. *
  4441. * @private
  4442. * @param {string} path The path of the property to get.
  4443. * @param {*} srcValue The value to match.
  4444. * @returns {Function} Returns the new spec function.
  4445. */
  4446. function baseMatchesProperty(path, srcValue) {
  4447. if (isKey(path) && isStrictComparable(srcValue)) {
  4448. return matchesStrictComparable(toKey(path), srcValue);
  4449. }
  4450. return function(object) {
  4451. var objValue = get(object, path);
  4452. return (objValue === undefined && objValue === srcValue)
  4453. ? hasIn(object, path)
  4454. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4455. };
  4456. }
  4457. /**
  4458. * The base implementation of `_.merge` without support for multiple sources.
  4459. *
  4460. * @private
  4461. * @param {Object} object The destination object.
  4462. * @param {Object} source The source object.
  4463. * @param {number} srcIndex The index of `source`.
  4464. * @param {Function} [customizer] The function to customize merged values.
  4465. * @param {Object} [stack] Tracks traversed source values and their merged
  4466. * counterparts.
  4467. */
  4468. function baseMerge(object, source, srcIndex, customizer, stack) {
  4469. if (object === source) {
  4470. return;
  4471. }
  4472. baseFor(source, function(srcValue, key) {
  4473. stack || (stack = new Stack);
  4474. if (isObject(srcValue)) {
  4475. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4476. }
  4477. else {
  4478. var newValue = customizer
  4479. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4480. : undefined;
  4481. if (newValue === undefined) {
  4482. newValue = srcValue;
  4483. }
  4484. assignMergeValue(object, key, newValue);
  4485. }
  4486. }, keysIn);
  4487. }
  4488. /**
  4489. * A specialized version of `baseMerge` for arrays and objects which performs
  4490. * deep merges and tracks traversed objects enabling objects with circular
  4491. * references to be merged.
  4492. *
  4493. * @private
  4494. * @param {Object} object The destination object.
  4495. * @param {Object} source The source object.
  4496. * @param {string} key The key of the value to merge.
  4497. * @param {number} srcIndex The index of `source`.
  4498. * @param {Function} mergeFunc The function to merge values.
  4499. * @param {Function} [customizer] The function to customize assigned values.
  4500. * @param {Object} [stack] Tracks traversed source values and their merged
  4501. * counterparts.
  4502. */
  4503. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4504. var objValue = safeGet(object, key),
  4505. srcValue = safeGet(source, key),
  4506. stacked = stack.get(srcValue);
  4507. if (stacked) {
  4508. assignMergeValue(object, key, stacked);
  4509. return;
  4510. }
  4511. var newValue = customizer
  4512. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4513. : undefined;
  4514. var isCommon = newValue === undefined;
  4515. if (isCommon) {
  4516. var isArr = isArray(srcValue),
  4517. isBuff = !isArr && isBuffer(srcValue),
  4518. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4519. newValue = srcValue;
  4520. if (isArr || isBuff || isTyped) {
  4521. if (isArray(objValue)) {
  4522. newValue = objValue;
  4523. }
  4524. else if (isArrayLikeObject(objValue)) {
  4525. newValue = copyArray(objValue);
  4526. }
  4527. else if (isBuff) {
  4528. isCommon = false;
  4529. newValue = cloneBuffer(srcValue, true);
  4530. }
  4531. else if (isTyped) {
  4532. isCommon = false;
  4533. newValue = cloneTypedArray(srcValue, true);
  4534. }
  4535. else {
  4536. newValue = [];
  4537. }
  4538. }
  4539. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4540. newValue = objValue;
  4541. if (isArguments(objValue)) {
  4542. newValue = toPlainObject(objValue);
  4543. }
  4544. else if (!isObject(objValue) || isFunction(objValue)) {
  4545. newValue = initCloneObject(srcValue);
  4546. }
  4547. }
  4548. else {
  4549. isCommon = false;
  4550. }
  4551. }
  4552. if (isCommon) {
  4553. // Recursively merge objects and arrays (susceptible to call stack limits).
  4554. stack.set(srcValue, newValue);
  4555. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4556. stack['delete'](srcValue);
  4557. }
  4558. assignMergeValue(object, key, newValue);
  4559. }
  4560. /**
  4561. * The base implementation of `_.nth` which doesn't coerce arguments.
  4562. *
  4563. * @private
  4564. * @param {Array} array The array to query.
  4565. * @param {number} n The index of the element to return.
  4566. * @returns {*} Returns the nth element of `array`.
  4567. */
  4568. function baseNth(array, n) {
  4569. var length = array.length;
  4570. if (!length) {
  4571. return;
  4572. }
  4573. n += n < 0 ? length : 0;
  4574. return isIndex(n, length) ? array[n] : undefined;
  4575. }
  4576. /**
  4577. * The base implementation of `_.orderBy` without param guards.
  4578. *
  4579. * @private
  4580. * @param {Array|Object} collection The collection to iterate over.
  4581. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4582. * @param {string[]} orders The sort orders of `iteratees`.
  4583. * @returns {Array} Returns the new sorted array.
  4584. */
  4585. function baseOrderBy(collection, iteratees, orders) {
  4586. if (iteratees.length) {
  4587. iteratees = arrayMap(iteratees, function(iteratee) {
  4588. if (isArray(iteratee)) {
  4589. return function(value) {
  4590. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4591. }
  4592. }
  4593. return iteratee;
  4594. });
  4595. } else {
  4596. iteratees = [identity];
  4597. }
  4598. var index = -1;
  4599. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4600. var result = baseMap(collection, function(value, key, collection) {
  4601. var criteria = arrayMap(iteratees, function(iteratee) {
  4602. return iteratee(value);
  4603. });
  4604. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4605. });
  4606. return baseSortBy(result, function(object, other) {
  4607. return compareMultiple(object, other, orders);
  4608. });
  4609. }
  4610. /**
  4611. * The base implementation of `_.pick` without support for individual
  4612. * property identifiers.
  4613. *
  4614. * @private
  4615. * @param {Object} object The source object.
  4616. * @param {string[]} paths The property paths to pick.
  4617. * @returns {Object} Returns the new object.
  4618. */
  4619. function basePick(object, paths) {
  4620. return basePickBy(object, paths, function(value, path) {
  4621. return hasIn(object, path);
  4622. });
  4623. }
  4624. /**
  4625. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4626. *
  4627. * @private
  4628. * @param {Object} object The source object.
  4629. * @param {string[]} paths The property paths to pick.
  4630. * @param {Function} predicate The function invoked per property.
  4631. * @returns {Object} Returns the new object.
  4632. */
  4633. function basePickBy(object, paths, predicate) {
  4634. var index = -1,
  4635. length = paths.length,
  4636. result = {};
  4637. while (++index < length) {
  4638. var path = paths[index],
  4639. value = baseGet(object, path);
  4640. if (predicate(value, path)) {
  4641. baseSet(result, castPath(path, object), value);
  4642. }
  4643. }
  4644. return result;
  4645. }
  4646. /**
  4647. * A specialized version of `baseProperty` which supports deep paths.
  4648. *
  4649. * @private
  4650. * @param {Array|string} path The path of the property to get.
  4651. * @returns {Function} Returns the new accessor function.
  4652. */
  4653. function basePropertyDeep(path) {
  4654. return function(object) {
  4655. return baseGet(object, path);
  4656. };
  4657. }
  4658. /**
  4659. * The base implementation of `_.pullAllBy` without support for iteratee
  4660. * shorthands.
  4661. *
  4662. * @private
  4663. * @param {Array} array The array to modify.
  4664. * @param {Array} values The values to remove.
  4665. * @param {Function} [iteratee] The iteratee invoked per element.
  4666. * @param {Function} [comparator] The comparator invoked per element.
  4667. * @returns {Array} Returns `array`.
  4668. */
  4669. function basePullAll(array, values, iteratee, comparator) {
  4670. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4671. index = -1,
  4672. length = values.length,
  4673. seen = array;
  4674. if (array === values) {
  4675. values = copyArray(values);
  4676. }
  4677. if (iteratee) {
  4678. seen = arrayMap(array, baseUnary(iteratee));
  4679. }
  4680. while (++index < length) {
  4681. var fromIndex = 0,
  4682. value = values[index],
  4683. computed = iteratee ? iteratee(value) : value;
  4684. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4685. if (seen !== array) {
  4686. splice.call(seen, fromIndex, 1);
  4687. }
  4688. splice.call(array, fromIndex, 1);
  4689. }
  4690. }
  4691. return array;
  4692. }
  4693. /**
  4694. * The base implementation of `_.pullAt` without support for individual
  4695. * indexes or capturing the removed elements.
  4696. *
  4697. * @private
  4698. * @param {Array} array The array to modify.
  4699. * @param {number[]} indexes The indexes of elements to remove.
  4700. * @returns {Array} Returns `array`.
  4701. */
  4702. function basePullAt(array, indexes) {
  4703. var length = array ? indexes.length : 0,
  4704. lastIndex = length - 1;
  4705. while (length--) {
  4706. var index = indexes[length];
  4707. if (length == lastIndex || index !== previous) {
  4708. var previous = index;
  4709. if (isIndex(index)) {
  4710. splice.call(array, index, 1);
  4711. } else {
  4712. baseUnset(array, index);
  4713. }
  4714. }
  4715. }
  4716. return array;
  4717. }
  4718. /**
  4719. * The base implementation of `_.random` without support for returning
  4720. * floating-point numbers.
  4721. *
  4722. * @private
  4723. * @param {number} lower The lower bound.
  4724. * @param {number} upper The upper bound.
  4725. * @returns {number} Returns the random number.
  4726. */
  4727. function baseRandom(lower, upper) {
  4728. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4729. }
  4730. /**
  4731. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4732. * coerce arguments.
  4733. *
  4734. * @private
  4735. * @param {number} start The start of the range.
  4736. * @param {number} end The end of the range.
  4737. * @param {number} step The value to increment or decrement by.
  4738. * @param {boolean} [fromRight] Specify iterating from right to left.
  4739. * @returns {Array} Returns the range of numbers.
  4740. */
  4741. function baseRange(start, end, step, fromRight) {
  4742. var index = -1,
  4743. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4744. result = Array(length);
  4745. while (length--) {
  4746. result[fromRight ? length : ++index] = start;
  4747. start += step;
  4748. }
  4749. return result;
  4750. }
  4751. /**
  4752. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4753. *
  4754. * @private
  4755. * @param {string} string The string to repeat.
  4756. * @param {number} n The number of times to repeat the string.
  4757. * @returns {string} Returns the repeated string.
  4758. */
  4759. function baseRepeat(string, n) {
  4760. var result = '';
  4761. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4762. return result;
  4763. }
  4764. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4765. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4766. do {
  4767. if (n % 2) {
  4768. result += string;
  4769. }
  4770. n = nativeFloor(n / 2);
  4771. if (n) {
  4772. string += string;
  4773. }
  4774. } while (n);
  4775. return result;
  4776. }
  4777. /**
  4778. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4779. *
  4780. * @private
  4781. * @param {Function} func The function to apply a rest parameter to.
  4782. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4783. * @returns {Function} Returns the new function.
  4784. */
  4785. function baseRest(func, start) {
  4786. return setToString(overRest(func, start, identity), func + '');
  4787. }
  4788. /**
  4789. * The base implementation of `_.sample`.
  4790. *
  4791. * @private
  4792. * @param {Array|Object} collection The collection to sample.
  4793. * @returns {*} Returns the random element.
  4794. */
  4795. function baseSample(collection) {
  4796. return arraySample(values(collection));
  4797. }
  4798. /**
  4799. * The base implementation of `_.sampleSize` without param guards.
  4800. *
  4801. * @private
  4802. * @param {Array|Object} collection The collection to sample.
  4803. * @param {number} n The number of elements to sample.
  4804. * @returns {Array} Returns the random elements.
  4805. */
  4806. function baseSampleSize(collection, n) {
  4807. var array = values(collection);
  4808. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4809. }
  4810. /**
  4811. * The base implementation of `_.set`.
  4812. *
  4813. * @private
  4814. * @param {Object} object The object to modify.
  4815. * @param {Array|string} path The path of the property to set.
  4816. * @param {*} value The value to set.
  4817. * @param {Function} [customizer] The function to customize path creation.
  4818. * @returns {Object} Returns `object`.
  4819. */
  4820. function baseSet(object, path, value, customizer) {
  4821. if (!isObject(object)) {
  4822. return object;
  4823. }
  4824. path = castPath(path, object);
  4825. var index = -1,
  4826. length = path.length,
  4827. lastIndex = length - 1,
  4828. nested = object;
  4829. while (nested != null && ++index < length) {
  4830. var key = toKey(path[index]),
  4831. newValue = value;
  4832. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4833. return object;
  4834. }
  4835. if (index != lastIndex) {
  4836. var objValue = nested[key];
  4837. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4838. if (newValue === undefined) {
  4839. newValue = isObject(objValue)
  4840. ? objValue
  4841. : (isIndex(path[index + 1]) ? [] : {});
  4842. }
  4843. }
  4844. assignValue(nested, key, newValue);
  4845. nested = nested[key];
  4846. }
  4847. return object;
  4848. }
  4849. /**
  4850. * The base implementation of `setData` without support for hot loop shorting.
  4851. *
  4852. * @private
  4853. * @param {Function} func The function to associate metadata with.
  4854. * @param {*} data The metadata.
  4855. * @returns {Function} Returns `func`.
  4856. */
  4857. var baseSetData = !metaMap ? identity : function(func, data) {
  4858. metaMap.set(func, data);
  4859. return func;
  4860. };
  4861. /**
  4862. * The base implementation of `setToString` without support for hot loop shorting.
  4863. *
  4864. * @private
  4865. * @param {Function} func The function to modify.
  4866. * @param {Function} string The `toString` result.
  4867. * @returns {Function} Returns `func`.
  4868. */
  4869. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4870. return defineProperty(func, 'toString', {
  4871. 'configurable': true,
  4872. 'enumerable': false,
  4873. 'value': constant(string),
  4874. 'writable': true
  4875. });
  4876. };
  4877. /**
  4878. * The base implementation of `_.shuffle`.
  4879. *
  4880. * @private
  4881. * @param {Array|Object} collection The collection to shuffle.
  4882. * @returns {Array} Returns the new shuffled array.
  4883. */
  4884. function baseShuffle(collection) {
  4885. return shuffleSelf(values(collection));
  4886. }
  4887. /**
  4888. * The base implementation of `_.slice` without an iteratee call guard.
  4889. *
  4890. * @private
  4891. * @param {Array} array The array to slice.
  4892. * @param {number} [start=0] The start position.
  4893. * @param {number} [end=array.length] The end position.
  4894. * @returns {Array} Returns the slice of `array`.
  4895. */
  4896. function baseSlice(array, start, end) {
  4897. var index = -1,
  4898. length = array.length;
  4899. if (start < 0) {
  4900. start = -start > length ? 0 : (length + start);
  4901. }
  4902. end = end > length ? length : end;
  4903. if (end < 0) {
  4904. end += length;
  4905. }
  4906. length = start > end ? 0 : ((end - start) >>> 0);
  4907. start >>>= 0;
  4908. var result = Array(length);
  4909. while (++index < length) {
  4910. result[index] = array[index + start];
  4911. }
  4912. return result;
  4913. }
  4914. /**
  4915. * The base implementation of `_.some` without support for iteratee shorthands.
  4916. *
  4917. * @private
  4918. * @param {Array|Object} collection The collection to iterate over.
  4919. * @param {Function} predicate The function invoked per iteration.
  4920. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4921. * else `false`.
  4922. */
  4923. function baseSome(collection, predicate) {
  4924. var result;
  4925. baseEach(collection, function(value, index, collection) {
  4926. result = predicate(value, index, collection);
  4927. return !result;
  4928. });
  4929. return !!result;
  4930. }
  4931. /**
  4932. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4933. * performs a binary search of `array` to determine the index at which `value`
  4934. * should be inserted into `array` in order to maintain its sort order.
  4935. *
  4936. * @private
  4937. * @param {Array} array The sorted array to inspect.
  4938. * @param {*} value The value to evaluate.
  4939. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4940. * @returns {number} Returns the index at which `value` should be inserted
  4941. * into `array`.
  4942. */
  4943. function baseSortedIndex(array, value, retHighest) {
  4944. var low = 0,
  4945. high = array == null ? low : array.length;
  4946. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4947. while (low < high) {
  4948. var mid = (low + high) >>> 1,
  4949. computed = array[mid];
  4950. if (computed !== null && !isSymbol(computed) &&
  4951. (retHighest ? (computed <= value) : (computed < value))) {
  4952. low = mid + 1;
  4953. } else {
  4954. high = mid;
  4955. }
  4956. }
  4957. return high;
  4958. }
  4959. return baseSortedIndexBy(array, value, identity, retHighest);
  4960. }
  4961. /**
  4962. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4963. * which invokes `iteratee` for `value` and each element of `array` to compute
  4964. * their sort ranking. The iteratee is invoked with one argument; (value).
  4965. *
  4966. * @private
  4967. * @param {Array} array The sorted array to inspect.
  4968. * @param {*} value The value to evaluate.
  4969. * @param {Function} iteratee The iteratee invoked per element.
  4970. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4971. * @returns {number} Returns the index at which `value` should be inserted
  4972. * into `array`.
  4973. */
  4974. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4975. var low = 0,
  4976. high = array == null ? 0 : array.length;
  4977. if (high === 0) {
  4978. return 0;
  4979. }
  4980. value = iteratee(value);
  4981. var valIsNaN = value !== value,
  4982. valIsNull = value === null,
  4983. valIsSymbol = isSymbol(value),
  4984. valIsUndefined = value === undefined;
  4985. while (low < high) {
  4986. var mid = nativeFloor((low + high) / 2),
  4987. computed = iteratee(array[mid]),
  4988. othIsDefined = computed !== undefined,
  4989. othIsNull = computed === null,
  4990. othIsReflexive = computed === computed,
  4991. othIsSymbol = isSymbol(computed);
  4992. if (valIsNaN) {
  4993. var setLow = retHighest || othIsReflexive;
  4994. } else if (valIsUndefined) {
  4995. setLow = othIsReflexive && (retHighest || othIsDefined);
  4996. } else if (valIsNull) {
  4997. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4998. } else if (valIsSymbol) {
  4999. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5000. } else if (othIsNull || othIsSymbol) {
  5001. setLow = false;
  5002. } else {
  5003. setLow = retHighest ? (computed <= value) : (computed < value);
  5004. }
  5005. if (setLow) {
  5006. low = mid + 1;
  5007. } else {
  5008. high = mid;
  5009. }
  5010. }
  5011. return nativeMin(high, MAX_ARRAY_INDEX);
  5012. }
  5013. /**
  5014. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5015. * support for iteratee shorthands.
  5016. *
  5017. * @private
  5018. * @param {Array} array The array to inspect.
  5019. * @param {Function} [iteratee] The iteratee invoked per element.
  5020. * @returns {Array} Returns the new duplicate free array.
  5021. */
  5022. function baseSortedUniq(array, iteratee) {
  5023. var index = -1,
  5024. length = array.length,
  5025. resIndex = 0,
  5026. result = [];
  5027. while (++index < length) {
  5028. var value = array[index],
  5029. computed = iteratee ? iteratee(value) : value;
  5030. if (!index || !eq(computed, seen)) {
  5031. var seen = computed;
  5032. result[resIndex++] = value === 0 ? 0 : value;
  5033. }
  5034. }
  5035. return result;
  5036. }
  5037. /**
  5038. * The base implementation of `_.toNumber` which doesn't ensure correct
  5039. * conversions of binary, hexadecimal, or octal string values.
  5040. *
  5041. * @private
  5042. * @param {*} value The value to process.
  5043. * @returns {number} Returns the number.
  5044. */
  5045. function baseToNumber(value) {
  5046. if (typeof value == 'number') {
  5047. return value;
  5048. }
  5049. if (isSymbol(value)) {
  5050. return NAN;
  5051. }
  5052. return +value;
  5053. }
  5054. /**
  5055. * The base implementation of `_.toString` which doesn't convert nullish
  5056. * values to empty strings.
  5057. *
  5058. * @private
  5059. * @param {*} value The value to process.
  5060. * @returns {string} Returns the string.
  5061. */
  5062. function baseToString(value) {
  5063. // Exit early for strings to avoid a performance hit in some environments.
  5064. if (typeof value == 'string') {
  5065. return value;
  5066. }
  5067. if (isArray(value)) {
  5068. // Recursively convert values (susceptible to call stack limits).
  5069. return arrayMap(value, baseToString) + '';
  5070. }
  5071. if (isSymbol(value)) {
  5072. return symbolToString ? symbolToString.call(value) : '';
  5073. }
  5074. var result = (value + '');
  5075. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5076. }
  5077. /**
  5078. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5079. *
  5080. * @private
  5081. * @param {Array} array The array to inspect.
  5082. * @param {Function} [iteratee] The iteratee invoked per element.
  5083. * @param {Function} [comparator] The comparator invoked per element.
  5084. * @returns {Array} Returns the new duplicate free array.
  5085. */
  5086. function baseUniq(array, iteratee, comparator) {
  5087. var index = -1,
  5088. includes = arrayIncludes,
  5089. length = array.length,
  5090. isCommon = true,
  5091. result = [],
  5092. seen = result;
  5093. if (comparator) {
  5094. isCommon = false;
  5095. includes = arrayIncludesWith;
  5096. }
  5097. else if (length >= LARGE_ARRAY_SIZE) {
  5098. var set = iteratee ? null : createSet(array);
  5099. if (set) {
  5100. return setToArray(set);
  5101. }
  5102. isCommon = false;
  5103. includes = cacheHas;
  5104. seen = new SetCache;
  5105. }
  5106. else {
  5107. seen = iteratee ? [] : result;
  5108. }
  5109. outer:
  5110. while (++index < length) {
  5111. var value = array[index],
  5112. computed = iteratee ? iteratee(value) : value;
  5113. value = (comparator || value !== 0) ? value : 0;
  5114. if (isCommon && computed === computed) {
  5115. var seenIndex = seen.length;
  5116. while (seenIndex--) {
  5117. if (seen[seenIndex] === computed) {
  5118. continue outer;
  5119. }
  5120. }
  5121. if (iteratee) {
  5122. seen.push(computed);
  5123. }
  5124. result.push(value);
  5125. }
  5126. else if (!includes(seen, computed, comparator)) {
  5127. if (seen !== result) {
  5128. seen.push(computed);
  5129. }
  5130. result.push(value);
  5131. }
  5132. }
  5133. return result;
  5134. }
  5135. /**
  5136. * The base implementation of `_.unset`.
  5137. *
  5138. * @private
  5139. * @param {Object} object The object to modify.
  5140. * @param {Array|string} path The property path to unset.
  5141. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5142. */
  5143. function baseUnset(object, path) {
  5144. path = castPath(path, object);
  5145. object = parent(object, path);
  5146. return object == null || delete object[toKey(last(path))];
  5147. }
  5148. /**
  5149. * The base implementation of `_.update`.
  5150. *
  5151. * @private
  5152. * @param {Object} object The object to modify.
  5153. * @param {Array|string} path The path of the property to update.
  5154. * @param {Function} updater The function to produce the updated value.
  5155. * @param {Function} [customizer] The function to customize path creation.
  5156. * @returns {Object} Returns `object`.
  5157. */
  5158. function baseUpdate(object, path, updater, customizer) {
  5159. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5160. }
  5161. /**
  5162. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5163. * without support for iteratee shorthands.
  5164. *
  5165. * @private
  5166. * @param {Array} array The array to query.
  5167. * @param {Function} predicate The function invoked per iteration.
  5168. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5169. * @param {boolean} [fromRight] Specify iterating from right to left.
  5170. * @returns {Array} Returns the slice of `array`.
  5171. */
  5172. function baseWhile(array, predicate, isDrop, fromRight) {
  5173. var length = array.length,
  5174. index = fromRight ? length : -1;
  5175. while ((fromRight ? index-- : ++index < length) &&
  5176. predicate(array[index], index, array)) {}
  5177. return isDrop
  5178. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5179. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5180. }
  5181. /**
  5182. * The base implementation of `wrapperValue` which returns the result of
  5183. * performing a sequence of actions on the unwrapped `value`, where each
  5184. * successive action is supplied the return value of the previous.
  5185. *
  5186. * @private
  5187. * @param {*} value The unwrapped value.
  5188. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5189. * @returns {*} Returns the resolved value.
  5190. */
  5191. function baseWrapperValue(value, actions) {
  5192. var result = value;
  5193. if (result instanceof LazyWrapper) {
  5194. result = result.value();
  5195. }
  5196. return arrayReduce(actions, function(result, action) {
  5197. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5198. }, result);
  5199. }
  5200. /**
  5201. * The base implementation of methods like `_.xor`, without support for
  5202. * iteratee shorthands, that accepts an array of arrays to inspect.
  5203. *
  5204. * @private
  5205. * @param {Array} arrays The arrays to inspect.
  5206. * @param {Function} [iteratee] The iteratee invoked per element.
  5207. * @param {Function} [comparator] The comparator invoked per element.
  5208. * @returns {Array} Returns the new array of values.
  5209. */
  5210. function baseXor(arrays, iteratee, comparator) {
  5211. var length = arrays.length;
  5212. if (length < 2) {
  5213. return length ? baseUniq(arrays[0]) : [];
  5214. }
  5215. var index = -1,
  5216. result = Array(length);
  5217. while (++index < length) {
  5218. var array = arrays[index],
  5219. othIndex = -1;
  5220. while (++othIndex < length) {
  5221. if (othIndex != index) {
  5222. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5223. }
  5224. }
  5225. }
  5226. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5227. }
  5228. /**
  5229. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5230. *
  5231. * @private
  5232. * @param {Array} props The property identifiers.
  5233. * @param {Array} values The property values.
  5234. * @param {Function} assignFunc The function to assign values.
  5235. * @returns {Object} Returns the new object.
  5236. */
  5237. function baseZipObject(props, values, assignFunc) {
  5238. var index = -1,
  5239. length = props.length,
  5240. valsLength = values.length,
  5241. result = {};
  5242. while (++index < length) {
  5243. var value = index < valsLength ? values[index] : undefined;
  5244. assignFunc(result, props[index], value);
  5245. }
  5246. return result;
  5247. }
  5248. /**
  5249. * Casts `value` to an empty array if it's not an array like object.
  5250. *
  5251. * @private
  5252. * @param {*} value The value to inspect.
  5253. * @returns {Array|Object} Returns the cast array-like object.
  5254. */
  5255. function castArrayLikeObject(value) {
  5256. return isArrayLikeObject(value) ? value : [];
  5257. }
  5258. /**
  5259. * Casts `value` to `identity` if it's not a function.
  5260. *
  5261. * @private
  5262. * @param {*} value The value to inspect.
  5263. * @returns {Function} Returns cast function.
  5264. */
  5265. function castFunction(value) {
  5266. return typeof value == 'function' ? value : identity;
  5267. }
  5268. /**
  5269. * Casts `value` to a path array if it's not one.
  5270. *
  5271. * @private
  5272. * @param {*} value The value to inspect.
  5273. * @param {Object} [object] The object to query keys on.
  5274. * @returns {Array} Returns the cast property path array.
  5275. */
  5276. function castPath(value, object) {
  5277. if (isArray(value)) {
  5278. return value;
  5279. }
  5280. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5281. }
  5282. /**
  5283. * A `baseRest` alias which can be replaced with `identity` by module
  5284. * replacement plugins.
  5285. *
  5286. * @private
  5287. * @type {Function}
  5288. * @param {Function} func The function to apply a rest parameter to.
  5289. * @returns {Function} Returns the new function.
  5290. */
  5291. var castRest = baseRest;
  5292. /**
  5293. * Casts `array` to a slice if it's needed.
  5294. *
  5295. * @private
  5296. * @param {Array} array The array to inspect.
  5297. * @param {number} start The start position.
  5298. * @param {number} [end=array.length] The end position.
  5299. * @returns {Array} Returns the cast slice.
  5300. */
  5301. function castSlice(array, start, end) {
  5302. var length = array.length;
  5303. end = end === undefined ? length : end;
  5304. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5305. }
  5306. /**
  5307. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5308. *
  5309. * @private
  5310. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5311. */
  5312. var clearTimeout = ctxClearTimeout || function(id) {
  5313. return root.clearTimeout(id);
  5314. };
  5315. /**
  5316. * Creates a clone of `buffer`.
  5317. *
  5318. * @private
  5319. * @param {Buffer} buffer The buffer to clone.
  5320. * @param {boolean} [isDeep] Specify a deep clone.
  5321. * @returns {Buffer} Returns the cloned buffer.
  5322. */
  5323. function cloneBuffer(buffer, isDeep) {
  5324. if (isDeep) {
  5325. return buffer.slice();
  5326. }
  5327. var length = buffer.length,
  5328. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5329. buffer.copy(result);
  5330. return result;
  5331. }
  5332. /**
  5333. * Creates a clone of `arrayBuffer`.
  5334. *
  5335. * @private
  5336. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5337. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5338. */
  5339. function cloneArrayBuffer(arrayBuffer) {
  5340. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5341. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5342. return result;
  5343. }
  5344. /**
  5345. * Creates a clone of `dataView`.
  5346. *
  5347. * @private
  5348. * @param {Object} dataView The data view to clone.
  5349. * @param {boolean} [isDeep] Specify a deep clone.
  5350. * @returns {Object} Returns the cloned data view.
  5351. */
  5352. function cloneDataView(dataView, isDeep) {
  5353. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5354. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5355. }
  5356. /**
  5357. * Creates a clone of `regexp`.
  5358. *
  5359. * @private
  5360. * @param {Object} regexp The regexp to clone.
  5361. * @returns {Object} Returns the cloned regexp.
  5362. */
  5363. function cloneRegExp(regexp) {
  5364. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5365. result.lastIndex = regexp.lastIndex;
  5366. return result;
  5367. }
  5368. /**
  5369. * Creates a clone of the `symbol` object.
  5370. *
  5371. * @private
  5372. * @param {Object} symbol The symbol object to clone.
  5373. * @returns {Object} Returns the cloned symbol object.
  5374. */
  5375. function cloneSymbol(symbol) {
  5376. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5377. }
  5378. /**
  5379. * Creates a clone of `typedArray`.
  5380. *
  5381. * @private
  5382. * @param {Object} typedArray The typed array to clone.
  5383. * @param {boolean} [isDeep] Specify a deep clone.
  5384. * @returns {Object} Returns the cloned typed array.
  5385. */
  5386. function cloneTypedArray(typedArray, isDeep) {
  5387. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5388. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5389. }
  5390. /**
  5391. * Compares values to sort them in ascending order.
  5392. *
  5393. * @private
  5394. * @param {*} value The value to compare.
  5395. * @param {*} other The other value to compare.
  5396. * @returns {number} Returns the sort order indicator for `value`.
  5397. */
  5398. function compareAscending(value, other) {
  5399. if (value !== other) {
  5400. var valIsDefined = value !== undefined,
  5401. valIsNull = value === null,
  5402. valIsReflexive = value === value,
  5403. valIsSymbol = isSymbol(value);
  5404. var othIsDefined = other !== undefined,
  5405. othIsNull = other === null,
  5406. othIsReflexive = other === other,
  5407. othIsSymbol = isSymbol(other);
  5408. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5409. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5410. (valIsNull && othIsDefined && othIsReflexive) ||
  5411. (!valIsDefined && othIsReflexive) ||
  5412. !valIsReflexive) {
  5413. return 1;
  5414. }
  5415. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5416. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5417. (othIsNull && valIsDefined && valIsReflexive) ||
  5418. (!othIsDefined && valIsReflexive) ||
  5419. !othIsReflexive) {
  5420. return -1;
  5421. }
  5422. }
  5423. return 0;
  5424. }
  5425. /**
  5426. * Used by `_.orderBy` to compare multiple properties of a value to another
  5427. * and stable sort them.
  5428. *
  5429. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5430. * specify an order of "desc" for descending or "asc" for ascending sort order
  5431. * of corresponding values.
  5432. *
  5433. * @private
  5434. * @param {Object} object The object to compare.
  5435. * @param {Object} other The other object to compare.
  5436. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5437. * @returns {number} Returns the sort order indicator for `object`.
  5438. */
  5439. function compareMultiple(object, other, orders) {
  5440. var index = -1,
  5441. objCriteria = object.criteria,
  5442. othCriteria = other.criteria,
  5443. length = objCriteria.length,
  5444. ordersLength = orders.length;
  5445. while (++index < length) {
  5446. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5447. if (result) {
  5448. if (index >= ordersLength) {
  5449. return result;
  5450. }
  5451. var order = orders[index];
  5452. return result * (order == 'desc' ? -1 : 1);
  5453. }
  5454. }
  5455. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5456. // that causes it, under certain circumstances, to provide the same value for
  5457. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5458. // for more details.
  5459. //
  5460. // This also ensures a stable sort in V8 and other engines.
  5461. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5462. return object.index - other.index;
  5463. }
  5464. /**
  5465. * Creates an array that is the composition of partially applied arguments,
  5466. * placeholders, and provided arguments into a single array of arguments.
  5467. *
  5468. * @private
  5469. * @param {Array} args The provided arguments.
  5470. * @param {Array} partials The arguments to prepend to those provided.
  5471. * @param {Array} holders The `partials` placeholder indexes.
  5472. * @params {boolean} [isCurried] Specify composing for a curried function.
  5473. * @returns {Array} Returns the new array of composed arguments.
  5474. */
  5475. function composeArgs(args, partials, holders, isCurried) {
  5476. var argsIndex = -1,
  5477. argsLength = args.length,
  5478. holdersLength = holders.length,
  5479. leftIndex = -1,
  5480. leftLength = partials.length,
  5481. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5482. result = Array(leftLength + rangeLength),
  5483. isUncurried = !isCurried;
  5484. while (++leftIndex < leftLength) {
  5485. result[leftIndex] = partials[leftIndex];
  5486. }
  5487. while (++argsIndex < holdersLength) {
  5488. if (isUncurried || argsIndex < argsLength) {
  5489. result[holders[argsIndex]] = args[argsIndex];
  5490. }
  5491. }
  5492. while (rangeLength--) {
  5493. result[leftIndex++] = args[argsIndex++];
  5494. }
  5495. return result;
  5496. }
  5497. /**
  5498. * This function is like `composeArgs` except that the arguments composition
  5499. * is tailored for `_.partialRight`.
  5500. *
  5501. * @private
  5502. * @param {Array} args The provided arguments.
  5503. * @param {Array} partials The arguments to append to those provided.
  5504. * @param {Array} holders The `partials` placeholder indexes.
  5505. * @params {boolean} [isCurried] Specify composing for a curried function.
  5506. * @returns {Array} Returns the new array of composed arguments.
  5507. */
  5508. function composeArgsRight(args, partials, holders, isCurried) {
  5509. var argsIndex = -1,
  5510. argsLength = args.length,
  5511. holdersIndex = -1,
  5512. holdersLength = holders.length,
  5513. rightIndex = -1,
  5514. rightLength = partials.length,
  5515. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5516. result = Array(rangeLength + rightLength),
  5517. isUncurried = !isCurried;
  5518. while (++argsIndex < rangeLength) {
  5519. result[argsIndex] = args[argsIndex];
  5520. }
  5521. var offset = argsIndex;
  5522. while (++rightIndex < rightLength) {
  5523. result[offset + rightIndex] = partials[rightIndex];
  5524. }
  5525. while (++holdersIndex < holdersLength) {
  5526. if (isUncurried || argsIndex < argsLength) {
  5527. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5528. }
  5529. }
  5530. return result;
  5531. }
  5532. /**
  5533. * Copies the values of `source` to `array`.
  5534. *
  5535. * @private
  5536. * @param {Array} source The array to copy values from.
  5537. * @param {Array} [array=[]] The array to copy values to.
  5538. * @returns {Array} Returns `array`.
  5539. */
  5540. function copyArray(source, array) {
  5541. var index = -1,
  5542. length = source.length;
  5543. array || (array = Array(length));
  5544. while (++index < length) {
  5545. array[index] = source[index];
  5546. }
  5547. return array;
  5548. }
  5549. /**
  5550. * Copies properties of `source` to `object`.
  5551. *
  5552. * @private
  5553. * @param {Object} source The object to copy properties from.
  5554. * @param {Array} props The property identifiers to copy.
  5555. * @param {Object} [object={}] The object to copy properties to.
  5556. * @param {Function} [customizer] The function to customize copied values.
  5557. * @returns {Object} Returns `object`.
  5558. */
  5559. function copyObject(source, props, object, customizer) {
  5560. var isNew = !object;
  5561. object || (object = {});
  5562. var index = -1,
  5563. length = props.length;
  5564. while (++index < length) {
  5565. var key = props[index];
  5566. var newValue = customizer
  5567. ? customizer(object[key], source[key], key, object, source)
  5568. : undefined;
  5569. if (newValue === undefined) {
  5570. newValue = source[key];
  5571. }
  5572. if (isNew) {
  5573. baseAssignValue(object, key, newValue);
  5574. } else {
  5575. assignValue(object, key, newValue);
  5576. }
  5577. }
  5578. return object;
  5579. }
  5580. /**
  5581. * Copies own symbols of `source` to `object`.
  5582. *
  5583. * @private
  5584. * @param {Object} source The object to copy symbols from.
  5585. * @param {Object} [object={}] The object to copy symbols to.
  5586. * @returns {Object} Returns `object`.
  5587. */
  5588. function copySymbols(source, object) {
  5589. return copyObject(source, getSymbols(source), object);
  5590. }
  5591. /**
  5592. * Copies own and inherited symbols of `source` to `object`.
  5593. *
  5594. * @private
  5595. * @param {Object} source The object to copy symbols from.
  5596. * @param {Object} [object={}] The object to copy symbols to.
  5597. * @returns {Object} Returns `object`.
  5598. */
  5599. function copySymbolsIn(source, object) {
  5600. return copyObject(source, getSymbolsIn(source), object);
  5601. }
  5602. /**
  5603. * Creates a function like `_.groupBy`.
  5604. *
  5605. * @private
  5606. * @param {Function} setter The function to set accumulator values.
  5607. * @param {Function} [initializer] The accumulator object initializer.
  5608. * @returns {Function} Returns the new aggregator function.
  5609. */
  5610. function createAggregator(setter, initializer) {
  5611. return function(collection, iteratee) {
  5612. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5613. accumulator = initializer ? initializer() : {};
  5614. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5615. };
  5616. }
  5617. /**
  5618. * Creates a function like `_.assign`.
  5619. *
  5620. * @private
  5621. * @param {Function} assigner The function to assign values.
  5622. * @returns {Function} Returns the new assigner function.
  5623. */
  5624. function createAssigner(assigner) {
  5625. return baseRest(function(object, sources) {
  5626. var index = -1,
  5627. length = sources.length,
  5628. customizer = length > 1 ? sources[length - 1] : undefined,
  5629. guard = length > 2 ? sources[2] : undefined;
  5630. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5631. ? (length--, customizer)
  5632. : undefined;
  5633. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5634. customizer = length < 3 ? undefined : customizer;
  5635. length = 1;
  5636. }
  5637. object = Object(object);
  5638. while (++index < length) {
  5639. var source = sources[index];
  5640. if (source) {
  5641. assigner(object, source, index, customizer);
  5642. }
  5643. }
  5644. return object;
  5645. });
  5646. }
  5647. /**
  5648. * Creates a `baseEach` or `baseEachRight` function.
  5649. *
  5650. * @private
  5651. * @param {Function} eachFunc The function to iterate over a collection.
  5652. * @param {boolean} [fromRight] Specify iterating from right to left.
  5653. * @returns {Function} Returns the new base function.
  5654. */
  5655. function createBaseEach(eachFunc, fromRight) {
  5656. return function(collection, iteratee) {
  5657. if (collection == null) {
  5658. return collection;
  5659. }
  5660. if (!isArrayLike(collection)) {
  5661. return eachFunc(collection, iteratee);
  5662. }
  5663. var length = collection.length,
  5664. index = fromRight ? length : -1,
  5665. iterable = Object(collection);
  5666. while ((fromRight ? index-- : ++index < length)) {
  5667. if (iteratee(iterable[index], index, iterable) === false) {
  5668. break;
  5669. }
  5670. }
  5671. return collection;
  5672. };
  5673. }
  5674. /**
  5675. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5676. *
  5677. * @private
  5678. * @param {boolean} [fromRight] Specify iterating from right to left.
  5679. * @returns {Function} Returns the new base function.
  5680. */
  5681. function createBaseFor(fromRight) {
  5682. return function(object, iteratee, keysFunc) {
  5683. var index = -1,
  5684. iterable = Object(object),
  5685. props = keysFunc(object),
  5686. length = props.length;
  5687. while (length--) {
  5688. var key = props[fromRight ? length : ++index];
  5689. if (iteratee(iterable[key], key, iterable) === false) {
  5690. break;
  5691. }
  5692. }
  5693. return object;
  5694. };
  5695. }
  5696. /**
  5697. * Creates a function that wraps `func` to invoke it with the optional `this`
  5698. * binding of `thisArg`.
  5699. *
  5700. * @private
  5701. * @param {Function} func The function to wrap.
  5702. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5703. * @param {*} [thisArg] The `this` binding of `func`.
  5704. * @returns {Function} Returns the new wrapped function.
  5705. */
  5706. function createBind(func, bitmask, thisArg) {
  5707. var isBind = bitmask & WRAP_BIND_FLAG,
  5708. Ctor = createCtor(func);
  5709. function wrapper() {
  5710. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5711. return fn.apply(isBind ? thisArg : this, arguments);
  5712. }
  5713. return wrapper;
  5714. }
  5715. /**
  5716. * Creates a function like `_.lowerFirst`.
  5717. *
  5718. * @private
  5719. * @param {string} methodName The name of the `String` case method to use.
  5720. * @returns {Function} Returns the new case function.
  5721. */
  5722. function createCaseFirst(methodName) {
  5723. return function(string) {
  5724. string = toString(string);
  5725. var strSymbols = hasUnicode(string)
  5726. ? stringToArray(string)
  5727. : undefined;
  5728. var chr = strSymbols
  5729. ? strSymbols[0]
  5730. : string.charAt(0);
  5731. var trailing = strSymbols
  5732. ? castSlice(strSymbols, 1).join('')
  5733. : string.slice(1);
  5734. return chr[methodName]() + trailing;
  5735. };
  5736. }
  5737. /**
  5738. * Creates a function like `_.camelCase`.
  5739. *
  5740. * @private
  5741. * @param {Function} callback The function to combine each word.
  5742. * @returns {Function} Returns the new compounder function.
  5743. */
  5744. function createCompounder(callback) {
  5745. return function(string) {
  5746. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5747. };
  5748. }
  5749. /**
  5750. * Creates a function that produces an instance of `Ctor` regardless of
  5751. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5752. *
  5753. * @private
  5754. * @param {Function} Ctor The constructor to wrap.
  5755. * @returns {Function} Returns the new wrapped function.
  5756. */
  5757. function createCtor(Ctor) {
  5758. return function() {
  5759. // Use a `switch` statement to work with class constructors. See
  5760. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5761. // for more details.
  5762. var args = arguments;
  5763. switch (args.length) {
  5764. case 0: return new Ctor;
  5765. case 1: return new Ctor(args[0]);
  5766. case 2: return new Ctor(args[0], args[1]);
  5767. case 3: return new Ctor(args[0], args[1], args[2]);
  5768. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5769. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5770. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5771. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5772. }
  5773. var thisBinding = baseCreate(Ctor.prototype),
  5774. result = Ctor.apply(thisBinding, args);
  5775. // Mimic the constructor's `return` behavior.
  5776. // See https://es5.github.io/#x13.2.2 for more details.
  5777. return isObject(result) ? result : thisBinding;
  5778. };
  5779. }
  5780. /**
  5781. * Creates a function that wraps `func` to enable currying.
  5782. *
  5783. * @private
  5784. * @param {Function} func The function to wrap.
  5785. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5786. * @param {number} arity The arity of `func`.
  5787. * @returns {Function} Returns the new wrapped function.
  5788. */
  5789. function createCurry(func, bitmask, arity) {
  5790. var Ctor = createCtor(func);
  5791. function wrapper() {
  5792. var length = arguments.length,
  5793. args = Array(length),
  5794. index = length,
  5795. placeholder = getHolder(wrapper);
  5796. while (index--) {
  5797. args[index] = arguments[index];
  5798. }
  5799. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5800. ? []
  5801. : replaceHolders(args, placeholder);
  5802. length -= holders.length;
  5803. if (length < arity) {
  5804. return createRecurry(
  5805. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5806. args, holders, undefined, undefined, arity - length);
  5807. }
  5808. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5809. return apply(fn, this, args);
  5810. }
  5811. return wrapper;
  5812. }
  5813. /**
  5814. * Creates a `_.find` or `_.findLast` function.
  5815. *
  5816. * @private
  5817. * @param {Function} findIndexFunc The function to find the collection index.
  5818. * @returns {Function} Returns the new find function.
  5819. */
  5820. function createFind(findIndexFunc) {
  5821. return function(collection, predicate, fromIndex) {
  5822. var iterable = Object(collection);
  5823. if (!isArrayLike(collection)) {
  5824. var iteratee = getIteratee(predicate, 3);
  5825. collection = keys(collection);
  5826. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5827. }
  5828. var index = findIndexFunc(collection, predicate, fromIndex);
  5829. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5830. };
  5831. }
  5832. /**
  5833. * Creates a `_.flow` or `_.flowRight` function.
  5834. *
  5835. * @private
  5836. * @param {boolean} [fromRight] Specify iterating from right to left.
  5837. * @returns {Function} Returns the new flow function.
  5838. */
  5839. function createFlow(fromRight) {
  5840. return flatRest(function(funcs) {
  5841. var length = funcs.length,
  5842. index = length,
  5843. prereq = LodashWrapper.prototype.thru;
  5844. if (fromRight) {
  5845. funcs.reverse();
  5846. }
  5847. while (index--) {
  5848. var func = funcs[index];
  5849. if (typeof func != 'function') {
  5850. throw new TypeError(FUNC_ERROR_TEXT);
  5851. }
  5852. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5853. var wrapper = new LodashWrapper([], true);
  5854. }
  5855. }
  5856. index = wrapper ? index : length;
  5857. while (++index < length) {
  5858. func = funcs[index];
  5859. var funcName = getFuncName(func),
  5860. data = funcName == 'wrapper' ? getData(func) : undefined;
  5861. if (data && isLaziable(data[0]) &&
  5862. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5863. !data[4].length && data[9] == 1
  5864. ) {
  5865. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5866. } else {
  5867. wrapper = (func.length == 1 && isLaziable(func))
  5868. ? wrapper[funcName]()
  5869. : wrapper.thru(func);
  5870. }
  5871. }
  5872. return function() {
  5873. var args = arguments,
  5874. value = args[0];
  5875. if (wrapper && args.length == 1 && isArray(value)) {
  5876. return wrapper.plant(value).value();
  5877. }
  5878. var index = 0,
  5879. result = length ? funcs[index].apply(this, args) : value;
  5880. while (++index < length) {
  5881. result = funcs[index].call(this, result);
  5882. }
  5883. return result;
  5884. };
  5885. });
  5886. }
  5887. /**
  5888. * Creates a function that wraps `func` to invoke it with optional `this`
  5889. * binding of `thisArg`, partial application, and currying.
  5890. *
  5891. * @private
  5892. * @param {Function|string} func The function or method name to wrap.
  5893. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5894. * @param {*} [thisArg] The `this` binding of `func`.
  5895. * @param {Array} [partials] The arguments to prepend to those provided to
  5896. * the new function.
  5897. * @param {Array} [holders] The `partials` placeholder indexes.
  5898. * @param {Array} [partialsRight] The arguments to append to those provided
  5899. * to the new function.
  5900. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5901. * @param {Array} [argPos] The argument positions of the new function.
  5902. * @param {number} [ary] The arity cap of `func`.
  5903. * @param {number} [arity] The arity of `func`.
  5904. * @returns {Function} Returns the new wrapped function.
  5905. */
  5906. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5907. var isAry = bitmask & WRAP_ARY_FLAG,
  5908. isBind = bitmask & WRAP_BIND_FLAG,
  5909. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5910. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5911. isFlip = bitmask & WRAP_FLIP_FLAG,
  5912. Ctor = isBindKey ? undefined : createCtor(func);
  5913. function wrapper() {
  5914. var length = arguments.length,
  5915. args = Array(length),
  5916. index = length;
  5917. while (index--) {
  5918. args[index] = arguments[index];
  5919. }
  5920. if (isCurried) {
  5921. var placeholder = getHolder(wrapper),
  5922. holdersCount = countHolders(args, placeholder);
  5923. }
  5924. if (partials) {
  5925. args = composeArgs(args, partials, holders, isCurried);
  5926. }
  5927. if (partialsRight) {
  5928. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5929. }
  5930. length -= holdersCount;
  5931. if (isCurried && length < arity) {
  5932. var newHolders = replaceHolders(args, placeholder);
  5933. return createRecurry(
  5934. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5935. args, newHolders, argPos, ary, arity - length
  5936. );
  5937. }
  5938. var thisBinding = isBind ? thisArg : this,
  5939. fn = isBindKey ? thisBinding[func] : func;
  5940. length = args.length;
  5941. if (argPos) {
  5942. args = reorder(args, argPos);
  5943. } else if (isFlip && length > 1) {
  5944. args.reverse();
  5945. }
  5946. if (isAry && ary < length) {
  5947. args.length = ary;
  5948. }
  5949. if (this && this !== root && this instanceof wrapper) {
  5950. fn = Ctor || createCtor(fn);
  5951. }
  5952. return fn.apply(thisBinding, args);
  5953. }
  5954. return wrapper;
  5955. }
  5956. /**
  5957. * Creates a function like `_.invertBy`.
  5958. *
  5959. * @private
  5960. * @param {Function} setter The function to set accumulator values.
  5961. * @param {Function} toIteratee The function to resolve iteratees.
  5962. * @returns {Function} Returns the new inverter function.
  5963. */
  5964. function createInverter(setter, toIteratee) {
  5965. return function(object, iteratee) {
  5966. return baseInverter(object, setter, toIteratee(iteratee), {});
  5967. };
  5968. }
  5969. /**
  5970. * Creates a function that performs a mathematical operation on two values.
  5971. *
  5972. * @private
  5973. * @param {Function} operator The function to perform the operation.
  5974. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5975. * @returns {Function} Returns the new mathematical operation function.
  5976. */
  5977. function createMathOperation(operator, defaultValue) {
  5978. return function(value, other) {
  5979. var result;
  5980. if (value === undefined && other === undefined) {
  5981. return defaultValue;
  5982. }
  5983. if (value !== undefined) {
  5984. result = value;
  5985. }
  5986. if (other !== undefined) {
  5987. if (result === undefined) {
  5988. return other;
  5989. }
  5990. if (typeof value == 'string' || typeof other == 'string') {
  5991. value = baseToString(value);
  5992. other = baseToString(other);
  5993. } else {
  5994. value = baseToNumber(value);
  5995. other = baseToNumber(other);
  5996. }
  5997. result = operator(value, other);
  5998. }
  5999. return result;
  6000. };
  6001. }
  6002. /**
  6003. * Creates a function like `_.over`.
  6004. *
  6005. * @private
  6006. * @param {Function} arrayFunc The function to iterate over iteratees.
  6007. * @returns {Function} Returns the new over function.
  6008. */
  6009. function createOver(arrayFunc) {
  6010. return flatRest(function(iteratees) {
  6011. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6012. return baseRest(function(args) {
  6013. var thisArg = this;
  6014. return arrayFunc(iteratees, function(iteratee) {
  6015. return apply(iteratee, thisArg, args);
  6016. });
  6017. });
  6018. });
  6019. }
  6020. /**
  6021. * Creates the padding for `string` based on `length`. The `chars` string
  6022. * is truncated if the number of characters exceeds `length`.
  6023. *
  6024. * @private
  6025. * @param {number} length The padding length.
  6026. * @param {string} [chars=' '] The string used as padding.
  6027. * @returns {string} Returns the padding for `string`.
  6028. */
  6029. function createPadding(length, chars) {
  6030. chars = chars === undefined ? ' ' : baseToString(chars);
  6031. var charsLength = chars.length;
  6032. if (charsLength < 2) {
  6033. return charsLength ? baseRepeat(chars, length) : chars;
  6034. }
  6035. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6036. return hasUnicode(chars)
  6037. ? castSlice(stringToArray(result), 0, length).join('')
  6038. : result.slice(0, length);
  6039. }
  6040. /**
  6041. * Creates a function that wraps `func` to invoke it with the `this` binding
  6042. * of `thisArg` and `partials` prepended to the arguments it receives.
  6043. *
  6044. * @private
  6045. * @param {Function} func The function to wrap.
  6046. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6047. * @param {*} thisArg The `this` binding of `func`.
  6048. * @param {Array} partials The arguments to prepend to those provided to
  6049. * the new function.
  6050. * @returns {Function} Returns the new wrapped function.
  6051. */
  6052. function createPartial(func, bitmask, thisArg, partials) {
  6053. var isBind = bitmask & WRAP_BIND_FLAG,
  6054. Ctor = createCtor(func);
  6055. function wrapper() {
  6056. var argsIndex = -1,
  6057. argsLength = arguments.length,
  6058. leftIndex = -1,
  6059. leftLength = partials.length,
  6060. args = Array(leftLength + argsLength),
  6061. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6062. while (++leftIndex < leftLength) {
  6063. args[leftIndex] = partials[leftIndex];
  6064. }
  6065. while (argsLength--) {
  6066. args[leftIndex++] = arguments[++argsIndex];
  6067. }
  6068. return apply(fn, isBind ? thisArg : this, args);
  6069. }
  6070. return wrapper;
  6071. }
  6072. /**
  6073. * Creates a `_.range` or `_.rangeRight` function.
  6074. *
  6075. * @private
  6076. * @param {boolean} [fromRight] Specify iterating from right to left.
  6077. * @returns {Function} Returns the new range function.
  6078. */
  6079. function createRange(fromRight) {
  6080. return function(start, end, step) {
  6081. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6082. end = step = undefined;
  6083. }
  6084. // Ensure the sign of `-0` is preserved.
  6085. start = toFinite(start);
  6086. if (end === undefined) {
  6087. end = start;
  6088. start = 0;
  6089. } else {
  6090. end = toFinite(end);
  6091. }
  6092. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6093. return baseRange(start, end, step, fromRight);
  6094. };
  6095. }
  6096. /**
  6097. * Creates a function that performs a relational operation on two values.
  6098. *
  6099. * @private
  6100. * @param {Function} operator The function to perform the operation.
  6101. * @returns {Function} Returns the new relational operation function.
  6102. */
  6103. function createRelationalOperation(operator) {
  6104. return function(value, other) {
  6105. if (!(typeof value == 'string' && typeof other == 'string')) {
  6106. value = toNumber(value);
  6107. other = toNumber(other);
  6108. }
  6109. return operator(value, other);
  6110. };
  6111. }
  6112. /**
  6113. * Creates a function that wraps `func` to continue currying.
  6114. *
  6115. * @private
  6116. * @param {Function} func The function to wrap.
  6117. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6118. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6119. * @param {*} placeholder The placeholder value.
  6120. * @param {*} [thisArg] The `this` binding of `func`.
  6121. * @param {Array} [partials] The arguments to prepend to those provided to
  6122. * the new function.
  6123. * @param {Array} [holders] The `partials` placeholder indexes.
  6124. * @param {Array} [argPos] The argument positions of the new function.
  6125. * @param {number} [ary] The arity cap of `func`.
  6126. * @param {number} [arity] The arity of `func`.
  6127. * @returns {Function} Returns the new wrapped function.
  6128. */
  6129. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6130. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6131. newHolders = isCurry ? holders : undefined,
  6132. newHoldersRight = isCurry ? undefined : holders,
  6133. newPartials = isCurry ? partials : undefined,
  6134. newPartialsRight = isCurry ? undefined : partials;
  6135. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6136. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6137. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6138. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6139. }
  6140. var newData = [
  6141. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6142. newHoldersRight, argPos, ary, arity
  6143. ];
  6144. var result = wrapFunc.apply(undefined, newData);
  6145. if (isLaziable(func)) {
  6146. setData(result, newData);
  6147. }
  6148. result.placeholder = placeholder;
  6149. return setWrapToString(result, func, bitmask);
  6150. }
  6151. /**
  6152. * Creates a function like `_.round`.
  6153. *
  6154. * @private
  6155. * @param {string} methodName The name of the `Math` method to use when rounding.
  6156. * @returns {Function} Returns the new round function.
  6157. */
  6158. function createRound(methodName) {
  6159. var func = Math[methodName];
  6160. return function(number, precision) {
  6161. number = toNumber(number);
  6162. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6163. if (precision && nativeIsFinite(number)) {
  6164. // Shift with exponential notation to avoid floating-point issues.
  6165. // See [MDN](https://mdn.io/round#Examples) for more details.
  6166. var pair = (toString(number) + 'e').split('e'),
  6167. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6168. pair = (toString(value) + 'e').split('e');
  6169. return +(pair[0] + 'e' + (+pair[1] - precision));
  6170. }
  6171. return func(number);
  6172. };
  6173. }
  6174. /**
  6175. * Creates a set object of `values`.
  6176. *
  6177. * @private
  6178. * @param {Array} values The values to add to the set.
  6179. * @returns {Object} Returns the new set.
  6180. */
  6181. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6182. return new Set(values);
  6183. };
  6184. /**
  6185. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6186. *
  6187. * @private
  6188. * @param {Function} keysFunc The function to get the keys of a given object.
  6189. * @returns {Function} Returns the new pairs function.
  6190. */
  6191. function createToPairs(keysFunc) {
  6192. return function(object) {
  6193. var tag = getTag(object);
  6194. if (tag == mapTag) {
  6195. return mapToArray(object);
  6196. }
  6197. if (tag == setTag) {
  6198. return setToPairs(object);
  6199. }
  6200. return baseToPairs(object, keysFunc(object));
  6201. };
  6202. }
  6203. /**
  6204. * Creates a function that either curries or invokes `func` with optional
  6205. * `this` binding and partially applied arguments.
  6206. *
  6207. * @private
  6208. * @param {Function|string} func The function or method name to wrap.
  6209. * @param {number} bitmask The bitmask flags.
  6210. * 1 - `_.bind`
  6211. * 2 - `_.bindKey`
  6212. * 4 - `_.curry` or `_.curryRight` of a bound function
  6213. * 8 - `_.curry`
  6214. * 16 - `_.curryRight`
  6215. * 32 - `_.partial`
  6216. * 64 - `_.partialRight`
  6217. * 128 - `_.rearg`
  6218. * 256 - `_.ary`
  6219. * 512 - `_.flip`
  6220. * @param {*} [thisArg] The `this` binding of `func`.
  6221. * @param {Array} [partials] The arguments to be partially applied.
  6222. * @param {Array} [holders] The `partials` placeholder indexes.
  6223. * @param {Array} [argPos] The argument positions of the new function.
  6224. * @param {number} [ary] The arity cap of `func`.
  6225. * @param {number} [arity] The arity of `func`.
  6226. * @returns {Function} Returns the new wrapped function.
  6227. */
  6228. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6229. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6230. if (!isBindKey && typeof func != 'function') {
  6231. throw new TypeError(FUNC_ERROR_TEXT);
  6232. }
  6233. var length = partials ? partials.length : 0;
  6234. if (!length) {
  6235. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6236. partials = holders = undefined;
  6237. }
  6238. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6239. arity = arity === undefined ? arity : toInteger(arity);
  6240. length -= holders ? holders.length : 0;
  6241. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6242. var partialsRight = partials,
  6243. holdersRight = holders;
  6244. partials = holders = undefined;
  6245. }
  6246. var data = isBindKey ? undefined : getData(func);
  6247. var newData = [
  6248. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6249. argPos, ary, arity
  6250. ];
  6251. if (data) {
  6252. mergeData(newData, data);
  6253. }
  6254. func = newData[0];
  6255. bitmask = newData[1];
  6256. thisArg = newData[2];
  6257. partials = newData[3];
  6258. holders = newData[4];
  6259. arity = newData[9] = newData[9] === undefined
  6260. ? (isBindKey ? 0 : func.length)
  6261. : nativeMax(newData[9] - length, 0);
  6262. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6263. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6264. }
  6265. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6266. var result = createBind(func, bitmask, thisArg);
  6267. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6268. result = createCurry(func, bitmask, arity);
  6269. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6270. result = createPartial(func, bitmask, thisArg, partials);
  6271. } else {
  6272. result = createHybrid.apply(undefined, newData);
  6273. }
  6274. var setter = data ? baseSetData : setData;
  6275. return setWrapToString(setter(result, newData), func, bitmask);
  6276. }
  6277. /**
  6278. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6279. * of source objects to the destination object for all destination properties
  6280. * that resolve to `undefined`.
  6281. *
  6282. * @private
  6283. * @param {*} objValue The destination value.
  6284. * @param {*} srcValue The source value.
  6285. * @param {string} key The key of the property to assign.
  6286. * @param {Object} object The parent object of `objValue`.
  6287. * @returns {*} Returns the value to assign.
  6288. */
  6289. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6290. if (objValue === undefined ||
  6291. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6292. return srcValue;
  6293. }
  6294. return objValue;
  6295. }
  6296. /**
  6297. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6298. * objects into destination objects that are passed thru.
  6299. *
  6300. * @private
  6301. * @param {*} objValue The destination value.
  6302. * @param {*} srcValue The source value.
  6303. * @param {string} key The key of the property to merge.
  6304. * @param {Object} object The parent object of `objValue`.
  6305. * @param {Object} source The parent object of `srcValue`.
  6306. * @param {Object} [stack] Tracks traversed source values and their merged
  6307. * counterparts.
  6308. * @returns {*} Returns the value to assign.
  6309. */
  6310. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6311. if (isObject(objValue) && isObject(srcValue)) {
  6312. // Recursively merge objects and arrays (susceptible to call stack limits).
  6313. stack.set(srcValue, objValue);
  6314. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6315. stack['delete'](srcValue);
  6316. }
  6317. return objValue;
  6318. }
  6319. /**
  6320. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6321. * objects.
  6322. *
  6323. * @private
  6324. * @param {*} value The value to inspect.
  6325. * @param {string} key The key of the property to inspect.
  6326. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6327. */
  6328. function customOmitClone(value) {
  6329. return isPlainObject(value) ? undefined : value;
  6330. }
  6331. /**
  6332. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6333. * partial deep comparisons.
  6334. *
  6335. * @private
  6336. * @param {Array} array The array to compare.
  6337. * @param {Array} other The other array to compare.
  6338. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6339. * @param {Function} customizer The function to customize comparisons.
  6340. * @param {Function} equalFunc The function to determine equivalents of values.
  6341. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6342. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6343. */
  6344. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6345. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6346. arrLength = array.length,
  6347. othLength = other.length;
  6348. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6349. return false;
  6350. }
  6351. // Check that cyclic values are equal.
  6352. var arrStacked = stack.get(array);
  6353. var othStacked = stack.get(other);
  6354. if (arrStacked && othStacked) {
  6355. return arrStacked == other && othStacked == array;
  6356. }
  6357. var index = -1,
  6358. result = true,
  6359. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6360. stack.set(array, other);
  6361. stack.set(other, array);
  6362. // Ignore non-index properties.
  6363. while (++index < arrLength) {
  6364. var arrValue = array[index],
  6365. othValue = other[index];
  6366. if (customizer) {
  6367. var compared = isPartial
  6368. ? customizer(othValue, arrValue, index, other, array, stack)
  6369. : customizer(arrValue, othValue, index, array, other, stack);
  6370. }
  6371. if (compared !== undefined) {
  6372. if (compared) {
  6373. continue;
  6374. }
  6375. result = false;
  6376. break;
  6377. }
  6378. // Recursively compare arrays (susceptible to call stack limits).
  6379. if (seen) {
  6380. if (!arraySome(other, function(othValue, othIndex) {
  6381. if (!cacheHas(seen, othIndex) &&
  6382. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6383. return seen.push(othIndex);
  6384. }
  6385. })) {
  6386. result = false;
  6387. break;
  6388. }
  6389. } else if (!(
  6390. arrValue === othValue ||
  6391. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6392. )) {
  6393. result = false;
  6394. break;
  6395. }
  6396. }
  6397. stack['delete'](array);
  6398. stack['delete'](other);
  6399. return result;
  6400. }
  6401. /**
  6402. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6403. * the same `toStringTag`.
  6404. *
  6405. * **Note:** This function only supports comparing values with tags of
  6406. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6407. *
  6408. * @private
  6409. * @param {Object} object The object to compare.
  6410. * @param {Object} other The other object to compare.
  6411. * @param {string} tag The `toStringTag` of the objects to compare.
  6412. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6413. * @param {Function} customizer The function to customize comparisons.
  6414. * @param {Function} equalFunc The function to determine equivalents of values.
  6415. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6416. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6417. */
  6418. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6419. switch (tag) {
  6420. case dataViewTag:
  6421. if ((object.byteLength != other.byteLength) ||
  6422. (object.byteOffset != other.byteOffset)) {
  6423. return false;
  6424. }
  6425. object = object.buffer;
  6426. other = other.buffer;
  6427. case arrayBufferTag:
  6428. if ((object.byteLength != other.byteLength) ||
  6429. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6430. return false;
  6431. }
  6432. return true;
  6433. case boolTag:
  6434. case dateTag:
  6435. case numberTag:
  6436. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6437. // Invalid dates are coerced to `NaN`.
  6438. return eq(+object, +other);
  6439. case errorTag:
  6440. return object.name == other.name && object.message == other.message;
  6441. case regexpTag:
  6442. case stringTag:
  6443. // Coerce regexes to strings and treat strings, primitives and objects,
  6444. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6445. // for more details.
  6446. return object == (other + '');
  6447. case mapTag:
  6448. var convert = mapToArray;
  6449. case setTag:
  6450. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6451. convert || (convert = setToArray);
  6452. if (object.size != other.size && !isPartial) {
  6453. return false;
  6454. }
  6455. // Assume cyclic values are equal.
  6456. var stacked = stack.get(object);
  6457. if (stacked) {
  6458. return stacked == other;
  6459. }
  6460. bitmask |= COMPARE_UNORDERED_FLAG;
  6461. // Recursively compare objects (susceptible to call stack limits).
  6462. stack.set(object, other);
  6463. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6464. stack['delete'](object);
  6465. return result;
  6466. case symbolTag:
  6467. if (symbolValueOf) {
  6468. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6469. }
  6470. }
  6471. return false;
  6472. }
  6473. /**
  6474. * A specialized version of `baseIsEqualDeep` for objects with support for
  6475. * partial deep comparisons.
  6476. *
  6477. * @private
  6478. * @param {Object} object The object to compare.
  6479. * @param {Object} other The other object to compare.
  6480. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6481. * @param {Function} customizer The function to customize comparisons.
  6482. * @param {Function} equalFunc The function to determine equivalents of values.
  6483. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6484. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6485. */
  6486. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6487. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6488. objProps = getAllKeys(object),
  6489. objLength = objProps.length,
  6490. othProps = getAllKeys(other),
  6491. othLength = othProps.length;
  6492. if (objLength != othLength && !isPartial) {
  6493. return false;
  6494. }
  6495. var index = objLength;
  6496. while (index--) {
  6497. var key = objProps[index];
  6498. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6499. return false;
  6500. }
  6501. }
  6502. // Check that cyclic values are equal.
  6503. var objStacked = stack.get(object);
  6504. var othStacked = stack.get(other);
  6505. if (objStacked && othStacked) {
  6506. return objStacked == other && othStacked == object;
  6507. }
  6508. var result = true;
  6509. stack.set(object, other);
  6510. stack.set(other, object);
  6511. var skipCtor = isPartial;
  6512. while (++index < objLength) {
  6513. key = objProps[index];
  6514. var objValue = object[key],
  6515. othValue = other[key];
  6516. if (customizer) {
  6517. var compared = isPartial
  6518. ? customizer(othValue, objValue, key, other, object, stack)
  6519. : customizer(objValue, othValue, key, object, other, stack);
  6520. }
  6521. // Recursively compare objects (susceptible to call stack limits).
  6522. if (!(compared === undefined
  6523. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6524. : compared
  6525. )) {
  6526. result = false;
  6527. break;
  6528. }
  6529. skipCtor || (skipCtor = key == 'constructor');
  6530. }
  6531. if (result && !skipCtor) {
  6532. var objCtor = object.constructor,
  6533. othCtor = other.constructor;
  6534. // Non `Object` object instances with different constructors are not equal.
  6535. if (objCtor != othCtor &&
  6536. ('constructor' in object && 'constructor' in other) &&
  6537. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6538. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6539. result = false;
  6540. }
  6541. }
  6542. stack['delete'](object);
  6543. stack['delete'](other);
  6544. return result;
  6545. }
  6546. /**
  6547. * A specialized version of `baseRest` which flattens the rest array.
  6548. *
  6549. * @private
  6550. * @param {Function} func The function to apply a rest parameter to.
  6551. * @returns {Function} Returns the new function.
  6552. */
  6553. function flatRest(func) {
  6554. return setToString(overRest(func, undefined, flatten), func + '');
  6555. }
  6556. /**
  6557. * Creates an array of own enumerable property names and symbols of `object`.
  6558. *
  6559. * @private
  6560. * @param {Object} object The object to query.
  6561. * @returns {Array} Returns the array of property names and symbols.
  6562. */
  6563. function getAllKeys(object) {
  6564. return baseGetAllKeys(object, keys, getSymbols);
  6565. }
  6566. /**
  6567. * Creates an array of own and inherited enumerable property names and
  6568. * symbols of `object`.
  6569. *
  6570. * @private
  6571. * @param {Object} object The object to query.
  6572. * @returns {Array} Returns the array of property names and symbols.
  6573. */
  6574. function getAllKeysIn(object) {
  6575. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6576. }
  6577. /**
  6578. * Gets metadata for `func`.
  6579. *
  6580. * @private
  6581. * @param {Function} func The function to query.
  6582. * @returns {*} Returns the metadata for `func`.
  6583. */
  6584. var getData = !metaMap ? noop : function(func) {
  6585. return metaMap.get(func);
  6586. };
  6587. /**
  6588. * Gets the name of `func`.
  6589. *
  6590. * @private
  6591. * @param {Function} func The function to query.
  6592. * @returns {string} Returns the function name.
  6593. */
  6594. function getFuncName(func) {
  6595. var result = (func.name + ''),
  6596. array = realNames[result],
  6597. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6598. while (length--) {
  6599. var data = array[length],
  6600. otherFunc = data.func;
  6601. if (otherFunc == null || otherFunc == func) {
  6602. return data.name;
  6603. }
  6604. }
  6605. return result;
  6606. }
  6607. /**
  6608. * Gets the argument placeholder value for `func`.
  6609. *
  6610. * @private
  6611. * @param {Function} func The function to inspect.
  6612. * @returns {*} Returns the placeholder value.
  6613. */
  6614. function getHolder(func) {
  6615. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6616. return object.placeholder;
  6617. }
  6618. /**
  6619. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6620. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6621. * If arguments are provided, the chosen function is invoked with them and
  6622. * its result is returned.
  6623. *
  6624. * @private
  6625. * @param {*} [value] The value to convert to an iteratee.
  6626. * @param {number} [arity] The arity of the created iteratee.
  6627. * @returns {Function} Returns the chosen function or its result.
  6628. */
  6629. function getIteratee() {
  6630. var result = lodash.iteratee || iteratee;
  6631. result = result === iteratee ? baseIteratee : result;
  6632. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6633. }
  6634. /**
  6635. * Gets the data for `map`.
  6636. *
  6637. * @private
  6638. * @param {Object} map The map to query.
  6639. * @param {string} key The reference key.
  6640. * @returns {*} Returns the map data.
  6641. */
  6642. function getMapData(map, key) {
  6643. var data = map.__data__;
  6644. return isKeyable(key)
  6645. ? data[typeof key == 'string' ? 'string' : 'hash']
  6646. : data.map;
  6647. }
  6648. /**
  6649. * Gets the property names, values, and compare flags of `object`.
  6650. *
  6651. * @private
  6652. * @param {Object} object The object to query.
  6653. * @returns {Array} Returns the match data of `object`.
  6654. */
  6655. function getMatchData(object) {
  6656. var result = keys(object),
  6657. length = result.length;
  6658. while (length--) {
  6659. var key = result[length],
  6660. value = object[key];
  6661. result[length] = [key, value, isStrictComparable(value)];
  6662. }
  6663. return result;
  6664. }
  6665. /**
  6666. * Gets the native function at `key` of `object`.
  6667. *
  6668. * @private
  6669. * @param {Object} object The object to query.
  6670. * @param {string} key The key of the method to get.
  6671. * @returns {*} Returns the function if it's native, else `undefined`.
  6672. */
  6673. function getNative(object, key) {
  6674. var value = getValue(object, key);
  6675. return baseIsNative(value) ? value : undefined;
  6676. }
  6677. /**
  6678. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6679. *
  6680. * @private
  6681. * @param {*} value The value to query.
  6682. * @returns {string} Returns the raw `toStringTag`.
  6683. */
  6684. function getRawTag(value) {
  6685. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6686. tag = value[symToStringTag];
  6687. try {
  6688. value[symToStringTag] = undefined;
  6689. var unmasked = true;
  6690. } catch (e) {}
  6691. var result = nativeObjectToString.call(value);
  6692. if (unmasked) {
  6693. if (isOwn) {
  6694. value[symToStringTag] = tag;
  6695. } else {
  6696. delete value[symToStringTag];
  6697. }
  6698. }
  6699. return result;
  6700. }
  6701. /**
  6702. * Creates an array of the own enumerable symbols of `object`.
  6703. *
  6704. * @private
  6705. * @param {Object} object The object to query.
  6706. * @returns {Array} Returns the array of symbols.
  6707. */
  6708. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6709. if (object == null) {
  6710. return [];
  6711. }
  6712. object = Object(object);
  6713. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6714. return propertyIsEnumerable.call(object, symbol);
  6715. });
  6716. };
  6717. /**
  6718. * Creates an array of the own and inherited enumerable symbols of `object`.
  6719. *
  6720. * @private
  6721. * @param {Object} object The object to query.
  6722. * @returns {Array} Returns the array of symbols.
  6723. */
  6724. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6725. var result = [];
  6726. while (object) {
  6727. arrayPush(result, getSymbols(object));
  6728. object = getPrototype(object);
  6729. }
  6730. return result;
  6731. };
  6732. /**
  6733. * Gets the `toStringTag` of `value`.
  6734. *
  6735. * @private
  6736. * @param {*} value The value to query.
  6737. * @returns {string} Returns the `toStringTag`.
  6738. */
  6739. var getTag = baseGetTag;
  6740. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6741. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6742. (Map && getTag(new Map) != mapTag) ||
  6743. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6744. (Set && getTag(new Set) != setTag) ||
  6745. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6746. getTag = function(value) {
  6747. var result = baseGetTag(value),
  6748. Ctor = result == objectTag ? value.constructor : undefined,
  6749. ctorString = Ctor ? toSource(Ctor) : '';
  6750. if (ctorString) {
  6751. switch (ctorString) {
  6752. case dataViewCtorString: return dataViewTag;
  6753. case mapCtorString: return mapTag;
  6754. case promiseCtorString: return promiseTag;
  6755. case setCtorString: return setTag;
  6756. case weakMapCtorString: return weakMapTag;
  6757. }
  6758. }
  6759. return result;
  6760. };
  6761. }
  6762. /**
  6763. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6764. *
  6765. * @private
  6766. * @param {number} start The start of the view.
  6767. * @param {number} end The end of the view.
  6768. * @param {Array} transforms The transformations to apply to the view.
  6769. * @returns {Object} Returns an object containing the `start` and `end`
  6770. * positions of the view.
  6771. */
  6772. function getView(start, end, transforms) {
  6773. var index = -1,
  6774. length = transforms.length;
  6775. while (++index < length) {
  6776. var data = transforms[index],
  6777. size = data.size;
  6778. switch (data.type) {
  6779. case 'drop': start += size; break;
  6780. case 'dropRight': end -= size; break;
  6781. case 'take': end = nativeMin(end, start + size); break;
  6782. case 'takeRight': start = nativeMax(start, end - size); break;
  6783. }
  6784. }
  6785. return { 'start': start, 'end': end };
  6786. }
  6787. /**
  6788. * Extracts wrapper details from the `source` body comment.
  6789. *
  6790. * @private
  6791. * @param {string} source The source to inspect.
  6792. * @returns {Array} Returns the wrapper details.
  6793. */
  6794. function getWrapDetails(source) {
  6795. var match = source.match(reWrapDetails);
  6796. return match ? match[1].split(reSplitDetails) : [];
  6797. }
  6798. /**
  6799. * Checks if `path` exists on `object`.
  6800. *
  6801. * @private
  6802. * @param {Object} object The object to query.
  6803. * @param {Array|string} path The path to check.
  6804. * @param {Function} hasFunc The function to check properties.
  6805. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6806. */
  6807. function hasPath(object, path, hasFunc) {
  6808. path = castPath(path, object);
  6809. var index = -1,
  6810. length = path.length,
  6811. result = false;
  6812. while (++index < length) {
  6813. var key = toKey(path[index]);
  6814. if (!(result = object != null && hasFunc(object, key))) {
  6815. break;
  6816. }
  6817. object = object[key];
  6818. }
  6819. if (result || ++index != length) {
  6820. return result;
  6821. }
  6822. length = object == null ? 0 : object.length;
  6823. return !!length && isLength(length) && isIndex(key, length) &&
  6824. (isArray(object) || isArguments(object));
  6825. }
  6826. /**
  6827. * Initializes an array clone.
  6828. *
  6829. * @private
  6830. * @param {Array} array The array to clone.
  6831. * @returns {Array} Returns the initialized clone.
  6832. */
  6833. function initCloneArray(array) {
  6834. var length = array.length,
  6835. result = new array.constructor(length);
  6836. // Add properties assigned by `RegExp#exec`.
  6837. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6838. result.index = array.index;
  6839. result.input = array.input;
  6840. }
  6841. return result;
  6842. }
  6843. /**
  6844. * Initializes an object clone.
  6845. *
  6846. * @private
  6847. * @param {Object} object The object to clone.
  6848. * @returns {Object} Returns the initialized clone.
  6849. */
  6850. function initCloneObject(object) {
  6851. return (typeof object.constructor == 'function' && !isPrototype(object))
  6852. ? baseCreate(getPrototype(object))
  6853. : {};
  6854. }
  6855. /**
  6856. * Initializes an object clone based on its `toStringTag`.
  6857. *
  6858. * **Note:** This function only supports cloning values with tags of
  6859. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6860. *
  6861. * @private
  6862. * @param {Object} object The object to clone.
  6863. * @param {string} tag The `toStringTag` of the object to clone.
  6864. * @param {boolean} [isDeep] Specify a deep clone.
  6865. * @returns {Object} Returns the initialized clone.
  6866. */
  6867. function initCloneByTag(object, tag, isDeep) {
  6868. var Ctor = object.constructor;
  6869. switch (tag) {
  6870. case arrayBufferTag:
  6871. return cloneArrayBuffer(object);
  6872. case boolTag:
  6873. case dateTag:
  6874. return new Ctor(+object);
  6875. case dataViewTag:
  6876. return cloneDataView(object, isDeep);
  6877. case float32Tag: case float64Tag:
  6878. case int8Tag: case int16Tag: case int32Tag:
  6879. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6880. return cloneTypedArray(object, isDeep);
  6881. case mapTag:
  6882. return new Ctor;
  6883. case numberTag:
  6884. case stringTag:
  6885. return new Ctor(object);
  6886. case regexpTag:
  6887. return cloneRegExp(object);
  6888. case setTag:
  6889. return new Ctor;
  6890. case symbolTag:
  6891. return cloneSymbol(object);
  6892. }
  6893. }
  6894. /**
  6895. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6896. *
  6897. * @private
  6898. * @param {string} source The source to modify.
  6899. * @returns {Array} details The details to insert.
  6900. * @returns {string} Returns the modified source.
  6901. */
  6902. function insertWrapDetails(source, details) {
  6903. var length = details.length;
  6904. if (!length) {
  6905. return source;
  6906. }
  6907. var lastIndex = length - 1;
  6908. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6909. details = details.join(length > 2 ? ', ' : ' ');
  6910. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6911. }
  6912. /**
  6913. * Checks if `value` is a flattenable `arguments` object or array.
  6914. *
  6915. * @private
  6916. * @param {*} value The value to check.
  6917. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6918. */
  6919. function isFlattenable(value) {
  6920. return isArray(value) || isArguments(value) ||
  6921. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6922. }
  6923. /**
  6924. * Checks if `value` is a valid array-like index.
  6925. *
  6926. * @private
  6927. * @param {*} value The value to check.
  6928. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6929. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6930. */
  6931. function isIndex(value, length) {
  6932. var type = typeof value;
  6933. length = length == null ? MAX_SAFE_INTEGER : length;
  6934. return !!length &&
  6935. (type == 'number' ||
  6936. (type != 'symbol' && reIsUint.test(value))) &&
  6937. (value > -1 && value % 1 == 0 && value < length);
  6938. }
  6939. /**
  6940. * Checks if the given arguments are from an iteratee call.
  6941. *
  6942. * @private
  6943. * @param {*} value The potential iteratee value argument.
  6944. * @param {*} index The potential iteratee index or key argument.
  6945. * @param {*} object The potential iteratee object argument.
  6946. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6947. * else `false`.
  6948. */
  6949. function isIterateeCall(value, index, object) {
  6950. if (!isObject(object)) {
  6951. return false;
  6952. }
  6953. var type = typeof index;
  6954. if (type == 'number'
  6955. ? (isArrayLike(object) && isIndex(index, object.length))
  6956. : (type == 'string' && index in object)
  6957. ) {
  6958. return eq(object[index], value);
  6959. }
  6960. return false;
  6961. }
  6962. /**
  6963. * Checks if `value` is a property name and not a property path.
  6964. *
  6965. * @private
  6966. * @param {*} value The value to check.
  6967. * @param {Object} [object] The object to query keys on.
  6968. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6969. */
  6970. function isKey(value, object) {
  6971. if (isArray(value)) {
  6972. return false;
  6973. }
  6974. var type = typeof value;
  6975. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6976. value == null || isSymbol(value)) {
  6977. return true;
  6978. }
  6979. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6980. (object != null && value in Object(object));
  6981. }
  6982. /**
  6983. * Checks if `value` is suitable for use as unique object key.
  6984. *
  6985. * @private
  6986. * @param {*} value The value to check.
  6987. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6988. */
  6989. function isKeyable(value) {
  6990. var type = typeof value;
  6991. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6992. ? (value !== '__proto__')
  6993. : (value === null);
  6994. }
  6995. /**
  6996. * Checks if `func` has a lazy counterpart.
  6997. *
  6998. * @private
  6999. * @param {Function} func The function to check.
  7000. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7001. * else `false`.
  7002. */
  7003. function isLaziable(func) {
  7004. var funcName = getFuncName(func),
  7005. other = lodash[funcName];
  7006. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7007. return false;
  7008. }
  7009. if (func === other) {
  7010. return true;
  7011. }
  7012. var data = getData(other);
  7013. return !!data && func === data[0];
  7014. }
  7015. /**
  7016. * Checks if `func` has its source masked.
  7017. *
  7018. * @private
  7019. * @param {Function} func The function to check.
  7020. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7021. */
  7022. function isMasked(func) {
  7023. return !!maskSrcKey && (maskSrcKey in func);
  7024. }
  7025. /**
  7026. * Checks if `func` is capable of being masked.
  7027. *
  7028. * @private
  7029. * @param {*} value The value to check.
  7030. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7031. */
  7032. var isMaskable = coreJsData ? isFunction : stubFalse;
  7033. /**
  7034. * Checks if `value` is likely a prototype object.
  7035. *
  7036. * @private
  7037. * @param {*} value The value to check.
  7038. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7039. */
  7040. function isPrototype(value) {
  7041. var Ctor = value && value.constructor,
  7042. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7043. return value === proto;
  7044. }
  7045. /**
  7046. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7047. *
  7048. * @private
  7049. * @param {*} value The value to check.
  7050. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7051. * equality comparisons, else `false`.
  7052. */
  7053. function isStrictComparable(value) {
  7054. return value === value && !isObject(value);
  7055. }
  7056. /**
  7057. * A specialized version of `matchesProperty` for source values suitable
  7058. * for strict equality comparisons, i.e. `===`.
  7059. *
  7060. * @private
  7061. * @param {string} key The key of the property to get.
  7062. * @param {*} srcValue The value to match.
  7063. * @returns {Function} Returns the new spec function.
  7064. */
  7065. function matchesStrictComparable(key, srcValue) {
  7066. return function(object) {
  7067. if (object == null) {
  7068. return false;
  7069. }
  7070. return object[key] === srcValue &&
  7071. (srcValue !== undefined || (key in Object(object)));
  7072. };
  7073. }
  7074. /**
  7075. * A specialized version of `_.memoize` which clears the memoized function's
  7076. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7077. *
  7078. * @private
  7079. * @param {Function} func The function to have its output memoized.
  7080. * @returns {Function} Returns the new memoized function.
  7081. */
  7082. function memoizeCapped(func) {
  7083. var result = memoize(func, function(key) {
  7084. if (cache.size === MAX_MEMOIZE_SIZE) {
  7085. cache.clear();
  7086. }
  7087. return key;
  7088. });
  7089. var cache = result.cache;
  7090. return result;
  7091. }
  7092. /**
  7093. * Merges the function metadata of `source` into `data`.
  7094. *
  7095. * Merging metadata reduces the number of wrappers used to invoke a function.
  7096. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7097. * may be applied regardless of execution order. Methods like `_.ary` and
  7098. * `_.rearg` modify function arguments, making the order in which they are
  7099. * executed important, preventing the merging of metadata. However, we make
  7100. * an exception for a safe combined case where curried functions have `_.ary`
  7101. * and or `_.rearg` applied.
  7102. *
  7103. * @private
  7104. * @param {Array} data The destination metadata.
  7105. * @param {Array} source The source metadata.
  7106. * @returns {Array} Returns `data`.
  7107. */
  7108. function mergeData(data, source) {
  7109. var bitmask = data[1],
  7110. srcBitmask = source[1],
  7111. newBitmask = bitmask | srcBitmask,
  7112. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7113. var isCombo =
  7114. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7115. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7116. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7117. // Exit early if metadata can't be merged.
  7118. if (!(isCommon || isCombo)) {
  7119. return data;
  7120. }
  7121. // Use source `thisArg` if available.
  7122. if (srcBitmask & WRAP_BIND_FLAG) {
  7123. data[2] = source[2];
  7124. // Set when currying a bound function.
  7125. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7126. }
  7127. // Compose partial arguments.
  7128. var value = source[3];
  7129. if (value) {
  7130. var partials = data[3];
  7131. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7132. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7133. }
  7134. // Compose partial right arguments.
  7135. value = source[5];
  7136. if (value) {
  7137. partials = data[5];
  7138. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7139. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7140. }
  7141. // Use source `argPos` if available.
  7142. value = source[7];
  7143. if (value) {
  7144. data[7] = value;
  7145. }
  7146. // Use source `ary` if it's smaller.
  7147. if (srcBitmask & WRAP_ARY_FLAG) {
  7148. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7149. }
  7150. // Use source `arity` if one is not provided.
  7151. if (data[9] == null) {
  7152. data[9] = source[9];
  7153. }
  7154. // Use source `func` and merge bitmasks.
  7155. data[0] = source[0];
  7156. data[1] = newBitmask;
  7157. return data;
  7158. }
  7159. /**
  7160. * This function is like
  7161. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7162. * except that it includes inherited enumerable properties.
  7163. *
  7164. * @private
  7165. * @param {Object} object The object to query.
  7166. * @returns {Array} Returns the array of property names.
  7167. */
  7168. function nativeKeysIn(object) {
  7169. var result = [];
  7170. if (object != null) {
  7171. for (var key in Object(object)) {
  7172. result.push(key);
  7173. }
  7174. }
  7175. return result;
  7176. }
  7177. /**
  7178. * Converts `value` to a string using `Object.prototype.toString`.
  7179. *
  7180. * @private
  7181. * @param {*} value The value to convert.
  7182. * @returns {string} Returns the converted string.
  7183. */
  7184. function objectToString(value) {
  7185. return nativeObjectToString.call(value);
  7186. }
  7187. /**
  7188. * A specialized version of `baseRest` which transforms the rest array.
  7189. *
  7190. * @private
  7191. * @param {Function} func The function to apply a rest parameter to.
  7192. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7193. * @param {Function} transform The rest array transform.
  7194. * @returns {Function} Returns the new function.
  7195. */
  7196. function overRest(func, start, transform) {
  7197. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7198. return function() {
  7199. var args = arguments,
  7200. index = -1,
  7201. length = nativeMax(args.length - start, 0),
  7202. array = Array(length);
  7203. while (++index < length) {
  7204. array[index] = args[start + index];
  7205. }
  7206. index = -1;
  7207. var otherArgs = Array(start + 1);
  7208. while (++index < start) {
  7209. otherArgs[index] = args[index];
  7210. }
  7211. otherArgs[start] = transform(array);
  7212. return apply(func, this, otherArgs);
  7213. };
  7214. }
  7215. /**
  7216. * Gets the parent value at `path` of `object`.
  7217. *
  7218. * @private
  7219. * @param {Object} object The object to query.
  7220. * @param {Array} path The path to get the parent value of.
  7221. * @returns {*} Returns the parent value.
  7222. */
  7223. function parent(object, path) {
  7224. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7225. }
  7226. /**
  7227. * Reorder `array` according to the specified indexes where the element at
  7228. * the first index is assigned as the first element, the element at
  7229. * the second index is assigned as the second element, and so on.
  7230. *
  7231. * @private
  7232. * @param {Array} array The array to reorder.
  7233. * @param {Array} indexes The arranged array indexes.
  7234. * @returns {Array} Returns `array`.
  7235. */
  7236. function reorder(array, indexes) {
  7237. var arrLength = array.length,
  7238. length = nativeMin(indexes.length, arrLength),
  7239. oldArray = copyArray(array);
  7240. while (length--) {
  7241. var index = indexes[length];
  7242. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7243. }
  7244. return array;
  7245. }
  7246. /**
  7247. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7248. *
  7249. * @private
  7250. * @param {Object} object The object to query.
  7251. * @param {string} key The key of the property to get.
  7252. * @returns {*} Returns the property value.
  7253. */
  7254. function safeGet(object, key) {
  7255. if (key === 'constructor' && typeof object[key] === 'function') {
  7256. return;
  7257. }
  7258. if (key == '__proto__') {
  7259. return;
  7260. }
  7261. return object[key];
  7262. }
  7263. /**
  7264. * Sets metadata for `func`.
  7265. *
  7266. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7267. * period of time, it will trip its breaker and transition to an identity
  7268. * function to avoid garbage collection pauses in V8. See
  7269. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7270. * for more details.
  7271. *
  7272. * @private
  7273. * @param {Function} func The function to associate metadata with.
  7274. * @param {*} data The metadata.
  7275. * @returns {Function} Returns `func`.
  7276. */
  7277. var setData = shortOut(baseSetData);
  7278. /**
  7279. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7280. *
  7281. * @private
  7282. * @param {Function} func The function to delay.
  7283. * @param {number} wait The number of milliseconds to delay invocation.
  7284. * @returns {number|Object} Returns the timer id or timeout object.
  7285. */
  7286. var setTimeout = ctxSetTimeout || function(func, wait) {
  7287. return root.setTimeout(func, wait);
  7288. };
  7289. /**
  7290. * Sets the `toString` method of `func` to return `string`.
  7291. *
  7292. * @private
  7293. * @param {Function} func The function to modify.
  7294. * @param {Function} string The `toString` result.
  7295. * @returns {Function} Returns `func`.
  7296. */
  7297. var setToString = shortOut(baseSetToString);
  7298. /**
  7299. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7300. * with wrapper details in a comment at the top of the source body.
  7301. *
  7302. * @private
  7303. * @param {Function} wrapper The function to modify.
  7304. * @param {Function} reference The reference function.
  7305. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7306. * @returns {Function} Returns `wrapper`.
  7307. */
  7308. function setWrapToString(wrapper, reference, bitmask) {
  7309. var source = (reference + '');
  7310. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7311. }
  7312. /**
  7313. * Creates a function that'll short out and invoke `identity` instead
  7314. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7315. * milliseconds.
  7316. *
  7317. * @private
  7318. * @param {Function} func The function to restrict.
  7319. * @returns {Function} Returns the new shortable function.
  7320. */
  7321. function shortOut(func) {
  7322. var count = 0,
  7323. lastCalled = 0;
  7324. return function() {
  7325. var stamp = nativeNow(),
  7326. remaining = HOT_SPAN - (stamp - lastCalled);
  7327. lastCalled = stamp;
  7328. if (remaining > 0) {
  7329. if (++count >= HOT_COUNT) {
  7330. return arguments[0];
  7331. }
  7332. } else {
  7333. count = 0;
  7334. }
  7335. return func.apply(undefined, arguments);
  7336. };
  7337. }
  7338. /**
  7339. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7340. *
  7341. * @private
  7342. * @param {Array} array The array to shuffle.
  7343. * @param {number} [size=array.length] The size of `array`.
  7344. * @returns {Array} Returns `array`.
  7345. */
  7346. function shuffleSelf(array, size) {
  7347. var index = -1,
  7348. length = array.length,
  7349. lastIndex = length - 1;
  7350. size = size === undefined ? length : size;
  7351. while (++index < size) {
  7352. var rand = baseRandom(index, lastIndex),
  7353. value = array[rand];
  7354. array[rand] = array[index];
  7355. array[index] = value;
  7356. }
  7357. array.length = size;
  7358. return array;
  7359. }
  7360. /**
  7361. * Converts `string` to a property path array.
  7362. *
  7363. * @private
  7364. * @param {string} string The string to convert.
  7365. * @returns {Array} Returns the property path array.
  7366. */
  7367. var stringToPath = memoizeCapped(function(string) {
  7368. var result = [];
  7369. if (string.charCodeAt(0) === 46 /* . */) {
  7370. result.push('');
  7371. }
  7372. string.replace(rePropName, function(match, number, quote, subString) {
  7373. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7374. });
  7375. return result;
  7376. });
  7377. /**
  7378. * Converts `value` to a string key if it's not a string or symbol.
  7379. *
  7380. * @private
  7381. * @param {*} value The value to inspect.
  7382. * @returns {string|symbol} Returns the key.
  7383. */
  7384. function toKey(value) {
  7385. if (typeof value == 'string' || isSymbol(value)) {
  7386. return value;
  7387. }
  7388. var result = (value + '');
  7389. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7390. }
  7391. /**
  7392. * Converts `func` to its source code.
  7393. *
  7394. * @private
  7395. * @param {Function} func The function to convert.
  7396. * @returns {string} Returns the source code.
  7397. */
  7398. function toSource(func) {
  7399. if (func != null) {
  7400. try {
  7401. return funcToString.call(func);
  7402. } catch (e) {}
  7403. try {
  7404. return (func + '');
  7405. } catch (e) {}
  7406. }
  7407. return '';
  7408. }
  7409. /**
  7410. * Updates wrapper `details` based on `bitmask` flags.
  7411. *
  7412. * @private
  7413. * @returns {Array} details The details to modify.
  7414. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7415. * @returns {Array} Returns `details`.
  7416. */
  7417. function updateWrapDetails(details, bitmask) {
  7418. arrayEach(wrapFlags, function(pair) {
  7419. var value = '_.' + pair[0];
  7420. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7421. details.push(value);
  7422. }
  7423. });
  7424. return details.sort();
  7425. }
  7426. /**
  7427. * Creates a clone of `wrapper`.
  7428. *
  7429. * @private
  7430. * @param {Object} wrapper The wrapper to clone.
  7431. * @returns {Object} Returns the cloned wrapper.
  7432. */
  7433. function wrapperClone(wrapper) {
  7434. if (wrapper instanceof LazyWrapper) {
  7435. return wrapper.clone();
  7436. }
  7437. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7438. result.__actions__ = copyArray(wrapper.__actions__);
  7439. result.__index__ = wrapper.__index__;
  7440. result.__values__ = wrapper.__values__;
  7441. return result;
  7442. }
  7443. /*------------------------------------------------------------------------*/
  7444. /**
  7445. * Creates an array of elements split into groups the length of `size`.
  7446. * If `array` can't be split evenly, the final chunk will be the remaining
  7447. * elements.
  7448. *
  7449. * @static
  7450. * @memberOf _
  7451. * @since 3.0.0
  7452. * @category Array
  7453. * @param {Array} array The array to process.
  7454. * @param {number} [size=1] The length of each chunk
  7455. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7456. * @returns {Array} Returns the new array of chunks.
  7457. * @example
  7458. *
  7459. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7460. * // => [['a', 'b'], ['c', 'd']]
  7461. *
  7462. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7463. * // => [['a', 'b', 'c'], ['d']]
  7464. */
  7465. function chunk(array, size, guard) {
  7466. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7467. size = 1;
  7468. } else {
  7469. size = nativeMax(toInteger(size), 0);
  7470. }
  7471. var length = array == null ? 0 : array.length;
  7472. if (!length || size < 1) {
  7473. return [];
  7474. }
  7475. var index = 0,
  7476. resIndex = 0,
  7477. result = Array(nativeCeil(length / size));
  7478. while (index < length) {
  7479. result[resIndex++] = baseSlice(array, index, (index += size));
  7480. }
  7481. return result;
  7482. }
  7483. /**
  7484. * Creates an array with all falsey values removed. The values `false`, `null`,
  7485. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7486. *
  7487. * @static
  7488. * @memberOf _
  7489. * @since 0.1.0
  7490. * @category Array
  7491. * @param {Array} array The array to compact.
  7492. * @returns {Array} Returns the new array of filtered values.
  7493. * @example
  7494. *
  7495. * _.compact([0, 1, false, 2, '', 3]);
  7496. * // => [1, 2, 3]
  7497. */
  7498. function compact(array) {
  7499. var index = -1,
  7500. length = array == null ? 0 : array.length,
  7501. resIndex = 0,
  7502. result = [];
  7503. while (++index < length) {
  7504. var value = array[index];
  7505. if (value) {
  7506. result[resIndex++] = value;
  7507. }
  7508. }
  7509. return result;
  7510. }
  7511. /**
  7512. * Creates a new array concatenating `array` with any additional arrays
  7513. * and/or values.
  7514. *
  7515. * @static
  7516. * @memberOf _
  7517. * @since 4.0.0
  7518. * @category Array
  7519. * @param {Array} array The array to concatenate.
  7520. * @param {...*} [values] The values to concatenate.
  7521. * @returns {Array} Returns the new concatenated array.
  7522. * @example
  7523. *
  7524. * var array = [1];
  7525. * var other = _.concat(array, 2, [3], [[4]]);
  7526. *
  7527. * console.log(other);
  7528. * // => [1, 2, 3, [4]]
  7529. *
  7530. * console.log(array);
  7531. * // => [1]
  7532. */
  7533. function concat() {
  7534. var length = arguments.length;
  7535. if (!length) {
  7536. return [];
  7537. }
  7538. var args = Array(length - 1),
  7539. array = arguments[0],
  7540. index = length;
  7541. while (index--) {
  7542. args[index - 1] = arguments[index];
  7543. }
  7544. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7545. }
  7546. /**
  7547. * Creates an array of `array` values not included in the other given arrays
  7548. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7549. * for equality comparisons. The order and references of result values are
  7550. * determined by the first array.
  7551. *
  7552. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7553. *
  7554. * @static
  7555. * @memberOf _
  7556. * @since 0.1.0
  7557. * @category Array
  7558. * @param {Array} array The array to inspect.
  7559. * @param {...Array} [values] The values to exclude.
  7560. * @returns {Array} Returns the new array of filtered values.
  7561. * @see _.without, _.xor
  7562. * @example
  7563. *
  7564. * _.difference([2, 1], [2, 3]);
  7565. * // => [1]
  7566. */
  7567. var difference = baseRest(function(array, values) {
  7568. return isArrayLikeObject(array)
  7569. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7570. : [];
  7571. });
  7572. /**
  7573. * This method is like `_.difference` except that it accepts `iteratee` which
  7574. * is invoked for each element of `array` and `values` to generate the criterion
  7575. * by which they're compared. The order and references of result values are
  7576. * determined by the first array. The iteratee is invoked with one argument:
  7577. * (value).
  7578. *
  7579. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7580. *
  7581. * @static
  7582. * @memberOf _
  7583. * @since 4.0.0
  7584. * @category Array
  7585. * @param {Array} array The array to inspect.
  7586. * @param {...Array} [values] The values to exclude.
  7587. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7588. * @returns {Array} Returns the new array of filtered values.
  7589. * @example
  7590. *
  7591. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7592. * // => [1.2]
  7593. *
  7594. * // The `_.property` iteratee shorthand.
  7595. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7596. * // => [{ 'x': 2 }]
  7597. */
  7598. var differenceBy = baseRest(function(array, values) {
  7599. var iteratee = last(values);
  7600. if (isArrayLikeObject(iteratee)) {
  7601. iteratee = undefined;
  7602. }
  7603. return isArrayLikeObject(array)
  7604. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7605. : [];
  7606. });
  7607. /**
  7608. * This method is like `_.difference` except that it accepts `comparator`
  7609. * which is invoked to compare elements of `array` to `values`. The order and
  7610. * references of result values are determined by the first array. The comparator
  7611. * is invoked with two arguments: (arrVal, othVal).
  7612. *
  7613. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7614. *
  7615. * @static
  7616. * @memberOf _
  7617. * @since 4.0.0
  7618. * @category Array
  7619. * @param {Array} array The array to inspect.
  7620. * @param {...Array} [values] The values to exclude.
  7621. * @param {Function} [comparator] The comparator invoked per element.
  7622. * @returns {Array} Returns the new array of filtered values.
  7623. * @example
  7624. *
  7625. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7626. *
  7627. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7628. * // => [{ 'x': 2, 'y': 1 }]
  7629. */
  7630. var differenceWith = baseRest(function(array, values) {
  7631. var comparator = last(values);
  7632. if (isArrayLikeObject(comparator)) {
  7633. comparator = undefined;
  7634. }
  7635. return isArrayLikeObject(array)
  7636. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7637. : [];
  7638. });
  7639. /**
  7640. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7641. *
  7642. * @static
  7643. * @memberOf _
  7644. * @since 0.5.0
  7645. * @category Array
  7646. * @param {Array} array The array to query.
  7647. * @param {number} [n=1] The number of elements to drop.
  7648. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7649. * @returns {Array} Returns the slice of `array`.
  7650. * @example
  7651. *
  7652. * _.drop([1, 2, 3]);
  7653. * // => [2, 3]
  7654. *
  7655. * _.drop([1, 2, 3], 2);
  7656. * // => [3]
  7657. *
  7658. * _.drop([1, 2, 3], 5);
  7659. * // => []
  7660. *
  7661. * _.drop([1, 2, 3], 0);
  7662. * // => [1, 2, 3]
  7663. */
  7664. function drop(array, n, guard) {
  7665. var length = array == null ? 0 : array.length;
  7666. if (!length) {
  7667. return [];
  7668. }
  7669. n = (guard || n === undefined) ? 1 : toInteger(n);
  7670. return baseSlice(array, n < 0 ? 0 : n, length);
  7671. }
  7672. /**
  7673. * Creates a slice of `array` with `n` elements dropped from the end.
  7674. *
  7675. * @static
  7676. * @memberOf _
  7677. * @since 3.0.0
  7678. * @category Array
  7679. * @param {Array} array The array to query.
  7680. * @param {number} [n=1] The number of elements to drop.
  7681. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7682. * @returns {Array} Returns the slice of `array`.
  7683. * @example
  7684. *
  7685. * _.dropRight([1, 2, 3]);
  7686. * // => [1, 2]
  7687. *
  7688. * _.dropRight([1, 2, 3], 2);
  7689. * // => [1]
  7690. *
  7691. * _.dropRight([1, 2, 3], 5);
  7692. * // => []
  7693. *
  7694. * _.dropRight([1, 2, 3], 0);
  7695. * // => [1, 2, 3]
  7696. */
  7697. function dropRight(array, n, guard) {
  7698. var length = array == null ? 0 : array.length;
  7699. if (!length) {
  7700. return [];
  7701. }
  7702. n = (guard || n === undefined) ? 1 : toInteger(n);
  7703. n = length - n;
  7704. return baseSlice(array, 0, n < 0 ? 0 : n);
  7705. }
  7706. /**
  7707. * Creates a slice of `array` excluding elements dropped from the end.
  7708. * Elements are dropped until `predicate` returns falsey. The predicate is
  7709. * invoked with three arguments: (value, index, array).
  7710. *
  7711. * @static
  7712. * @memberOf _
  7713. * @since 3.0.0
  7714. * @category Array
  7715. * @param {Array} array The array to query.
  7716. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7717. * @returns {Array} Returns the slice of `array`.
  7718. * @example
  7719. *
  7720. * var users = [
  7721. * { 'user': 'barney', 'active': true },
  7722. * { 'user': 'fred', 'active': false },
  7723. * { 'user': 'pebbles', 'active': false }
  7724. * ];
  7725. *
  7726. * _.dropRightWhile(users, function(o) { return !o.active; });
  7727. * // => objects for ['barney']
  7728. *
  7729. * // The `_.matches` iteratee shorthand.
  7730. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7731. * // => objects for ['barney', 'fred']
  7732. *
  7733. * // The `_.matchesProperty` iteratee shorthand.
  7734. * _.dropRightWhile(users, ['active', false]);
  7735. * // => objects for ['barney']
  7736. *
  7737. * // The `_.property` iteratee shorthand.
  7738. * _.dropRightWhile(users, 'active');
  7739. * // => objects for ['barney', 'fred', 'pebbles']
  7740. */
  7741. function dropRightWhile(array, predicate) {
  7742. return (array && array.length)
  7743. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7744. : [];
  7745. }
  7746. /**
  7747. * Creates a slice of `array` excluding elements dropped from the beginning.
  7748. * Elements are dropped until `predicate` returns falsey. The predicate is
  7749. * invoked with three arguments: (value, index, array).
  7750. *
  7751. * @static
  7752. * @memberOf _
  7753. * @since 3.0.0
  7754. * @category Array
  7755. * @param {Array} array The array to query.
  7756. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7757. * @returns {Array} Returns the slice of `array`.
  7758. * @example
  7759. *
  7760. * var users = [
  7761. * { 'user': 'barney', 'active': false },
  7762. * { 'user': 'fred', 'active': false },
  7763. * { 'user': 'pebbles', 'active': true }
  7764. * ];
  7765. *
  7766. * _.dropWhile(users, function(o) { return !o.active; });
  7767. * // => objects for ['pebbles']
  7768. *
  7769. * // The `_.matches` iteratee shorthand.
  7770. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7771. * // => objects for ['fred', 'pebbles']
  7772. *
  7773. * // The `_.matchesProperty` iteratee shorthand.
  7774. * _.dropWhile(users, ['active', false]);
  7775. * // => objects for ['pebbles']
  7776. *
  7777. * // The `_.property` iteratee shorthand.
  7778. * _.dropWhile(users, 'active');
  7779. * // => objects for ['barney', 'fred', 'pebbles']
  7780. */
  7781. function dropWhile(array, predicate) {
  7782. return (array && array.length)
  7783. ? baseWhile(array, getIteratee(predicate, 3), true)
  7784. : [];
  7785. }
  7786. /**
  7787. * Fills elements of `array` with `value` from `start` up to, but not
  7788. * including, `end`.
  7789. *
  7790. * **Note:** This method mutates `array`.
  7791. *
  7792. * @static
  7793. * @memberOf _
  7794. * @since 3.2.0
  7795. * @category Array
  7796. * @param {Array} array The array to fill.
  7797. * @param {*} value The value to fill `array` with.
  7798. * @param {number} [start=0] The start position.
  7799. * @param {number} [end=array.length] The end position.
  7800. * @returns {Array} Returns `array`.
  7801. * @example
  7802. *
  7803. * var array = [1, 2, 3];
  7804. *
  7805. * _.fill(array, 'a');
  7806. * console.log(array);
  7807. * // => ['a', 'a', 'a']
  7808. *
  7809. * _.fill(Array(3), 2);
  7810. * // => [2, 2, 2]
  7811. *
  7812. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7813. * // => [4, '*', '*', 10]
  7814. */
  7815. function fill(array, value, start, end) {
  7816. var length = array == null ? 0 : array.length;
  7817. if (!length) {
  7818. return [];
  7819. }
  7820. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7821. start = 0;
  7822. end = length;
  7823. }
  7824. return baseFill(array, value, start, end);
  7825. }
  7826. /**
  7827. * This method is like `_.find` except that it returns the index of the first
  7828. * element `predicate` returns truthy for instead of the element itself.
  7829. *
  7830. * @static
  7831. * @memberOf _
  7832. * @since 1.1.0
  7833. * @category Array
  7834. * @param {Array} array The array to inspect.
  7835. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7836. * @param {number} [fromIndex=0] The index to search from.
  7837. * @returns {number} Returns the index of the found element, else `-1`.
  7838. * @example
  7839. *
  7840. * var users = [
  7841. * { 'user': 'barney', 'active': false },
  7842. * { 'user': 'fred', 'active': false },
  7843. * { 'user': 'pebbles', 'active': true }
  7844. * ];
  7845. *
  7846. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7847. * // => 0
  7848. *
  7849. * // The `_.matches` iteratee shorthand.
  7850. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7851. * // => 1
  7852. *
  7853. * // The `_.matchesProperty` iteratee shorthand.
  7854. * _.findIndex(users, ['active', false]);
  7855. * // => 0
  7856. *
  7857. * // The `_.property` iteratee shorthand.
  7858. * _.findIndex(users, 'active');
  7859. * // => 2
  7860. */
  7861. function findIndex(array, predicate, fromIndex) {
  7862. var length = array == null ? 0 : array.length;
  7863. if (!length) {
  7864. return -1;
  7865. }
  7866. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7867. if (index < 0) {
  7868. index = nativeMax(length + index, 0);
  7869. }
  7870. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7871. }
  7872. /**
  7873. * This method is like `_.findIndex` except that it iterates over elements
  7874. * of `collection` from right to left.
  7875. *
  7876. * @static
  7877. * @memberOf _
  7878. * @since 2.0.0
  7879. * @category Array
  7880. * @param {Array} array The array to inspect.
  7881. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7882. * @param {number} [fromIndex=array.length-1] The index to search from.
  7883. * @returns {number} Returns the index of the found element, else `-1`.
  7884. * @example
  7885. *
  7886. * var users = [
  7887. * { 'user': 'barney', 'active': true },
  7888. * { 'user': 'fred', 'active': false },
  7889. * { 'user': 'pebbles', 'active': false }
  7890. * ];
  7891. *
  7892. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7893. * // => 2
  7894. *
  7895. * // The `_.matches` iteratee shorthand.
  7896. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7897. * // => 0
  7898. *
  7899. * // The `_.matchesProperty` iteratee shorthand.
  7900. * _.findLastIndex(users, ['active', false]);
  7901. * // => 2
  7902. *
  7903. * // The `_.property` iteratee shorthand.
  7904. * _.findLastIndex(users, 'active');
  7905. * // => 0
  7906. */
  7907. function findLastIndex(array, predicate, fromIndex) {
  7908. var length = array == null ? 0 : array.length;
  7909. if (!length) {
  7910. return -1;
  7911. }
  7912. var index = length - 1;
  7913. if (fromIndex !== undefined) {
  7914. index = toInteger(fromIndex);
  7915. index = fromIndex < 0
  7916. ? nativeMax(length + index, 0)
  7917. : nativeMin(index, length - 1);
  7918. }
  7919. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7920. }
  7921. /**
  7922. * Flattens `array` a single level deep.
  7923. *
  7924. * @static
  7925. * @memberOf _
  7926. * @since 0.1.0
  7927. * @category Array
  7928. * @param {Array} array The array to flatten.
  7929. * @returns {Array} Returns the new flattened array.
  7930. * @example
  7931. *
  7932. * _.flatten([1, [2, [3, [4]], 5]]);
  7933. * // => [1, 2, [3, [4]], 5]
  7934. */
  7935. function flatten(array) {
  7936. var length = array == null ? 0 : array.length;
  7937. return length ? baseFlatten(array, 1) : [];
  7938. }
  7939. /**
  7940. * Recursively flattens `array`.
  7941. *
  7942. * @static
  7943. * @memberOf _
  7944. * @since 3.0.0
  7945. * @category Array
  7946. * @param {Array} array The array to flatten.
  7947. * @returns {Array} Returns the new flattened array.
  7948. * @example
  7949. *
  7950. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7951. * // => [1, 2, 3, 4, 5]
  7952. */
  7953. function flattenDeep(array) {
  7954. var length = array == null ? 0 : array.length;
  7955. return length ? baseFlatten(array, INFINITY) : [];
  7956. }
  7957. /**
  7958. * Recursively flatten `array` up to `depth` times.
  7959. *
  7960. * @static
  7961. * @memberOf _
  7962. * @since 4.4.0
  7963. * @category Array
  7964. * @param {Array} array The array to flatten.
  7965. * @param {number} [depth=1] The maximum recursion depth.
  7966. * @returns {Array} Returns the new flattened array.
  7967. * @example
  7968. *
  7969. * var array = [1, [2, [3, [4]], 5]];
  7970. *
  7971. * _.flattenDepth(array, 1);
  7972. * // => [1, 2, [3, [4]], 5]
  7973. *
  7974. * _.flattenDepth(array, 2);
  7975. * // => [1, 2, 3, [4], 5]
  7976. */
  7977. function flattenDepth(array, depth) {
  7978. var length = array == null ? 0 : array.length;
  7979. if (!length) {
  7980. return [];
  7981. }
  7982. depth = depth === undefined ? 1 : toInteger(depth);
  7983. return baseFlatten(array, depth);
  7984. }
  7985. /**
  7986. * The inverse of `_.toPairs`; this method returns an object composed
  7987. * from key-value `pairs`.
  7988. *
  7989. * @static
  7990. * @memberOf _
  7991. * @since 4.0.0
  7992. * @category Array
  7993. * @param {Array} pairs The key-value pairs.
  7994. * @returns {Object} Returns the new object.
  7995. * @example
  7996. *
  7997. * _.fromPairs([['a', 1], ['b', 2]]);
  7998. * // => { 'a': 1, 'b': 2 }
  7999. */
  8000. function fromPairs(pairs) {
  8001. var index = -1,
  8002. length = pairs == null ? 0 : pairs.length,
  8003. result = {};
  8004. while (++index < length) {
  8005. var pair = pairs[index];
  8006. result[pair[0]] = pair[1];
  8007. }
  8008. return result;
  8009. }
  8010. /**
  8011. * Gets the first element of `array`.
  8012. *
  8013. * @static
  8014. * @memberOf _
  8015. * @since 0.1.0
  8016. * @alias first
  8017. * @category Array
  8018. * @param {Array} array The array to query.
  8019. * @returns {*} Returns the first element of `array`.
  8020. * @example
  8021. *
  8022. * _.head([1, 2, 3]);
  8023. * // => 1
  8024. *
  8025. * _.head([]);
  8026. * // => undefined
  8027. */
  8028. function head(array) {
  8029. return (array && array.length) ? array[0] : undefined;
  8030. }
  8031. /**
  8032. * Gets the index at which the first occurrence of `value` is found in `array`
  8033. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8034. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8035. * offset from the end of `array`.
  8036. *
  8037. * @static
  8038. * @memberOf _
  8039. * @since 0.1.0
  8040. * @category Array
  8041. * @param {Array} array The array to inspect.
  8042. * @param {*} value The value to search for.
  8043. * @param {number} [fromIndex=0] The index to search from.
  8044. * @returns {number} Returns the index of the matched value, else `-1`.
  8045. * @example
  8046. *
  8047. * _.indexOf([1, 2, 1, 2], 2);
  8048. * // => 1
  8049. *
  8050. * // Search from the `fromIndex`.
  8051. * _.indexOf([1, 2, 1, 2], 2, 2);
  8052. * // => 3
  8053. */
  8054. function indexOf(array, value, fromIndex) {
  8055. var length = array == null ? 0 : array.length;
  8056. if (!length) {
  8057. return -1;
  8058. }
  8059. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8060. if (index < 0) {
  8061. index = nativeMax(length + index, 0);
  8062. }
  8063. return baseIndexOf(array, value, index);
  8064. }
  8065. /**
  8066. * Gets all but the last element of `array`.
  8067. *
  8068. * @static
  8069. * @memberOf _
  8070. * @since 0.1.0
  8071. * @category Array
  8072. * @param {Array} array The array to query.
  8073. * @returns {Array} Returns the slice of `array`.
  8074. * @example
  8075. *
  8076. * _.initial([1, 2, 3]);
  8077. * // => [1, 2]
  8078. */
  8079. function initial(array) {
  8080. var length = array == null ? 0 : array.length;
  8081. return length ? baseSlice(array, 0, -1) : [];
  8082. }
  8083. /**
  8084. * Creates an array of unique values that are included in all given arrays
  8085. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8086. * for equality comparisons. The order and references of result values are
  8087. * determined by the first array.
  8088. *
  8089. * @static
  8090. * @memberOf _
  8091. * @since 0.1.0
  8092. * @category Array
  8093. * @param {...Array} [arrays] The arrays to inspect.
  8094. * @returns {Array} Returns the new array of intersecting values.
  8095. * @example
  8096. *
  8097. * _.intersection([2, 1], [2, 3]);
  8098. * // => [2]
  8099. */
  8100. var intersection = baseRest(function(arrays) {
  8101. var mapped = arrayMap(arrays, castArrayLikeObject);
  8102. return (mapped.length && mapped[0] === arrays[0])
  8103. ? baseIntersection(mapped)
  8104. : [];
  8105. });
  8106. /**
  8107. * This method is like `_.intersection` except that it accepts `iteratee`
  8108. * which is invoked for each element of each `arrays` to generate the criterion
  8109. * by which they're compared. The order and references of result values are
  8110. * determined by the first array. The iteratee is invoked with one argument:
  8111. * (value).
  8112. *
  8113. * @static
  8114. * @memberOf _
  8115. * @since 4.0.0
  8116. * @category Array
  8117. * @param {...Array} [arrays] The arrays to inspect.
  8118. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8119. * @returns {Array} Returns the new array of intersecting values.
  8120. * @example
  8121. *
  8122. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8123. * // => [2.1]
  8124. *
  8125. * // The `_.property` iteratee shorthand.
  8126. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8127. * // => [{ 'x': 1 }]
  8128. */
  8129. var intersectionBy = baseRest(function(arrays) {
  8130. var iteratee = last(arrays),
  8131. mapped = arrayMap(arrays, castArrayLikeObject);
  8132. if (iteratee === last(mapped)) {
  8133. iteratee = undefined;
  8134. } else {
  8135. mapped.pop();
  8136. }
  8137. return (mapped.length && mapped[0] === arrays[0])
  8138. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8139. : [];
  8140. });
  8141. /**
  8142. * This method is like `_.intersection` except that it accepts `comparator`
  8143. * which is invoked to compare elements of `arrays`. The order and references
  8144. * of result values are determined by the first array. The comparator is
  8145. * invoked with two arguments: (arrVal, othVal).
  8146. *
  8147. * @static
  8148. * @memberOf _
  8149. * @since 4.0.0
  8150. * @category Array
  8151. * @param {...Array} [arrays] The arrays to inspect.
  8152. * @param {Function} [comparator] The comparator invoked per element.
  8153. * @returns {Array} Returns the new array of intersecting values.
  8154. * @example
  8155. *
  8156. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8157. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8158. *
  8159. * _.intersectionWith(objects, others, _.isEqual);
  8160. * // => [{ 'x': 1, 'y': 2 }]
  8161. */
  8162. var intersectionWith = baseRest(function(arrays) {
  8163. var comparator = last(arrays),
  8164. mapped = arrayMap(arrays, castArrayLikeObject);
  8165. comparator = typeof comparator == 'function' ? comparator : undefined;
  8166. if (comparator) {
  8167. mapped.pop();
  8168. }
  8169. return (mapped.length && mapped[0] === arrays[0])
  8170. ? baseIntersection(mapped, undefined, comparator)
  8171. : [];
  8172. });
  8173. /**
  8174. * Converts all elements in `array` into a string separated by `separator`.
  8175. *
  8176. * @static
  8177. * @memberOf _
  8178. * @since 4.0.0
  8179. * @category Array
  8180. * @param {Array} array The array to convert.
  8181. * @param {string} [separator=','] The element separator.
  8182. * @returns {string} Returns the joined string.
  8183. * @example
  8184. *
  8185. * _.join(['a', 'b', 'c'], '~');
  8186. * // => 'a~b~c'
  8187. */
  8188. function join(array, separator) {
  8189. return array == null ? '' : nativeJoin.call(array, separator);
  8190. }
  8191. /**
  8192. * Gets the last element of `array`.
  8193. *
  8194. * @static
  8195. * @memberOf _
  8196. * @since 0.1.0
  8197. * @category Array
  8198. * @param {Array} array The array to query.
  8199. * @returns {*} Returns the last element of `array`.
  8200. * @example
  8201. *
  8202. * _.last([1, 2, 3]);
  8203. * // => 3
  8204. */
  8205. function last(array) {
  8206. var length = array == null ? 0 : array.length;
  8207. return length ? array[length - 1] : undefined;
  8208. }
  8209. /**
  8210. * This method is like `_.indexOf` except that it iterates over elements of
  8211. * `array` from right to left.
  8212. *
  8213. * @static
  8214. * @memberOf _
  8215. * @since 0.1.0
  8216. * @category Array
  8217. * @param {Array} array The array to inspect.
  8218. * @param {*} value The value to search for.
  8219. * @param {number} [fromIndex=array.length-1] The index to search from.
  8220. * @returns {number} Returns the index of the matched value, else `-1`.
  8221. * @example
  8222. *
  8223. * _.lastIndexOf([1, 2, 1, 2], 2);
  8224. * // => 3
  8225. *
  8226. * // Search from the `fromIndex`.
  8227. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8228. * // => 1
  8229. */
  8230. function lastIndexOf(array, value, fromIndex) {
  8231. var length = array == null ? 0 : array.length;
  8232. if (!length) {
  8233. return -1;
  8234. }
  8235. var index = length;
  8236. if (fromIndex !== undefined) {
  8237. index = toInteger(fromIndex);
  8238. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8239. }
  8240. return value === value
  8241. ? strictLastIndexOf(array, value, index)
  8242. : baseFindIndex(array, baseIsNaN, index, true);
  8243. }
  8244. /**
  8245. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8246. * element from the end is returned.
  8247. *
  8248. * @static
  8249. * @memberOf _
  8250. * @since 4.11.0
  8251. * @category Array
  8252. * @param {Array} array The array to query.
  8253. * @param {number} [n=0] The index of the element to return.
  8254. * @returns {*} Returns the nth element of `array`.
  8255. * @example
  8256. *
  8257. * var array = ['a', 'b', 'c', 'd'];
  8258. *
  8259. * _.nth(array, 1);
  8260. * // => 'b'
  8261. *
  8262. * _.nth(array, -2);
  8263. * // => 'c';
  8264. */
  8265. function nth(array, n) {
  8266. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8267. }
  8268. /**
  8269. * Removes all given values from `array` using
  8270. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8271. * for equality comparisons.
  8272. *
  8273. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8274. * to remove elements from an array by predicate.
  8275. *
  8276. * @static
  8277. * @memberOf _
  8278. * @since 2.0.0
  8279. * @category Array
  8280. * @param {Array} array The array to modify.
  8281. * @param {...*} [values] The values to remove.
  8282. * @returns {Array} Returns `array`.
  8283. * @example
  8284. *
  8285. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8286. *
  8287. * _.pull(array, 'a', 'c');
  8288. * console.log(array);
  8289. * // => ['b', 'b']
  8290. */
  8291. var pull = baseRest(pullAll);
  8292. /**
  8293. * This method is like `_.pull` except that it accepts an array of values to remove.
  8294. *
  8295. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8296. *
  8297. * @static
  8298. * @memberOf _
  8299. * @since 4.0.0
  8300. * @category Array
  8301. * @param {Array} array The array to modify.
  8302. * @param {Array} values The values to remove.
  8303. * @returns {Array} Returns `array`.
  8304. * @example
  8305. *
  8306. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8307. *
  8308. * _.pullAll(array, ['a', 'c']);
  8309. * console.log(array);
  8310. * // => ['b', 'b']
  8311. */
  8312. function pullAll(array, values) {
  8313. return (array && array.length && values && values.length)
  8314. ? basePullAll(array, values)
  8315. : array;
  8316. }
  8317. /**
  8318. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8319. * invoked for each element of `array` and `values` to generate the criterion
  8320. * by which they're compared. The iteratee is invoked with one argument: (value).
  8321. *
  8322. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8323. *
  8324. * @static
  8325. * @memberOf _
  8326. * @since 4.0.0
  8327. * @category Array
  8328. * @param {Array} array The array to modify.
  8329. * @param {Array} values The values to remove.
  8330. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8331. * @returns {Array} Returns `array`.
  8332. * @example
  8333. *
  8334. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8335. *
  8336. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8337. * console.log(array);
  8338. * // => [{ 'x': 2 }]
  8339. */
  8340. function pullAllBy(array, values, iteratee) {
  8341. return (array && array.length && values && values.length)
  8342. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8343. : array;
  8344. }
  8345. /**
  8346. * This method is like `_.pullAll` except that it accepts `comparator` which
  8347. * is invoked to compare elements of `array` to `values`. The comparator is
  8348. * invoked with two arguments: (arrVal, othVal).
  8349. *
  8350. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8351. *
  8352. * @static
  8353. * @memberOf _
  8354. * @since 4.6.0
  8355. * @category Array
  8356. * @param {Array} array The array to modify.
  8357. * @param {Array} values The values to remove.
  8358. * @param {Function} [comparator] The comparator invoked per element.
  8359. * @returns {Array} Returns `array`.
  8360. * @example
  8361. *
  8362. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8363. *
  8364. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8365. * console.log(array);
  8366. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8367. */
  8368. function pullAllWith(array, values, comparator) {
  8369. return (array && array.length && values && values.length)
  8370. ? basePullAll(array, values, undefined, comparator)
  8371. : array;
  8372. }
  8373. /**
  8374. * Removes elements from `array` corresponding to `indexes` and returns an
  8375. * array of removed elements.
  8376. *
  8377. * **Note:** Unlike `_.at`, this method mutates `array`.
  8378. *
  8379. * @static
  8380. * @memberOf _
  8381. * @since 3.0.0
  8382. * @category Array
  8383. * @param {Array} array The array to modify.
  8384. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8385. * @returns {Array} Returns the new array of removed elements.
  8386. * @example
  8387. *
  8388. * var array = ['a', 'b', 'c', 'd'];
  8389. * var pulled = _.pullAt(array, [1, 3]);
  8390. *
  8391. * console.log(array);
  8392. * // => ['a', 'c']
  8393. *
  8394. * console.log(pulled);
  8395. * // => ['b', 'd']
  8396. */
  8397. var pullAt = flatRest(function(array, indexes) {
  8398. var length = array == null ? 0 : array.length,
  8399. result = baseAt(array, indexes);
  8400. basePullAt(array, arrayMap(indexes, function(index) {
  8401. return isIndex(index, length) ? +index : index;
  8402. }).sort(compareAscending));
  8403. return result;
  8404. });
  8405. /**
  8406. * Removes all elements from `array` that `predicate` returns truthy for
  8407. * and returns an array of the removed elements. The predicate is invoked
  8408. * with three arguments: (value, index, array).
  8409. *
  8410. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8411. * to pull elements from an array by value.
  8412. *
  8413. * @static
  8414. * @memberOf _
  8415. * @since 2.0.0
  8416. * @category Array
  8417. * @param {Array} array The array to modify.
  8418. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8419. * @returns {Array} Returns the new array of removed elements.
  8420. * @example
  8421. *
  8422. * var array = [1, 2, 3, 4];
  8423. * var evens = _.remove(array, function(n) {
  8424. * return n % 2 == 0;
  8425. * });
  8426. *
  8427. * console.log(array);
  8428. * // => [1, 3]
  8429. *
  8430. * console.log(evens);
  8431. * // => [2, 4]
  8432. */
  8433. function remove(array, predicate) {
  8434. var result = [];
  8435. if (!(array && array.length)) {
  8436. return result;
  8437. }
  8438. var index = -1,
  8439. indexes = [],
  8440. length = array.length;
  8441. predicate = getIteratee(predicate, 3);
  8442. while (++index < length) {
  8443. var value = array[index];
  8444. if (predicate(value, index, array)) {
  8445. result.push(value);
  8446. indexes.push(index);
  8447. }
  8448. }
  8449. basePullAt(array, indexes);
  8450. return result;
  8451. }
  8452. /**
  8453. * Reverses `array` so that the first element becomes the last, the second
  8454. * element becomes the second to last, and so on.
  8455. *
  8456. * **Note:** This method mutates `array` and is based on
  8457. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8458. *
  8459. * @static
  8460. * @memberOf _
  8461. * @since 4.0.0
  8462. * @category Array
  8463. * @param {Array} array The array to modify.
  8464. * @returns {Array} Returns `array`.
  8465. * @example
  8466. *
  8467. * var array = [1, 2, 3];
  8468. *
  8469. * _.reverse(array);
  8470. * // => [3, 2, 1]
  8471. *
  8472. * console.log(array);
  8473. * // => [3, 2, 1]
  8474. */
  8475. function reverse(array) {
  8476. return array == null ? array : nativeReverse.call(array);
  8477. }
  8478. /**
  8479. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8480. *
  8481. * **Note:** This method is used instead of
  8482. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8483. * returned.
  8484. *
  8485. * @static
  8486. * @memberOf _
  8487. * @since 3.0.0
  8488. * @category Array
  8489. * @param {Array} array The array to slice.
  8490. * @param {number} [start=0] The start position.
  8491. * @param {number} [end=array.length] The end position.
  8492. * @returns {Array} Returns the slice of `array`.
  8493. */
  8494. function slice(array, start, end) {
  8495. var length = array == null ? 0 : array.length;
  8496. if (!length) {
  8497. return [];
  8498. }
  8499. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8500. start = 0;
  8501. end = length;
  8502. }
  8503. else {
  8504. start = start == null ? 0 : toInteger(start);
  8505. end = end === undefined ? length : toInteger(end);
  8506. }
  8507. return baseSlice(array, start, end);
  8508. }
  8509. /**
  8510. * Uses a binary search to determine the lowest index at which `value`
  8511. * should be inserted into `array` in order to maintain its sort order.
  8512. *
  8513. * @static
  8514. * @memberOf _
  8515. * @since 0.1.0
  8516. * @category Array
  8517. * @param {Array} array The sorted array to inspect.
  8518. * @param {*} value The value to evaluate.
  8519. * @returns {number} Returns the index at which `value` should be inserted
  8520. * into `array`.
  8521. * @example
  8522. *
  8523. * _.sortedIndex([30, 50], 40);
  8524. * // => 1
  8525. */
  8526. function sortedIndex(array, value) {
  8527. return baseSortedIndex(array, value);
  8528. }
  8529. /**
  8530. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8531. * which is invoked for `value` and each element of `array` to compute their
  8532. * sort ranking. The iteratee is invoked with one argument: (value).
  8533. *
  8534. * @static
  8535. * @memberOf _
  8536. * @since 4.0.0
  8537. * @category Array
  8538. * @param {Array} array The sorted array to inspect.
  8539. * @param {*} value The value to evaluate.
  8540. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8541. * @returns {number} Returns the index at which `value` should be inserted
  8542. * into `array`.
  8543. * @example
  8544. *
  8545. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8546. *
  8547. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8548. * // => 0
  8549. *
  8550. * // The `_.property` iteratee shorthand.
  8551. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8552. * // => 0
  8553. */
  8554. function sortedIndexBy(array, value, iteratee) {
  8555. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8556. }
  8557. /**
  8558. * This method is like `_.indexOf` except that it performs a binary
  8559. * search on a sorted `array`.
  8560. *
  8561. * @static
  8562. * @memberOf _
  8563. * @since 4.0.0
  8564. * @category Array
  8565. * @param {Array} array The array to inspect.
  8566. * @param {*} value The value to search for.
  8567. * @returns {number} Returns the index of the matched value, else `-1`.
  8568. * @example
  8569. *
  8570. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8571. * // => 1
  8572. */
  8573. function sortedIndexOf(array, value) {
  8574. var length = array == null ? 0 : array.length;
  8575. if (length) {
  8576. var index = baseSortedIndex(array, value);
  8577. if (index < length && eq(array[index], value)) {
  8578. return index;
  8579. }
  8580. }
  8581. return -1;
  8582. }
  8583. /**
  8584. * This method is like `_.sortedIndex` except that it returns the highest
  8585. * index at which `value` should be inserted into `array` in order to
  8586. * maintain its sort order.
  8587. *
  8588. * @static
  8589. * @memberOf _
  8590. * @since 3.0.0
  8591. * @category Array
  8592. * @param {Array} array The sorted array to inspect.
  8593. * @param {*} value The value to evaluate.
  8594. * @returns {number} Returns the index at which `value` should be inserted
  8595. * into `array`.
  8596. * @example
  8597. *
  8598. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8599. * // => 4
  8600. */
  8601. function sortedLastIndex(array, value) {
  8602. return baseSortedIndex(array, value, true);
  8603. }
  8604. /**
  8605. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8606. * which is invoked for `value` and each element of `array` to compute their
  8607. * sort ranking. The iteratee is invoked with one argument: (value).
  8608. *
  8609. * @static
  8610. * @memberOf _
  8611. * @since 4.0.0
  8612. * @category Array
  8613. * @param {Array} array The sorted array to inspect.
  8614. * @param {*} value The value to evaluate.
  8615. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8616. * @returns {number} Returns the index at which `value` should be inserted
  8617. * into `array`.
  8618. * @example
  8619. *
  8620. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8621. *
  8622. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8623. * // => 1
  8624. *
  8625. * // The `_.property` iteratee shorthand.
  8626. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8627. * // => 1
  8628. */
  8629. function sortedLastIndexBy(array, value, iteratee) {
  8630. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8631. }
  8632. /**
  8633. * This method is like `_.lastIndexOf` except that it performs a binary
  8634. * search on a sorted `array`.
  8635. *
  8636. * @static
  8637. * @memberOf _
  8638. * @since 4.0.0
  8639. * @category Array
  8640. * @param {Array} array The array to inspect.
  8641. * @param {*} value The value to search for.
  8642. * @returns {number} Returns the index of the matched value, else `-1`.
  8643. * @example
  8644. *
  8645. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8646. * // => 3
  8647. */
  8648. function sortedLastIndexOf(array, value) {
  8649. var length = array == null ? 0 : array.length;
  8650. if (length) {
  8651. var index = baseSortedIndex(array, value, true) - 1;
  8652. if (eq(array[index], value)) {
  8653. return index;
  8654. }
  8655. }
  8656. return -1;
  8657. }
  8658. /**
  8659. * This method is like `_.uniq` except that it's designed and optimized
  8660. * for sorted arrays.
  8661. *
  8662. * @static
  8663. * @memberOf _
  8664. * @since 4.0.0
  8665. * @category Array
  8666. * @param {Array} array The array to inspect.
  8667. * @returns {Array} Returns the new duplicate free array.
  8668. * @example
  8669. *
  8670. * _.sortedUniq([1, 1, 2]);
  8671. * // => [1, 2]
  8672. */
  8673. function sortedUniq(array) {
  8674. return (array && array.length)
  8675. ? baseSortedUniq(array)
  8676. : [];
  8677. }
  8678. /**
  8679. * This method is like `_.uniqBy` except that it's designed and optimized
  8680. * for sorted arrays.
  8681. *
  8682. * @static
  8683. * @memberOf _
  8684. * @since 4.0.0
  8685. * @category Array
  8686. * @param {Array} array The array to inspect.
  8687. * @param {Function} [iteratee] The iteratee invoked per element.
  8688. * @returns {Array} Returns the new duplicate free array.
  8689. * @example
  8690. *
  8691. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8692. * // => [1.1, 2.3]
  8693. */
  8694. function sortedUniqBy(array, iteratee) {
  8695. return (array && array.length)
  8696. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8697. : [];
  8698. }
  8699. /**
  8700. * Gets all but the first element of `array`.
  8701. *
  8702. * @static
  8703. * @memberOf _
  8704. * @since 4.0.0
  8705. * @category Array
  8706. * @param {Array} array The array to query.
  8707. * @returns {Array} Returns the slice of `array`.
  8708. * @example
  8709. *
  8710. * _.tail([1, 2, 3]);
  8711. * // => [2, 3]
  8712. */
  8713. function tail(array) {
  8714. var length = array == null ? 0 : array.length;
  8715. return length ? baseSlice(array, 1, length) : [];
  8716. }
  8717. /**
  8718. * Creates a slice of `array` with `n` elements taken from the beginning.
  8719. *
  8720. * @static
  8721. * @memberOf _
  8722. * @since 0.1.0
  8723. * @category Array
  8724. * @param {Array} array The array to query.
  8725. * @param {number} [n=1] The number of elements to take.
  8726. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8727. * @returns {Array} Returns the slice of `array`.
  8728. * @example
  8729. *
  8730. * _.take([1, 2, 3]);
  8731. * // => [1]
  8732. *
  8733. * _.take([1, 2, 3], 2);
  8734. * // => [1, 2]
  8735. *
  8736. * _.take([1, 2, 3], 5);
  8737. * // => [1, 2, 3]
  8738. *
  8739. * _.take([1, 2, 3], 0);
  8740. * // => []
  8741. */
  8742. function take(array, n, guard) {
  8743. if (!(array && array.length)) {
  8744. return [];
  8745. }
  8746. n = (guard || n === undefined) ? 1 : toInteger(n);
  8747. return baseSlice(array, 0, n < 0 ? 0 : n);
  8748. }
  8749. /**
  8750. * Creates a slice of `array` with `n` elements taken from the end.
  8751. *
  8752. * @static
  8753. * @memberOf _
  8754. * @since 3.0.0
  8755. * @category Array
  8756. * @param {Array} array The array to query.
  8757. * @param {number} [n=1] The number of elements to take.
  8758. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8759. * @returns {Array} Returns the slice of `array`.
  8760. * @example
  8761. *
  8762. * _.takeRight([1, 2, 3]);
  8763. * // => [3]
  8764. *
  8765. * _.takeRight([1, 2, 3], 2);
  8766. * // => [2, 3]
  8767. *
  8768. * _.takeRight([1, 2, 3], 5);
  8769. * // => [1, 2, 3]
  8770. *
  8771. * _.takeRight([1, 2, 3], 0);
  8772. * // => []
  8773. */
  8774. function takeRight(array, n, guard) {
  8775. var length = array == null ? 0 : array.length;
  8776. if (!length) {
  8777. return [];
  8778. }
  8779. n = (guard || n === undefined) ? 1 : toInteger(n);
  8780. n = length - n;
  8781. return baseSlice(array, n < 0 ? 0 : n, length);
  8782. }
  8783. /**
  8784. * Creates a slice of `array` with elements taken from the end. Elements are
  8785. * taken until `predicate` returns falsey. The predicate is invoked with
  8786. * three arguments: (value, index, array).
  8787. *
  8788. * @static
  8789. * @memberOf _
  8790. * @since 3.0.0
  8791. * @category Array
  8792. * @param {Array} array The array to query.
  8793. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8794. * @returns {Array} Returns the slice of `array`.
  8795. * @example
  8796. *
  8797. * var users = [
  8798. * { 'user': 'barney', 'active': true },
  8799. * { 'user': 'fred', 'active': false },
  8800. * { 'user': 'pebbles', 'active': false }
  8801. * ];
  8802. *
  8803. * _.takeRightWhile(users, function(o) { return !o.active; });
  8804. * // => objects for ['fred', 'pebbles']
  8805. *
  8806. * // The `_.matches` iteratee shorthand.
  8807. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8808. * // => objects for ['pebbles']
  8809. *
  8810. * // The `_.matchesProperty` iteratee shorthand.
  8811. * _.takeRightWhile(users, ['active', false]);
  8812. * // => objects for ['fred', 'pebbles']
  8813. *
  8814. * // The `_.property` iteratee shorthand.
  8815. * _.takeRightWhile(users, 'active');
  8816. * // => []
  8817. */
  8818. function takeRightWhile(array, predicate) {
  8819. return (array && array.length)
  8820. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8821. : [];
  8822. }
  8823. /**
  8824. * Creates a slice of `array` with elements taken from the beginning. Elements
  8825. * are taken until `predicate` returns falsey. The predicate is invoked with
  8826. * three arguments: (value, index, array).
  8827. *
  8828. * @static
  8829. * @memberOf _
  8830. * @since 3.0.0
  8831. * @category Array
  8832. * @param {Array} array The array to query.
  8833. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8834. * @returns {Array} Returns the slice of `array`.
  8835. * @example
  8836. *
  8837. * var users = [
  8838. * { 'user': 'barney', 'active': false },
  8839. * { 'user': 'fred', 'active': false },
  8840. * { 'user': 'pebbles', 'active': true }
  8841. * ];
  8842. *
  8843. * _.takeWhile(users, function(o) { return !o.active; });
  8844. * // => objects for ['barney', 'fred']
  8845. *
  8846. * // The `_.matches` iteratee shorthand.
  8847. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8848. * // => objects for ['barney']
  8849. *
  8850. * // The `_.matchesProperty` iteratee shorthand.
  8851. * _.takeWhile(users, ['active', false]);
  8852. * // => objects for ['barney', 'fred']
  8853. *
  8854. * // The `_.property` iteratee shorthand.
  8855. * _.takeWhile(users, 'active');
  8856. * // => []
  8857. */
  8858. function takeWhile(array, predicate) {
  8859. return (array && array.length)
  8860. ? baseWhile(array, getIteratee(predicate, 3))
  8861. : [];
  8862. }
  8863. /**
  8864. * Creates an array of unique values, in order, from all given arrays using
  8865. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8866. * for equality comparisons.
  8867. *
  8868. * @static
  8869. * @memberOf _
  8870. * @since 0.1.0
  8871. * @category Array
  8872. * @param {...Array} [arrays] The arrays to inspect.
  8873. * @returns {Array} Returns the new array of combined values.
  8874. * @example
  8875. *
  8876. * _.union([2], [1, 2]);
  8877. * // => [2, 1]
  8878. */
  8879. var union = baseRest(function(arrays) {
  8880. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8881. });
  8882. /**
  8883. * This method is like `_.union` except that it accepts `iteratee` which is
  8884. * invoked for each element of each `arrays` to generate the criterion by
  8885. * which uniqueness is computed. Result values are chosen from the first
  8886. * array in which the value occurs. The iteratee is invoked with one argument:
  8887. * (value).
  8888. *
  8889. * @static
  8890. * @memberOf _
  8891. * @since 4.0.0
  8892. * @category Array
  8893. * @param {...Array} [arrays] The arrays to inspect.
  8894. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8895. * @returns {Array} Returns the new array of combined values.
  8896. * @example
  8897. *
  8898. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8899. * // => [2.1, 1.2]
  8900. *
  8901. * // The `_.property` iteratee shorthand.
  8902. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8903. * // => [{ 'x': 1 }, { 'x': 2 }]
  8904. */
  8905. var unionBy = baseRest(function(arrays) {
  8906. var iteratee = last(arrays);
  8907. if (isArrayLikeObject(iteratee)) {
  8908. iteratee = undefined;
  8909. }
  8910. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8911. });
  8912. /**
  8913. * This method is like `_.union` except that it accepts `comparator` which
  8914. * is invoked to compare elements of `arrays`. Result values are chosen from
  8915. * the first array in which the value occurs. The comparator is invoked
  8916. * with two arguments: (arrVal, othVal).
  8917. *
  8918. * @static
  8919. * @memberOf _
  8920. * @since 4.0.0
  8921. * @category Array
  8922. * @param {...Array} [arrays] The arrays to inspect.
  8923. * @param {Function} [comparator] The comparator invoked per element.
  8924. * @returns {Array} Returns the new array of combined values.
  8925. * @example
  8926. *
  8927. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8928. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8929. *
  8930. * _.unionWith(objects, others, _.isEqual);
  8931. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8932. */
  8933. var unionWith = baseRest(function(arrays) {
  8934. var comparator = last(arrays);
  8935. comparator = typeof comparator == 'function' ? comparator : undefined;
  8936. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8937. });
  8938. /**
  8939. * Creates a duplicate-free version of an array, using
  8940. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8941. * for equality comparisons, in which only the first occurrence of each element
  8942. * is kept. The order of result values is determined by the order they occur
  8943. * in the array.
  8944. *
  8945. * @static
  8946. * @memberOf _
  8947. * @since 0.1.0
  8948. * @category Array
  8949. * @param {Array} array The array to inspect.
  8950. * @returns {Array} Returns the new duplicate free array.
  8951. * @example
  8952. *
  8953. * _.uniq([2, 1, 2]);
  8954. * // => [2, 1]
  8955. */
  8956. function uniq(array) {
  8957. return (array && array.length) ? baseUniq(array) : [];
  8958. }
  8959. /**
  8960. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8961. * invoked for each element in `array` to generate the criterion by which
  8962. * uniqueness is computed. The order of result values is determined by the
  8963. * order they occur in the array. The iteratee is invoked with one argument:
  8964. * (value).
  8965. *
  8966. * @static
  8967. * @memberOf _
  8968. * @since 4.0.0
  8969. * @category Array
  8970. * @param {Array} array The array to inspect.
  8971. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8972. * @returns {Array} Returns the new duplicate free array.
  8973. * @example
  8974. *
  8975. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8976. * // => [2.1, 1.2]
  8977. *
  8978. * // The `_.property` iteratee shorthand.
  8979. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8980. * // => [{ 'x': 1 }, { 'x': 2 }]
  8981. */
  8982. function uniqBy(array, iteratee) {
  8983. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8984. }
  8985. /**
  8986. * This method is like `_.uniq` except that it accepts `comparator` which
  8987. * is invoked to compare elements of `array`. The order of result values is
  8988. * determined by the order they occur in the array.The comparator is invoked
  8989. * with two arguments: (arrVal, othVal).
  8990. *
  8991. * @static
  8992. * @memberOf _
  8993. * @since 4.0.0
  8994. * @category Array
  8995. * @param {Array} array The array to inspect.
  8996. * @param {Function} [comparator] The comparator invoked per element.
  8997. * @returns {Array} Returns the new duplicate free array.
  8998. * @example
  8999. *
  9000. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9001. *
  9002. * _.uniqWith(objects, _.isEqual);
  9003. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9004. */
  9005. function uniqWith(array, comparator) {
  9006. comparator = typeof comparator == 'function' ? comparator : undefined;
  9007. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9008. }
  9009. /**
  9010. * This method is like `_.zip` except that it accepts an array of grouped
  9011. * elements and creates an array regrouping the elements to their pre-zip
  9012. * configuration.
  9013. *
  9014. * @static
  9015. * @memberOf _
  9016. * @since 1.2.0
  9017. * @category Array
  9018. * @param {Array} array The array of grouped elements to process.
  9019. * @returns {Array} Returns the new array of regrouped elements.
  9020. * @example
  9021. *
  9022. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9023. * // => [['a', 1, true], ['b', 2, false]]
  9024. *
  9025. * _.unzip(zipped);
  9026. * // => [['a', 'b'], [1, 2], [true, false]]
  9027. */
  9028. function unzip(array) {
  9029. if (!(array && array.length)) {
  9030. return [];
  9031. }
  9032. var length = 0;
  9033. array = arrayFilter(array, function(group) {
  9034. if (isArrayLikeObject(group)) {
  9035. length = nativeMax(group.length, length);
  9036. return true;
  9037. }
  9038. });
  9039. return baseTimes(length, function(index) {
  9040. return arrayMap(array, baseProperty(index));
  9041. });
  9042. }
  9043. /**
  9044. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9045. * how regrouped values should be combined. The iteratee is invoked with the
  9046. * elements of each group: (...group).
  9047. *
  9048. * @static
  9049. * @memberOf _
  9050. * @since 3.8.0
  9051. * @category Array
  9052. * @param {Array} array The array of grouped elements to process.
  9053. * @param {Function} [iteratee=_.identity] The function to combine
  9054. * regrouped values.
  9055. * @returns {Array} Returns the new array of regrouped elements.
  9056. * @example
  9057. *
  9058. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9059. * // => [[1, 10, 100], [2, 20, 200]]
  9060. *
  9061. * _.unzipWith(zipped, _.add);
  9062. * // => [3, 30, 300]
  9063. */
  9064. function unzipWith(array, iteratee) {
  9065. if (!(array && array.length)) {
  9066. return [];
  9067. }
  9068. var result = unzip(array);
  9069. if (iteratee == null) {
  9070. return result;
  9071. }
  9072. return arrayMap(result, function(group) {
  9073. return apply(iteratee, undefined, group);
  9074. });
  9075. }
  9076. /**
  9077. * Creates an array excluding all given values using
  9078. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9079. * for equality comparisons.
  9080. *
  9081. * **Note:** Unlike `_.pull`, this method returns a new array.
  9082. *
  9083. * @static
  9084. * @memberOf _
  9085. * @since 0.1.0
  9086. * @category Array
  9087. * @param {Array} array The array to inspect.
  9088. * @param {...*} [values] The values to exclude.
  9089. * @returns {Array} Returns the new array of filtered values.
  9090. * @see _.difference, _.xor
  9091. * @example
  9092. *
  9093. * _.without([2, 1, 2, 3], 1, 2);
  9094. * // => [3]
  9095. */
  9096. var without = baseRest(function(array, values) {
  9097. return isArrayLikeObject(array)
  9098. ? baseDifference(array, values)
  9099. : [];
  9100. });
  9101. /**
  9102. * Creates an array of unique values that is the
  9103. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9104. * of the given arrays. The order of result values is determined by the order
  9105. * they occur in the arrays.
  9106. *
  9107. * @static
  9108. * @memberOf _
  9109. * @since 2.4.0
  9110. * @category Array
  9111. * @param {...Array} [arrays] The arrays to inspect.
  9112. * @returns {Array} Returns the new array of filtered values.
  9113. * @see _.difference, _.without
  9114. * @example
  9115. *
  9116. * _.xor([2, 1], [2, 3]);
  9117. * // => [1, 3]
  9118. */
  9119. var xor = baseRest(function(arrays) {
  9120. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9121. });
  9122. /**
  9123. * This method is like `_.xor` except that it accepts `iteratee` which is
  9124. * invoked for each element of each `arrays` to generate the criterion by
  9125. * which by which they're compared. The order of result values is determined
  9126. * by the order they occur in the arrays. The iteratee is invoked with one
  9127. * argument: (value).
  9128. *
  9129. * @static
  9130. * @memberOf _
  9131. * @since 4.0.0
  9132. * @category Array
  9133. * @param {...Array} [arrays] The arrays to inspect.
  9134. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9135. * @returns {Array} Returns the new array of filtered values.
  9136. * @example
  9137. *
  9138. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9139. * // => [1.2, 3.4]
  9140. *
  9141. * // The `_.property` iteratee shorthand.
  9142. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9143. * // => [{ 'x': 2 }]
  9144. */
  9145. var xorBy = baseRest(function(arrays) {
  9146. var iteratee = last(arrays);
  9147. if (isArrayLikeObject(iteratee)) {
  9148. iteratee = undefined;
  9149. }
  9150. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9151. });
  9152. /**
  9153. * This method is like `_.xor` except that it accepts `comparator` which is
  9154. * invoked to compare elements of `arrays`. The order of result values is
  9155. * determined by the order they occur in the arrays. The comparator is invoked
  9156. * with two arguments: (arrVal, othVal).
  9157. *
  9158. * @static
  9159. * @memberOf _
  9160. * @since 4.0.0
  9161. * @category Array
  9162. * @param {...Array} [arrays] The arrays to inspect.
  9163. * @param {Function} [comparator] The comparator invoked per element.
  9164. * @returns {Array} Returns the new array of filtered values.
  9165. * @example
  9166. *
  9167. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9168. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9169. *
  9170. * _.xorWith(objects, others, _.isEqual);
  9171. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9172. */
  9173. var xorWith = baseRest(function(arrays) {
  9174. var comparator = last(arrays);
  9175. comparator = typeof comparator == 'function' ? comparator : undefined;
  9176. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9177. });
  9178. /**
  9179. * Creates an array of grouped elements, the first of which contains the
  9180. * first elements of the given arrays, the second of which contains the
  9181. * second elements of the given arrays, and so on.
  9182. *
  9183. * @static
  9184. * @memberOf _
  9185. * @since 0.1.0
  9186. * @category Array
  9187. * @param {...Array} [arrays] The arrays to process.
  9188. * @returns {Array} Returns the new array of grouped elements.
  9189. * @example
  9190. *
  9191. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9192. * // => [['a', 1, true], ['b', 2, false]]
  9193. */
  9194. var zip = baseRest(unzip);
  9195. /**
  9196. * This method is like `_.fromPairs` except that it accepts two arrays,
  9197. * one of property identifiers and one of corresponding values.
  9198. *
  9199. * @static
  9200. * @memberOf _
  9201. * @since 0.4.0
  9202. * @category Array
  9203. * @param {Array} [props=[]] The property identifiers.
  9204. * @param {Array} [values=[]] The property values.
  9205. * @returns {Object} Returns the new object.
  9206. * @example
  9207. *
  9208. * _.zipObject(['a', 'b'], [1, 2]);
  9209. * // => { 'a': 1, 'b': 2 }
  9210. */
  9211. function zipObject(props, values) {
  9212. return baseZipObject(props || [], values || [], assignValue);
  9213. }
  9214. /**
  9215. * This method is like `_.zipObject` except that it supports property paths.
  9216. *
  9217. * @static
  9218. * @memberOf _
  9219. * @since 4.1.0
  9220. * @category Array
  9221. * @param {Array} [props=[]] The property identifiers.
  9222. * @param {Array} [values=[]] The property values.
  9223. * @returns {Object} Returns the new object.
  9224. * @example
  9225. *
  9226. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9227. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9228. */
  9229. function zipObjectDeep(props, values) {
  9230. return baseZipObject(props || [], values || [], baseSet);
  9231. }
  9232. /**
  9233. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9234. * how grouped values should be combined. The iteratee is invoked with the
  9235. * elements of each group: (...group).
  9236. *
  9237. * @static
  9238. * @memberOf _
  9239. * @since 3.8.0
  9240. * @category Array
  9241. * @param {...Array} [arrays] The arrays to process.
  9242. * @param {Function} [iteratee=_.identity] The function to combine
  9243. * grouped values.
  9244. * @returns {Array} Returns the new array of grouped elements.
  9245. * @example
  9246. *
  9247. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9248. * return a + b + c;
  9249. * });
  9250. * // => [111, 222]
  9251. */
  9252. var zipWith = baseRest(function(arrays) {
  9253. var length = arrays.length,
  9254. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9255. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9256. return unzipWith(arrays, iteratee);
  9257. });
  9258. /*------------------------------------------------------------------------*/
  9259. /**
  9260. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9261. * chain sequences enabled. The result of such sequences must be unwrapped
  9262. * with `_#value`.
  9263. *
  9264. * @static
  9265. * @memberOf _
  9266. * @since 1.3.0
  9267. * @category Seq
  9268. * @param {*} value The value to wrap.
  9269. * @returns {Object} Returns the new `lodash` wrapper instance.
  9270. * @example
  9271. *
  9272. * var users = [
  9273. * { 'user': 'barney', 'age': 36 },
  9274. * { 'user': 'fred', 'age': 40 },
  9275. * { 'user': 'pebbles', 'age': 1 }
  9276. * ];
  9277. *
  9278. * var youngest = _
  9279. * .chain(users)
  9280. * .sortBy('age')
  9281. * .map(function(o) {
  9282. * return o.user + ' is ' + o.age;
  9283. * })
  9284. * .head()
  9285. * .value();
  9286. * // => 'pebbles is 1'
  9287. */
  9288. function chain(value) {
  9289. var result = lodash(value);
  9290. result.__chain__ = true;
  9291. return result;
  9292. }
  9293. /**
  9294. * This method invokes `interceptor` and returns `value`. The interceptor
  9295. * is invoked with one argument; (value). The purpose of this method is to
  9296. * "tap into" a method chain sequence in order to modify intermediate results.
  9297. *
  9298. * @static
  9299. * @memberOf _
  9300. * @since 0.1.0
  9301. * @category Seq
  9302. * @param {*} value The value to provide to `interceptor`.
  9303. * @param {Function} interceptor The function to invoke.
  9304. * @returns {*} Returns `value`.
  9305. * @example
  9306. *
  9307. * _([1, 2, 3])
  9308. * .tap(function(array) {
  9309. * // Mutate input array.
  9310. * array.pop();
  9311. * })
  9312. * .reverse()
  9313. * .value();
  9314. * // => [2, 1]
  9315. */
  9316. function tap(value, interceptor) {
  9317. interceptor(value);
  9318. return value;
  9319. }
  9320. /**
  9321. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9322. * The purpose of this method is to "pass thru" values replacing intermediate
  9323. * results in a method chain sequence.
  9324. *
  9325. * @static
  9326. * @memberOf _
  9327. * @since 3.0.0
  9328. * @category Seq
  9329. * @param {*} value The value to provide to `interceptor`.
  9330. * @param {Function} interceptor The function to invoke.
  9331. * @returns {*} Returns the result of `interceptor`.
  9332. * @example
  9333. *
  9334. * _(' abc ')
  9335. * .chain()
  9336. * .trim()
  9337. * .thru(function(value) {
  9338. * return [value];
  9339. * })
  9340. * .value();
  9341. * // => ['abc']
  9342. */
  9343. function thru(value, interceptor) {
  9344. return interceptor(value);
  9345. }
  9346. /**
  9347. * This method is the wrapper version of `_.at`.
  9348. *
  9349. * @name at
  9350. * @memberOf _
  9351. * @since 1.0.0
  9352. * @category Seq
  9353. * @param {...(string|string[])} [paths] The property paths to pick.
  9354. * @returns {Object} Returns the new `lodash` wrapper instance.
  9355. * @example
  9356. *
  9357. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9358. *
  9359. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9360. * // => [3, 4]
  9361. */
  9362. var wrapperAt = flatRest(function(paths) {
  9363. var length = paths.length,
  9364. start = length ? paths[0] : 0,
  9365. value = this.__wrapped__,
  9366. interceptor = function(object) { return baseAt(object, paths); };
  9367. if (length > 1 || this.__actions__.length ||
  9368. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9369. return this.thru(interceptor);
  9370. }
  9371. value = value.slice(start, +start + (length ? 1 : 0));
  9372. value.__actions__.push({
  9373. 'func': thru,
  9374. 'args': [interceptor],
  9375. 'thisArg': undefined
  9376. });
  9377. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9378. if (length && !array.length) {
  9379. array.push(undefined);
  9380. }
  9381. return array;
  9382. });
  9383. });
  9384. /**
  9385. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9386. *
  9387. * @name chain
  9388. * @memberOf _
  9389. * @since 0.1.0
  9390. * @category Seq
  9391. * @returns {Object} Returns the new `lodash` wrapper instance.
  9392. * @example
  9393. *
  9394. * var users = [
  9395. * { 'user': 'barney', 'age': 36 },
  9396. * { 'user': 'fred', 'age': 40 }
  9397. * ];
  9398. *
  9399. * // A sequence without explicit chaining.
  9400. * _(users).head();
  9401. * // => { 'user': 'barney', 'age': 36 }
  9402. *
  9403. * // A sequence with explicit chaining.
  9404. * _(users)
  9405. * .chain()
  9406. * .head()
  9407. * .pick('user')
  9408. * .value();
  9409. * // => { 'user': 'barney' }
  9410. */
  9411. function wrapperChain() {
  9412. return chain(this);
  9413. }
  9414. /**
  9415. * Executes the chain sequence and returns the wrapped result.
  9416. *
  9417. * @name commit
  9418. * @memberOf _
  9419. * @since 3.2.0
  9420. * @category Seq
  9421. * @returns {Object} Returns the new `lodash` wrapper instance.
  9422. * @example
  9423. *
  9424. * var array = [1, 2];
  9425. * var wrapped = _(array).push(3);
  9426. *
  9427. * console.log(array);
  9428. * // => [1, 2]
  9429. *
  9430. * wrapped = wrapped.commit();
  9431. * console.log(array);
  9432. * // => [1, 2, 3]
  9433. *
  9434. * wrapped.last();
  9435. * // => 3
  9436. *
  9437. * console.log(array);
  9438. * // => [1, 2, 3]
  9439. */
  9440. function wrapperCommit() {
  9441. return new LodashWrapper(this.value(), this.__chain__);
  9442. }
  9443. /**
  9444. * Gets the next value on a wrapped object following the
  9445. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9446. *
  9447. * @name next
  9448. * @memberOf _
  9449. * @since 4.0.0
  9450. * @category Seq
  9451. * @returns {Object} Returns the next iterator value.
  9452. * @example
  9453. *
  9454. * var wrapped = _([1, 2]);
  9455. *
  9456. * wrapped.next();
  9457. * // => { 'done': false, 'value': 1 }
  9458. *
  9459. * wrapped.next();
  9460. * // => { 'done': false, 'value': 2 }
  9461. *
  9462. * wrapped.next();
  9463. * // => { 'done': true, 'value': undefined }
  9464. */
  9465. function wrapperNext() {
  9466. if (this.__values__ === undefined) {
  9467. this.__values__ = toArray(this.value());
  9468. }
  9469. var done = this.__index__ >= this.__values__.length,
  9470. value = done ? undefined : this.__values__[this.__index__++];
  9471. return { 'done': done, 'value': value };
  9472. }
  9473. /**
  9474. * Enables the wrapper to be iterable.
  9475. *
  9476. * @name Symbol.iterator
  9477. * @memberOf _
  9478. * @since 4.0.0
  9479. * @category Seq
  9480. * @returns {Object} Returns the wrapper object.
  9481. * @example
  9482. *
  9483. * var wrapped = _([1, 2]);
  9484. *
  9485. * wrapped[Symbol.iterator]() === wrapped;
  9486. * // => true
  9487. *
  9488. * Array.from(wrapped);
  9489. * // => [1, 2]
  9490. */
  9491. function wrapperToIterator() {
  9492. return this;
  9493. }
  9494. /**
  9495. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9496. *
  9497. * @name plant
  9498. * @memberOf _
  9499. * @since 3.2.0
  9500. * @category Seq
  9501. * @param {*} value The value to plant.
  9502. * @returns {Object} Returns the new `lodash` wrapper instance.
  9503. * @example
  9504. *
  9505. * function square(n) {
  9506. * return n * n;
  9507. * }
  9508. *
  9509. * var wrapped = _([1, 2]).map(square);
  9510. * var other = wrapped.plant([3, 4]);
  9511. *
  9512. * other.value();
  9513. * // => [9, 16]
  9514. *
  9515. * wrapped.value();
  9516. * // => [1, 4]
  9517. */
  9518. function wrapperPlant(value) {
  9519. var result,
  9520. parent = this;
  9521. while (parent instanceof baseLodash) {
  9522. var clone = wrapperClone(parent);
  9523. clone.__index__ = 0;
  9524. clone.__values__ = undefined;
  9525. if (result) {
  9526. previous.__wrapped__ = clone;
  9527. } else {
  9528. result = clone;
  9529. }
  9530. var previous = clone;
  9531. parent = parent.__wrapped__;
  9532. }
  9533. previous.__wrapped__ = value;
  9534. return result;
  9535. }
  9536. /**
  9537. * This method is the wrapper version of `_.reverse`.
  9538. *
  9539. * **Note:** This method mutates the wrapped array.
  9540. *
  9541. * @name reverse
  9542. * @memberOf _
  9543. * @since 0.1.0
  9544. * @category Seq
  9545. * @returns {Object} Returns the new `lodash` wrapper instance.
  9546. * @example
  9547. *
  9548. * var array = [1, 2, 3];
  9549. *
  9550. * _(array).reverse().value()
  9551. * // => [3, 2, 1]
  9552. *
  9553. * console.log(array);
  9554. * // => [3, 2, 1]
  9555. */
  9556. function wrapperReverse() {
  9557. var value = this.__wrapped__;
  9558. if (value instanceof LazyWrapper) {
  9559. var wrapped = value;
  9560. if (this.__actions__.length) {
  9561. wrapped = new LazyWrapper(this);
  9562. }
  9563. wrapped = wrapped.reverse();
  9564. wrapped.__actions__.push({
  9565. 'func': thru,
  9566. 'args': [reverse],
  9567. 'thisArg': undefined
  9568. });
  9569. return new LodashWrapper(wrapped, this.__chain__);
  9570. }
  9571. return this.thru(reverse);
  9572. }
  9573. /**
  9574. * Executes the chain sequence to resolve the unwrapped value.
  9575. *
  9576. * @name value
  9577. * @memberOf _
  9578. * @since 0.1.0
  9579. * @alias toJSON, valueOf
  9580. * @category Seq
  9581. * @returns {*} Returns the resolved unwrapped value.
  9582. * @example
  9583. *
  9584. * _([1, 2, 3]).value();
  9585. * // => [1, 2, 3]
  9586. */
  9587. function wrapperValue() {
  9588. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9589. }
  9590. /*------------------------------------------------------------------------*/
  9591. /**
  9592. * Creates an object composed of keys generated from the results of running
  9593. * each element of `collection` thru `iteratee`. The corresponding value of
  9594. * each key is the number of times the key was returned by `iteratee`. The
  9595. * iteratee is invoked with one argument: (value).
  9596. *
  9597. * @static
  9598. * @memberOf _
  9599. * @since 0.5.0
  9600. * @category Collection
  9601. * @param {Array|Object} collection The collection to iterate over.
  9602. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9603. * @returns {Object} Returns the composed aggregate object.
  9604. * @example
  9605. *
  9606. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9607. * // => { '4': 1, '6': 2 }
  9608. *
  9609. * // The `_.property` iteratee shorthand.
  9610. * _.countBy(['one', 'two', 'three'], 'length');
  9611. * // => { '3': 2, '5': 1 }
  9612. */
  9613. var countBy = createAggregator(function(result, value, key) {
  9614. if (hasOwnProperty.call(result, key)) {
  9615. ++result[key];
  9616. } else {
  9617. baseAssignValue(result, key, 1);
  9618. }
  9619. });
  9620. /**
  9621. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9622. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9623. * invoked with three arguments: (value, index|key, collection).
  9624. *
  9625. * **Note:** This method returns `true` for
  9626. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9627. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9628. * elements of empty collections.
  9629. *
  9630. * @static
  9631. * @memberOf _
  9632. * @since 0.1.0
  9633. * @category Collection
  9634. * @param {Array|Object} collection The collection to iterate over.
  9635. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9636. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9637. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9638. * else `false`.
  9639. * @example
  9640. *
  9641. * _.every([true, 1, null, 'yes'], Boolean);
  9642. * // => false
  9643. *
  9644. * var users = [
  9645. * { 'user': 'barney', 'age': 36, 'active': false },
  9646. * { 'user': 'fred', 'age': 40, 'active': false }
  9647. * ];
  9648. *
  9649. * // The `_.matches` iteratee shorthand.
  9650. * _.every(users, { 'user': 'barney', 'active': false });
  9651. * // => false
  9652. *
  9653. * // The `_.matchesProperty` iteratee shorthand.
  9654. * _.every(users, ['active', false]);
  9655. * // => true
  9656. *
  9657. * // The `_.property` iteratee shorthand.
  9658. * _.every(users, 'active');
  9659. * // => false
  9660. */
  9661. function every(collection, predicate, guard) {
  9662. var func = isArray(collection) ? arrayEvery : baseEvery;
  9663. if (guard && isIterateeCall(collection, predicate, guard)) {
  9664. predicate = undefined;
  9665. }
  9666. return func(collection, getIteratee(predicate, 3));
  9667. }
  9668. /**
  9669. * Iterates over elements of `collection`, returning an array of all elements
  9670. * `predicate` returns truthy for. The predicate is invoked with three
  9671. * arguments: (value, index|key, collection).
  9672. *
  9673. * **Note:** Unlike `_.remove`, this method returns a new array.
  9674. *
  9675. * @static
  9676. * @memberOf _
  9677. * @since 0.1.0
  9678. * @category Collection
  9679. * @param {Array|Object} collection The collection to iterate over.
  9680. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9681. * @returns {Array} Returns the new filtered array.
  9682. * @see _.reject
  9683. * @example
  9684. *
  9685. * var users = [
  9686. * { 'user': 'barney', 'age': 36, 'active': true },
  9687. * { 'user': 'fred', 'age': 40, 'active': false }
  9688. * ];
  9689. *
  9690. * _.filter(users, function(o) { return !o.active; });
  9691. * // => objects for ['fred']
  9692. *
  9693. * // The `_.matches` iteratee shorthand.
  9694. * _.filter(users, { 'age': 36, 'active': true });
  9695. * // => objects for ['barney']
  9696. *
  9697. * // The `_.matchesProperty` iteratee shorthand.
  9698. * _.filter(users, ['active', false]);
  9699. * // => objects for ['fred']
  9700. *
  9701. * // The `_.property` iteratee shorthand.
  9702. * _.filter(users, 'active');
  9703. * // => objects for ['barney']
  9704. *
  9705. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9706. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9707. * // => objects for ['fred', 'barney']
  9708. */
  9709. function filter(collection, predicate) {
  9710. var func = isArray(collection) ? arrayFilter : baseFilter;
  9711. return func(collection, getIteratee(predicate, 3));
  9712. }
  9713. /**
  9714. * Iterates over elements of `collection`, returning the first element
  9715. * `predicate` returns truthy for. The predicate is invoked with three
  9716. * arguments: (value, index|key, collection).
  9717. *
  9718. * @static
  9719. * @memberOf _
  9720. * @since 0.1.0
  9721. * @category Collection
  9722. * @param {Array|Object} collection The collection to inspect.
  9723. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9724. * @param {number} [fromIndex=0] The index to search from.
  9725. * @returns {*} Returns the matched element, else `undefined`.
  9726. * @example
  9727. *
  9728. * var users = [
  9729. * { 'user': 'barney', 'age': 36, 'active': true },
  9730. * { 'user': 'fred', 'age': 40, 'active': false },
  9731. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9732. * ];
  9733. *
  9734. * _.find(users, function(o) { return o.age < 40; });
  9735. * // => object for 'barney'
  9736. *
  9737. * // The `_.matches` iteratee shorthand.
  9738. * _.find(users, { 'age': 1, 'active': true });
  9739. * // => object for 'pebbles'
  9740. *
  9741. * // The `_.matchesProperty` iteratee shorthand.
  9742. * _.find(users, ['active', false]);
  9743. * // => object for 'fred'
  9744. *
  9745. * // The `_.property` iteratee shorthand.
  9746. * _.find(users, 'active');
  9747. * // => object for 'barney'
  9748. */
  9749. var find = createFind(findIndex);
  9750. /**
  9751. * This method is like `_.find` except that it iterates over elements of
  9752. * `collection` from right to left.
  9753. *
  9754. * @static
  9755. * @memberOf _
  9756. * @since 2.0.0
  9757. * @category Collection
  9758. * @param {Array|Object} collection The collection to inspect.
  9759. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9760. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9761. * @returns {*} Returns the matched element, else `undefined`.
  9762. * @example
  9763. *
  9764. * _.findLast([1, 2, 3, 4], function(n) {
  9765. * return n % 2 == 1;
  9766. * });
  9767. * // => 3
  9768. */
  9769. var findLast = createFind(findLastIndex);
  9770. /**
  9771. * Creates a flattened array of values by running each element in `collection`
  9772. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9773. * with three arguments: (value, index|key, collection).
  9774. *
  9775. * @static
  9776. * @memberOf _
  9777. * @since 4.0.0
  9778. * @category Collection
  9779. * @param {Array|Object} collection The collection to iterate over.
  9780. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9781. * @returns {Array} Returns the new flattened array.
  9782. * @example
  9783. *
  9784. * function duplicate(n) {
  9785. * return [n, n];
  9786. * }
  9787. *
  9788. * _.flatMap([1, 2], duplicate);
  9789. * // => [1, 1, 2, 2]
  9790. */
  9791. function flatMap(collection, iteratee) {
  9792. return baseFlatten(map(collection, iteratee), 1);
  9793. }
  9794. /**
  9795. * This method is like `_.flatMap` except that it recursively flattens the
  9796. * mapped results.
  9797. *
  9798. * @static
  9799. * @memberOf _
  9800. * @since 4.7.0
  9801. * @category Collection
  9802. * @param {Array|Object} collection The collection to iterate over.
  9803. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9804. * @returns {Array} Returns the new flattened array.
  9805. * @example
  9806. *
  9807. * function duplicate(n) {
  9808. * return [[[n, n]]];
  9809. * }
  9810. *
  9811. * _.flatMapDeep([1, 2], duplicate);
  9812. * // => [1, 1, 2, 2]
  9813. */
  9814. function flatMapDeep(collection, iteratee) {
  9815. return baseFlatten(map(collection, iteratee), INFINITY);
  9816. }
  9817. /**
  9818. * This method is like `_.flatMap` except that it recursively flattens the
  9819. * mapped results up to `depth` times.
  9820. *
  9821. * @static
  9822. * @memberOf _
  9823. * @since 4.7.0
  9824. * @category Collection
  9825. * @param {Array|Object} collection The collection to iterate over.
  9826. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9827. * @param {number} [depth=1] The maximum recursion depth.
  9828. * @returns {Array} Returns the new flattened array.
  9829. * @example
  9830. *
  9831. * function duplicate(n) {
  9832. * return [[[n, n]]];
  9833. * }
  9834. *
  9835. * _.flatMapDepth([1, 2], duplicate, 2);
  9836. * // => [[1, 1], [2, 2]]
  9837. */
  9838. function flatMapDepth(collection, iteratee, depth) {
  9839. depth = depth === undefined ? 1 : toInteger(depth);
  9840. return baseFlatten(map(collection, iteratee), depth);
  9841. }
  9842. /**
  9843. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9844. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9845. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9846. *
  9847. * **Note:** As with other "Collections" methods, objects with a "length"
  9848. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9849. * or `_.forOwn` for object iteration.
  9850. *
  9851. * @static
  9852. * @memberOf _
  9853. * @since 0.1.0
  9854. * @alias each
  9855. * @category Collection
  9856. * @param {Array|Object} collection The collection to iterate over.
  9857. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9858. * @returns {Array|Object} Returns `collection`.
  9859. * @see _.forEachRight
  9860. * @example
  9861. *
  9862. * _.forEach([1, 2], function(value) {
  9863. * console.log(value);
  9864. * });
  9865. * // => Logs `1` then `2`.
  9866. *
  9867. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9868. * console.log(key);
  9869. * });
  9870. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9871. */
  9872. function forEach(collection, iteratee) {
  9873. var func = isArray(collection) ? arrayEach : baseEach;
  9874. return func(collection, getIteratee(iteratee, 3));
  9875. }
  9876. /**
  9877. * This method is like `_.forEach` except that it iterates over elements of
  9878. * `collection` from right to left.
  9879. *
  9880. * @static
  9881. * @memberOf _
  9882. * @since 2.0.0
  9883. * @alias eachRight
  9884. * @category Collection
  9885. * @param {Array|Object} collection The collection to iterate over.
  9886. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9887. * @returns {Array|Object} Returns `collection`.
  9888. * @see _.forEach
  9889. * @example
  9890. *
  9891. * _.forEachRight([1, 2], function(value) {
  9892. * console.log(value);
  9893. * });
  9894. * // => Logs `2` then `1`.
  9895. */
  9896. function forEachRight(collection, iteratee) {
  9897. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9898. return func(collection, getIteratee(iteratee, 3));
  9899. }
  9900. /**
  9901. * Creates an object composed of keys generated from the results of running
  9902. * each element of `collection` thru `iteratee`. The order of grouped values
  9903. * is determined by the order they occur in `collection`. The corresponding
  9904. * value of each key is an array of elements responsible for generating the
  9905. * key. The iteratee is invoked with one argument: (value).
  9906. *
  9907. * @static
  9908. * @memberOf _
  9909. * @since 0.1.0
  9910. * @category Collection
  9911. * @param {Array|Object} collection The collection to iterate over.
  9912. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9913. * @returns {Object} Returns the composed aggregate object.
  9914. * @example
  9915. *
  9916. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9917. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9918. *
  9919. * // The `_.property` iteratee shorthand.
  9920. * _.groupBy(['one', 'two', 'three'], 'length');
  9921. * // => { '3': ['one', 'two'], '5': ['three'] }
  9922. */
  9923. var groupBy = createAggregator(function(result, value, key) {
  9924. if (hasOwnProperty.call(result, key)) {
  9925. result[key].push(value);
  9926. } else {
  9927. baseAssignValue(result, key, [value]);
  9928. }
  9929. });
  9930. /**
  9931. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9932. * checked for a substring of `value`, otherwise
  9933. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9934. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9935. * the offset from the end of `collection`.
  9936. *
  9937. * @static
  9938. * @memberOf _
  9939. * @since 0.1.0
  9940. * @category Collection
  9941. * @param {Array|Object|string} collection The collection to inspect.
  9942. * @param {*} value The value to search for.
  9943. * @param {number} [fromIndex=0] The index to search from.
  9944. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9945. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9946. * @example
  9947. *
  9948. * _.includes([1, 2, 3], 1);
  9949. * // => true
  9950. *
  9951. * _.includes([1, 2, 3], 1, 2);
  9952. * // => false
  9953. *
  9954. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9955. * // => true
  9956. *
  9957. * _.includes('abcd', 'bc');
  9958. * // => true
  9959. */
  9960. function includes(collection, value, fromIndex, guard) {
  9961. collection = isArrayLike(collection) ? collection : values(collection);
  9962. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9963. var length = collection.length;
  9964. if (fromIndex < 0) {
  9965. fromIndex = nativeMax(length + fromIndex, 0);
  9966. }
  9967. return isString(collection)
  9968. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9969. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9970. }
  9971. /**
  9972. * Invokes the method at `path` of each element in `collection`, returning
  9973. * an array of the results of each invoked method. Any additional arguments
  9974. * are provided to each invoked method. If `path` is a function, it's invoked
  9975. * for, and `this` bound to, each element in `collection`.
  9976. *
  9977. * @static
  9978. * @memberOf _
  9979. * @since 4.0.0
  9980. * @category Collection
  9981. * @param {Array|Object} collection The collection to iterate over.
  9982. * @param {Array|Function|string} path The path of the method to invoke or
  9983. * the function invoked per iteration.
  9984. * @param {...*} [args] The arguments to invoke each method with.
  9985. * @returns {Array} Returns the array of results.
  9986. * @example
  9987. *
  9988. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9989. * // => [[1, 5, 7], [1, 2, 3]]
  9990. *
  9991. * _.invokeMap([123, 456], String.prototype.split, '');
  9992. * // => [['1', '2', '3'], ['4', '5', '6']]
  9993. */
  9994. var invokeMap = baseRest(function(collection, path, args) {
  9995. var index = -1,
  9996. isFunc = typeof path == 'function',
  9997. result = isArrayLike(collection) ? Array(collection.length) : [];
  9998. baseEach(collection, function(value) {
  9999. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10000. });
  10001. return result;
  10002. });
  10003. /**
  10004. * Creates an object composed of keys generated from the results of running
  10005. * each element of `collection` thru `iteratee`. The corresponding value of
  10006. * each key is the last element responsible for generating the key. The
  10007. * iteratee is invoked with one argument: (value).
  10008. *
  10009. * @static
  10010. * @memberOf _
  10011. * @since 4.0.0
  10012. * @category Collection
  10013. * @param {Array|Object} collection The collection to iterate over.
  10014. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10015. * @returns {Object} Returns the composed aggregate object.
  10016. * @example
  10017. *
  10018. * var array = [
  10019. * { 'dir': 'left', 'code': 97 },
  10020. * { 'dir': 'right', 'code': 100 }
  10021. * ];
  10022. *
  10023. * _.keyBy(array, function(o) {
  10024. * return String.fromCharCode(o.code);
  10025. * });
  10026. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10027. *
  10028. * _.keyBy(array, 'dir');
  10029. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10030. */
  10031. var keyBy = createAggregator(function(result, value, key) {
  10032. baseAssignValue(result, key, value);
  10033. });
  10034. /**
  10035. * Creates an array of values by running each element in `collection` thru
  10036. * `iteratee`. The iteratee is invoked with three arguments:
  10037. * (value, index|key, collection).
  10038. *
  10039. * Many lodash methods are guarded to work as iteratees for methods like
  10040. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10041. *
  10042. * The guarded methods are:
  10043. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10044. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10045. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10046. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10047. *
  10048. * @static
  10049. * @memberOf _
  10050. * @since 0.1.0
  10051. * @category Collection
  10052. * @param {Array|Object} collection The collection to iterate over.
  10053. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10054. * @returns {Array} Returns the new mapped array.
  10055. * @example
  10056. *
  10057. * function square(n) {
  10058. * return n * n;
  10059. * }
  10060. *
  10061. * _.map([4, 8], square);
  10062. * // => [16, 64]
  10063. *
  10064. * _.map({ 'a': 4, 'b': 8 }, square);
  10065. * // => [16, 64] (iteration order is not guaranteed)
  10066. *
  10067. * var users = [
  10068. * { 'user': 'barney' },
  10069. * { 'user': 'fred' }
  10070. * ];
  10071. *
  10072. * // The `_.property` iteratee shorthand.
  10073. * _.map(users, 'user');
  10074. * // => ['barney', 'fred']
  10075. */
  10076. function map(collection, iteratee) {
  10077. var func = isArray(collection) ? arrayMap : baseMap;
  10078. return func(collection, getIteratee(iteratee, 3));
  10079. }
  10080. /**
  10081. * This method is like `_.sortBy` except that it allows specifying the sort
  10082. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10083. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10084. * descending or "asc" for ascending sort order of corresponding values.
  10085. *
  10086. * @static
  10087. * @memberOf _
  10088. * @since 4.0.0
  10089. * @category Collection
  10090. * @param {Array|Object} collection The collection to iterate over.
  10091. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10092. * The iteratees to sort by.
  10093. * @param {string[]} [orders] The sort orders of `iteratees`.
  10094. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10095. * @returns {Array} Returns the new sorted array.
  10096. * @example
  10097. *
  10098. * var users = [
  10099. * { 'user': 'fred', 'age': 48 },
  10100. * { 'user': 'barney', 'age': 34 },
  10101. * { 'user': 'fred', 'age': 40 },
  10102. * { 'user': 'barney', 'age': 36 }
  10103. * ];
  10104. *
  10105. * // Sort by `user` in ascending order and by `age` in descending order.
  10106. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10107. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10108. */
  10109. function orderBy(collection, iteratees, orders, guard) {
  10110. if (collection == null) {
  10111. return [];
  10112. }
  10113. if (!isArray(iteratees)) {
  10114. iteratees = iteratees == null ? [] : [iteratees];
  10115. }
  10116. orders = guard ? undefined : orders;
  10117. if (!isArray(orders)) {
  10118. orders = orders == null ? [] : [orders];
  10119. }
  10120. return baseOrderBy(collection, iteratees, orders);
  10121. }
  10122. /**
  10123. * Creates an array of elements split into two groups, the first of which
  10124. * contains elements `predicate` returns truthy for, the second of which
  10125. * contains elements `predicate` returns falsey for. The predicate is
  10126. * invoked with one argument: (value).
  10127. *
  10128. * @static
  10129. * @memberOf _
  10130. * @since 3.0.0
  10131. * @category Collection
  10132. * @param {Array|Object} collection The collection to iterate over.
  10133. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10134. * @returns {Array} Returns the array of grouped elements.
  10135. * @example
  10136. *
  10137. * var users = [
  10138. * { 'user': 'barney', 'age': 36, 'active': false },
  10139. * { 'user': 'fred', 'age': 40, 'active': true },
  10140. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10141. * ];
  10142. *
  10143. * _.partition(users, function(o) { return o.active; });
  10144. * // => objects for [['fred'], ['barney', 'pebbles']]
  10145. *
  10146. * // The `_.matches` iteratee shorthand.
  10147. * _.partition(users, { 'age': 1, 'active': false });
  10148. * // => objects for [['pebbles'], ['barney', 'fred']]
  10149. *
  10150. * // The `_.matchesProperty` iteratee shorthand.
  10151. * _.partition(users, ['active', false]);
  10152. * // => objects for [['barney', 'pebbles'], ['fred']]
  10153. *
  10154. * // The `_.property` iteratee shorthand.
  10155. * _.partition(users, 'active');
  10156. * // => objects for [['fred'], ['barney', 'pebbles']]
  10157. */
  10158. var partition = createAggregator(function(result, value, key) {
  10159. result[key ? 0 : 1].push(value);
  10160. }, function() { return [[], []]; });
  10161. /**
  10162. * Reduces `collection` to a value which is the accumulated result of running
  10163. * each element in `collection` thru `iteratee`, where each successive
  10164. * invocation is supplied the return value of the previous. If `accumulator`
  10165. * is not given, the first element of `collection` is used as the initial
  10166. * value. The iteratee is invoked with four arguments:
  10167. * (accumulator, value, index|key, collection).
  10168. *
  10169. * Many lodash methods are guarded to work as iteratees for methods like
  10170. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10171. *
  10172. * The guarded methods are:
  10173. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10174. * and `sortBy`
  10175. *
  10176. * @static
  10177. * @memberOf _
  10178. * @since 0.1.0
  10179. * @category Collection
  10180. * @param {Array|Object} collection The collection to iterate over.
  10181. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10182. * @param {*} [accumulator] The initial value.
  10183. * @returns {*} Returns the accumulated value.
  10184. * @see _.reduceRight
  10185. * @example
  10186. *
  10187. * _.reduce([1, 2], function(sum, n) {
  10188. * return sum + n;
  10189. * }, 0);
  10190. * // => 3
  10191. *
  10192. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10193. * (result[value] || (result[value] = [])).push(key);
  10194. * return result;
  10195. * }, {});
  10196. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10197. */
  10198. function reduce(collection, iteratee, accumulator) {
  10199. var func = isArray(collection) ? arrayReduce : baseReduce,
  10200. initAccum = arguments.length < 3;
  10201. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10202. }
  10203. /**
  10204. * This method is like `_.reduce` except that it iterates over elements of
  10205. * `collection` from right to left.
  10206. *
  10207. * @static
  10208. * @memberOf _
  10209. * @since 0.1.0
  10210. * @category Collection
  10211. * @param {Array|Object} collection The collection to iterate over.
  10212. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10213. * @param {*} [accumulator] The initial value.
  10214. * @returns {*} Returns the accumulated value.
  10215. * @see _.reduce
  10216. * @example
  10217. *
  10218. * var array = [[0, 1], [2, 3], [4, 5]];
  10219. *
  10220. * _.reduceRight(array, function(flattened, other) {
  10221. * return flattened.concat(other);
  10222. * }, []);
  10223. * // => [4, 5, 2, 3, 0, 1]
  10224. */
  10225. function reduceRight(collection, iteratee, accumulator) {
  10226. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10227. initAccum = arguments.length < 3;
  10228. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10229. }
  10230. /**
  10231. * The opposite of `_.filter`; this method returns the elements of `collection`
  10232. * that `predicate` does **not** return truthy for.
  10233. *
  10234. * @static
  10235. * @memberOf _
  10236. * @since 0.1.0
  10237. * @category Collection
  10238. * @param {Array|Object} collection The collection to iterate over.
  10239. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10240. * @returns {Array} Returns the new filtered array.
  10241. * @see _.filter
  10242. * @example
  10243. *
  10244. * var users = [
  10245. * { 'user': 'barney', 'age': 36, 'active': false },
  10246. * { 'user': 'fred', 'age': 40, 'active': true }
  10247. * ];
  10248. *
  10249. * _.reject(users, function(o) { return !o.active; });
  10250. * // => objects for ['fred']
  10251. *
  10252. * // The `_.matches` iteratee shorthand.
  10253. * _.reject(users, { 'age': 40, 'active': true });
  10254. * // => objects for ['barney']
  10255. *
  10256. * // The `_.matchesProperty` iteratee shorthand.
  10257. * _.reject(users, ['active', false]);
  10258. * // => objects for ['fred']
  10259. *
  10260. * // The `_.property` iteratee shorthand.
  10261. * _.reject(users, 'active');
  10262. * // => objects for ['barney']
  10263. */
  10264. function reject(collection, predicate) {
  10265. var func = isArray(collection) ? arrayFilter : baseFilter;
  10266. return func(collection, negate(getIteratee(predicate, 3)));
  10267. }
  10268. /**
  10269. * Gets a random element from `collection`.
  10270. *
  10271. * @static
  10272. * @memberOf _
  10273. * @since 2.0.0
  10274. * @category Collection
  10275. * @param {Array|Object} collection The collection to sample.
  10276. * @returns {*} Returns the random element.
  10277. * @example
  10278. *
  10279. * _.sample([1, 2, 3, 4]);
  10280. * // => 2
  10281. */
  10282. function sample(collection) {
  10283. var func = isArray(collection) ? arraySample : baseSample;
  10284. return func(collection);
  10285. }
  10286. /**
  10287. * Gets `n` random elements at unique keys from `collection` up to the
  10288. * size of `collection`.
  10289. *
  10290. * @static
  10291. * @memberOf _
  10292. * @since 4.0.0
  10293. * @category Collection
  10294. * @param {Array|Object} collection The collection to sample.
  10295. * @param {number} [n=1] The number of elements to sample.
  10296. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10297. * @returns {Array} Returns the random elements.
  10298. * @example
  10299. *
  10300. * _.sampleSize([1, 2, 3], 2);
  10301. * // => [3, 1]
  10302. *
  10303. * _.sampleSize([1, 2, 3], 4);
  10304. * // => [2, 3, 1]
  10305. */
  10306. function sampleSize(collection, n, guard) {
  10307. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10308. n = 1;
  10309. } else {
  10310. n = toInteger(n);
  10311. }
  10312. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10313. return func(collection, n);
  10314. }
  10315. /**
  10316. * Creates an array of shuffled values, using a version of the
  10317. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10318. *
  10319. * @static
  10320. * @memberOf _
  10321. * @since 0.1.0
  10322. * @category Collection
  10323. * @param {Array|Object} collection The collection to shuffle.
  10324. * @returns {Array} Returns the new shuffled array.
  10325. * @example
  10326. *
  10327. * _.shuffle([1, 2, 3, 4]);
  10328. * // => [4, 1, 3, 2]
  10329. */
  10330. function shuffle(collection) {
  10331. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10332. return func(collection);
  10333. }
  10334. /**
  10335. * Gets the size of `collection` by returning its length for array-like
  10336. * values or the number of own enumerable string keyed properties for objects.
  10337. *
  10338. * @static
  10339. * @memberOf _
  10340. * @since 0.1.0
  10341. * @category Collection
  10342. * @param {Array|Object|string} collection The collection to inspect.
  10343. * @returns {number} Returns the collection size.
  10344. * @example
  10345. *
  10346. * _.size([1, 2, 3]);
  10347. * // => 3
  10348. *
  10349. * _.size({ 'a': 1, 'b': 2 });
  10350. * // => 2
  10351. *
  10352. * _.size('pebbles');
  10353. * // => 7
  10354. */
  10355. function size(collection) {
  10356. if (collection == null) {
  10357. return 0;
  10358. }
  10359. if (isArrayLike(collection)) {
  10360. return isString(collection) ? stringSize(collection) : collection.length;
  10361. }
  10362. var tag = getTag(collection);
  10363. if (tag == mapTag || tag == setTag) {
  10364. return collection.size;
  10365. }
  10366. return baseKeys(collection).length;
  10367. }
  10368. /**
  10369. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10370. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10371. * invoked with three arguments: (value, index|key, collection).
  10372. *
  10373. * @static
  10374. * @memberOf _
  10375. * @since 0.1.0
  10376. * @category Collection
  10377. * @param {Array|Object} collection The collection to iterate over.
  10378. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10379. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10380. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10381. * else `false`.
  10382. * @example
  10383. *
  10384. * _.some([null, 0, 'yes', false], Boolean);
  10385. * // => true
  10386. *
  10387. * var users = [
  10388. * { 'user': 'barney', 'active': true },
  10389. * { 'user': 'fred', 'active': false }
  10390. * ];
  10391. *
  10392. * // The `_.matches` iteratee shorthand.
  10393. * _.some(users, { 'user': 'barney', 'active': false });
  10394. * // => false
  10395. *
  10396. * // The `_.matchesProperty` iteratee shorthand.
  10397. * _.some(users, ['active', false]);
  10398. * // => true
  10399. *
  10400. * // The `_.property` iteratee shorthand.
  10401. * _.some(users, 'active');
  10402. * // => true
  10403. */
  10404. function some(collection, predicate, guard) {
  10405. var func = isArray(collection) ? arraySome : baseSome;
  10406. if (guard && isIterateeCall(collection, predicate, guard)) {
  10407. predicate = undefined;
  10408. }
  10409. return func(collection, getIteratee(predicate, 3));
  10410. }
  10411. /**
  10412. * Creates an array of elements, sorted in ascending order by the results of
  10413. * running each element in a collection thru each iteratee. This method
  10414. * performs a stable sort, that is, it preserves the original sort order of
  10415. * equal elements. The iteratees are invoked with one argument: (value).
  10416. *
  10417. * @static
  10418. * @memberOf _
  10419. * @since 0.1.0
  10420. * @category Collection
  10421. * @param {Array|Object} collection The collection to iterate over.
  10422. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10423. * The iteratees to sort by.
  10424. * @returns {Array} Returns the new sorted array.
  10425. * @example
  10426. *
  10427. * var users = [
  10428. * { 'user': 'fred', 'age': 48 },
  10429. * { 'user': 'barney', 'age': 36 },
  10430. * { 'user': 'fred', 'age': 30 },
  10431. * { 'user': 'barney', 'age': 34 }
  10432. * ];
  10433. *
  10434. * _.sortBy(users, [function(o) { return o.user; }]);
  10435. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10436. *
  10437. * _.sortBy(users, ['user', 'age']);
  10438. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10439. */
  10440. var sortBy = baseRest(function(collection, iteratees) {
  10441. if (collection == null) {
  10442. return [];
  10443. }
  10444. var length = iteratees.length;
  10445. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10446. iteratees = [];
  10447. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10448. iteratees = [iteratees[0]];
  10449. }
  10450. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10451. });
  10452. /*------------------------------------------------------------------------*/
  10453. /**
  10454. * Gets the timestamp of the number of milliseconds that have elapsed since
  10455. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10456. *
  10457. * @static
  10458. * @memberOf _
  10459. * @since 2.4.0
  10460. * @category Date
  10461. * @returns {number} Returns the timestamp.
  10462. * @example
  10463. *
  10464. * _.defer(function(stamp) {
  10465. * console.log(_.now() - stamp);
  10466. * }, _.now());
  10467. * // => Logs the number of milliseconds it took for the deferred invocation.
  10468. */
  10469. var now = ctxNow || function() {
  10470. return root.Date.now();
  10471. };
  10472. /*------------------------------------------------------------------------*/
  10473. /**
  10474. * The opposite of `_.before`; this method creates a function that invokes
  10475. * `func` once it's called `n` or more times.
  10476. *
  10477. * @static
  10478. * @memberOf _
  10479. * @since 0.1.0
  10480. * @category Function
  10481. * @param {number} n The number of calls before `func` is invoked.
  10482. * @param {Function} func The function to restrict.
  10483. * @returns {Function} Returns the new restricted function.
  10484. * @example
  10485. *
  10486. * var saves = ['profile', 'settings'];
  10487. *
  10488. * var done = _.after(saves.length, function() {
  10489. * console.log('done saving!');
  10490. * });
  10491. *
  10492. * _.forEach(saves, function(type) {
  10493. * asyncSave({ 'type': type, 'complete': done });
  10494. * });
  10495. * // => Logs 'done saving!' after the two async saves have completed.
  10496. */
  10497. function after(n, func) {
  10498. if (typeof func != 'function') {
  10499. throw new TypeError(FUNC_ERROR_TEXT);
  10500. }
  10501. n = toInteger(n);
  10502. return function() {
  10503. if (--n < 1) {
  10504. return func.apply(this, arguments);
  10505. }
  10506. };
  10507. }
  10508. /**
  10509. * Creates a function that invokes `func`, with up to `n` arguments,
  10510. * ignoring any additional arguments.
  10511. *
  10512. * @static
  10513. * @memberOf _
  10514. * @since 3.0.0
  10515. * @category Function
  10516. * @param {Function} func The function to cap arguments for.
  10517. * @param {number} [n=func.length] The arity cap.
  10518. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10519. * @returns {Function} Returns the new capped function.
  10520. * @example
  10521. *
  10522. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10523. * // => [6, 8, 10]
  10524. */
  10525. function ary(func, n, guard) {
  10526. n = guard ? undefined : n;
  10527. n = (func && n == null) ? func.length : n;
  10528. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10529. }
  10530. /**
  10531. * Creates a function that invokes `func`, with the `this` binding and arguments
  10532. * of the created function, while it's called less than `n` times. Subsequent
  10533. * calls to the created function return the result of the last `func` invocation.
  10534. *
  10535. * @static
  10536. * @memberOf _
  10537. * @since 3.0.0
  10538. * @category Function
  10539. * @param {number} n The number of calls at which `func` is no longer invoked.
  10540. * @param {Function} func The function to restrict.
  10541. * @returns {Function} Returns the new restricted function.
  10542. * @example
  10543. *
  10544. * jQuery(element).on('click', _.before(5, addContactToList));
  10545. * // => Allows adding up to 4 contacts to the list.
  10546. */
  10547. function before(n, func) {
  10548. var result;
  10549. if (typeof func != 'function') {
  10550. throw new TypeError(FUNC_ERROR_TEXT);
  10551. }
  10552. n = toInteger(n);
  10553. return function() {
  10554. if (--n > 0) {
  10555. result = func.apply(this, arguments);
  10556. }
  10557. if (n <= 1) {
  10558. func = undefined;
  10559. }
  10560. return result;
  10561. };
  10562. }
  10563. /**
  10564. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10565. * and `partials` prepended to the arguments it receives.
  10566. *
  10567. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10568. * may be used as a placeholder for partially applied arguments.
  10569. *
  10570. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10571. * property of bound functions.
  10572. *
  10573. * @static
  10574. * @memberOf _
  10575. * @since 0.1.0
  10576. * @category Function
  10577. * @param {Function} func The function to bind.
  10578. * @param {*} thisArg The `this` binding of `func`.
  10579. * @param {...*} [partials] The arguments to be partially applied.
  10580. * @returns {Function} Returns the new bound function.
  10581. * @example
  10582. *
  10583. * function greet(greeting, punctuation) {
  10584. * return greeting + ' ' + this.user + punctuation;
  10585. * }
  10586. *
  10587. * var object = { 'user': 'fred' };
  10588. *
  10589. * var bound = _.bind(greet, object, 'hi');
  10590. * bound('!');
  10591. * // => 'hi fred!'
  10592. *
  10593. * // Bound with placeholders.
  10594. * var bound = _.bind(greet, object, _, '!');
  10595. * bound('hi');
  10596. * // => 'hi fred!'
  10597. */
  10598. var bind = baseRest(function(func, thisArg, partials) {
  10599. var bitmask = WRAP_BIND_FLAG;
  10600. if (partials.length) {
  10601. var holders = replaceHolders(partials, getHolder(bind));
  10602. bitmask |= WRAP_PARTIAL_FLAG;
  10603. }
  10604. return createWrap(func, bitmask, thisArg, partials, holders);
  10605. });
  10606. /**
  10607. * Creates a function that invokes the method at `object[key]` with `partials`
  10608. * prepended to the arguments it receives.
  10609. *
  10610. * This method differs from `_.bind` by allowing bound functions to reference
  10611. * methods that may be redefined or don't yet exist. See
  10612. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10613. * for more details.
  10614. *
  10615. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10616. * builds, may be used as a placeholder for partially applied arguments.
  10617. *
  10618. * @static
  10619. * @memberOf _
  10620. * @since 0.10.0
  10621. * @category Function
  10622. * @param {Object} object The object to invoke the method on.
  10623. * @param {string} key The key of the method.
  10624. * @param {...*} [partials] The arguments to be partially applied.
  10625. * @returns {Function} Returns the new bound function.
  10626. * @example
  10627. *
  10628. * var object = {
  10629. * 'user': 'fred',
  10630. * 'greet': function(greeting, punctuation) {
  10631. * return greeting + ' ' + this.user + punctuation;
  10632. * }
  10633. * };
  10634. *
  10635. * var bound = _.bindKey(object, 'greet', 'hi');
  10636. * bound('!');
  10637. * // => 'hi fred!'
  10638. *
  10639. * object.greet = function(greeting, punctuation) {
  10640. * return greeting + 'ya ' + this.user + punctuation;
  10641. * };
  10642. *
  10643. * bound('!');
  10644. * // => 'hiya fred!'
  10645. *
  10646. * // Bound with placeholders.
  10647. * var bound = _.bindKey(object, 'greet', _, '!');
  10648. * bound('hi');
  10649. * // => 'hiya fred!'
  10650. */
  10651. var bindKey = baseRest(function(object, key, partials) {
  10652. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10653. if (partials.length) {
  10654. var holders = replaceHolders(partials, getHolder(bindKey));
  10655. bitmask |= WRAP_PARTIAL_FLAG;
  10656. }
  10657. return createWrap(key, bitmask, object, partials, holders);
  10658. });
  10659. /**
  10660. * Creates a function that accepts arguments of `func` and either invokes
  10661. * `func` returning its result, if at least `arity` number of arguments have
  10662. * been provided, or returns a function that accepts the remaining `func`
  10663. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10664. * is not sufficient.
  10665. *
  10666. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10667. * may be used as a placeholder for provided arguments.
  10668. *
  10669. * **Note:** This method doesn't set the "length" property of curried functions.
  10670. *
  10671. * @static
  10672. * @memberOf _
  10673. * @since 2.0.0
  10674. * @category Function
  10675. * @param {Function} func The function to curry.
  10676. * @param {number} [arity=func.length] The arity of `func`.
  10677. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10678. * @returns {Function} Returns the new curried function.
  10679. * @example
  10680. *
  10681. * var abc = function(a, b, c) {
  10682. * return [a, b, c];
  10683. * };
  10684. *
  10685. * var curried = _.curry(abc);
  10686. *
  10687. * curried(1)(2)(3);
  10688. * // => [1, 2, 3]
  10689. *
  10690. * curried(1, 2)(3);
  10691. * // => [1, 2, 3]
  10692. *
  10693. * curried(1, 2, 3);
  10694. * // => [1, 2, 3]
  10695. *
  10696. * // Curried with placeholders.
  10697. * curried(1)(_, 3)(2);
  10698. * // => [1, 2, 3]
  10699. */
  10700. function curry(func, arity, guard) {
  10701. arity = guard ? undefined : arity;
  10702. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10703. result.placeholder = curry.placeholder;
  10704. return result;
  10705. }
  10706. /**
  10707. * This method is like `_.curry` except that arguments are applied to `func`
  10708. * in the manner of `_.partialRight` instead of `_.partial`.
  10709. *
  10710. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10711. * builds, may be used as a placeholder for provided arguments.
  10712. *
  10713. * **Note:** This method doesn't set the "length" property of curried functions.
  10714. *
  10715. * @static
  10716. * @memberOf _
  10717. * @since 3.0.0
  10718. * @category Function
  10719. * @param {Function} func The function to curry.
  10720. * @param {number} [arity=func.length] The arity of `func`.
  10721. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10722. * @returns {Function} Returns the new curried function.
  10723. * @example
  10724. *
  10725. * var abc = function(a, b, c) {
  10726. * return [a, b, c];
  10727. * };
  10728. *
  10729. * var curried = _.curryRight(abc);
  10730. *
  10731. * curried(3)(2)(1);
  10732. * // => [1, 2, 3]
  10733. *
  10734. * curried(2, 3)(1);
  10735. * // => [1, 2, 3]
  10736. *
  10737. * curried(1, 2, 3);
  10738. * // => [1, 2, 3]
  10739. *
  10740. * // Curried with placeholders.
  10741. * curried(3)(1, _)(2);
  10742. * // => [1, 2, 3]
  10743. */
  10744. function curryRight(func, arity, guard) {
  10745. arity = guard ? undefined : arity;
  10746. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10747. result.placeholder = curryRight.placeholder;
  10748. return result;
  10749. }
  10750. /**
  10751. * Creates a debounced function that delays invoking `func` until after `wait`
  10752. * milliseconds have elapsed since the last time the debounced function was
  10753. * invoked. The debounced function comes with a `cancel` method to cancel
  10754. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10755. * Provide `options` to indicate whether `func` should be invoked on the
  10756. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10757. * with the last arguments provided to the debounced function. Subsequent
  10758. * calls to the debounced function return the result of the last `func`
  10759. * invocation.
  10760. *
  10761. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10762. * invoked on the trailing edge of the timeout only if the debounced function
  10763. * is invoked more than once during the `wait` timeout.
  10764. *
  10765. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10766. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10767. *
  10768. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10769. * for details over the differences between `_.debounce` and `_.throttle`.
  10770. *
  10771. * @static
  10772. * @memberOf _
  10773. * @since 0.1.0
  10774. * @category Function
  10775. * @param {Function} func The function to debounce.
  10776. * @param {number} [wait=0] The number of milliseconds to delay.
  10777. * @param {Object} [options={}] The options object.
  10778. * @param {boolean} [options.leading=false]
  10779. * Specify invoking on the leading edge of the timeout.
  10780. * @param {number} [options.maxWait]
  10781. * The maximum time `func` is allowed to be delayed before it's invoked.
  10782. * @param {boolean} [options.trailing=true]
  10783. * Specify invoking on the trailing edge of the timeout.
  10784. * @returns {Function} Returns the new debounced function.
  10785. * @example
  10786. *
  10787. * // Avoid costly calculations while the window size is in flux.
  10788. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10789. *
  10790. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10791. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10792. * 'leading': true,
  10793. * 'trailing': false
  10794. * }));
  10795. *
  10796. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10797. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10798. * var source = new EventSource('/stream');
  10799. * jQuery(source).on('message', debounced);
  10800. *
  10801. * // Cancel the trailing debounced invocation.
  10802. * jQuery(window).on('popstate', debounced.cancel);
  10803. */
  10804. function debounce(func, wait, options) {
  10805. var lastArgs,
  10806. lastThis,
  10807. maxWait,
  10808. result,
  10809. timerId,
  10810. lastCallTime,
  10811. lastInvokeTime = 0,
  10812. leading = false,
  10813. maxing = false,
  10814. trailing = true;
  10815. if (typeof func != 'function') {
  10816. throw new TypeError(FUNC_ERROR_TEXT);
  10817. }
  10818. wait = toNumber(wait) || 0;
  10819. if (isObject(options)) {
  10820. leading = !!options.leading;
  10821. maxing = 'maxWait' in options;
  10822. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10823. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10824. }
  10825. function invokeFunc(time) {
  10826. var args = lastArgs,
  10827. thisArg = lastThis;
  10828. lastArgs = lastThis = undefined;
  10829. lastInvokeTime = time;
  10830. result = func.apply(thisArg, args);
  10831. return result;
  10832. }
  10833. function leadingEdge(time) {
  10834. // Reset any `maxWait` timer.
  10835. lastInvokeTime = time;
  10836. // Start the timer for the trailing edge.
  10837. timerId = setTimeout(timerExpired, wait);
  10838. // Invoke the leading edge.
  10839. return leading ? invokeFunc(time) : result;
  10840. }
  10841. function remainingWait(time) {
  10842. var timeSinceLastCall = time - lastCallTime,
  10843. timeSinceLastInvoke = time - lastInvokeTime,
  10844. timeWaiting = wait - timeSinceLastCall;
  10845. return maxing
  10846. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10847. : timeWaiting;
  10848. }
  10849. function shouldInvoke(time) {
  10850. var timeSinceLastCall = time - lastCallTime,
  10851. timeSinceLastInvoke = time - lastInvokeTime;
  10852. // Either this is the first call, activity has stopped and we're at the
  10853. // trailing edge, the system time has gone backwards and we're treating
  10854. // it as the trailing edge, or we've hit the `maxWait` limit.
  10855. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10856. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10857. }
  10858. function timerExpired() {
  10859. var time = now();
  10860. if (shouldInvoke(time)) {
  10861. return trailingEdge(time);
  10862. }
  10863. // Restart the timer.
  10864. timerId = setTimeout(timerExpired, remainingWait(time));
  10865. }
  10866. function trailingEdge(time) {
  10867. timerId = undefined;
  10868. // Only invoke if we have `lastArgs` which means `func` has been
  10869. // debounced at least once.
  10870. if (trailing && lastArgs) {
  10871. return invokeFunc(time);
  10872. }
  10873. lastArgs = lastThis = undefined;
  10874. return result;
  10875. }
  10876. function cancel() {
  10877. if (timerId !== undefined) {
  10878. clearTimeout(timerId);
  10879. }
  10880. lastInvokeTime = 0;
  10881. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10882. }
  10883. function flush() {
  10884. return timerId === undefined ? result : trailingEdge(now());
  10885. }
  10886. function debounced() {
  10887. var time = now(),
  10888. isInvoking = shouldInvoke(time);
  10889. lastArgs = arguments;
  10890. lastThis = this;
  10891. lastCallTime = time;
  10892. if (isInvoking) {
  10893. if (timerId === undefined) {
  10894. return leadingEdge(lastCallTime);
  10895. }
  10896. if (maxing) {
  10897. // Handle invocations in a tight loop.
  10898. clearTimeout(timerId);
  10899. timerId = setTimeout(timerExpired, wait);
  10900. return invokeFunc(lastCallTime);
  10901. }
  10902. }
  10903. if (timerId === undefined) {
  10904. timerId = setTimeout(timerExpired, wait);
  10905. }
  10906. return result;
  10907. }
  10908. debounced.cancel = cancel;
  10909. debounced.flush = flush;
  10910. return debounced;
  10911. }
  10912. /**
  10913. * Defers invoking the `func` until the current call stack has cleared. Any
  10914. * additional arguments are provided to `func` when it's invoked.
  10915. *
  10916. * @static
  10917. * @memberOf _
  10918. * @since 0.1.0
  10919. * @category Function
  10920. * @param {Function} func The function to defer.
  10921. * @param {...*} [args] The arguments to invoke `func` with.
  10922. * @returns {number} Returns the timer id.
  10923. * @example
  10924. *
  10925. * _.defer(function(text) {
  10926. * console.log(text);
  10927. * }, 'deferred');
  10928. * // => Logs 'deferred' after one millisecond.
  10929. */
  10930. var defer = baseRest(function(func, args) {
  10931. return baseDelay(func, 1, args);
  10932. });
  10933. /**
  10934. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10935. * provided to `func` when it's invoked.
  10936. *
  10937. * @static
  10938. * @memberOf _
  10939. * @since 0.1.0
  10940. * @category Function
  10941. * @param {Function} func The function to delay.
  10942. * @param {number} wait The number of milliseconds to delay invocation.
  10943. * @param {...*} [args] The arguments to invoke `func` with.
  10944. * @returns {number} Returns the timer id.
  10945. * @example
  10946. *
  10947. * _.delay(function(text) {
  10948. * console.log(text);
  10949. * }, 1000, 'later');
  10950. * // => Logs 'later' after one second.
  10951. */
  10952. var delay = baseRest(function(func, wait, args) {
  10953. return baseDelay(func, toNumber(wait) || 0, args);
  10954. });
  10955. /**
  10956. * Creates a function that invokes `func` with arguments reversed.
  10957. *
  10958. * @static
  10959. * @memberOf _
  10960. * @since 4.0.0
  10961. * @category Function
  10962. * @param {Function} func The function to flip arguments for.
  10963. * @returns {Function} Returns the new flipped function.
  10964. * @example
  10965. *
  10966. * var flipped = _.flip(function() {
  10967. * return _.toArray(arguments);
  10968. * });
  10969. *
  10970. * flipped('a', 'b', 'c', 'd');
  10971. * // => ['d', 'c', 'b', 'a']
  10972. */
  10973. function flip(func) {
  10974. return createWrap(func, WRAP_FLIP_FLAG);
  10975. }
  10976. /**
  10977. * Creates a function that memoizes the result of `func`. If `resolver` is
  10978. * provided, it determines the cache key for storing the result based on the
  10979. * arguments provided to the memoized function. By default, the first argument
  10980. * provided to the memoized function is used as the map cache key. The `func`
  10981. * is invoked with the `this` binding of the memoized function.
  10982. *
  10983. * **Note:** The cache is exposed as the `cache` property on the memoized
  10984. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10985. * constructor with one whose instances implement the
  10986. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10987. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10988. *
  10989. * @static
  10990. * @memberOf _
  10991. * @since 0.1.0
  10992. * @category Function
  10993. * @param {Function} func The function to have its output memoized.
  10994. * @param {Function} [resolver] The function to resolve the cache key.
  10995. * @returns {Function} Returns the new memoized function.
  10996. * @example
  10997. *
  10998. * var object = { 'a': 1, 'b': 2 };
  10999. * var other = { 'c': 3, 'd': 4 };
  11000. *
  11001. * var values = _.memoize(_.values);
  11002. * values(object);
  11003. * // => [1, 2]
  11004. *
  11005. * values(other);
  11006. * // => [3, 4]
  11007. *
  11008. * object.a = 2;
  11009. * values(object);
  11010. * // => [1, 2]
  11011. *
  11012. * // Modify the result cache.
  11013. * values.cache.set(object, ['a', 'b']);
  11014. * values(object);
  11015. * // => ['a', 'b']
  11016. *
  11017. * // Replace `_.memoize.Cache`.
  11018. * _.memoize.Cache = WeakMap;
  11019. */
  11020. function memoize(func, resolver) {
  11021. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11022. throw new TypeError(FUNC_ERROR_TEXT);
  11023. }
  11024. var memoized = function() {
  11025. var args = arguments,
  11026. key = resolver ? resolver.apply(this, args) : args[0],
  11027. cache = memoized.cache;
  11028. if (cache.has(key)) {
  11029. return cache.get(key);
  11030. }
  11031. var result = func.apply(this, args);
  11032. memoized.cache = cache.set(key, result) || cache;
  11033. return result;
  11034. };
  11035. memoized.cache = new (memoize.Cache || MapCache);
  11036. return memoized;
  11037. }
  11038. // Expose `MapCache`.
  11039. memoize.Cache = MapCache;
  11040. /**
  11041. * Creates a function that negates the result of the predicate `func`. The
  11042. * `func` predicate is invoked with the `this` binding and arguments of the
  11043. * created function.
  11044. *
  11045. * @static
  11046. * @memberOf _
  11047. * @since 3.0.0
  11048. * @category Function
  11049. * @param {Function} predicate The predicate to negate.
  11050. * @returns {Function} Returns the new negated function.
  11051. * @example
  11052. *
  11053. * function isEven(n) {
  11054. * return n % 2 == 0;
  11055. * }
  11056. *
  11057. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11058. * // => [1, 3, 5]
  11059. */
  11060. function negate(predicate) {
  11061. if (typeof predicate != 'function') {
  11062. throw new TypeError(FUNC_ERROR_TEXT);
  11063. }
  11064. return function() {
  11065. var args = arguments;
  11066. switch (args.length) {
  11067. case 0: return !predicate.call(this);
  11068. case 1: return !predicate.call(this, args[0]);
  11069. case 2: return !predicate.call(this, args[0], args[1]);
  11070. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11071. }
  11072. return !predicate.apply(this, args);
  11073. };
  11074. }
  11075. /**
  11076. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11077. * to the function return the value of the first invocation. The `func` is
  11078. * invoked with the `this` binding and arguments of the created function.
  11079. *
  11080. * @static
  11081. * @memberOf _
  11082. * @since 0.1.0
  11083. * @category Function
  11084. * @param {Function} func The function to restrict.
  11085. * @returns {Function} Returns the new restricted function.
  11086. * @example
  11087. *
  11088. * var initialize = _.once(createApplication);
  11089. * initialize();
  11090. * initialize();
  11091. * // => `createApplication` is invoked once
  11092. */
  11093. function once(func) {
  11094. return before(2, func);
  11095. }
  11096. /**
  11097. * Creates a function that invokes `func` with its arguments transformed.
  11098. *
  11099. * @static
  11100. * @since 4.0.0
  11101. * @memberOf _
  11102. * @category Function
  11103. * @param {Function} func The function to wrap.
  11104. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11105. * The argument transforms.
  11106. * @returns {Function} Returns the new function.
  11107. * @example
  11108. *
  11109. * function doubled(n) {
  11110. * return n * 2;
  11111. * }
  11112. *
  11113. * function square(n) {
  11114. * return n * n;
  11115. * }
  11116. *
  11117. * var func = _.overArgs(function(x, y) {
  11118. * return [x, y];
  11119. * }, [square, doubled]);
  11120. *
  11121. * func(9, 3);
  11122. * // => [81, 6]
  11123. *
  11124. * func(10, 5);
  11125. * // => [100, 10]
  11126. */
  11127. var overArgs = castRest(function(func, transforms) {
  11128. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11129. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11130. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11131. var funcsLength = transforms.length;
  11132. return baseRest(function(args) {
  11133. var index = -1,
  11134. length = nativeMin(args.length, funcsLength);
  11135. while (++index < length) {
  11136. args[index] = transforms[index].call(this, args[index]);
  11137. }
  11138. return apply(func, this, args);
  11139. });
  11140. });
  11141. /**
  11142. * Creates a function that invokes `func` with `partials` prepended to the
  11143. * arguments it receives. This method is like `_.bind` except it does **not**
  11144. * alter the `this` binding.
  11145. *
  11146. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11147. * builds, may be used as a placeholder for partially applied arguments.
  11148. *
  11149. * **Note:** This method doesn't set the "length" property of partially
  11150. * applied functions.
  11151. *
  11152. * @static
  11153. * @memberOf _
  11154. * @since 0.2.0
  11155. * @category Function
  11156. * @param {Function} func The function to partially apply arguments to.
  11157. * @param {...*} [partials] The arguments to be partially applied.
  11158. * @returns {Function} Returns the new partially applied function.
  11159. * @example
  11160. *
  11161. * function greet(greeting, name) {
  11162. * return greeting + ' ' + name;
  11163. * }
  11164. *
  11165. * var sayHelloTo = _.partial(greet, 'hello');
  11166. * sayHelloTo('fred');
  11167. * // => 'hello fred'
  11168. *
  11169. * // Partially applied with placeholders.
  11170. * var greetFred = _.partial(greet, _, 'fred');
  11171. * greetFred('hi');
  11172. * // => 'hi fred'
  11173. */
  11174. var partial = baseRest(function(func, partials) {
  11175. var holders = replaceHolders(partials, getHolder(partial));
  11176. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11177. });
  11178. /**
  11179. * This method is like `_.partial` except that partially applied arguments
  11180. * are appended to the arguments it receives.
  11181. *
  11182. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11183. * builds, may be used as a placeholder for partially applied arguments.
  11184. *
  11185. * **Note:** This method doesn't set the "length" property of partially
  11186. * applied functions.
  11187. *
  11188. * @static
  11189. * @memberOf _
  11190. * @since 1.0.0
  11191. * @category Function
  11192. * @param {Function} func The function to partially apply arguments to.
  11193. * @param {...*} [partials] The arguments to be partially applied.
  11194. * @returns {Function} Returns the new partially applied function.
  11195. * @example
  11196. *
  11197. * function greet(greeting, name) {
  11198. * return greeting + ' ' + name;
  11199. * }
  11200. *
  11201. * var greetFred = _.partialRight(greet, 'fred');
  11202. * greetFred('hi');
  11203. * // => 'hi fred'
  11204. *
  11205. * // Partially applied with placeholders.
  11206. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11207. * sayHelloTo('fred');
  11208. * // => 'hello fred'
  11209. */
  11210. var partialRight = baseRest(function(func, partials) {
  11211. var holders = replaceHolders(partials, getHolder(partialRight));
  11212. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11213. });
  11214. /**
  11215. * Creates a function that invokes `func` with arguments arranged according
  11216. * to the specified `indexes` where the argument value at the first index is
  11217. * provided as the first argument, the argument value at the second index is
  11218. * provided as the second argument, and so on.
  11219. *
  11220. * @static
  11221. * @memberOf _
  11222. * @since 3.0.0
  11223. * @category Function
  11224. * @param {Function} func The function to rearrange arguments for.
  11225. * @param {...(number|number[])} indexes The arranged argument indexes.
  11226. * @returns {Function} Returns the new function.
  11227. * @example
  11228. *
  11229. * var rearged = _.rearg(function(a, b, c) {
  11230. * return [a, b, c];
  11231. * }, [2, 0, 1]);
  11232. *
  11233. * rearged('b', 'c', 'a')
  11234. * // => ['a', 'b', 'c']
  11235. */
  11236. var rearg = flatRest(function(func, indexes) {
  11237. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11238. });
  11239. /**
  11240. * Creates a function that invokes `func` with the `this` binding of the
  11241. * created function and arguments from `start` and beyond provided as
  11242. * an array.
  11243. *
  11244. * **Note:** This method is based on the
  11245. * [rest parameter](https://mdn.io/rest_parameters).
  11246. *
  11247. * @static
  11248. * @memberOf _
  11249. * @since 4.0.0
  11250. * @category Function
  11251. * @param {Function} func The function to apply a rest parameter to.
  11252. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11253. * @returns {Function} Returns the new function.
  11254. * @example
  11255. *
  11256. * var say = _.rest(function(what, names) {
  11257. * return what + ' ' + _.initial(names).join(', ') +
  11258. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11259. * });
  11260. *
  11261. * say('hello', 'fred', 'barney', 'pebbles');
  11262. * // => 'hello fred, barney, & pebbles'
  11263. */
  11264. function rest(func, start) {
  11265. if (typeof func != 'function') {
  11266. throw new TypeError(FUNC_ERROR_TEXT);
  11267. }
  11268. start = start === undefined ? start : toInteger(start);
  11269. return baseRest(func, start);
  11270. }
  11271. /**
  11272. * Creates a function that invokes `func` with the `this` binding of the
  11273. * create function and an array of arguments much like
  11274. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11275. *
  11276. * **Note:** This method is based on the
  11277. * [spread operator](https://mdn.io/spread_operator).
  11278. *
  11279. * @static
  11280. * @memberOf _
  11281. * @since 3.2.0
  11282. * @category Function
  11283. * @param {Function} func The function to spread arguments over.
  11284. * @param {number} [start=0] The start position of the spread.
  11285. * @returns {Function} Returns the new function.
  11286. * @example
  11287. *
  11288. * var say = _.spread(function(who, what) {
  11289. * return who + ' says ' + what;
  11290. * });
  11291. *
  11292. * say(['fred', 'hello']);
  11293. * // => 'fred says hello'
  11294. *
  11295. * var numbers = Promise.all([
  11296. * Promise.resolve(40),
  11297. * Promise.resolve(36)
  11298. * ]);
  11299. *
  11300. * numbers.then(_.spread(function(x, y) {
  11301. * return x + y;
  11302. * }));
  11303. * // => a Promise of 76
  11304. */
  11305. function spread(func, start) {
  11306. if (typeof func != 'function') {
  11307. throw new TypeError(FUNC_ERROR_TEXT);
  11308. }
  11309. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11310. return baseRest(function(args) {
  11311. var array = args[start],
  11312. otherArgs = castSlice(args, 0, start);
  11313. if (array) {
  11314. arrayPush(otherArgs, array);
  11315. }
  11316. return apply(func, this, otherArgs);
  11317. });
  11318. }
  11319. /**
  11320. * Creates a throttled function that only invokes `func` at most once per
  11321. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11322. * method to cancel delayed `func` invocations and a `flush` method to
  11323. * immediately invoke them. Provide `options` to indicate whether `func`
  11324. * should be invoked on the leading and/or trailing edge of the `wait`
  11325. * timeout. The `func` is invoked with the last arguments provided to the
  11326. * throttled function. Subsequent calls to the throttled function return the
  11327. * result of the last `func` invocation.
  11328. *
  11329. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11330. * invoked on the trailing edge of the timeout only if the throttled function
  11331. * is invoked more than once during the `wait` timeout.
  11332. *
  11333. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11334. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11335. *
  11336. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11337. * for details over the differences between `_.throttle` and `_.debounce`.
  11338. *
  11339. * @static
  11340. * @memberOf _
  11341. * @since 0.1.0
  11342. * @category Function
  11343. * @param {Function} func The function to throttle.
  11344. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11345. * @param {Object} [options={}] The options object.
  11346. * @param {boolean} [options.leading=true]
  11347. * Specify invoking on the leading edge of the timeout.
  11348. * @param {boolean} [options.trailing=true]
  11349. * Specify invoking on the trailing edge of the timeout.
  11350. * @returns {Function} Returns the new throttled function.
  11351. * @example
  11352. *
  11353. * // Avoid excessively updating the position while scrolling.
  11354. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11355. *
  11356. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11357. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11358. * jQuery(element).on('click', throttled);
  11359. *
  11360. * // Cancel the trailing throttled invocation.
  11361. * jQuery(window).on('popstate', throttled.cancel);
  11362. */
  11363. function throttle(func, wait, options) {
  11364. var leading = true,
  11365. trailing = true;
  11366. if (typeof func != 'function') {
  11367. throw new TypeError(FUNC_ERROR_TEXT);
  11368. }
  11369. if (isObject(options)) {
  11370. leading = 'leading' in options ? !!options.leading : leading;
  11371. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11372. }
  11373. return debounce(func, wait, {
  11374. 'leading': leading,
  11375. 'maxWait': wait,
  11376. 'trailing': trailing
  11377. });
  11378. }
  11379. /**
  11380. * Creates a function that accepts up to one argument, ignoring any
  11381. * additional arguments.
  11382. *
  11383. * @static
  11384. * @memberOf _
  11385. * @since 4.0.0
  11386. * @category Function
  11387. * @param {Function} func The function to cap arguments for.
  11388. * @returns {Function} Returns the new capped function.
  11389. * @example
  11390. *
  11391. * _.map(['6', '8', '10'], _.unary(parseInt));
  11392. * // => [6, 8, 10]
  11393. */
  11394. function unary(func) {
  11395. return ary(func, 1);
  11396. }
  11397. /**
  11398. * Creates a function that provides `value` to `wrapper` as its first
  11399. * argument. Any additional arguments provided to the function are appended
  11400. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11401. * binding of the created function.
  11402. *
  11403. * @static
  11404. * @memberOf _
  11405. * @since 0.1.0
  11406. * @category Function
  11407. * @param {*} value The value to wrap.
  11408. * @param {Function} [wrapper=identity] The wrapper function.
  11409. * @returns {Function} Returns the new function.
  11410. * @example
  11411. *
  11412. * var p = _.wrap(_.escape, function(func, text) {
  11413. * return '<p>' + func(text) + '</p>';
  11414. * });
  11415. *
  11416. * p('fred, barney, & pebbles');
  11417. * // => '<p>fred, barney, &amp; pebbles</p>'
  11418. */
  11419. function wrap(value, wrapper) {
  11420. return partial(castFunction(wrapper), value);
  11421. }
  11422. /*------------------------------------------------------------------------*/
  11423. /**
  11424. * Casts `value` as an array if it's not one.
  11425. *
  11426. * @static
  11427. * @memberOf _
  11428. * @since 4.4.0
  11429. * @category Lang
  11430. * @param {*} value The value to inspect.
  11431. * @returns {Array} Returns the cast array.
  11432. * @example
  11433. *
  11434. * _.castArray(1);
  11435. * // => [1]
  11436. *
  11437. * _.castArray({ 'a': 1 });
  11438. * // => [{ 'a': 1 }]
  11439. *
  11440. * _.castArray('abc');
  11441. * // => ['abc']
  11442. *
  11443. * _.castArray(null);
  11444. * // => [null]
  11445. *
  11446. * _.castArray(undefined);
  11447. * // => [undefined]
  11448. *
  11449. * _.castArray();
  11450. * // => []
  11451. *
  11452. * var array = [1, 2, 3];
  11453. * console.log(_.castArray(array) === array);
  11454. * // => true
  11455. */
  11456. function castArray() {
  11457. if (!arguments.length) {
  11458. return [];
  11459. }
  11460. var value = arguments[0];
  11461. return isArray(value) ? value : [value];
  11462. }
  11463. /**
  11464. * Creates a shallow clone of `value`.
  11465. *
  11466. * **Note:** This method is loosely based on the
  11467. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11468. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11469. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11470. * arrays. The own enumerable properties of `arguments` objects are cloned
  11471. * as plain objects. An empty object is returned for uncloneable values such
  11472. * as error objects, functions, DOM nodes, and WeakMaps.
  11473. *
  11474. * @static
  11475. * @memberOf _
  11476. * @since 0.1.0
  11477. * @category Lang
  11478. * @param {*} value The value to clone.
  11479. * @returns {*} Returns the cloned value.
  11480. * @see _.cloneDeep
  11481. * @example
  11482. *
  11483. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11484. *
  11485. * var shallow = _.clone(objects);
  11486. * console.log(shallow[0] === objects[0]);
  11487. * // => true
  11488. */
  11489. function clone(value) {
  11490. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11491. }
  11492. /**
  11493. * This method is like `_.clone` except that it accepts `customizer` which
  11494. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11495. * cloning is handled by the method instead. The `customizer` is invoked with
  11496. * up to four arguments; (value [, index|key, object, stack]).
  11497. *
  11498. * @static
  11499. * @memberOf _
  11500. * @since 4.0.0
  11501. * @category Lang
  11502. * @param {*} value The value to clone.
  11503. * @param {Function} [customizer] The function to customize cloning.
  11504. * @returns {*} Returns the cloned value.
  11505. * @see _.cloneDeepWith
  11506. * @example
  11507. *
  11508. * function customizer(value) {
  11509. * if (_.isElement(value)) {
  11510. * return value.cloneNode(false);
  11511. * }
  11512. * }
  11513. *
  11514. * var el = _.cloneWith(document.body, customizer);
  11515. *
  11516. * console.log(el === document.body);
  11517. * // => false
  11518. * console.log(el.nodeName);
  11519. * // => 'BODY'
  11520. * console.log(el.childNodes.length);
  11521. * // => 0
  11522. */
  11523. function cloneWith(value, customizer) {
  11524. customizer = typeof customizer == 'function' ? customizer : undefined;
  11525. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11526. }
  11527. /**
  11528. * This method is like `_.clone` except that it recursively clones `value`.
  11529. *
  11530. * @static
  11531. * @memberOf _
  11532. * @since 1.0.0
  11533. * @category Lang
  11534. * @param {*} value The value to recursively clone.
  11535. * @returns {*} Returns the deep cloned value.
  11536. * @see _.clone
  11537. * @example
  11538. *
  11539. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11540. *
  11541. * var deep = _.cloneDeep(objects);
  11542. * console.log(deep[0] === objects[0]);
  11543. * // => false
  11544. */
  11545. function cloneDeep(value) {
  11546. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11547. }
  11548. /**
  11549. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11550. *
  11551. * @static
  11552. * @memberOf _
  11553. * @since 4.0.0
  11554. * @category Lang
  11555. * @param {*} value The value to recursively clone.
  11556. * @param {Function} [customizer] The function to customize cloning.
  11557. * @returns {*} Returns the deep cloned value.
  11558. * @see _.cloneWith
  11559. * @example
  11560. *
  11561. * function customizer(value) {
  11562. * if (_.isElement(value)) {
  11563. * return value.cloneNode(true);
  11564. * }
  11565. * }
  11566. *
  11567. * var el = _.cloneDeepWith(document.body, customizer);
  11568. *
  11569. * console.log(el === document.body);
  11570. * // => false
  11571. * console.log(el.nodeName);
  11572. * // => 'BODY'
  11573. * console.log(el.childNodes.length);
  11574. * // => 20
  11575. */
  11576. function cloneDeepWith(value, customizer) {
  11577. customizer = typeof customizer == 'function' ? customizer : undefined;
  11578. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11579. }
  11580. /**
  11581. * Checks if `object` conforms to `source` by invoking the predicate
  11582. * properties of `source` with the corresponding property values of `object`.
  11583. *
  11584. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11585. * partially applied.
  11586. *
  11587. * @static
  11588. * @memberOf _
  11589. * @since 4.14.0
  11590. * @category Lang
  11591. * @param {Object} object The object to inspect.
  11592. * @param {Object} source The object of property predicates to conform to.
  11593. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11594. * @example
  11595. *
  11596. * var object = { 'a': 1, 'b': 2 };
  11597. *
  11598. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11599. * // => true
  11600. *
  11601. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11602. * // => false
  11603. */
  11604. function conformsTo(object, source) {
  11605. return source == null || baseConformsTo(object, source, keys(source));
  11606. }
  11607. /**
  11608. * Performs a
  11609. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11610. * comparison between two values to determine if they are equivalent.
  11611. *
  11612. * @static
  11613. * @memberOf _
  11614. * @since 4.0.0
  11615. * @category Lang
  11616. * @param {*} value The value to compare.
  11617. * @param {*} other The other value to compare.
  11618. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11619. * @example
  11620. *
  11621. * var object = { 'a': 1 };
  11622. * var other = { 'a': 1 };
  11623. *
  11624. * _.eq(object, object);
  11625. * // => true
  11626. *
  11627. * _.eq(object, other);
  11628. * // => false
  11629. *
  11630. * _.eq('a', 'a');
  11631. * // => true
  11632. *
  11633. * _.eq('a', Object('a'));
  11634. * // => false
  11635. *
  11636. * _.eq(NaN, NaN);
  11637. * // => true
  11638. */
  11639. function eq(value, other) {
  11640. return value === other || (value !== value && other !== other);
  11641. }
  11642. /**
  11643. * Checks if `value` is greater than `other`.
  11644. *
  11645. * @static
  11646. * @memberOf _
  11647. * @since 3.9.0
  11648. * @category Lang
  11649. * @param {*} value The value to compare.
  11650. * @param {*} other The other value to compare.
  11651. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11652. * else `false`.
  11653. * @see _.lt
  11654. * @example
  11655. *
  11656. * _.gt(3, 1);
  11657. * // => true
  11658. *
  11659. * _.gt(3, 3);
  11660. * // => false
  11661. *
  11662. * _.gt(1, 3);
  11663. * // => false
  11664. */
  11665. var gt = createRelationalOperation(baseGt);
  11666. /**
  11667. * Checks if `value` is greater than or equal to `other`.
  11668. *
  11669. * @static
  11670. * @memberOf _
  11671. * @since 3.9.0
  11672. * @category Lang
  11673. * @param {*} value The value to compare.
  11674. * @param {*} other The other value to compare.
  11675. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11676. * `other`, else `false`.
  11677. * @see _.lte
  11678. * @example
  11679. *
  11680. * _.gte(3, 1);
  11681. * // => true
  11682. *
  11683. * _.gte(3, 3);
  11684. * // => true
  11685. *
  11686. * _.gte(1, 3);
  11687. * // => false
  11688. */
  11689. var gte = createRelationalOperation(function(value, other) {
  11690. return value >= other;
  11691. });
  11692. /**
  11693. * Checks if `value` is likely an `arguments` 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 `arguments` object,
  11701. * else `false`.
  11702. * @example
  11703. *
  11704. * _.isArguments(function() { return arguments; }());
  11705. * // => true
  11706. *
  11707. * _.isArguments([1, 2, 3]);
  11708. * // => false
  11709. */
  11710. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11711. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11712. !propertyIsEnumerable.call(value, 'callee');
  11713. };
  11714. /**
  11715. * Checks if `value` is classified as an `Array` object.
  11716. *
  11717. * @static
  11718. * @memberOf _
  11719. * @since 0.1.0
  11720. * @category Lang
  11721. * @param {*} value The value to check.
  11722. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11723. * @example
  11724. *
  11725. * _.isArray([1, 2, 3]);
  11726. * // => true
  11727. *
  11728. * _.isArray(document.body.children);
  11729. * // => false
  11730. *
  11731. * _.isArray('abc');
  11732. * // => false
  11733. *
  11734. * _.isArray(_.noop);
  11735. * // => false
  11736. */
  11737. var isArray = Array.isArray;
  11738. /**
  11739. * Checks if `value` is classified as an `ArrayBuffer` object.
  11740. *
  11741. * @static
  11742. * @memberOf _
  11743. * @since 4.3.0
  11744. * @category Lang
  11745. * @param {*} value The value to check.
  11746. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11747. * @example
  11748. *
  11749. * _.isArrayBuffer(new ArrayBuffer(2));
  11750. * // => true
  11751. *
  11752. * _.isArrayBuffer(new Array(2));
  11753. * // => false
  11754. */
  11755. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11756. /**
  11757. * Checks if `value` is array-like. A value is considered array-like if it's
  11758. * not a function and has a `value.length` that's an integer greater than or
  11759. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11760. *
  11761. * @static
  11762. * @memberOf _
  11763. * @since 4.0.0
  11764. * @category Lang
  11765. * @param {*} value The value to check.
  11766. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11767. * @example
  11768. *
  11769. * _.isArrayLike([1, 2, 3]);
  11770. * // => true
  11771. *
  11772. * _.isArrayLike(document.body.children);
  11773. * // => true
  11774. *
  11775. * _.isArrayLike('abc');
  11776. * // => true
  11777. *
  11778. * _.isArrayLike(_.noop);
  11779. * // => false
  11780. */
  11781. function isArrayLike(value) {
  11782. return value != null && isLength(value.length) && !isFunction(value);
  11783. }
  11784. /**
  11785. * This method is like `_.isArrayLike` except that it also checks if `value`
  11786. * is an object.
  11787. *
  11788. * @static
  11789. * @memberOf _
  11790. * @since 4.0.0
  11791. * @category Lang
  11792. * @param {*} value The value to check.
  11793. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11794. * else `false`.
  11795. * @example
  11796. *
  11797. * _.isArrayLikeObject([1, 2, 3]);
  11798. * // => true
  11799. *
  11800. * _.isArrayLikeObject(document.body.children);
  11801. * // => true
  11802. *
  11803. * _.isArrayLikeObject('abc');
  11804. * // => false
  11805. *
  11806. * _.isArrayLikeObject(_.noop);
  11807. * // => false
  11808. */
  11809. function isArrayLikeObject(value) {
  11810. return isObjectLike(value) && isArrayLike(value);
  11811. }
  11812. /**
  11813. * Checks if `value` is classified as a boolean primitive or object.
  11814. *
  11815. * @static
  11816. * @memberOf _
  11817. * @since 0.1.0
  11818. * @category Lang
  11819. * @param {*} value The value to check.
  11820. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11821. * @example
  11822. *
  11823. * _.isBoolean(false);
  11824. * // => true
  11825. *
  11826. * _.isBoolean(null);
  11827. * // => false
  11828. */
  11829. function isBoolean(value) {
  11830. return value === true || value === false ||
  11831. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11832. }
  11833. /**
  11834. * Checks if `value` is a buffer.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 4.3.0
  11839. * @category Lang
  11840. * @param {*} value The value to check.
  11841. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11842. * @example
  11843. *
  11844. * _.isBuffer(new Buffer(2));
  11845. * // => true
  11846. *
  11847. * _.isBuffer(new Uint8Array(2));
  11848. * // => false
  11849. */
  11850. var isBuffer = nativeIsBuffer || stubFalse;
  11851. /**
  11852. * Checks if `value` is classified as a `Date` object.
  11853. *
  11854. * @static
  11855. * @memberOf _
  11856. * @since 0.1.0
  11857. * @category Lang
  11858. * @param {*} value The value to check.
  11859. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11860. * @example
  11861. *
  11862. * _.isDate(new Date);
  11863. * // => true
  11864. *
  11865. * _.isDate('Mon April 23 2012');
  11866. * // => false
  11867. */
  11868. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11869. /**
  11870. * Checks if `value` is likely a DOM element.
  11871. *
  11872. * @static
  11873. * @memberOf _
  11874. * @since 0.1.0
  11875. * @category Lang
  11876. * @param {*} value The value to check.
  11877. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11878. * @example
  11879. *
  11880. * _.isElement(document.body);
  11881. * // => true
  11882. *
  11883. * _.isElement('<body>');
  11884. * // => false
  11885. */
  11886. function isElement(value) {
  11887. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11888. }
  11889. /**
  11890. * Checks if `value` is an empty object, collection, map, or set.
  11891. *
  11892. * Objects are considered empty if they have no own enumerable string keyed
  11893. * properties.
  11894. *
  11895. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11896. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11897. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11898. *
  11899. * @static
  11900. * @memberOf _
  11901. * @since 0.1.0
  11902. * @category Lang
  11903. * @param {*} value The value to check.
  11904. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11905. * @example
  11906. *
  11907. * _.isEmpty(null);
  11908. * // => true
  11909. *
  11910. * _.isEmpty(true);
  11911. * // => true
  11912. *
  11913. * _.isEmpty(1);
  11914. * // => true
  11915. *
  11916. * _.isEmpty([1, 2, 3]);
  11917. * // => false
  11918. *
  11919. * _.isEmpty({ 'a': 1 });
  11920. * // => false
  11921. */
  11922. function isEmpty(value) {
  11923. if (value == null) {
  11924. return true;
  11925. }
  11926. if (isArrayLike(value) &&
  11927. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11928. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11929. return !value.length;
  11930. }
  11931. var tag = getTag(value);
  11932. if (tag == mapTag || tag == setTag) {
  11933. return !value.size;
  11934. }
  11935. if (isPrototype(value)) {
  11936. return !baseKeys(value).length;
  11937. }
  11938. for (var key in value) {
  11939. if (hasOwnProperty.call(value, key)) {
  11940. return false;
  11941. }
  11942. }
  11943. return true;
  11944. }
  11945. /**
  11946. * Performs a deep comparison between two values to determine if they are
  11947. * equivalent.
  11948. *
  11949. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11950. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11951. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11952. * by their own, not inherited, enumerable properties. Functions and DOM
  11953. * nodes are compared by strict equality, i.e. `===`.
  11954. *
  11955. * @static
  11956. * @memberOf _
  11957. * @since 0.1.0
  11958. * @category Lang
  11959. * @param {*} value The value to compare.
  11960. * @param {*} other The other value to compare.
  11961. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11962. * @example
  11963. *
  11964. * var object = { 'a': 1 };
  11965. * var other = { 'a': 1 };
  11966. *
  11967. * _.isEqual(object, other);
  11968. * // => true
  11969. *
  11970. * object === other;
  11971. * // => false
  11972. */
  11973. function isEqual(value, other) {
  11974. return baseIsEqual(value, other);
  11975. }
  11976. /**
  11977. * This method is like `_.isEqual` except that it accepts `customizer` which
  11978. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11979. * are handled by the method instead. The `customizer` is invoked with up to
  11980. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11981. *
  11982. * @static
  11983. * @memberOf _
  11984. * @since 4.0.0
  11985. * @category Lang
  11986. * @param {*} value The value to compare.
  11987. * @param {*} other The other value to compare.
  11988. * @param {Function} [customizer] The function to customize comparisons.
  11989. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11990. * @example
  11991. *
  11992. * function isGreeting(value) {
  11993. * return /^h(?:i|ello)$/.test(value);
  11994. * }
  11995. *
  11996. * function customizer(objValue, othValue) {
  11997. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11998. * return true;
  11999. * }
  12000. * }
  12001. *
  12002. * var array = ['hello', 'goodbye'];
  12003. * var other = ['hi', 'goodbye'];
  12004. *
  12005. * _.isEqualWith(array, other, customizer);
  12006. * // => true
  12007. */
  12008. function isEqualWith(value, other, customizer) {
  12009. customizer = typeof customizer == 'function' ? customizer : undefined;
  12010. var result = customizer ? customizer(value, other) : undefined;
  12011. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12012. }
  12013. /**
  12014. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12015. * `SyntaxError`, `TypeError`, or `URIError` object.
  12016. *
  12017. * @static
  12018. * @memberOf _
  12019. * @since 3.0.0
  12020. * @category Lang
  12021. * @param {*} value The value to check.
  12022. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12023. * @example
  12024. *
  12025. * _.isError(new Error);
  12026. * // => true
  12027. *
  12028. * _.isError(Error);
  12029. * // => false
  12030. */
  12031. function isError(value) {
  12032. if (!isObjectLike(value)) {
  12033. return false;
  12034. }
  12035. var tag = baseGetTag(value);
  12036. return tag == errorTag || tag == domExcTag ||
  12037. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12038. }
  12039. /**
  12040. * Checks if `value` is a finite primitive number.
  12041. *
  12042. * **Note:** This method is based on
  12043. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12044. *
  12045. * @static
  12046. * @memberOf _
  12047. * @since 0.1.0
  12048. * @category Lang
  12049. * @param {*} value The value to check.
  12050. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12051. * @example
  12052. *
  12053. * _.isFinite(3);
  12054. * // => true
  12055. *
  12056. * _.isFinite(Number.MIN_VALUE);
  12057. * // => true
  12058. *
  12059. * _.isFinite(Infinity);
  12060. * // => false
  12061. *
  12062. * _.isFinite('3');
  12063. * // => false
  12064. */
  12065. function isFinite(value) {
  12066. return typeof value == 'number' && nativeIsFinite(value);
  12067. }
  12068. /**
  12069. * Checks if `value` is classified as a `Function` object.
  12070. *
  12071. * @static
  12072. * @memberOf _
  12073. * @since 0.1.0
  12074. * @category Lang
  12075. * @param {*} value The value to check.
  12076. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12077. * @example
  12078. *
  12079. * _.isFunction(_);
  12080. * // => true
  12081. *
  12082. * _.isFunction(/abc/);
  12083. * // => false
  12084. */
  12085. function isFunction(value) {
  12086. if (!isObject(value)) {
  12087. return false;
  12088. }
  12089. // The use of `Object#toString` avoids issues with the `typeof` operator
  12090. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12091. var tag = baseGetTag(value);
  12092. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12093. }
  12094. /**
  12095. * Checks if `value` is an integer.
  12096. *
  12097. * **Note:** This method is based on
  12098. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12099. *
  12100. * @static
  12101. * @memberOf _
  12102. * @since 4.0.0
  12103. * @category Lang
  12104. * @param {*} value The value to check.
  12105. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12106. * @example
  12107. *
  12108. * _.isInteger(3);
  12109. * // => true
  12110. *
  12111. * _.isInteger(Number.MIN_VALUE);
  12112. * // => false
  12113. *
  12114. * _.isInteger(Infinity);
  12115. * // => false
  12116. *
  12117. * _.isInteger('3');
  12118. * // => false
  12119. */
  12120. function isInteger(value) {
  12121. return typeof value == 'number' && value == toInteger(value);
  12122. }
  12123. /**
  12124. * Checks if `value` is a valid array-like length.
  12125. *
  12126. * **Note:** This method is loosely based on
  12127. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12128. *
  12129. * @static
  12130. * @memberOf _
  12131. * @since 4.0.0
  12132. * @category Lang
  12133. * @param {*} value The value to check.
  12134. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12135. * @example
  12136. *
  12137. * _.isLength(3);
  12138. * // => true
  12139. *
  12140. * _.isLength(Number.MIN_VALUE);
  12141. * // => false
  12142. *
  12143. * _.isLength(Infinity);
  12144. * // => false
  12145. *
  12146. * _.isLength('3');
  12147. * // => false
  12148. */
  12149. function isLength(value) {
  12150. return typeof value == 'number' &&
  12151. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12152. }
  12153. /**
  12154. * Checks if `value` is the
  12155. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12156. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12157. *
  12158. * @static
  12159. * @memberOf _
  12160. * @since 0.1.0
  12161. * @category Lang
  12162. * @param {*} value The value to check.
  12163. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12164. * @example
  12165. *
  12166. * _.isObject({});
  12167. * // => true
  12168. *
  12169. * _.isObject([1, 2, 3]);
  12170. * // => true
  12171. *
  12172. * _.isObject(_.noop);
  12173. * // => true
  12174. *
  12175. * _.isObject(null);
  12176. * // => false
  12177. */
  12178. function isObject(value) {
  12179. var type = typeof value;
  12180. return value != null && (type == 'object' || type == 'function');
  12181. }
  12182. /**
  12183. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12184. * and has a `typeof` result of "object".
  12185. *
  12186. * @static
  12187. * @memberOf _
  12188. * @since 4.0.0
  12189. * @category Lang
  12190. * @param {*} value The value to check.
  12191. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12192. * @example
  12193. *
  12194. * _.isObjectLike({});
  12195. * // => true
  12196. *
  12197. * _.isObjectLike([1, 2, 3]);
  12198. * // => true
  12199. *
  12200. * _.isObjectLike(_.noop);
  12201. * // => false
  12202. *
  12203. * _.isObjectLike(null);
  12204. * // => false
  12205. */
  12206. function isObjectLike(value) {
  12207. return value != null && typeof value == 'object';
  12208. }
  12209. /**
  12210. * Checks if `value` is classified as a `Map` object.
  12211. *
  12212. * @static
  12213. * @memberOf _
  12214. * @since 4.3.0
  12215. * @category Lang
  12216. * @param {*} value The value to check.
  12217. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12218. * @example
  12219. *
  12220. * _.isMap(new Map);
  12221. * // => true
  12222. *
  12223. * _.isMap(new WeakMap);
  12224. * // => false
  12225. */
  12226. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12227. /**
  12228. * Performs a partial deep comparison between `object` and `source` to
  12229. * determine if `object` contains equivalent property values.
  12230. *
  12231. * **Note:** This method is equivalent to `_.matches` when `source` is
  12232. * partially applied.
  12233. *
  12234. * Partial comparisons will match empty array and empty object `source`
  12235. * values against any array or object value, respectively. See `_.isEqual`
  12236. * for a list of supported value comparisons.
  12237. *
  12238. * @static
  12239. * @memberOf _
  12240. * @since 3.0.0
  12241. * @category Lang
  12242. * @param {Object} object The object to inspect.
  12243. * @param {Object} source The object of property values to match.
  12244. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12245. * @example
  12246. *
  12247. * var object = { 'a': 1, 'b': 2 };
  12248. *
  12249. * _.isMatch(object, { 'b': 2 });
  12250. * // => true
  12251. *
  12252. * _.isMatch(object, { 'b': 1 });
  12253. * // => false
  12254. */
  12255. function isMatch(object, source) {
  12256. return object === source || baseIsMatch(object, source, getMatchData(source));
  12257. }
  12258. /**
  12259. * This method is like `_.isMatch` except that it accepts `customizer` which
  12260. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12261. * are handled by the method instead. The `customizer` is invoked with five
  12262. * arguments: (objValue, srcValue, index|key, object, source).
  12263. *
  12264. * @static
  12265. * @memberOf _
  12266. * @since 4.0.0
  12267. * @category Lang
  12268. * @param {Object} object The object to inspect.
  12269. * @param {Object} source The object of property values to match.
  12270. * @param {Function} [customizer] The function to customize comparisons.
  12271. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12272. * @example
  12273. *
  12274. * function isGreeting(value) {
  12275. * return /^h(?:i|ello)$/.test(value);
  12276. * }
  12277. *
  12278. * function customizer(objValue, srcValue) {
  12279. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12280. * return true;
  12281. * }
  12282. * }
  12283. *
  12284. * var object = { 'greeting': 'hello' };
  12285. * var source = { 'greeting': 'hi' };
  12286. *
  12287. * _.isMatchWith(object, source, customizer);
  12288. * // => true
  12289. */
  12290. function isMatchWith(object, source, customizer) {
  12291. customizer = typeof customizer == 'function' ? customizer : undefined;
  12292. return baseIsMatch(object, source, getMatchData(source), customizer);
  12293. }
  12294. /**
  12295. * Checks if `value` is `NaN`.
  12296. *
  12297. * **Note:** This method is based on
  12298. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12299. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12300. * `undefined` and other non-number values.
  12301. *
  12302. * @static
  12303. * @memberOf _
  12304. * @since 0.1.0
  12305. * @category Lang
  12306. * @param {*} value The value to check.
  12307. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12308. * @example
  12309. *
  12310. * _.isNaN(NaN);
  12311. * // => true
  12312. *
  12313. * _.isNaN(new Number(NaN));
  12314. * // => true
  12315. *
  12316. * isNaN(undefined);
  12317. * // => true
  12318. *
  12319. * _.isNaN(undefined);
  12320. * // => false
  12321. */
  12322. function isNaN(value) {
  12323. // An `NaN` primitive is the only value that is not equal to itself.
  12324. // Perform the `toStringTag` check first to avoid errors with some
  12325. // ActiveX objects in IE.
  12326. return isNumber(value) && value != +value;
  12327. }
  12328. /**
  12329. * Checks if `value` is a pristine native function.
  12330. *
  12331. * **Note:** This method can't reliably detect native functions in the presence
  12332. * of the core-js package because core-js circumvents this kind of detection.
  12333. * Despite multiple requests, the core-js maintainer has made it clear: any
  12334. * attempt to fix the detection will be obstructed. As a result, we're left
  12335. * with little choice but to throw an error. Unfortunately, this also affects
  12336. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12337. * which rely on core-js.
  12338. *
  12339. * @static
  12340. * @memberOf _
  12341. * @since 3.0.0
  12342. * @category Lang
  12343. * @param {*} value The value to check.
  12344. * @returns {boolean} Returns `true` if `value` is a native function,
  12345. * else `false`.
  12346. * @example
  12347. *
  12348. * _.isNative(Array.prototype.push);
  12349. * // => true
  12350. *
  12351. * _.isNative(_);
  12352. * // => false
  12353. */
  12354. function isNative(value) {
  12355. if (isMaskable(value)) {
  12356. throw new Error(CORE_ERROR_TEXT);
  12357. }
  12358. return baseIsNative(value);
  12359. }
  12360. /**
  12361. * Checks if `value` is `null`.
  12362. *
  12363. * @static
  12364. * @memberOf _
  12365. * @since 0.1.0
  12366. * @category Lang
  12367. * @param {*} value The value to check.
  12368. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12369. * @example
  12370. *
  12371. * _.isNull(null);
  12372. * // => true
  12373. *
  12374. * _.isNull(void 0);
  12375. * // => false
  12376. */
  12377. function isNull(value) {
  12378. return value === null;
  12379. }
  12380. /**
  12381. * Checks if `value` is `null` or `undefined`.
  12382. *
  12383. * @static
  12384. * @memberOf _
  12385. * @since 4.0.0
  12386. * @category Lang
  12387. * @param {*} value The value to check.
  12388. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12389. * @example
  12390. *
  12391. * _.isNil(null);
  12392. * // => true
  12393. *
  12394. * _.isNil(void 0);
  12395. * // => true
  12396. *
  12397. * _.isNil(NaN);
  12398. * // => false
  12399. */
  12400. function isNil(value) {
  12401. return value == null;
  12402. }
  12403. /**
  12404. * Checks if `value` is classified as a `Number` primitive or object.
  12405. *
  12406. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12407. * classified as numbers, use the `_.isFinite` method.
  12408. *
  12409. * @static
  12410. * @memberOf _
  12411. * @since 0.1.0
  12412. * @category Lang
  12413. * @param {*} value The value to check.
  12414. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12415. * @example
  12416. *
  12417. * _.isNumber(3);
  12418. * // => true
  12419. *
  12420. * _.isNumber(Number.MIN_VALUE);
  12421. * // => true
  12422. *
  12423. * _.isNumber(Infinity);
  12424. * // => true
  12425. *
  12426. * _.isNumber('3');
  12427. * // => false
  12428. */
  12429. function isNumber(value) {
  12430. return typeof value == 'number' ||
  12431. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12432. }
  12433. /**
  12434. * Checks if `value` is a plain object, that is, an object created by the
  12435. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12436. *
  12437. * @static
  12438. * @memberOf _
  12439. * @since 0.8.0
  12440. * @category Lang
  12441. * @param {*} value The value to check.
  12442. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12443. * @example
  12444. *
  12445. * function Foo() {
  12446. * this.a = 1;
  12447. * }
  12448. *
  12449. * _.isPlainObject(new Foo);
  12450. * // => false
  12451. *
  12452. * _.isPlainObject([1, 2, 3]);
  12453. * // => false
  12454. *
  12455. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12456. * // => true
  12457. *
  12458. * _.isPlainObject(Object.create(null));
  12459. * // => true
  12460. */
  12461. function isPlainObject(value) {
  12462. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12463. return false;
  12464. }
  12465. var proto = getPrototype(value);
  12466. if (proto === null) {
  12467. return true;
  12468. }
  12469. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12470. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12471. funcToString.call(Ctor) == objectCtorString;
  12472. }
  12473. /**
  12474. * Checks if `value` is classified as a `RegExp` object.
  12475. *
  12476. * @static
  12477. * @memberOf _
  12478. * @since 0.1.0
  12479. * @category Lang
  12480. * @param {*} value The value to check.
  12481. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12482. * @example
  12483. *
  12484. * _.isRegExp(/abc/);
  12485. * // => true
  12486. *
  12487. * _.isRegExp('/abc/');
  12488. * // => false
  12489. */
  12490. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12491. /**
  12492. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12493. * double precision number which isn't the result of a rounded unsafe integer.
  12494. *
  12495. * **Note:** This method is based on
  12496. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12497. *
  12498. * @static
  12499. * @memberOf _
  12500. * @since 4.0.0
  12501. * @category Lang
  12502. * @param {*} value The value to check.
  12503. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12504. * @example
  12505. *
  12506. * _.isSafeInteger(3);
  12507. * // => true
  12508. *
  12509. * _.isSafeInteger(Number.MIN_VALUE);
  12510. * // => false
  12511. *
  12512. * _.isSafeInteger(Infinity);
  12513. * // => false
  12514. *
  12515. * _.isSafeInteger('3');
  12516. * // => false
  12517. */
  12518. function isSafeInteger(value) {
  12519. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12520. }
  12521. /**
  12522. * Checks if `value` is classified as a `Set` object.
  12523. *
  12524. * @static
  12525. * @memberOf _
  12526. * @since 4.3.0
  12527. * @category Lang
  12528. * @param {*} value The value to check.
  12529. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12530. * @example
  12531. *
  12532. * _.isSet(new Set);
  12533. * // => true
  12534. *
  12535. * _.isSet(new WeakSet);
  12536. * // => false
  12537. */
  12538. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12539. /**
  12540. * Checks if `value` is classified as a `String` primitive or object.
  12541. *
  12542. * @static
  12543. * @since 0.1.0
  12544. * @memberOf _
  12545. * @category Lang
  12546. * @param {*} value The value to check.
  12547. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12548. * @example
  12549. *
  12550. * _.isString('abc');
  12551. * // => true
  12552. *
  12553. * _.isString(1);
  12554. * // => false
  12555. */
  12556. function isString(value) {
  12557. return typeof value == 'string' ||
  12558. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12559. }
  12560. /**
  12561. * Checks if `value` is classified as a `Symbol` primitive or object.
  12562. *
  12563. * @static
  12564. * @memberOf _
  12565. * @since 4.0.0
  12566. * @category Lang
  12567. * @param {*} value The value to check.
  12568. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12569. * @example
  12570. *
  12571. * _.isSymbol(Symbol.iterator);
  12572. * // => true
  12573. *
  12574. * _.isSymbol('abc');
  12575. * // => false
  12576. */
  12577. function isSymbol(value) {
  12578. return typeof value == 'symbol' ||
  12579. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12580. }
  12581. /**
  12582. * Checks if `value` is classified as a typed array.
  12583. *
  12584. * @static
  12585. * @memberOf _
  12586. * @since 3.0.0
  12587. * @category Lang
  12588. * @param {*} value The value to check.
  12589. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12590. * @example
  12591. *
  12592. * _.isTypedArray(new Uint8Array);
  12593. * // => true
  12594. *
  12595. * _.isTypedArray([]);
  12596. * // => false
  12597. */
  12598. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12599. /**
  12600. * Checks if `value` is `undefined`.
  12601. *
  12602. * @static
  12603. * @since 0.1.0
  12604. * @memberOf _
  12605. * @category Lang
  12606. * @param {*} value The value to check.
  12607. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12608. * @example
  12609. *
  12610. * _.isUndefined(void 0);
  12611. * // => true
  12612. *
  12613. * _.isUndefined(null);
  12614. * // => false
  12615. */
  12616. function isUndefined(value) {
  12617. return value === undefined;
  12618. }
  12619. /**
  12620. * Checks if `value` is classified as a `WeakMap` object.
  12621. *
  12622. * @static
  12623. * @memberOf _
  12624. * @since 4.3.0
  12625. * @category Lang
  12626. * @param {*} value The value to check.
  12627. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12628. * @example
  12629. *
  12630. * _.isWeakMap(new WeakMap);
  12631. * // => true
  12632. *
  12633. * _.isWeakMap(new Map);
  12634. * // => false
  12635. */
  12636. function isWeakMap(value) {
  12637. return isObjectLike(value) && getTag(value) == weakMapTag;
  12638. }
  12639. /**
  12640. * Checks if `value` is classified as a `WeakSet` object.
  12641. *
  12642. * @static
  12643. * @memberOf _
  12644. * @since 4.3.0
  12645. * @category Lang
  12646. * @param {*} value The value to check.
  12647. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12648. * @example
  12649. *
  12650. * _.isWeakSet(new WeakSet);
  12651. * // => true
  12652. *
  12653. * _.isWeakSet(new Set);
  12654. * // => false
  12655. */
  12656. function isWeakSet(value) {
  12657. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12658. }
  12659. /**
  12660. * Checks if `value` is less than `other`.
  12661. *
  12662. * @static
  12663. * @memberOf _
  12664. * @since 3.9.0
  12665. * @category Lang
  12666. * @param {*} value The value to compare.
  12667. * @param {*} other The other value to compare.
  12668. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12669. * else `false`.
  12670. * @see _.gt
  12671. * @example
  12672. *
  12673. * _.lt(1, 3);
  12674. * // => true
  12675. *
  12676. * _.lt(3, 3);
  12677. * // => false
  12678. *
  12679. * _.lt(3, 1);
  12680. * // => false
  12681. */
  12682. var lt = createRelationalOperation(baseLt);
  12683. /**
  12684. * Checks if `value` is less than or equal to `other`.
  12685. *
  12686. * @static
  12687. * @memberOf _
  12688. * @since 3.9.0
  12689. * @category Lang
  12690. * @param {*} value The value to compare.
  12691. * @param {*} other The other value to compare.
  12692. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12693. * `other`, else `false`.
  12694. * @see _.gte
  12695. * @example
  12696. *
  12697. * _.lte(1, 3);
  12698. * // => true
  12699. *
  12700. * _.lte(3, 3);
  12701. * // => true
  12702. *
  12703. * _.lte(3, 1);
  12704. * // => false
  12705. */
  12706. var lte = createRelationalOperation(function(value, other) {
  12707. return value <= other;
  12708. });
  12709. /**
  12710. * Converts `value` to an array.
  12711. *
  12712. * @static
  12713. * @since 0.1.0
  12714. * @memberOf _
  12715. * @category Lang
  12716. * @param {*} value The value to convert.
  12717. * @returns {Array} Returns the converted array.
  12718. * @example
  12719. *
  12720. * _.toArray({ 'a': 1, 'b': 2 });
  12721. * // => [1, 2]
  12722. *
  12723. * _.toArray('abc');
  12724. * // => ['a', 'b', 'c']
  12725. *
  12726. * _.toArray(1);
  12727. * // => []
  12728. *
  12729. * _.toArray(null);
  12730. * // => []
  12731. */
  12732. function toArray(value) {
  12733. if (!value) {
  12734. return [];
  12735. }
  12736. if (isArrayLike(value)) {
  12737. return isString(value) ? stringToArray(value) : copyArray(value);
  12738. }
  12739. if (symIterator && value[symIterator]) {
  12740. return iteratorToArray(value[symIterator]());
  12741. }
  12742. var tag = getTag(value),
  12743. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12744. return func(value);
  12745. }
  12746. /**
  12747. * Converts `value` to a finite number.
  12748. *
  12749. * @static
  12750. * @memberOf _
  12751. * @since 4.12.0
  12752. * @category Lang
  12753. * @param {*} value The value to convert.
  12754. * @returns {number} Returns the converted number.
  12755. * @example
  12756. *
  12757. * _.toFinite(3.2);
  12758. * // => 3.2
  12759. *
  12760. * _.toFinite(Number.MIN_VALUE);
  12761. * // => 5e-324
  12762. *
  12763. * _.toFinite(Infinity);
  12764. * // => 1.7976931348623157e+308
  12765. *
  12766. * _.toFinite('3.2');
  12767. * // => 3.2
  12768. */
  12769. function toFinite(value) {
  12770. if (!value) {
  12771. return value === 0 ? value : 0;
  12772. }
  12773. value = toNumber(value);
  12774. if (value === INFINITY || value === -INFINITY) {
  12775. var sign = (value < 0 ? -1 : 1);
  12776. return sign * MAX_INTEGER;
  12777. }
  12778. return value === value ? value : 0;
  12779. }
  12780. /**
  12781. * Converts `value` to an integer.
  12782. *
  12783. * **Note:** This method is loosely based on
  12784. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12785. *
  12786. * @static
  12787. * @memberOf _
  12788. * @since 4.0.0
  12789. * @category Lang
  12790. * @param {*} value The value to convert.
  12791. * @returns {number} Returns the converted integer.
  12792. * @example
  12793. *
  12794. * _.toInteger(3.2);
  12795. * // => 3
  12796. *
  12797. * _.toInteger(Number.MIN_VALUE);
  12798. * // => 0
  12799. *
  12800. * _.toInteger(Infinity);
  12801. * // => 1.7976931348623157e+308
  12802. *
  12803. * _.toInteger('3.2');
  12804. * // => 3
  12805. */
  12806. function toInteger(value) {
  12807. var result = toFinite(value),
  12808. remainder = result % 1;
  12809. return result === result ? (remainder ? result - remainder : result) : 0;
  12810. }
  12811. /**
  12812. * Converts `value` to an integer suitable for use as the length of an
  12813. * array-like object.
  12814. *
  12815. * **Note:** This method is based on
  12816. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12817. *
  12818. * @static
  12819. * @memberOf _
  12820. * @since 4.0.0
  12821. * @category Lang
  12822. * @param {*} value The value to convert.
  12823. * @returns {number} Returns the converted integer.
  12824. * @example
  12825. *
  12826. * _.toLength(3.2);
  12827. * // => 3
  12828. *
  12829. * _.toLength(Number.MIN_VALUE);
  12830. * // => 0
  12831. *
  12832. * _.toLength(Infinity);
  12833. * // => 4294967295
  12834. *
  12835. * _.toLength('3.2');
  12836. * // => 3
  12837. */
  12838. function toLength(value) {
  12839. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12840. }
  12841. /**
  12842. * Converts `value` to a number.
  12843. *
  12844. * @static
  12845. * @memberOf _
  12846. * @since 4.0.0
  12847. * @category Lang
  12848. * @param {*} value The value to process.
  12849. * @returns {number} Returns the number.
  12850. * @example
  12851. *
  12852. * _.toNumber(3.2);
  12853. * // => 3.2
  12854. *
  12855. * _.toNumber(Number.MIN_VALUE);
  12856. * // => 5e-324
  12857. *
  12858. * _.toNumber(Infinity);
  12859. * // => Infinity
  12860. *
  12861. * _.toNumber('3.2');
  12862. * // => 3.2
  12863. */
  12864. function toNumber(value) {
  12865. if (typeof value == 'number') {
  12866. return value;
  12867. }
  12868. if (isSymbol(value)) {
  12869. return NAN;
  12870. }
  12871. if (isObject(value)) {
  12872. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12873. value = isObject(other) ? (other + '') : other;
  12874. }
  12875. if (typeof value != 'string') {
  12876. return value === 0 ? value : +value;
  12877. }
  12878. value = baseTrim(value);
  12879. var isBinary = reIsBinary.test(value);
  12880. return (isBinary || reIsOctal.test(value))
  12881. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12882. : (reIsBadHex.test(value) ? NAN : +value);
  12883. }
  12884. /**
  12885. * Converts `value` to a plain object flattening inherited enumerable string
  12886. * keyed properties of `value` to own properties of the plain object.
  12887. *
  12888. * @static
  12889. * @memberOf _
  12890. * @since 3.0.0
  12891. * @category Lang
  12892. * @param {*} value The value to convert.
  12893. * @returns {Object} Returns the converted plain object.
  12894. * @example
  12895. *
  12896. * function Foo() {
  12897. * this.b = 2;
  12898. * }
  12899. *
  12900. * Foo.prototype.c = 3;
  12901. *
  12902. * _.assign({ 'a': 1 }, new Foo);
  12903. * // => { 'a': 1, 'b': 2 }
  12904. *
  12905. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12906. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12907. */
  12908. function toPlainObject(value) {
  12909. return copyObject(value, keysIn(value));
  12910. }
  12911. /**
  12912. * Converts `value` to a safe integer. A safe integer can be compared and
  12913. * represented correctly.
  12914. *
  12915. * @static
  12916. * @memberOf _
  12917. * @since 4.0.0
  12918. * @category Lang
  12919. * @param {*} value The value to convert.
  12920. * @returns {number} Returns the converted integer.
  12921. * @example
  12922. *
  12923. * _.toSafeInteger(3.2);
  12924. * // => 3
  12925. *
  12926. * _.toSafeInteger(Number.MIN_VALUE);
  12927. * // => 0
  12928. *
  12929. * _.toSafeInteger(Infinity);
  12930. * // => 9007199254740991
  12931. *
  12932. * _.toSafeInteger('3.2');
  12933. * // => 3
  12934. */
  12935. function toSafeInteger(value) {
  12936. return value
  12937. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12938. : (value === 0 ? value : 0);
  12939. }
  12940. /**
  12941. * Converts `value` to a string. An empty string is returned for `null`
  12942. * and `undefined` values. The sign of `-0` is preserved.
  12943. *
  12944. * @static
  12945. * @memberOf _
  12946. * @since 4.0.0
  12947. * @category Lang
  12948. * @param {*} value The value to convert.
  12949. * @returns {string} Returns the converted string.
  12950. * @example
  12951. *
  12952. * _.toString(null);
  12953. * // => ''
  12954. *
  12955. * _.toString(-0);
  12956. * // => '-0'
  12957. *
  12958. * _.toString([1, 2, 3]);
  12959. * // => '1,2,3'
  12960. */
  12961. function toString(value) {
  12962. return value == null ? '' : baseToString(value);
  12963. }
  12964. /*------------------------------------------------------------------------*/
  12965. /**
  12966. * Assigns own enumerable string keyed properties of source objects to the
  12967. * destination object. Source objects are applied from left to right.
  12968. * Subsequent sources overwrite property assignments of previous sources.
  12969. *
  12970. * **Note:** This method mutates `object` and is loosely based on
  12971. * [`Object.assign`](https://mdn.io/Object/assign).
  12972. *
  12973. * @static
  12974. * @memberOf _
  12975. * @since 0.10.0
  12976. * @category Object
  12977. * @param {Object} object The destination object.
  12978. * @param {...Object} [sources] The source objects.
  12979. * @returns {Object} Returns `object`.
  12980. * @see _.assignIn
  12981. * @example
  12982. *
  12983. * function Foo() {
  12984. * this.a = 1;
  12985. * }
  12986. *
  12987. * function Bar() {
  12988. * this.c = 3;
  12989. * }
  12990. *
  12991. * Foo.prototype.b = 2;
  12992. * Bar.prototype.d = 4;
  12993. *
  12994. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12995. * // => { 'a': 1, 'c': 3 }
  12996. */
  12997. var assign = createAssigner(function(object, source) {
  12998. if (isPrototype(source) || isArrayLike(source)) {
  12999. copyObject(source, keys(source), object);
  13000. return;
  13001. }
  13002. for (var key in source) {
  13003. if (hasOwnProperty.call(source, key)) {
  13004. assignValue(object, key, source[key]);
  13005. }
  13006. }
  13007. });
  13008. /**
  13009. * This method is like `_.assign` except that it iterates over own and
  13010. * inherited source properties.
  13011. *
  13012. * **Note:** This method mutates `object`.
  13013. *
  13014. * @static
  13015. * @memberOf _
  13016. * @since 4.0.0
  13017. * @alias extend
  13018. * @category Object
  13019. * @param {Object} object The destination object.
  13020. * @param {...Object} [sources] The source objects.
  13021. * @returns {Object} Returns `object`.
  13022. * @see _.assign
  13023. * @example
  13024. *
  13025. * function Foo() {
  13026. * this.a = 1;
  13027. * }
  13028. *
  13029. * function Bar() {
  13030. * this.c = 3;
  13031. * }
  13032. *
  13033. * Foo.prototype.b = 2;
  13034. * Bar.prototype.d = 4;
  13035. *
  13036. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13037. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13038. */
  13039. var assignIn = createAssigner(function(object, source) {
  13040. copyObject(source, keysIn(source), object);
  13041. });
  13042. /**
  13043. * This method is like `_.assignIn` except that it accepts `customizer`
  13044. * which is invoked to produce the assigned values. If `customizer` returns
  13045. * `undefined`, assignment is handled by the method instead. The `customizer`
  13046. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13047. *
  13048. * **Note:** This method mutates `object`.
  13049. *
  13050. * @static
  13051. * @memberOf _
  13052. * @since 4.0.0
  13053. * @alias extendWith
  13054. * @category Object
  13055. * @param {Object} object The destination object.
  13056. * @param {...Object} sources The source objects.
  13057. * @param {Function} [customizer] The function to customize assigned values.
  13058. * @returns {Object} Returns `object`.
  13059. * @see _.assignWith
  13060. * @example
  13061. *
  13062. * function customizer(objValue, srcValue) {
  13063. * return _.isUndefined(objValue) ? srcValue : objValue;
  13064. * }
  13065. *
  13066. * var defaults = _.partialRight(_.assignInWith, customizer);
  13067. *
  13068. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13069. * // => { 'a': 1, 'b': 2 }
  13070. */
  13071. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13072. copyObject(source, keysIn(source), object, customizer);
  13073. });
  13074. /**
  13075. * This method is like `_.assign` except that it accepts `customizer`
  13076. * which is invoked to produce the assigned values. If `customizer` returns
  13077. * `undefined`, assignment is handled by the method instead. The `customizer`
  13078. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13079. *
  13080. * **Note:** This method mutates `object`.
  13081. *
  13082. * @static
  13083. * @memberOf _
  13084. * @since 4.0.0
  13085. * @category Object
  13086. * @param {Object} object The destination object.
  13087. * @param {...Object} sources The source objects.
  13088. * @param {Function} [customizer] The function to customize assigned values.
  13089. * @returns {Object} Returns `object`.
  13090. * @see _.assignInWith
  13091. * @example
  13092. *
  13093. * function customizer(objValue, srcValue) {
  13094. * return _.isUndefined(objValue) ? srcValue : objValue;
  13095. * }
  13096. *
  13097. * var defaults = _.partialRight(_.assignWith, customizer);
  13098. *
  13099. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13100. * // => { 'a': 1, 'b': 2 }
  13101. */
  13102. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13103. copyObject(source, keys(source), object, customizer);
  13104. });
  13105. /**
  13106. * Creates an array of values corresponding to `paths` of `object`.
  13107. *
  13108. * @static
  13109. * @memberOf _
  13110. * @since 1.0.0
  13111. * @category Object
  13112. * @param {Object} object The object to iterate over.
  13113. * @param {...(string|string[])} [paths] The property paths to pick.
  13114. * @returns {Array} Returns the picked values.
  13115. * @example
  13116. *
  13117. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13118. *
  13119. * _.at(object, ['a[0].b.c', 'a[1]']);
  13120. * // => [3, 4]
  13121. */
  13122. var at = flatRest(baseAt);
  13123. /**
  13124. * Creates an object that inherits from the `prototype` object. If a
  13125. * `properties` object is given, its own enumerable string keyed properties
  13126. * are assigned to the created object.
  13127. *
  13128. * @static
  13129. * @memberOf _
  13130. * @since 2.3.0
  13131. * @category Object
  13132. * @param {Object} prototype The object to inherit from.
  13133. * @param {Object} [properties] The properties to assign to the object.
  13134. * @returns {Object} Returns the new object.
  13135. * @example
  13136. *
  13137. * function Shape() {
  13138. * this.x = 0;
  13139. * this.y = 0;
  13140. * }
  13141. *
  13142. * function Circle() {
  13143. * Shape.call(this);
  13144. * }
  13145. *
  13146. * Circle.prototype = _.create(Shape.prototype, {
  13147. * 'constructor': Circle
  13148. * });
  13149. *
  13150. * var circle = new Circle;
  13151. * circle instanceof Circle;
  13152. * // => true
  13153. *
  13154. * circle instanceof Shape;
  13155. * // => true
  13156. */
  13157. function create(prototype, properties) {
  13158. var result = baseCreate(prototype);
  13159. return properties == null ? result : baseAssign(result, properties);
  13160. }
  13161. /**
  13162. * Assigns own and inherited enumerable string keyed properties of source
  13163. * objects to the destination object for all destination properties that
  13164. * resolve to `undefined`. Source objects are applied from left to right.
  13165. * Once a property is set, additional values of the same property are ignored.
  13166. *
  13167. * **Note:** This method mutates `object`.
  13168. *
  13169. * @static
  13170. * @since 0.1.0
  13171. * @memberOf _
  13172. * @category Object
  13173. * @param {Object} object The destination object.
  13174. * @param {...Object} [sources] The source objects.
  13175. * @returns {Object} Returns `object`.
  13176. * @see _.defaultsDeep
  13177. * @example
  13178. *
  13179. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13180. * // => { 'a': 1, 'b': 2 }
  13181. */
  13182. var defaults = baseRest(function(object, sources) {
  13183. object = Object(object);
  13184. var index = -1;
  13185. var length = sources.length;
  13186. var guard = length > 2 ? sources[2] : undefined;
  13187. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13188. length = 1;
  13189. }
  13190. while (++index < length) {
  13191. var source = sources[index];
  13192. var props = keysIn(source);
  13193. var propsIndex = -1;
  13194. var propsLength = props.length;
  13195. while (++propsIndex < propsLength) {
  13196. var key = props[propsIndex];
  13197. var value = object[key];
  13198. if (value === undefined ||
  13199. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13200. object[key] = source[key];
  13201. }
  13202. }
  13203. }
  13204. return object;
  13205. });
  13206. /**
  13207. * This method is like `_.defaults` except that it recursively assigns
  13208. * default properties.
  13209. *
  13210. * **Note:** This method mutates `object`.
  13211. *
  13212. * @static
  13213. * @memberOf _
  13214. * @since 3.10.0
  13215. * @category Object
  13216. * @param {Object} object The destination object.
  13217. * @param {...Object} [sources] The source objects.
  13218. * @returns {Object} Returns `object`.
  13219. * @see _.defaults
  13220. * @example
  13221. *
  13222. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13223. * // => { 'a': { 'b': 2, 'c': 3 } }
  13224. */
  13225. var defaultsDeep = baseRest(function(args) {
  13226. args.push(undefined, customDefaultsMerge);
  13227. return apply(mergeWith, undefined, args);
  13228. });
  13229. /**
  13230. * This method is like `_.find` except that it returns the key of the first
  13231. * element `predicate` returns truthy for instead of the element itself.
  13232. *
  13233. * @static
  13234. * @memberOf _
  13235. * @since 1.1.0
  13236. * @category Object
  13237. * @param {Object} object The object to inspect.
  13238. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13239. * @returns {string|undefined} Returns the key of the matched element,
  13240. * else `undefined`.
  13241. * @example
  13242. *
  13243. * var users = {
  13244. * 'barney': { 'age': 36, 'active': true },
  13245. * 'fred': { 'age': 40, 'active': false },
  13246. * 'pebbles': { 'age': 1, 'active': true }
  13247. * };
  13248. *
  13249. * _.findKey(users, function(o) { return o.age < 40; });
  13250. * // => 'barney' (iteration order is not guaranteed)
  13251. *
  13252. * // The `_.matches` iteratee shorthand.
  13253. * _.findKey(users, { 'age': 1, 'active': true });
  13254. * // => 'pebbles'
  13255. *
  13256. * // The `_.matchesProperty` iteratee shorthand.
  13257. * _.findKey(users, ['active', false]);
  13258. * // => 'fred'
  13259. *
  13260. * // The `_.property` iteratee shorthand.
  13261. * _.findKey(users, 'active');
  13262. * // => 'barney'
  13263. */
  13264. function findKey(object, predicate) {
  13265. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13266. }
  13267. /**
  13268. * This method is like `_.findKey` except that it iterates over elements of
  13269. * a collection in the opposite order.
  13270. *
  13271. * @static
  13272. * @memberOf _
  13273. * @since 2.0.0
  13274. * @category Object
  13275. * @param {Object} object The object to inspect.
  13276. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13277. * @returns {string|undefined} Returns the key of the matched element,
  13278. * else `undefined`.
  13279. * @example
  13280. *
  13281. * var users = {
  13282. * 'barney': { 'age': 36, 'active': true },
  13283. * 'fred': { 'age': 40, 'active': false },
  13284. * 'pebbles': { 'age': 1, 'active': true }
  13285. * };
  13286. *
  13287. * _.findLastKey(users, function(o) { return o.age < 40; });
  13288. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13289. *
  13290. * // The `_.matches` iteratee shorthand.
  13291. * _.findLastKey(users, { 'age': 36, 'active': true });
  13292. * // => 'barney'
  13293. *
  13294. * // The `_.matchesProperty` iteratee shorthand.
  13295. * _.findLastKey(users, ['active', false]);
  13296. * // => 'fred'
  13297. *
  13298. * // The `_.property` iteratee shorthand.
  13299. * _.findLastKey(users, 'active');
  13300. * // => 'pebbles'
  13301. */
  13302. function findLastKey(object, predicate) {
  13303. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13304. }
  13305. /**
  13306. * Iterates over own and inherited enumerable string keyed properties of an
  13307. * object and invokes `iteratee` for each property. The iteratee is invoked
  13308. * with three arguments: (value, key, object). Iteratee functions may exit
  13309. * iteration early by explicitly returning `false`.
  13310. *
  13311. * @static
  13312. * @memberOf _
  13313. * @since 0.3.0
  13314. * @category Object
  13315. * @param {Object} object The object to iterate over.
  13316. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13317. * @returns {Object} Returns `object`.
  13318. * @see _.forInRight
  13319. * @example
  13320. *
  13321. * function Foo() {
  13322. * this.a = 1;
  13323. * this.b = 2;
  13324. * }
  13325. *
  13326. * Foo.prototype.c = 3;
  13327. *
  13328. * _.forIn(new Foo, function(value, key) {
  13329. * console.log(key);
  13330. * });
  13331. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13332. */
  13333. function forIn(object, iteratee) {
  13334. return object == null
  13335. ? object
  13336. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13337. }
  13338. /**
  13339. * This method is like `_.forIn` except that it iterates over properties of
  13340. * `object` in the opposite order.
  13341. *
  13342. * @static
  13343. * @memberOf _
  13344. * @since 2.0.0
  13345. * @category Object
  13346. * @param {Object} object The object to iterate over.
  13347. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13348. * @returns {Object} Returns `object`.
  13349. * @see _.forIn
  13350. * @example
  13351. *
  13352. * function Foo() {
  13353. * this.a = 1;
  13354. * this.b = 2;
  13355. * }
  13356. *
  13357. * Foo.prototype.c = 3;
  13358. *
  13359. * _.forInRight(new Foo, function(value, key) {
  13360. * console.log(key);
  13361. * });
  13362. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13363. */
  13364. function forInRight(object, iteratee) {
  13365. return object == null
  13366. ? object
  13367. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13368. }
  13369. /**
  13370. * Iterates over own enumerable string keyed properties of an object and
  13371. * invokes `iteratee` for each property. The iteratee is invoked with three
  13372. * arguments: (value, key, object). Iteratee functions may exit iteration
  13373. * early by explicitly returning `false`.
  13374. *
  13375. * @static
  13376. * @memberOf _
  13377. * @since 0.3.0
  13378. * @category Object
  13379. * @param {Object} object The object to iterate over.
  13380. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13381. * @returns {Object} Returns `object`.
  13382. * @see _.forOwnRight
  13383. * @example
  13384. *
  13385. * function Foo() {
  13386. * this.a = 1;
  13387. * this.b = 2;
  13388. * }
  13389. *
  13390. * Foo.prototype.c = 3;
  13391. *
  13392. * _.forOwn(new Foo, function(value, key) {
  13393. * console.log(key);
  13394. * });
  13395. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13396. */
  13397. function forOwn(object, iteratee) {
  13398. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13399. }
  13400. /**
  13401. * This method is like `_.forOwn` except that it iterates over properties of
  13402. * `object` in the opposite order.
  13403. *
  13404. * @static
  13405. * @memberOf _
  13406. * @since 2.0.0
  13407. * @category Object
  13408. * @param {Object} object The object to iterate over.
  13409. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13410. * @returns {Object} Returns `object`.
  13411. * @see _.forOwn
  13412. * @example
  13413. *
  13414. * function Foo() {
  13415. * this.a = 1;
  13416. * this.b = 2;
  13417. * }
  13418. *
  13419. * Foo.prototype.c = 3;
  13420. *
  13421. * _.forOwnRight(new Foo, function(value, key) {
  13422. * console.log(key);
  13423. * });
  13424. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13425. */
  13426. function forOwnRight(object, iteratee) {
  13427. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13428. }
  13429. /**
  13430. * Creates an array of function property names from own enumerable properties
  13431. * of `object`.
  13432. *
  13433. * @static
  13434. * @since 0.1.0
  13435. * @memberOf _
  13436. * @category Object
  13437. * @param {Object} object The object to inspect.
  13438. * @returns {Array} Returns the function names.
  13439. * @see _.functionsIn
  13440. * @example
  13441. *
  13442. * function Foo() {
  13443. * this.a = _.constant('a');
  13444. * this.b = _.constant('b');
  13445. * }
  13446. *
  13447. * Foo.prototype.c = _.constant('c');
  13448. *
  13449. * _.functions(new Foo);
  13450. * // => ['a', 'b']
  13451. */
  13452. function functions(object) {
  13453. return object == null ? [] : baseFunctions(object, keys(object));
  13454. }
  13455. /**
  13456. * Creates an array of function property names from own and inherited
  13457. * enumerable properties of `object`.
  13458. *
  13459. * @static
  13460. * @memberOf _
  13461. * @since 4.0.0
  13462. * @category Object
  13463. * @param {Object} object The object to inspect.
  13464. * @returns {Array} Returns the function names.
  13465. * @see _.functions
  13466. * @example
  13467. *
  13468. * function Foo() {
  13469. * this.a = _.constant('a');
  13470. * this.b = _.constant('b');
  13471. * }
  13472. *
  13473. * Foo.prototype.c = _.constant('c');
  13474. *
  13475. * _.functionsIn(new Foo);
  13476. * // => ['a', 'b', 'c']
  13477. */
  13478. function functionsIn(object) {
  13479. return object == null ? [] : baseFunctions(object, keysIn(object));
  13480. }
  13481. /**
  13482. * Gets the value at `path` of `object`. If the resolved value is
  13483. * `undefined`, the `defaultValue` is returned in its place.
  13484. *
  13485. * @static
  13486. * @memberOf _
  13487. * @since 3.7.0
  13488. * @category Object
  13489. * @param {Object} object The object to query.
  13490. * @param {Array|string} path The path of the property to get.
  13491. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13492. * @returns {*} Returns the resolved value.
  13493. * @example
  13494. *
  13495. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13496. *
  13497. * _.get(object, 'a[0].b.c');
  13498. * // => 3
  13499. *
  13500. * _.get(object, ['a', '0', 'b', 'c']);
  13501. * // => 3
  13502. *
  13503. * _.get(object, 'a.b.c', 'default');
  13504. * // => 'default'
  13505. */
  13506. function get(object, path, defaultValue) {
  13507. var result = object == null ? undefined : baseGet(object, path);
  13508. return result === undefined ? defaultValue : result;
  13509. }
  13510. /**
  13511. * Checks if `path` is a direct property of `object`.
  13512. *
  13513. * @static
  13514. * @since 0.1.0
  13515. * @memberOf _
  13516. * @category Object
  13517. * @param {Object} object The object to query.
  13518. * @param {Array|string} path The path to check.
  13519. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13520. * @example
  13521. *
  13522. * var object = { 'a': { 'b': 2 } };
  13523. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13524. *
  13525. * _.has(object, 'a');
  13526. * // => true
  13527. *
  13528. * _.has(object, 'a.b');
  13529. * // => true
  13530. *
  13531. * _.has(object, ['a', 'b']);
  13532. * // => true
  13533. *
  13534. * _.has(other, 'a');
  13535. * // => false
  13536. */
  13537. function has(object, path) {
  13538. return object != null && hasPath(object, path, baseHas);
  13539. }
  13540. /**
  13541. * Checks if `path` is a direct or inherited property of `object`.
  13542. *
  13543. * @static
  13544. * @memberOf _
  13545. * @since 4.0.0
  13546. * @category Object
  13547. * @param {Object} object The object to query.
  13548. * @param {Array|string} path The path to check.
  13549. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13550. * @example
  13551. *
  13552. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13553. *
  13554. * _.hasIn(object, 'a');
  13555. * // => true
  13556. *
  13557. * _.hasIn(object, 'a.b');
  13558. * // => true
  13559. *
  13560. * _.hasIn(object, ['a', 'b']);
  13561. * // => true
  13562. *
  13563. * _.hasIn(object, 'b');
  13564. * // => false
  13565. */
  13566. function hasIn(object, path) {
  13567. return object != null && hasPath(object, path, baseHasIn);
  13568. }
  13569. /**
  13570. * Creates an object composed of the inverted keys and values of `object`.
  13571. * If `object` contains duplicate values, subsequent values overwrite
  13572. * property assignments of previous values.
  13573. *
  13574. * @static
  13575. * @memberOf _
  13576. * @since 0.7.0
  13577. * @category Object
  13578. * @param {Object} object The object to invert.
  13579. * @returns {Object} Returns the new inverted object.
  13580. * @example
  13581. *
  13582. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13583. *
  13584. * _.invert(object);
  13585. * // => { '1': 'c', '2': 'b' }
  13586. */
  13587. var invert = createInverter(function(result, value, key) {
  13588. if (value != null &&
  13589. typeof value.toString != 'function') {
  13590. value = nativeObjectToString.call(value);
  13591. }
  13592. result[value] = key;
  13593. }, constant(identity));
  13594. /**
  13595. * This method is like `_.invert` except that the inverted object is generated
  13596. * from the results of running each element of `object` thru `iteratee`. The
  13597. * corresponding inverted value of each inverted key is an array of keys
  13598. * responsible for generating the inverted value. The iteratee is invoked
  13599. * with one argument: (value).
  13600. *
  13601. * @static
  13602. * @memberOf _
  13603. * @since 4.1.0
  13604. * @category Object
  13605. * @param {Object} object The object to invert.
  13606. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13607. * @returns {Object} Returns the new inverted object.
  13608. * @example
  13609. *
  13610. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13611. *
  13612. * _.invertBy(object);
  13613. * // => { '1': ['a', 'c'], '2': ['b'] }
  13614. *
  13615. * _.invertBy(object, function(value) {
  13616. * return 'group' + value;
  13617. * });
  13618. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13619. */
  13620. var invertBy = createInverter(function(result, value, key) {
  13621. if (value != null &&
  13622. typeof value.toString != 'function') {
  13623. value = nativeObjectToString.call(value);
  13624. }
  13625. if (hasOwnProperty.call(result, value)) {
  13626. result[value].push(key);
  13627. } else {
  13628. result[value] = [key];
  13629. }
  13630. }, getIteratee);
  13631. /**
  13632. * Invokes the method at `path` of `object`.
  13633. *
  13634. * @static
  13635. * @memberOf _
  13636. * @since 4.0.0
  13637. * @category Object
  13638. * @param {Object} object The object to query.
  13639. * @param {Array|string} path The path of the method to invoke.
  13640. * @param {...*} [args] The arguments to invoke the method with.
  13641. * @returns {*} Returns the result of the invoked method.
  13642. * @example
  13643. *
  13644. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13645. *
  13646. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13647. * // => [2, 3]
  13648. */
  13649. var invoke = baseRest(baseInvoke);
  13650. /**
  13651. * Creates an array of the own enumerable property names of `object`.
  13652. *
  13653. * **Note:** Non-object values are coerced to objects. See the
  13654. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13655. * for more details.
  13656. *
  13657. * @static
  13658. * @since 0.1.0
  13659. * @memberOf _
  13660. * @category Object
  13661. * @param {Object} object The object to query.
  13662. * @returns {Array} Returns the array of property names.
  13663. * @example
  13664. *
  13665. * function Foo() {
  13666. * this.a = 1;
  13667. * this.b = 2;
  13668. * }
  13669. *
  13670. * Foo.prototype.c = 3;
  13671. *
  13672. * _.keys(new Foo);
  13673. * // => ['a', 'b'] (iteration order is not guaranteed)
  13674. *
  13675. * _.keys('hi');
  13676. * // => ['0', '1']
  13677. */
  13678. function keys(object) {
  13679. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13680. }
  13681. /**
  13682. * Creates an array of the own and inherited enumerable property names of `object`.
  13683. *
  13684. * **Note:** Non-object values are coerced to objects.
  13685. *
  13686. * @static
  13687. * @memberOf _
  13688. * @since 3.0.0
  13689. * @category Object
  13690. * @param {Object} object The object to query.
  13691. * @returns {Array} Returns the array of property names.
  13692. * @example
  13693. *
  13694. * function Foo() {
  13695. * this.a = 1;
  13696. * this.b = 2;
  13697. * }
  13698. *
  13699. * Foo.prototype.c = 3;
  13700. *
  13701. * _.keysIn(new Foo);
  13702. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13703. */
  13704. function keysIn(object) {
  13705. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13706. }
  13707. /**
  13708. * The opposite of `_.mapValues`; this method creates an object with the
  13709. * same values as `object` and keys generated by running each own enumerable
  13710. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13711. * with three arguments: (value, key, object).
  13712. *
  13713. * @static
  13714. * @memberOf _
  13715. * @since 3.8.0
  13716. * @category Object
  13717. * @param {Object} object The object to iterate over.
  13718. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13719. * @returns {Object} Returns the new mapped object.
  13720. * @see _.mapValues
  13721. * @example
  13722. *
  13723. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13724. * return key + value;
  13725. * });
  13726. * // => { 'a1': 1, 'b2': 2 }
  13727. */
  13728. function mapKeys(object, iteratee) {
  13729. var result = {};
  13730. iteratee = getIteratee(iteratee, 3);
  13731. baseForOwn(object, function(value, key, object) {
  13732. baseAssignValue(result, iteratee(value, key, object), value);
  13733. });
  13734. return result;
  13735. }
  13736. /**
  13737. * Creates an object with the same keys as `object` and values generated
  13738. * by running each own enumerable string keyed property of `object` thru
  13739. * `iteratee`. The iteratee is invoked with three arguments:
  13740. * (value, key, object).
  13741. *
  13742. * @static
  13743. * @memberOf _
  13744. * @since 2.4.0
  13745. * @category Object
  13746. * @param {Object} object The object to iterate over.
  13747. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13748. * @returns {Object} Returns the new mapped object.
  13749. * @see _.mapKeys
  13750. * @example
  13751. *
  13752. * var users = {
  13753. * 'fred': { 'user': 'fred', 'age': 40 },
  13754. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13755. * };
  13756. *
  13757. * _.mapValues(users, function(o) { return o.age; });
  13758. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13759. *
  13760. * // The `_.property` iteratee shorthand.
  13761. * _.mapValues(users, 'age');
  13762. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13763. */
  13764. function mapValues(object, iteratee) {
  13765. var result = {};
  13766. iteratee = getIteratee(iteratee, 3);
  13767. baseForOwn(object, function(value, key, object) {
  13768. baseAssignValue(result, key, iteratee(value, key, object));
  13769. });
  13770. return result;
  13771. }
  13772. /**
  13773. * This method is like `_.assign` except that it recursively merges own and
  13774. * inherited enumerable string keyed properties of source objects into the
  13775. * destination object. Source properties that resolve to `undefined` are
  13776. * skipped if a destination value exists. Array and plain object properties
  13777. * are merged recursively. Other objects and value types are overridden by
  13778. * assignment. Source objects are applied from left to right. Subsequent
  13779. * sources overwrite property assignments of previous sources.
  13780. *
  13781. * **Note:** This method mutates `object`.
  13782. *
  13783. * @static
  13784. * @memberOf _
  13785. * @since 0.5.0
  13786. * @category Object
  13787. * @param {Object} object The destination object.
  13788. * @param {...Object} [sources] The source objects.
  13789. * @returns {Object} Returns `object`.
  13790. * @example
  13791. *
  13792. * var object = {
  13793. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13794. * };
  13795. *
  13796. * var other = {
  13797. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13798. * };
  13799. *
  13800. * _.merge(object, other);
  13801. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13802. */
  13803. var merge = createAssigner(function(object, source, srcIndex) {
  13804. baseMerge(object, source, srcIndex);
  13805. });
  13806. /**
  13807. * This method is like `_.merge` except that it accepts `customizer` which
  13808. * is invoked to produce the merged values of the destination and source
  13809. * properties. If `customizer` returns `undefined`, merging is handled by the
  13810. * method instead. The `customizer` is invoked with six arguments:
  13811. * (objValue, srcValue, key, object, source, stack).
  13812. *
  13813. * **Note:** This method mutates `object`.
  13814. *
  13815. * @static
  13816. * @memberOf _
  13817. * @since 4.0.0
  13818. * @category Object
  13819. * @param {Object} object The destination object.
  13820. * @param {...Object} sources The source objects.
  13821. * @param {Function} customizer The function to customize assigned values.
  13822. * @returns {Object} Returns `object`.
  13823. * @example
  13824. *
  13825. * function customizer(objValue, srcValue) {
  13826. * if (_.isArray(objValue)) {
  13827. * return objValue.concat(srcValue);
  13828. * }
  13829. * }
  13830. *
  13831. * var object = { 'a': [1], 'b': [2] };
  13832. * var other = { 'a': [3], 'b': [4] };
  13833. *
  13834. * _.mergeWith(object, other, customizer);
  13835. * // => { 'a': [1, 3], 'b': [2, 4] }
  13836. */
  13837. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13838. baseMerge(object, source, srcIndex, customizer);
  13839. });
  13840. /**
  13841. * The opposite of `_.pick`; this method creates an object composed of the
  13842. * own and inherited enumerable property paths of `object` that are not omitted.
  13843. *
  13844. * **Note:** This method is considerably slower than `_.pick`.
  13845. *
  13846. * @static
  13847. * @since 0.1.0
  13848. * @memberOf _
  13849. * @category Object
  13850. * @param {Object} object The source object.
  13851. * @param {...(string|string[])} [paths] The property paths to omit.
  13852. * @returns {Object} Returns the new object.
  13853. * @example
  13854. *
  13855. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13856. *
  13857. * _.omit(object, ['a', 'c']);
  13858. * // => { 'b': '2' }
  13859. */
  13860. var omit = flatRest(function(object, paths) {
  13861. var result = {};
  13862. if (object == null) {
  13863. return result;
  13864. }
  13865. var isDeep = false;
  13866. paths = arrayMap(paths, function(path) {
  13867. path = castPath(path, object);
  13868. isDeep || (isDeep = path.length > 1);
  13869. return path;
  13870. });
  13871. copyObject(object, getAllKeysIn(object), result);
  13872. if (isDeep) {
  13873. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13874. }
  13875. var length = paths.length;
  13876. while (length--) {
  13877. baseUnset(result, paths[length]);
  13878. }
  13879. return result;
  13880. });
  13881. /**
  13882. * The opposite of `_.pickBy`; this method creates an object composed of
  13883. * the own and inherited enumerable string keyed properties of `object` that
  13884. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13885. * arguments: (value, key).
  13886. *
  13887. * @static
  13888. * @memberOf _
  13889. * @since 4.0.0
  13890. * @category Object
  13891. * @param {Object} object The source object.
  13892. * @param {Function} [predicate=_.identity] The function invoked per property.
  13893. * @returns {Object} Returns the new object.
  13894. * @example
  13895. *
  13896. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13897. *
  13898. * _.omitBy(object, _.isNumber);
  13899. * // => { 'b': '2' }
  13900. */
  13901. function omitBy(object, predicate) {
  13902. return pickBy(object, negate(getIteratee(predicate)));
  13903. }
  13904. /**
  13905. * Creates an object composed of the picked `object` properties.
  13906. *
  13907. * @static
  13908. * @since 0.1.0
  13909. * @memberOf _
  13910. * @category Object
  13911. * @param {Object} object The source object.
  13912. * @param {...(string|string[])} [paths] The property paths to pick.
  13913. * @returns {Object} Returns the new object.
  13914. * @example
  13915. *
  13916. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13917. *
  13918. * _.pick(object, ['a', 'c']);
  13919. * // => { 'a': 1, 'c': 3 }
  13920. */
  13921. var pick = flatRest(function(object, paths) {
  13922. return object == null ? {} : basePick(object, paths);
  13923. });
  13924. /**
  13925. * Creates an object composed of the `object` properties `predicate` returns
  13926. * truthy for. The predicate is invoked with two arguments: (value, key).
  13927. *
  13928. * @static
  13929. * @memberOf _
  13930. * @since 4.0.0
  13931. * @category Object
  13932. * @param {Object} object The source object.
  13933. * @param {Function} [predicate=_.identity] The function invoked per property.
  13934. * @returns {Object} Returns the new object.
  13935. * @example
  13936. *
  13937. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13938. *
  13939. * _.pickBy(object, _.isNumber);
  13940. * // => { 'a': 1, 'c': 3 }
  13941. */
  13942. function pickBy(object, predicate) {
  13943. if (object == null) {
  13944. return {};
  13945. }
  13946. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13947. return [prop];
  13948. });
  13949. predicate = getIteratee(predicate);
  13950. return basePickBy(object, props, function(value, path) {
  13951. return predicate(value, path[0]);
  13952. });
  13953. }
  13954. /**
  13955. * This method is like `_.get` except that if the resolved value is a
  13956. * function it's invoked with the `this` binding of its parent object and
  13957. * its result is returned.
  13958. *
  13959. * @static
  13960. * @since 0.1.0
  13961. * @memberOf _
  13962. * @category Object
  13963. * @param {Object} object The object to query.
  13964. * @param {Array|string} path The path of the property to resolve.
  13965. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13966. * @returns {*} Returns the resolved value.
  13967. * @example
  13968. *
  13969. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13970. *
  13971. * _.result(object, 'a[0].b.c1');
  13972. * // => 3
  13973. *
  13974. * _.result(object, 'a[0].b.c2');
  13975. * // => 4
  13976. *
  13977. * _.result(object, 'a[0].b.c3', 'default');
  13978. * // => 'default'
  13979. *
  13980. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13981. * // => 'default'
  13982. */
  13983. function result(object, path, defaultValue) {
  13984. path = castPath(path, object);
  13985. var index = -1,
  13986. length = path.length;
  13987. // Ensure the loop is entered when path is empty.
  13988. if (!length) {
  13989. length = 1;
  13990. object = undefined;
  13991. }
  13992. while (++index < length) {
  13993. var value = object == null ? undefined : object[toKey(path[index])];
  13994. if (value === undefined) {
  13995. index = length;
  13996. value = defaultValue;
  13997. }
  13998. object = isFunction(value) ? value.call(object) : value;
  13999. }
  14000. return object;
  14001. }
  14002. /**
  14003. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14004. * it's created. Arrays are created for missing index properties while objects
  14005. * are created for all other missing properties. Use `_.setWith` to customize
  14006. * `path` creation.
  14007. *
  14008. * **Note:** This method mutates `object`.
  14009. *
  14010. * @static
  14011. * @memberOf _
  14012. * @since 3.7.0
  14013. * @category Object
  14014. * @param {Object} object The object to modify.
  14015. * @param {Array|string} path The path of the property to set.
  14016. * @param {*} value The value to set.
  14017. * @returns {Object} Returns `object`.
  14018. * @example
  14019. *
  14020. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14021. *
  14022. * _.set(object, 'a[0].b.c', 4);
  14023. * console.log(object.a[0].b.c);
  14024. * // => 4
  14025. *
  14026. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14027. * console.log(object.x[0].y.z);
  14028. * // => 5
  14029. */
  14030. function set(object, path, value) {
  14031. return object == null ? object : baseSet(object, path, value);
  14032. }
  14033. /**
  14034. * This method is like `_.set` except that it accepts `customizer` which is
  14035. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14036. * path creation is handled by the method instead. The `customizer` is invoked
  14037. * with three arguments: (nsValue, key, nsObject).
  14038. *
  14039. * **Note:** This method mutates `object`.
  14040. *
  14041. * @static
  14042. * @memberOf _
  14043. * @since 4.0.0
  14044. * @category Object
  14045. * @param {Object} object The object to modify.
  14046. * @param {Array|string} path The path of the property to set.
  14047. * @param {*} value The value to set.
  14048. * @param {Function} [customizer] The function to customize assigned values.
  14049. * @returns {Object} Returns `object`.
  14050. * @example
  14051. *
  14052. * var object = {};
  14053. *
  14054. * _.setWith(object, '[0][1]', 'a', Object);
  14055. * // => { '0': { '1': 'a' } }
  14056. */
  14057. function setWith(object, path, value, customizer) {
  14058. customizer = typeof customizer == 'function' ? customizer : undefined;
  14059. return object == null ? object : baseSet(object, path, value, customizer);
  14060. }
  14061. /**
  14062. * Creates an array of own enumerable string keyed-value pairs for `object`
  14063. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14064. * entries are returned.
  14065. *
  14066. * @static
  14067. * @memberOf _
  14068. * @since 4.0.0
  14069. * @alias entries
  14070. * @category Object
  14071. * @param {Object} object The object to query.
  14072. * @returns {Array} Returns the key-value pairs.
  14073. * @example
  14074. *
  14075. * function Foo() {
  14076. * this.a = 1;
  14077. * this.b = 2;
  14078. * }
  14079. *
  14080. * Foo.prototype.c = 3;
  14081. *
  14082. * _.toPairs(new Foo);
  14083. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14084. */
  14085. var toPairs = createToPairs(keys);
  14086. /**
  14087. * Creates an array of own and inherited enumerable string keyed-value pairs
  14088. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14089. * or set, its entries are returned.
  14090. *
  14091. * @static
  14092. * @memberOf _
  14093. * @since 4.0.0
  14094. * @alias entriesIn
  14095. * @category Object
  14096. * @param {Object} object The object to query.
  14097. * @returns {Array} Returns the key-value pairs.
  14098. * @example
  14099. *
  14100. * function Foo() {
  14101. * this.a = 1;
  14102. * this.b = 2;
  14103. * }
  14104. *
  14105. * Foo.prototype.c = 3;
  14106. *
  14107. * _.toPairsIn(new Foo);
  14108. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14109. */
  14110. var toPairsIn = createToPairs(keysIn);
  14111. /**
  14112. * An alternative to `_.reduce`; this method transforms `object` to a new
  14113. * `accumulator` object which is the result of running each of its own
  14114. * enumerable string keyed properties thru `iteratee`, with each invocation
  14115. * potentially mutating the `accumulator` object. If `accumulator` is not
  14116. * provided, a new object with the same `[[Prototype]]` will be used. The
  14117. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14118. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14119. *
  14120. * @static
  14121. * @memberOf _
  14122. * @since 1.3.0
  14123. * @category Object
  14124. * @param {Object} object The object to iterate over.
  14125. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14126. * @param {*} [accumulator] The custom accumulator value.
  14127. * @returns {*} Returns the accumulated value.
  14128. * @example
  14129. *
  14130. * _.transform([2, 3, 4], function(result, n) {
  14131. * result.push(n *= n);
  14132. * return n % 2 == 0;
  14133. * }, []);
  14134. * // => [4, 9]
  14135. *
  14136. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14137. * (result[value] || (result[value] = [])).push(key);
  14138. * }, {});
  14139. * // => { '1': ['a', 'c'], '2': ['b'] }
  14140. */
  14141. function transform(object, iteratee, accumulator) {
  14142. var isArr = isArray(object),
  14143. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14144. iteratee = getIteratee(iteratee, 4);
  14145. if (accumulator == null) {
  14146. var Ctor = object && object.constructor;
  14147. if (isArrLike) {
  14148. accumulator = isArr ? new Ctor : [];
  14149. }
  14150. else if (isObject(object)) {
  14151. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14152. }
  14153. else {
  14154. accumulator = {};
  14155. }
  14156. }
  14157. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14158. return iteratee(accumulator, value, index, object);
  14159. });
  14160. return accumulator;
  14161. }
  14162. /**
  14163. * Removes the property at `path` of `object`.
  14164. *
  14165. * **Note:** This method mutates `object`.
  14166. *
  14167. * @static
  14168. * @memberOf _
  14169. * @since 4.0.0
  14170. * @category Object
  14171. * @param {Object} object The object to modify.
  14172. * @param {Array|string} path The path of the property to unset.
  14173. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14174. * @example
  14175. *
  14176. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14177. * _.unset(object, 'a[0].b.c');
  14178. * // => true
  14179. *
  14180. * console.log(object);
  14181. * // => { 'a': [{ 'b': {} }] };
  14182. *
  14183. * _.unset(object, ['a', '0', 'b', 'c']);
  14184. * // => true
  14185. *
  14186. * console.log(object);
  14187. * // => { 'a': [{ 'b': {} }] };
  14188. */
  14189. function unset(object, path) {
  14190. return object == null ? true : baseUnset(object, path);
  14191. }
  14192. /**
  14193. * This method is like `_.set` except that accepts `updater` to produce the
  14194. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14195. * is invoked with one argument: (value).
  14196. *
  14197. * **Note:** This method mutates `object`.
  14198. *
  14199. * @static
  14200. * @memberOf _
  14201. * @since 4.6.0
  14202. * @category Object
  14203. * @param {Object} object The object to modify.
  14204. * @param {Array|string} path The path of the property to set.
  14205. * @param {Function} updater The function to produce the updated value.
  14206. * @returns {Object} Returns `object`.
  14207. * @example
  14208. *
  14209. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14210. *
  14211. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14212. * console.log(object.a[0].b.c);
  14213. * // => 9
  14214. *
  14215. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14216. * console.log(object.x[0].y.z);
  14217. * // => 0
  14218. */
  14219. function update(object, path, updater) {
  14220. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14221. }
  14222. /**
  14223. * This method is like `_.update` except that it accepts `customizer` which is
  14224. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14225. * path creation is handled by the method instead. The `customizer` is invoked
  14226. * with three arguments: (nsValue, key, nsObject).
  14227. *
  14228. * **Note:** This method mutates `object`.
  14229. *
  14230. * @static
  14231. * @memberOf _
  14232. * @since 4.6.0
  14233. * @category Object
  14234. * @param {Object} object The object to modify.
  14235. * @param {Array|string} path The path of the property to set.
  14236. * @param {Function} updater The function to produce the updated value.
  14237. * @param {Function} [customizer] The function to customize assigned values.
  14238. * @returns {Object} Returns `object`.
  14239. * @example
  14240. *
  14241. * var object = {};
  14242. *
  14243. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14244. * // => { '0': { '1': 'a' } }
  14245. */
  14246. function updateWith(object, path, updater, customizer) {
  14247. customizer = typeof customizer == 'function' ? customizer : undefined;
  14248. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14249. }
  14250. /**
  14251. * Creates an array of the own enumerable string keyed property values of `object`.
  14252. *
  14253. * **Note:** Non-object values are coerced to objects.
  14254. *
  14255. * @static
  14256. * @since 0.1.0
  14257. * @memberOf _
  14258. * @category Object
  14259. * @param {Object} object The object to query.
  14260. * @returns {Array} Returns the array of property values.
  14261. * @example
  14262. *
  14263. * function Foo() {
  14264. * this.a = 1;
  14265. * this.b = 2;
  14266. * }
  14267. *
  14268. * Foo.prototype.c = 3;
  14269. *
  14270. * _.values(new Foo);
  14271. * // => [1, 2] (iteration order is not guaranteed)
  14272. *
  14273. * _.values('hi');
  14274. * // => ['h', 'i']
  14275. */
  14276. function values(object) {
  14277. return object == null ? [] : baseValues(object, keys(object));
  14278. }
  14279. /**
  14280. * Creates an array of the own and inherited enumerable string keyed property
  14281. * values of `object`.
  14282. *
  14283. * **Note:** Non-object values are coerced to objects.
  14284. *
  14285. * @static
  14286. * @memberOf _
  14287. * @since 3.0.0
  14288. * @category Object
  14289. * @param {Object} object The object to query.
  14290. * @returns {Array} Returns the array of property values.
  14291. * @example
  14292. *
  14293. * function Foo() {
  14294. * this.a = 1;
  14295. * this.b = 2;
  14296. * }
  14297. *
  14298. * Foo.prototype.c = 3;
  14299. *
  14300. * _.valuesIn(new Foo);
  14301. * // => [1, 2, 3] (iteration order is not guaranteed)
  14302. */
  14303. function valuesIn(object) {
  14304. return object == null ? [] : baseValues(object, keysIn(object));
  14305. }
  14306. /*------------------------------------------------------------------------*/
  14307. /**
  14308. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14309. *
  14310. * @static
  14311. * @memberOf _
  14312. * @since 4.0.0
  14313. * @category Number
  14314. * @param {number} number The number to clamp.
  14315. * @param {number} [lower] The lower bound.
  14316. * @param {number} upper The upper bound.
  14317. * @returns {number} Returns the clamped number.
  14318. * @example
  14319. *
  14320. * _.clamp(-10, -5, 5);
  14321. * // => -5
  14322. *
  14323. * _.clamp(10, -5, 5);
  14324. * // => 5
  14325. */
  14326. function clamp(number, lower, upper) {
  14327. if (upper === undefined) {
  14328. upper = lower;
  14329. lower = undefined;
  14330. }
  14331. if (upper !== undefined) {
  14332. upper = toNumber(upper);
  14333. upper = upper === upper ? upper : 0;
  14334. }
  14335. if (lower !== undefined) {
  14336. lower = toNumber(lower);
  14337. lower = lower === lower ? lower : 0;
  14338. }
  14339. return baseClamp(toNumber(number), lower, upper);
  14340. }
  14341. /**
  14342. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14343. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14344. * If `start` is greater than `end` the params are swapped to support
  14345. * negative ranges.
  14346. *
  14347. * @static
  14348. * @memberOf _
  14349. * @since 3.3.0
  14350. * @category Number
  14351. * @param {number} number The number to check.
  14352. * @param {number} [start=0] The start of the range.
  14353. * @param {number} end The end of the range.
  14354. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14355. * @see _.range, _.rangeRight
  14356. * @example
  14357. *
  14358. * _.inRange(3, 2, 4);
  14359. * // => true
  14360. *
  14361. * _.inRange(4, 8);
  14362. * // => true
  14363. *
  14364. * _.inRange(4, 2);
  14365. * // => false
  14366. *
  14367. * _.inRange(2, 2);
  14368. * // => false
  14369. *
  14370. * _.inRange(1.2, 2);
  14371. * // => true
  14372. *
  14373. * _.inRange(5.2, 4);
  14374. * // => false
  14375. *
  14376. * _.inRange(-3, -2, -6);
  14377. * // => true
  14378. */
  14379. function inRange(number, start, end) {
  14380. start = toFinite(start);
  14381. if (end === undefined) {
  14382. end = start;
  14383. start = 0;
  14384. } else {
  14385. end = toFinite(end);
  14386. }
  14387. number = toNumber(number);
  14388. return baseInRange(number, start, end);
  14389. }
  14390. /**
  14391. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14392. * If only one argument is provided a number between `0` and the given number
  14393. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14394. * floats, a floating-point number is returned instead of an integer.
  14395. *
  14396. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14397. * floating-point values which can produce unexpected results.
  14398. *
  14399. * @static
  14400. * @memberOf _
  14401. * @since 0.7.0
  14402. * @category Number
  14403. * @param {number} [lower=0] The lower bound.
  14404. * @param {number} [upper=1] The upper bound.
  14405. * @param {boolean} [floating] Specify returning a floating-point number.
  14406. * @returns {number} Returns the random number.
  14407. * @example
  14408. *
  14409. * _.random(0, 5);
  14410. * // => an integer between 0 and 5
  14411. *
  14412. * _.random(5);
  14413. * // => also an integer between 0 and 5
  14414. *
  14415. * _.random(5, true);
  14416. * // => a floating-point number between 0 and 5
  14417. *
  14418. * _.random(1.2, 5.2);
  14419. * // => a floating-point number between 1.2 and 5.2
  14420. */
  14421. function random(lower, upper, floating) {
  14422. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14423. upper = floating = undefined;
  14424. }
  14425. if (floating === undefined) {
  14426. if (typeof upper == 'boolean') {
  14427. floating = upper;
  14428. upper = undefined;
  14429. }
  14430. else if (typeof lower == 'boolean') {
  14431. floating = lower;
  14432. lower = undefined;
  14433. }
  14434. }
  14435. if (lower === undefined && upper === undefined) {
  14436. lower = 0;
  14437. upper = 1;
  14438. }
  14439. else {
  14440. lower = toFinite(lower);
  14441. if (upper === undefined) {
  14442. upper = lower;
  14443. lower = 0;
  14444. } else {
  14445. upper = toFinite(upper);
  14446. }
  14447. }
  14448. if (lower > upper) {
  14449. var temp = lower;
  14450. lower = upper;
  14451. upper = temp;
  14452. }
  14453. if (floating || lower % 1 || upper % 1) {
  14454. var rand = nativeRandom();
  14455. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14456. }
  14457. return baseRandom(lower, upper);
  14458. }
  14459. /*------------------------------------------------------------------------*/
  14460. /**
  14461. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14462. *
  14463. * @static
  14464. * @memberOf _
  14465. * @since 3.0.0
  14466. * @category String
  14467. * @param {string} [string=''] The string to convert.
  14468. * @returns {string} Returns the camel cased string.
  14469. * @example
  14470. *
  14471. * _.camelCase('Foo Bar');
  14472. * // => 'fooBar'
  14473. *
  14474. * _.camelCase('--foo-bar--');
  14475. * // => 'fooBar'
  14476. *
  14477. * _.camelCase('__FOO_BAR__');
  14478. * // => 'fooBar'
  14479. */
  14480. var camelCase = createCompounder(function(result, word, index) {
  14481. word = word.toLowerCase();
  14482. return result + (index ? capitalize(word) : word);
  14483. });
  14484. /**
  14485. * Converts the first character of `string` to upper case and the remaining
  14486. * to lower case.
  14487. *
  14488. * @static
  14489. * @memberOf _
  14490. * @since 3.0.0
  14491. * @category String
  14492. * @param {string} [string=''] The string to capitalize.
  14493. * @returns {string} Returns the capitalized string.
  14494. * @example
  14495. *
  14496. * _.capitalize('FRED');
  14497. * // => 'Fred'
  14498. */
  14499. function capitalize(string) {
  14500. return upperFirst(toString(string).toLowerCase());
  14501. }
  14502. /**
  14503. * Deburrs `string` by converting
  14504. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14505. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14506. * letters to basic Latin letters and removing
  14507. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14508. *
  14509. * @static
  14510. * @memberOf _
  14511. * @since 3.0.0
  14512. * @category String
  14513. * @param {string} [string=''] The string to deburr.
  14514. * @returns {string} Returns the deburred string.
  14515. * @example
  14516. *
  14517. * _.deburr('déjà vu');
  14518. * // => 'deja vu'
  14519. */
  14520. function deburr(string) {
  14521. string = toString(string);
  14522. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14523. }
  14524. /**
  14525. * Checks if `string` ends with the given target string.
  14526. *
  14527. * @static
  14528. * @memberOf _
  14529. * @since 3.0.0
  14530. * @category String
  14531. * @param {string} [string=''] The string to inspect.
  14532. * @param {string} [target] The string to search for.
  14533. * @param {number} [position=string.length] The position to search up to.
  14534. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14535. * else `false`.
  14536. * @example
  14537. *
  14538. * _.endsWith('abc', 'c');
  14539. * // => true
  14540. *
  14541. * _.endsWith('abc', 'b');
  14542. * // => false
  14543. *
  14544. * _.endsWith('abc', 'b', 2);
  14545. * // => true
  14546. */
  14547. function endsWith(string, target, position) {
  14548. string = toString(string);
  14549. target = baseToString(target);
  14550. var length = string.length;
  14551. position = position === undefined
  14552. ? length
  14553. : baseClamp(toInteger(position), 0, length);
  14554. var end = position;
  14555. position -= target.length;
  14556. return position >= 0 && string.slice(position, end) == target;
  14557. }
  14558. /**
  14559. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14560. * corresponding HTML entities.
  14561. *
  14562. * **Note:** No other characters are escaped. To escape additional
  14563. * characters use a third-party library like [_he_](https://mths.be/he).
  14564. *
  14565. * Though the ">" character is escaped for symmetry, characters like
  14566. * ">" and "/" don't need escaping in HTML and have no special meaning
  14567. * unless they're part of a tag or unquoted attribute value. See
  14568. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14569. * (under "semi-related fun fact") for more details.
  14570. *
  14571. * When working with HTML you should always
  14572. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14573. * XSS vectors.
  14574. *
  14575. * @static
  14576. * @since 0.1.0
  14577. * @memberOf _
  14578. * @category String
  14579. * @param {string} [string=''] The string to escape.
  14580. * @returns {string} Returns the escaped string.
  14581. * @example
  14582. *
  14583. * _.escape('fred, barney, & pebbles');
  14584. * // => 'fred, barney, &amp; pebbles'
  14585. */
  14586. function escape(string) {
  14587. string = toString(string);
  14588. return (string && reHasUnescapedHtml.test(string))
  14589. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14590. : string;
  14591. }
  14592. /**
  14593. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14594. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14595. *
  14596. * @static
  14597. * @memberOf _
  14598. * @since 3.0.0
  14599. * @category String
  14600. * @param {string} [string=''] The string to escape.
  14601. * @returns {string} Returns the escaped string.
  14602. * @example
  14603. *
  14604. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14605. * // => '\[lodash\]\(https://lodash\.com/\)'
  14606. */
  14607. function escapeRegExp(string) {
  14608. string = toString(string);
  14609. return (string && reHasRegExpChar.test(string))
  14610. ? string.replace(reRegExpChar, '\\$&')
  14611. : string;
  14612. }
  14613. /**
  14614. * Converts `string` to
  14615. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14616. *
  14617. * @static
  14618. * @memberOf _
  14619. * @since 3.0.0
  14620. * @category String
  14621. * @param {string} [string=''] The string to convert.
  14622. * @returns {string} Returns the kebab cased string.
  14623. * @example
  14624. *
  14625. * _.kebabCase('Foo Bar');
  14626. * // => 'foo-bar'
  14627. *
  14628. * _.kebabCase('fooBar');
  14629. * // => 'foo-bar'
  14630. *
  14631. * _.kebabCase('__FOO_BAR__');
  14632. * // => 'foo-bar'
  14633. */
  14634. var kebabCase = createCompounder(function(result, word, index) {
  14635. return result + (index ? '-' : '') + word.toLowerCase();
  14636. });
  14637. /**
  14638. * Converts `string`, as space separated words, to lower case.
  14639. *
  14640. * @static
  14641. * @memberOf _
  14642. * @since 4.0.0
  14643. * @category String
  14644. * @param {string} [string=''] The string to convert.
  14645. * @returns {string} Returns the lower cased string.
  14646. * @example
  14647. *
  14648. * _.lowerCase('--Foo-Bar--');
  14649. * // => 'foo bar'
  14650. *
  14651. * _.lowerCase('fooBar');
  14652. * // => 'foo bar'
  14653. *
  14654. * _.lowerCase('__FOO_BAR__');
  14655. * // => 'foo bar'
  14656. */
  14657. var lowerCase = createCompounder(function(result, word, index) {
  14658. return result + (index ? ' ' : '') + word.toLowerCase();
  14659. });
  14660. /**
  14661. * Converts the first character of `string` to lower case.
  14662. *
  14663. * @static
  14664. * @memberOf _
  14665. * @since 4.0.0
  14666. * @category String
  14667. * @param {string} [string=''] The string to convert.
  14668. * @returns {string} Returns the converted string.
  14669. * @example
  14670. *
  14671. * _.lowerFirst('Fred');
  14672. * // => 'fred'
  14673. *
  14674. * _.lowerFirst('FRED');
  14675. * // => 'fRED'
  14676. */
  14677. var lowerFirst = createCaseFirst('toLowerCase');
  14678. /**
  14679. * Pads `string` on the left and right sides if it's shorter than `length`.
  14680. * Padding characters are truncated if they can't be evenly divided by `length`.
  14681. *
  14682. * @static
  14683. * @memberOf _
  14684. * @since 3.0.0
  14685. * @category String
  14686. * @param {string} [string=''] The string to pad.
  14687. * @param {number} [length=0] The padding length.
  14688. * @param {string} [chars=' '] The string used as padding.
  14689. * @returns {string} Returns the padded string.
  14690. * @example
  14691. *
  14692. * _.pad('abc', 8);
  14693. * // => ' abc '
  14694. *
  14695. * _.pad('abc', 8, '_-');
  14696. * // => '_-abc_-_'
  14697. *
  14698. * _.pad('abc', 3);
  14699. * // => 'abc'
  14700. */
  14701. function pad(string, length, chars) {
  14702. string = toString(string);
  14703. length = toInteger(length);
  14704. var strLength = length ? stringSize(string) : 0;
  14705. if (!length || strLength >= length) {
  14706. return string;
  14707. }
  14708. var mid = (length - strLength) / 2;
  14709. return (
  14710. createPadding(nativeFloor(mid), chars) +
  14711. string +
  14712. createPadding(nativeCeil(mid), chars)
  14713. );
  14714. }
  14715. /**
  14716. * Pads `string` on the right side if it's shorter than `length`. Padding
  14717. * characters are truncated if they exceed `length`.
  14718. *
  14719. * @static
  14720. * @memberOf _
  14721. * @since 4.0.0
  14722. * @category String
  14723. * @param {string} [string=''] The string to pad.
  14724. * @param {number} [length=0] The padding length.
  14725. * @param {string} [chars=' '] The string used as padding.
  14726. * @returns {string} Returns the padded string.
  14727. * @example
  14728. *
  14729. * _.padEnd('abc', 6);
  14730. * // => 'abc '
  14731. *
  14732. * _.padEnd('abc', 6, '_-');
  14733. * // => 'abc_-_'
  14734. *
  14735. * _.padEnd('abc', 3);
  14736. * // => 'abc'
  14737. */
  14738. function padEnd(string, length, chars) {
  14739. string = toString(string);
  14740. length = toInteger(length);
  14741. var strLength = length ? stringSize(string) : 0;
  14742. return (length && strLength < length)
  14743. ? (string + createPadding(length - strLength, chars))
  14744. : string;
  14745. }
  14746. /**
  14747. * Pads `string` on the left side if it's shorter than `length`. Padding
  14748. * characters are truncated if they exceed `length`.
  14749. *
  14750. * @static
  14751. * @memberOf _
  14752. * @since 4.0.0
  14753. * @category String
  14754. * @param {string} [string=''] The string to pad.
  14755. * @param {number} [length=0] The padding length.
  14756. * @param {string} [chars=' '] The string used as padding.
  14757. * @returns {string} Returns the padded string.
  14758. * @example
  14759. *
  14760. * _.padStart('abc', 6);
  14761. * // => ' abc'
  14762. *
  14763. * _.padStart('abc', 6, '_-');
  14764. * // => '_-_abc'
  14765. *
  14766. * _.padStart('abc', 3);
  14767. * // => 'abc'
  14768. */
  14769. function padStart(string, length, chars) {
  14770. string = toString(string);
  14771. length = toInteger(length);
  14772. var strLength = length ? stringSize(string) : 0;
  14773. return (length && strLength < length)
  14774. ? (createPadding(length - strLength, chars) + string)
  14775. : string;
  14776. }
  14777. /**
  14778. * Converts `string` to an integer of the specified radix. If `radix` is
  14779. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14780. * hexadecimal, in which case a `radix` of `16` is used.
  14781. *
  14782. * **Note:** This method aligns with the
  14783. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14784. *
  14785. * @static
  14786. * @memberOf _
  14787. * @since 1.1.0
  14788. * @category String
  14789. * @param {string} string The string to convert.
  14790. * @param {number} [radix=10] The radix to interpret `value` by.
  14791. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14792. * @returns {number} Returns the converted integer.
  14793. * @example
  14794. *
  14795. * _.parseInt('08');
  14796. * // => 8
  14797. *
  14798. * _.map(['6', '08', '10'], _.parseInt);
  14799. * // => [6, 8, 10]
  14800. */
  14801. function parseInt(string, radix, guard) {
  14802. if (guard || radix == null) {
  14803. radix = 0;
  14804. } else if (radix) {
  14805. radix = +radix;
  14806. }
  14807. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14808. }
  14809. /**
  14810. * Repeats the given string `n` times.
  14811. *
  14812. * @static
  14813. * @memberOf _
  14814. * @since 3.0.0
  14815. * @category String
  14816. * @param {string} [string=''] The string to repeat.
  14817. * @param {number} [n=1] The number of times to repeat the string.
  14818. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14819. * @returns {string} Returns the repeated string.
  14820. * @example
  14821. *
  14822. * _.repeat('*', 3);
  14823. * // => '***'
  14824. *
  14825. * _.repeat('abc', 2);
  14826. * // => 'abcabc'
  14827. *
  14828. * _.repeat('abc', 0);
  14829. * // => ''
  14830. */
  14831. function repeat(string, n, guard) {
  14832. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14833. n = 1;
  14834. } else {
  14835. n = toInteger(n);
  14836. }
  14837. return baseRepeat(toString(string), n);
  14838. }
  14839. /**
  14840. * Replaces matches for `pattern` in `string` with `replacement`.
  14841. *
  14842. * **Note:** This method is based on
  14843. * [`String#replace`](https://mdn.io/String/replace).
  14844. *
  14845. * @static
  14846. * @memberOf _
  14847. * @since 4.0.0
  14848. * @category String
  14849. * @param {string} [string=''] The string to modify.
  14850. * @param {RegExp|string} pattern The pattern to replace.
  14851. * @param {Function|string} replacement The match replacement.
  14852. * @returns {string} Returns the modified string.
  14853. * @example
  14854. *
  14855. * _.replace('Hi Fred', 'Fred', 'Barney');
  14856. * // => 'Hi Barney'
  14857. */
  14858. function replace() {
  14859. var args = arguments,
  14860. string = toString(args[0]);
  14861. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14862. }
  14863. /**
  14864. * Converts `string` to
  14865. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14866. *
  14867. * @static
  14868. * @memberOf _
  14869. * @since 3.0.0
  14870. * @category String
  14871. * @param {string} [string=''] The string to convert.
  14872. * @returns {string} Returns the snake cased string.
  14873. * @example
  14874. *
  14875. * _.snakeCase('Foo Bar');
  14876. * // => 'foo_bar'
  14877. *
  14878. * _.snakeCase('fooBar');
  14879. * // => 'foo_bar'
  14880. *
  14881. * _.snakeCase('--FOO-BAR--');
  14882. * // => 'foo_bar'
  14883. */
  14884. var snakeCase = createCompounder(function(result, word, index) {
  14885. return result + (index ? '_' : '') + word.toLowerCase();
  14886. });
  14887. /**
  14888. * Splits `string` by `separator`.
  14889. *
  14890. * **Note:** This method is based on
  14891. * [`String#split`](https://mdn.io/String/split).
  14892. *
  14893. * @static
  14894. * @memberOf _
  14895. * @since 4.0.0
  14896. * @category String
  14897. * @param {string} [string=''] The string to split.
  14898. * @param {RegExp|string} separator The separator pattern to split by.
  14899. * @param {number} [limit] The length to truncate results to.
  14900. * @returns {Array} Returns the string segments.
  14901. * @example
  14902. *
  14903. * _.split('a-b-c', '-', 2);
  14904. * // => ['a', 'b']
  14905. */
  14906. function split(string, separator, limit) {
  14907. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14908. separator = limit = undefined;
  14909. }
  14910. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14911. if (!limit) {
  14912. return [];
  14913. }
  14914. string = toString(string);
  14915. if (string && (
  14916. typeof separator == 'string' ||
  14917. (separator != null && !isRegExp(separator))
  14918. )) {
  14919. separator = baseToString(separator);
  14920. if (!separator && hasUnicode(string)) {
  14921. return castSlice(stringToArray(string), 0, limit);
  14922. }
  14923. }
  14924. return string.split(separator, limit);
  14925. }
  14926. /**
  14927. * Converts `string` to
  14928. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14929. *
  14930. * @static
  14931. * @memberOf _
  14932. * @since 3.1.0
  14933. * @category String
  14934. * @param {string} [string=''] The string to convert.
  14935. * @returns {string} Returns the start cased string.
  14936. * @example
  14937. *
  14938. * _.startCase('--foo-bar--');
  14939. * // => 'Foo Bar'
  14940. *
  14941. * _.startCase('fooBar');
  14942. * // => 'Foo Bar'
  14943. *
  14944. * _.startCase('__FOO_BAR__');
  14945. * // => 'FOO BAR'
  14946. */
  14947. var startCase = createCompounder(function(result, word, index) {
  14948. return result + (index ? ' ' : '') + upperFirst(word);
  14949. });
  14950. /**
  14951. * Checks if `string` starts with the given target string.
  14952. *
  14953. * @static
  14954. * @memberOf _
  14955. * @since 3.0.0
  14956. * @category String
  14957. * @param {string} [string=''] The string to inspect.
  14958. * @param {string} [target] The string to search for.
  14959. * @param {number} [position=0] The position to search from.
  14960. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14961. * else `false`.
  14962. * @example
  14963. *
  14964. * _.startsWith('abc', 'a');
  14965. * // => true
  14966. *
  14967. * _.startsWith('abc', 'b');
  14968. * // => false
  14969. *
  14970. * _.startsWith('abc', 'b', 1);
  14971. * // => true
  14972. */
  14973. function startsWith(string, target, position) {
  14974. string = toString(string);
  14975. position = position == null
  14976. ? 0
  14977. : baseClamp(toInteger(position), 0, string.length);
  14978. target = baseToString(target);
  14979. return string.slice(position, position + target.length) == target;
  14980. }
  14981. /**
  14982. * Creates a compiled template function that can interpolate data properties
  14983. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14984. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14985. * properties may be accessed as free variables in the template. If a setting
  14986. * object is given, it takes precedence over `_.templateSettings` values.
  14987. *
  14988. * **Note:** In the development build `_.template` utilizes
  14989. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14990. * for easier debugging.
  14991. *
  14992. * For more information on precompiling templates see
  14993. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14994. *
  14995. * For more information on Chrome extension sandboxes see
  14996. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14997. *
  14998. * @static
  14999. * @since 0.1.0
  15000. * @memberOf _
  15001. * @category String
  15002. * @param {string} [string=''] The template string.
  15003. * @param {Object} [options={}] The options object.
  15004. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15005. * The HTML "escape" delimiter.
  15006. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15007. * The "evaluate" delimiter.
  15008. * @param {Object} [options.imports=_.templateSettings.imports]
  15009. * An object to import into the template as free variables.
  15010. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15011. * The "interpolate" delimiter.
  15012. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15013. * The sourceURL of the compiled template.
  15014. * @param {string} [options.variable='obj']
  15015. * The data object variable name.
  15016. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15017. * @returns {Function} Returns the compiled template function.
  15018. * @example
  15019. *
  15020. * // Use the "interpolate" delimiter to create a compiled template.
  15021. * var compiled = _.template('hello <%= user %>!');
  15022. * compiled({ 'user': 'fred' });
  15023. * // => 'hello fred!'
  15024. *
  15025. * // Use the HTML "escape" delimiter to escape data property values.
  15026. * var compiled = _.template('<b><%- value %></b>');
  15027. * compiled({ 'value': '<script>' });
  15028. * // => '<b>&lt;script&gt;</b>'
  15029. *
  15030. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15031. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15032. * compiled({ 'users': ['fred', 'barney'] });
  15033. * // => '<li>fred</li><li>barney</li>'
  15034. *
  15035. * // Use the internal `print` function in "evaluate" delimiters.
  15036. * var compiled = _.template('<% print("hello " + user); %>!');
  15037. * compiled({ 'user': 'barney' });
  15038. * // => 'hello barney!'
  15039. *
  15040. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15041. * // Disable support by replacing the "interpolate" delimiter.
  15042. * var compiled = _.template('hello ${ user }!');
  15043. * compiled({ 'user': 'pebbles' });
  15044. * // => 'hello pebbles!'
  15045. *
  15046. * // Use backslashes to treat delimiters as plain text.
  15047. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15048. * compiled({ 'value': 'ignored' });
  15049. * // => '<%- value %>'
  15050. *
  15051. * // Use the `imports` option to import `jQuery` as `jq`.
  15052. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15053. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15054. * compiled({ 'users': ['fred', 'barney'] });
  15055. * // => '<li>fred</li><li>barney</li>'
  15056. *
  15057. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15058. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15059. * compiled(data);
  15060. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15061. *
  15062. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15063. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15064. * compiled.source;
  15065. * // => function(data) {
  15066. * // var __t, __p = '';
  15067. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15068. * // return __p;
  15069. * // }
  15070. *
  15071. * // Use custom template delimiters.
  15072. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15073. * var compiled = _.template('hello {{ user }}!');
  15074. * compiled({ 'user': 'mustache' });
  15075. * // => 'hello mustache!'
  15076. *
  15077. * // Use the `source` property to inline compiled templates for meaningful
  15078. * // line numbers in error messages and stack traces.
  15079. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15080. * var JST = {\
  15081. * "main": ' + _.template(mainText).source + '\
  15082. * };\
  15083. * ');
  15084. */
  15085. function template(string, options, guard) {
  15086. // Based on John Resig's `tmpl` implementation
  15087. // (http://ejohn.org/blog/javascript-micro-templating/)
  15088. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15089. var settings = lodash.templateSettings;
  15090. if (guard && isIterateeCall(string, options, guard)) {
  15091. options = undefined;
  15092. }
  15093. string = toString(string);
  15094. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15095. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15096. importsKeys = keys(imports),
  15097. importsValues = baseValues(imports, importsKeys);
  15098. var isEscaping,
  15099. isEvaluating,
  15100. index = 0,
  15101. interpolate = options.interpolate || reNoMatch,
  15102. source = "__p += '";
  15103. // Compile the regexp to match each delimiter.
  15104. var reDelimiters = RegExp(
  15105. (options.escape || reNoMatch).source + '|' +
  15106. interpolate.source + '|' +
  15107. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15108. (options.evaluate || reNoMatch).source + '|$'
  15109. , 'g');
  15110. // Use a sourceURL for easier debugging.
  15111. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15112. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15113. // and escape the comment, thus injecting code that gets evaled.
  15114. var sourceURL = '//# sourceURL=' +
  15115. (hasOwnProperty.call(options, 'sourceURL')
  15116. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15117. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15118. ) + '\n';
  15119. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15120. interpolateValue || (interpolateValue = esTemplateValue);
  15121. // Escape characters that can't be included in string literals.
  15122. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15123. // Replace delimiters with snippets.
  15124. if (escapeValue) {
  15125. isEscaping = true;
  15126. source += "' +\n__e(" + escapeValue + ") +\n'";
  15127. }
  15128. if (evaluateValue) {
  15129. isEvaluating = true;
  15130. source += "';\n" + evaluateValue + ";\n__p += '";
  15131. }
  15132. if (interpolateValue) {
  15133. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15134. }
  15135. index = offset + match.length;
  15136. // The JS engine embedded in Adobe products needs `match` returned in
  15137. // order to produce the correct `offset` value.
  15138. return match;
  15139. });
  15140. source += "';\n";
  15141. // If `variable` is not specified wrap a with-statement around the generated
  15142. // code to add the data object to the top of the scope chain.
  15143. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15144. if (!variable) {
  15145. source = 'with (obj) {\n' + source + '\n}\n';
  15146. }
  15147. // Throw an error if a forbidden character was found in `variable`, to prevent
  15148. // potential command injection attacks.
  15149. else if (reForbiddenIdentifierChars.test(variable)) {
  15150. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15151. }
  15152. // Cleanup code by stripping empty strings.
  15153. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15154. .replace(reEmptyStringMiddle, '$1')
  15155. .replace(reEmptyStringTrailing, '$1;');
  15156. // Frame code as the function body.
  15157. source = 'function(' + (variable || 'obj') + ') {\n' +
  15158. (variable
  15159. ? ''
  15160. : 'obj || (obj = {});\n'
  15161. ) +
  15162. "var __t, __p = ''" +
  15163. (isEscaping
  15164. ? ', __e = _.escape'
  15165. : ''
  15166. ) +
  15167. (isEvaluating
  15168. ? ', __j = Array.prototype.join;\n' +
  15169. "function print() { __p += __j.call(arguments, '') }\n"
  15170. : ';\n'
  15171. ) +
  15172. source +
  15173. 'return __p\n}';
  15174. var result = attempt(function() {
  15175. return Function(importsKeys, sourceURL + 'return ' + source)
  15176. .apply(undefined, importsValues);
  15177. });
  15178. // Provide the compiled function's source by its `toString` method or
  15179. // the `source` property as a convenience for inlining compiled templates.
  15180. result.source = source;
  15181. if (isError(result)) {
  15182. throw result;
  15183. }
  15184. return result;
  15185. }
  15186. /**
  15187. * Converts `string`, as a whole, to lower case just like
  15188. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15189. *
  15190. * @static
  15191. * @memberOf _
  15192. * @since 4.0.0
  15193. * @category String
  15194. * @param {string} [string=''] The string to convert.
  15195. * @returns {string} Returns the lower cased string.
  15196. * @example
  15197. *
  15198. * _.toLower('--Foo-Bar--');
  15199. * // => '--foo-bar--'
  15200. *
  15201. * _.toLower('fooBar');
  15202. * // => 'foobar'
  15203. *
  15204. * _.toLower('__FOO_BAR__');
  15205. * // => '__foo_bar__'
  15206. */
  15207. function toLower(value) {
  15208. return toString(value).toLowerCase();
  15209. }
  15210. /**
  15211. * Converts `string`, as a whole, to upper case just like
  15212. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15213. *
  15214. * @static
  15215. * @memberOf _
  15216. * @since 4.0.0
  15217. * @category String
  15218. * @param {string} [string=''] The string to convert.
  15219. * @returns {string} Returns the upper cased string.
  15220. * @example
  15221. *
  15222. * _.toUpper('--foo-bar--');
  15223. * // => '--FOO-BAR--'
  15224. *
  15225. * _.toUpper('fooBar');
  15226. * // => 'FOOBAR'
  15227. *
  15228. * _.toUpper('__foo_bar__');
  15229. * // => '__FOO_BAR__'
  15230. */
  15231. function toUpper(value) {
  15232. return toString(value).toUpperCase();
  15233. }
  15234. /**
  15235. * Removes leading and trailing whitespace or specified characters from `string`.
  15236. *
  15237. * @static
  15238. * @memberOf _
  15239. * @since 3.0.0
  15240. * @category String
  15241. * @param {string} [string=''] The string to trim.
  15242. * @param {string} [chars=whitespace] The characters to trim.
  15243. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15244. * @returns {string} Returns the trimmed string.
  15245. * @example
  15246. *
  15247. * _.trim(' abc ');
  15248. * // => 'abc'
  15249. *
  15250. * _.trim('-_-abc-_-', '_-');
  15251. * // => 'abc'
  15252. *
  15253. * _.map([' foo ', ' bar '], _.trim);
  15254. * // => ['foo', 'bar']
  15255. */
  15256. function trim(string, chars, guard) {
  15257. string = toString(string);
  15258. if (string && (guard || chars === undefined)) {
  15259. return baseTrim(string);
  15260. }
  15261. if (!string || !(chars = baseToString(chars))) {
  15262. return string;
  15263. }
  15264. var strSymbols = stringToArray(string),
  15265. chrSymbols = stringToArray(chars),
  15266. start = charsStartIndex(strSymbols, chrSymbols),
  15267. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15268. return castSlice(strSymbols, start, end).join('');
  15269. }
  15270. /**
  15271. * Removes trailing whitespace or specified characters from `string`.
  15272. *
  15273. * @static
  15274. * @memberOf _
  15275. * @since 4.0.0
  15276. * @category String
  15277. * @param {string} [string=''] The string to trim.
  15278. * @param {string} [chars=whitespace] The characters to trim.
  15279. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15280. * @returns {string} Returns the trimmed string.
  15281. * @example
  15282. *
  15283. * _.trimEnd(' abc ');
  15284. * // => ' abc'
  15285. *
  15286. * _.trimEnd('-_-abc-_-', '_-');
  15287. * // => '-_-abc'
  15288. */
  15289. function trimEnd(string, chars, guard) {
  15290. string = toString(string);
  15291. if (string && (guard || chars === undefined)) {
  15292. return string.slice(0, trimmedEndIndex(string) + 1);
  15293. }
  15294. if (!string || !(chars = baseToString(chars))) {
  15295. return string;
  15296. }
  15297. var strSymbols = stringToArray(string),
  15298. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15299. return castSlice(strSymbols, 0, end).join('');
  15300. }
  15301. /**
  15302. * Removes leading whitespace or specified characters from `string`.
  15303. *
  15304. * @static
  15305. * @memberOf _
  15306. * @since 4.0.0
  15307. * @category String
  15308. * @param {string} [string=''] The string to trim.
  15309. * @param {string} [chars=whitespace] The characters to trim.
  15310. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15311. * @returns {string} Returns the trimmed string.
  15312. * @example
  15313. *
  15314. * _.trimStart(' abc ');
  15315. * // => 'abc '
  15316. *
  15317. * _.trimStart('-_-abc-_-', '_-');
  15318. * // => 'abc-_-'
  15319. */
  15320. function trimStart(string, chars, guard) {
  15321. string = toString(string);
  15322. if (string && (guard || chars === undefined)) {
  15323. return string.replace(reTrimStart, '');
  15324. }
  15325. if (!string || !(chars = baseToString(chars))) {
  15326. return string;
  15327. }
  15328. var strSymbols = stringToArray(string),
  15329. start = charsStartIndex(strSymbols, stringToArray(chars));
  15330. return castSlice(strSymbols, start).join('');
  15331. }
  15332. /**
  15333. * Truncates `string` if it's longer than the given maximum string length.
  15334. * The last characters of the truncated string are replaced with the omission
  15335. * string which defaults to "...".
  15336. *
  15337. * @static
  15338. * @memberOf _
  15339. * @since 4.0.0
  15340. * @category String
  15341. * @param {string} [string=''] The string to truncate.
  15342. * @param {Object} [options={}] The options object.
  15343. * @param {number} [options.length=30] The maximum string length.
  15344. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15345. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15346. * @returns {string} Returns the truncated string.
  15347. * @example
  15348. *
  15349. * _.truncate('hi-diddly-ho there, neighborino');
  15350. * // => 'hi-diddly-ho there, neighbo...'
  15351. *
  15352. * _.truncate('hi-diddly-ho there, neighborino', {
  15353. * 'length': 24,
  15354. * 'separator': ' '
  15355. * });
  15356. * // => 'hi-diddly-ho there,...'
  15357. *
  15358. * _.truncate('hi-diddly-ho there, neighborino', {
  15359. * 'length': 24,
  15360. * 'separator': /,? +/
  15361. * });
  15362. * // => 'hi-diddly-ho there...'
  15363. *
  15364. * _.truncate('hi-diddly-ho there, neighborino', {
  15365. * 'omission': ' [...]'
  15366. * });
  15367. * // => 'hi-diddly-ho there, neig [...]'
  15368. */
  15369. function truncate(string, options) {
  15370. var length = DEFAULT_TRUNC_LENGTH,
  15371. omission = DEFAULT_TRUNC_OMISSION;
  15372. if (isObject(options)) {
  15373. var separator = 'separator' in options ? options.separator : separator;
  15374. length = 'length' in options ? toInteger(options.length) : length;
  15375. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15376. }
  15377. string = toString(string);
  15378. var strLength = string.length;
  15379. if (hasUnicode(string)) {
  15380. var strSymbols = stringToArray(string);
  15381. strLength = strSymbols.length;
  15382. }
  15383. if (length >= strLength) {
  15384. return string;
  15385. }
  15386. var end = length - stringSize(omission);
  15387. if (end < 1) {
  15388. return omission;
  15389. }
  15390. var result = strSymbols
  15391. ? castSlice(strSymbols, 0, end).join('')
  15392. : string.slice(0, end);
  15393. if (separator === undefined) {
  15394. return result + omission;
  15395. }
  15396. if (strSymbols) {
  15397. end += (result.length - end);
  15398. }
  15399. if (isRegExp(separator)) {
  15400. if (string.slice(end).search(separator)) {
  15401. var match,
  15402. substring = result;
  15403. if (!separator.global) {
  15404. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15405. }
  15406. separator.lastIndex = 0;
  15407. while ((match = separator.exec(substring))) {
  15408. var newEnd = match.index;
  15409. }
  15410. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15411. }
  15412. } else if (string.indexOf(baseToString(separator), end) != end) {
  15413. var index = result.lastIndexOf(separator);
  15414. if (index > -1) {
  15415. result = result.slice(0, index);
  15416. }
  15417. }
  15418. return result + omission;
  15419. }
  15420. /**
  15421. * The inverse of `_.escape`; this method converts the HTML entities
  15422. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15423. * their corresponding characters.
  15424. *
  15425. * **Note:** No other HTML entities are unescaped. To unescape additional
  15426. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15427. *
  15428. * @static
  15429. * @memberOf _
  15430. * @since 0.6.0
  15431. * @category String
  15432. * @param {string} [string=''] The string to unescape.
  15433. * @returns {string} Returns the unescaped string.
  15434. * @example
  15435. *
  15436. * _.unescape('fred, barney, &amp; pebbles');
  15437. * // => 'fred, barney, & pebbles'
  15438. */
  15439. function unescape(string) {
  15440. string = toString(string);
  15441. return (string && reHasEscapedHtml.test(string))
  15442. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15443. : string;
  15444. }
  15445. /**
  15446. * Converts `string`, as space separated words, to upper case.
  15447. *
  15448. * @static
  15449. * @memberOf _
  15450. * @since 4.0.0
  15451. * @category String
  15452. * @param {string} [string=''] The string to convert.
  15453. * @returns {string} Returns the upper cased string.
  15454. * @example
  15455. *
  15456. * _.upperCase('--foo-bar');
  15457. * // => 'FOO BAR'
  15458. *
  15459. * _.upperCase('fooBar');
  15460. * // => 'FOO BAR'
  15461. *
  15462. * _.upperCase('__foo_bar__');
  15463. * // => 'FOO BAR'
  15464. */
  15465. var upperCase = createCompounder(function(result, word, index) {
  15466. return result + (index ? ' ' : '') + word.toUpperCase();
  15467. });
  15468. /**
  15469. * Converts the first character of `string` to upper case.
  15470. *
  15471. * @static
  15472. * @memberOf _
  15473. * @since 4.0.0
  15474. * @category String
  15475. * @param {string} [string=''] The string to convert.
  15476. * @returns {string} Returns the converted string.
  15477. * @example
  15478. *
  15479. * _.upperFirst('fred');
  15480. * // => 'Fred'
  15481. *
  15482. * _.upperFirst('FRED');
  15483. * // => 'FRED'
  15484. */
  15485. var upperFirst = createCaseFirst('toUpperCase');
  15486. /**
  15487. * Splits `string` into an array of its words.
  15488. *
  15489. * @static
  15490. * @memberOf _
  15491. * @since 3.0.0
  15492. * @category String
  15493. * @param {string} [string=''] The string to inspect.
  15494. * @param {RegExp|string} [pattern] The pattern to match words.
  15495. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15496. * @returns {Array} Returns the words of `string`.
  15497. * @example
  15498. *
  15499. * _.words('fred, barney, & pebbles');
  15500. * // => ['fred', 'barney', 'pebbles']
  15501. *
  15502. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15503. * // => ['fred', 'barney', '&', 'pebbles']
  15504. */
  15505. function words(string, pattern, guard) {
  15506. string = toString(string);
  15507. pattern = guard ? undefined : pattern;
  15508. if (pattern === undefined) {
  15509. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15510. }
  15511. return string.match(pattern) || [];
  15512. }
  15513. /*------------------------------------------------------------------------*/
  15514. /**
  15515. * Attempts to invoke `func`, returning either the result or the caught error
  15516. * object. Any additional arguments are provided to `func` when it's invoked.
  15517. *
  15518. * @static
  15519. * @memberOf _
  15520. * @since 3.0.0
  15521. * @category Util
  15522. * @param {Function} func The function to attempt.
  15523. * @param {...*} [args] The arguments to invoke `func` with.
  15524. * @returns {*} Returns the `func` result or error object.
  15525. * @example
  15526. *
  15527. * // Avoid throwing errors for invalid selectors.
  15528. * var elements = _.attempt(function(selector) {
  15529. * return document.querySelectorAll(selector);
  15530. * }, '>_>');
  15531. *
  15532. * if (_.isError(elements)) {
  15533. * elements = [];
  15534. * }
  15535. */
  15536. var attempt = baseRest(function(func, args) {
  15537. try {
  15538. return apply(func, undefined, args);
  15539. } catch (e) {
  15540. return isError(e) ? e : new Error(e);
  15541. }
  15542. });
  15543. /**
  15544. * Binds methods of an object to the object itself, overwriting the existing
  15545. * method.
  15546. *
  15547. * **Note:** This method doesn't set the "length" property of bound functions.
  15548. *
  15549. * @static
  15550. * @since 0.1.0
  15551. * @memberOf _
  15552. * @category Util
  15553. * @param {Object} object The object to bind and assign the bound methods to.
  15554. * @param {...(string|string[])} methodNames The object method names to bind.
  15555. * @returns {Object} Returns `object`.
  15556. * @example
  15557. *
  15558. * var view = {
  15559. * 'label': 'docs',
  15560. * 'click': function() {
  15561. * console.log('clicked ' + this.label);
  15562. * }
  15563. * };
  15564. *
  15565. * _.bindAll(view, ['click']);
  15566. * jQuery(element).on('click', view.click);
  15567. * // => Logs 'clicked docs' when clicked.
  15568. */
  15569. var bindAll = flatRest(function(object, methodNames) {
  15570. arrayEach(methodNames, function(key) {
  15571. key = toKey(key);
  15572. baseAssignValue(object, key, bind(object[key], object));
  15573. });
  15574. return object;
  15575. });
  15576. /**
  15577. * Creates a function that iterates over `pairs` and invokes the corresponding
  15578. * function of the first predicate to return truthy. The predicate-function
  15579. * pairs are invoked with the `this` binding and arguments of the created
  15580. * function.
  15581. *
  15582. * @static
  15583. * @memberOf _
  15584. * @since 4.0.0
  15585. * @category Util
  15586. * @param {Array} pairs The predicate-function pairs.
  15587. * @returns {Function} Returns the new composite function.
  15588. * @example
  15589. *
  15590. * var func = _.cond([
  15591. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15592. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15593. * [_.stubTrue, _.constant('no match')]
  15594. * ]);
  15595. *
  15596. * func({ 'a': 1, 'b': 2 });
  15597. * // => 'matches A'
  15598. *
  15599. * func({ 'a': 0, 'b': 1 });
  15600. * // => 'matches B'
  15601. *
  15602. * func({ 'a': '1', 'b': '2' });
  15603. * // => 'no match'
  15604. */
  15605. function cond(pairs) {
  15606. var length = pairs == null ? 0 : pairs.length,
  15607. toIteratee = getIteratee();
  15608. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15609. if (typeof pair[1] != 'function') {
  15610. throw new TypeError(FUNC_ERROR_TEXT);
  15611. }
  15612. return [toIteratee(pair[0]), pair[1]];
  15613. });
  15614. return baseRest(function(args) {
  15615. var index = -1;
  15616. while (++index < length) {
  15617. var pair = pairs[index];
  15618. if (apply(pair[0], this, args)) {
  15619. return apply(pair[1], this, args);
  15620. }
  15621. }
  15622. });
  15623. }
  15624. /**
  15625. * Creates a function that invokes the predicate properties of `source` with
  15626. * the corresponding property values of a given object, returning `true` if
  15627. * all predicates return truthy, else `false`.
  15628. *
  15629. * **Note:** The created function is equivalent to `_.conformsTo` with
  15630. * `source` partially applied.
  15631. *
  15632. * @static
  15633. * @memberOf _
  15634. * @since 4.0.0
  15635. * @category Util
  15636. * @param {Object} source The object of property predicates to conform to.
  15637. * @returns {Function} Returns the new spec function.
  15638. * @example
  15639. *
  15640. * var objects = [
  15641. * { 'a': 2, 'b': 1 },
  15642. * { 'a': 1, 'b': 2 }
  15643. * ];
  15644. *
  15645. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15646. * // => [{ 'a': 1, 'b': 2 }]
  15647. */
  15648. function conforms(source) {
  15649. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15650. }
  15651. /**
  15652. * Creates a function that returns `value`.
  15653. *
  15654. * @static
  15655. * @memberOf _
  15656. * @since 2.4.0
  15657. * @category Util
  15658. * @param {*} value The value to return from the new function.
  15659. * @returns {Function} Returns the new constant function.
  15660. * @example
  15661. *
  15662. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15663. *
  15664. * console.log(objects);
  15665. * // => [{ 'a': 1 }, { 'a': 1 }]
  15666. *
  15667. * console.log(objects[0] === objects[1]);
  15668. * // => true
  15669. */
  15670. function constant(value) {
  15671. return function() {
  15672. return value;
  15673. };
  15674. }
  15675. /**
  15676. * Checks `value` to determine whether a default value should be returned in
  15677. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15678. * or `undefined`.
  15679. *
  15680. * @static
  15681. * @memberOf _
  15682. * @since 4.14.0
  15683. * @category Util
  15684. * @param {*} value The value to check.
  15685. * @param {*} defaultValue The default value.
  15686. * @returns {*} Returns the resolved value.
  15687. * @example
  15688. *
  15689. * _.defaultTo(1, 10);
  15690. * // => 1
  15691. *
  15692. * _.defaultTo(undefined, 10);
  15693. * // => 10
  15694. */
  15695. function defaultTo(value, defaultValue) {
  15696. return (value == null || value !== value) ? defaultValue : value;
  15697. }
  15698. /**
  15699. * Creates a function that returns the result of invoking the given functions
  15700. * with the `this` binding of the created function, where each successive
  15701. * invocation is supplied the return value of the previous.
  15702. *
  15703. * @static
  15704. * @memberOf _
  15705. * @since 3.0.0
  15706. * @category Util
  15707. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15708. * @returns {Function} Returns the new composite function.
  15709. * @see _.flowRight
  15710. * @example
  15711. *
  15712. * function square(n) {
  15713. * return n * n;
  15714. * }
  15715. *
  15716. * var addSquare = _.flow([_.add, square]);
  15717. * addSquare(1, 2);
  15718. * // => 9
  15719. */
  15720. var flow = createFlow();
  15721. /**
  15722. * This method is like `_.flow` except that it creates a function that
  15723. * invokes the given functions from right to left.
  15724. *
  15725. * @static
  15726. * @since 3.0.0
  15727. * @memberOf _
  15728. * @category Util
  15729. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15730. * @returns {Function} Returns the new composite function.
  15731. * @see _.flow
  15732. * @example
  15733. *
  15734. * function square(n) {
  15735. * return n * n;
  15736. * }
  15737. *
  15738. * var addSquare = _.flowRight([square, _.add]);
  15739. * addSquare(1, 2);
  15740. * // => 9
  15741. */
  15742. var flowRight = createFlow(true);
  15743. /**
  15744. * This method returns the first argument it receives.
  15745. *
  15746. * @static
  15747. * @since 0.1.0
  15748. * @memberOf _
  15749. * @category Util
  15750. * @param {*} value Any value.
  15751. * @returns {*} Returns `value`.
  15752. * @example
  15753. *
  15754. * var object = { 'a': 1 };
  15755. *
  15756. * console.log(_.identity(object) === object);
  15757. * // => true
  15758. */
  15759. function identity(value) {
  15760. return value;
  15761. }
  15762. /**
  15763. * Creates a function that invokes `func` with the arguments of the created
  15764. * function. If `func` is a property name, the created function returns the
  15765. * property value for a given element. If `func` is an array or object, the
  15766. * created function returns `true` for elements that contain the equivalent
  15767. * source properties, otherwise it returns `false`.
  15768. *
  15769. * @static
  15770. * @since 4.0.0
  15771. * @memberOf _
  15772. * @category Util
  15773. * @param {*} [func=_.identity] The value to convert to a callback.
  15774. * @returns {Function} Returns the callback.
  15775. * @example
  15776. *
  15777. * var users = [
  15778. * { 'user': 'barney', 'age': 36, 'active': true },
  15779. * { 'user': 'fred', 'age': 40, 'active': false }
  15780. * ];
  15781. *
  15782. * // The `_.matches` iteratee shorthand.
  15783. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15784. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15785. *
  15786. * // The `_.matchesProperty` iteratee shorthand.
  15787. * _.filter(users, _.iteratee(['user', 'fred']));
  15788. * // => [{ 'user': 'fred', 'age': 40 }]
  15789. *
  15790. * // The `_.property` iteratee shorthand.
  15791. * _.map(users, _.iteratee('user'));
  15792. * // => ['barney', 'fred']
  15793. *
  15794. * // Create custom iteratee shorthands.
  15795. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15796. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15797. * return func.test(string);
  15798. * };
  15799. * });
  15800. *
  15801. * _.filter(['abc', 'def'], /ef/);
  15802. * // => ['def']
  15803. */
  15804. function iteratee(func) {
  15805. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15806. }
  15807. /**
  15808. * Creates a function that performs a partial deep comparison between a given
  15809. * object and `source`, returning `true` if the given object has equivalent
  15810. * property values, else `false`.
  15811. *
  15812. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15813. * partially applied.
  15814. *
  15815. * Partial comparisons will match empty array and empty object `source`
  15816. * values against any array or object value, respectively. See `_.isEqual`
  15817. * for a list of supported value comparisons.
  15818. *
  15819. * **Note:** Multiple values can be checked by combining several matchers
  15820. * using `_.overSome`
  15821. *
  15822. * @static
  15823. * @memberOf _
  15824. * @since 3.0.0
  15825. * @category Util
  15826. * @param {Object} source The object of property values to match.
  15827. * @returns {Function} Returns the new spec function.
  15828. * @example
  15829. *
  15830. * var objects = [
  15831. * { 'a': 1, 'b': 2, 'c': 3 },
  15832. * { 'a': 4, 'b': 5, 'c': 6 }
  15833. * ];
  15834. *
  15835. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15836. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15837. *
  15838. * // Checking for several possible values
  15839. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15840. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15841. */
  15842. function matches(source) {
  15843. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15844. }
  15845. /**
  15846. * Creates a function that performs a partial deep comparison between the
  15847. * value at `path` of a given object to `srcValue`, returning `true` if the
  15848. * object value is equivalent, else `false`.
  15849. *
  15850. * **Note:** Partial comparisons will match empty array and empty object
  15851. * `srcValue` values against any array or object value, respectively. See
  15852. * `_.isEqual` for a list of supported value comparisons.
  15853. *
  15854. * **Note:** Multiple values can be checked by combining several matchers
  15855. * using `_.overSome`
  15856. *
  15857. * @static
  15858. * @memberOf _
  15859. * @since 3.2.0
  15860. * @category Util
  15861. * @param {Array|string} path The path of the property to get.
  15862. * @param {*} srcValue The value to match.
  15863. * @returns {Function} Returns the new spec function.
  15864. * @example
  15865. *
  15866. * var objects = [
  15867. * { 'a': 1, 'b': 2, 'c': 3 },
  15868. * { 'a': 4, 'b': 5, 'c': 6 }
  15869. * ];
  15870. *
  15871. * _.find(objects, _.matchesProperty('a', 4));
  15872. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15873. *
  15874. * // Checking for several possible values
  15875. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15876. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15877. */
  15878. function matchesProperty(path, srcValue) {
  15879. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15880. }
  15881. /**
  15882. * Creates a function that invokes the method at `path` of a given object.
  15883. * Any additional arguments are provided to the invoked method.
  15884. *
  15885. * @static
  15886. * @memberOf _
  15887. * @since 3.7.0
  15888. * @category Util
  15889. * @param {Array|string} path The path of the method to invoke.
  15890. * @param {...*} [args] The arguments to invoke the method with.
  15891. * @returns {Function} Returns the new invoker function.
  15892. * @example
  15893. *
  15894. * var objects = [
  15895. * { 'a': { 'b': _.constant(2) } },
  15896. * { 'a': { 'b': _.constant(1) } }
  15897. * ];
  15898. *
  15899. * _.map(objects, _.method('a.b'));
  15900. * // => [2, 1]
  15901. *
  15902. * _.map(objects, _.method(['a', 'b']));
  15903. * // => [2, 1]
  15904. */
  15905. var method = baseRest(function(path, args) {
  15906. return function(object) {
  15907. return baseInvoke(object, path, args);
  15908. };
  15909. });
  15910. /**
  15911. * The opposite of `_.method`; this method creates a function that invokes
  15912. * the method at a given path of `object`. Any additional arguments are
  15913. * provided to the invoked method.
  15914. *
  15915. * @static
  15916. * @memberOf _
  15917. * @since 3.7.0
  15918. * @category Util
  15919. * @param {Object} object The object to query.
  15920. * @param {...*} [args] The arguments to invoke the method with.
  15921. * @returns {Function} Returns the new invoker function.
  15922. * @example
  15923. *
  15924. * var array = _.times(3, _.constant),
  15925. * object = { 'a': array, 'b': array, 'c': array };
  15926. *
  15927. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15928. * // => [2, 0]
  15929. *
  15930. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15931. * // => [2, 0]
  15932. */
  15933. var methodOf = baseRest(function(object, args) {
  15934. return function(path) {
  15935. return baseInvoke(object, path, args);
  15936. };
  15937. });
  15938. /**
  15939. * Adds all own enumerable string keyed function properties of a source
  15940. * object to the destination object. If `object` is a function, then methods
  15941. * are added to its prototype as well.
  15942. *
  15943. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15944. * avoid conflicts caused by modifying the original.
  15945. *
  15946. * @static
  15947. * @since 0.1.0
  15948. * @memberOf _
  15949. * @category Util
  15950. * @param {Function|Object} [object=lodash] The destination object.
  15951. * @param {Object} source The object of functions to add.
  15952. * @param {Object} [options={}] The options object.
  15953. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15954. * @returns {Function|Object} Returns `object`.
  15955. * @example
  15956. *
  15957. * function vowels(string) {
  15958. * return _.filter(string, function(v) {
  15959. * return /[aeiou]/i.test(v);
  15960. * });
  15961. * }
  15962. *
  15963. * _.mixin({ 'vowels': vowels });
  15964. * _.vowels('fred');
  15965. * // => ['e']
  15966. *
  15967. * _('fred').vowels().value();
  15968. * // => ['e']
  15969. *
  15970. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15971. * _('fred').vowels();
  15972. * // => ['e']
  15973. */
  15974. function mixin(object, source, options) {
  15975. var props = keys(source),
  15976. methodNames = baseFunctions(source, props);
  15977. if (options == null &&
  15978. !(isObject(source) && (methodNames.length || !props.length))) {
  15979. options = source;
  15980. source = object;
  15981. object = this;
  15982. methodNames = baseFunctions(source, keys(source));
  15983. }
  15984. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15985. isFunc = isFunction(object);
  15986. arrayEach(methodNames, function(methodName) {
  15987. var func = source[methodName];
  15988. object[methodName] = func;
  15989. if (isFunc) {
  15990. object.prototype[methodName] = function() {
  15991. var chainAll = this.__chain__;
  15992. if (chain || chainAll) {
  15993. var result = object(this.__wrapped__),
  15994. actions = result.__actions__ = copyArray(this.__actions__);
  15995. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15996. result.__chain__ = chainAll;
  15997. return result;
  15998. }
  15999. return func.apply(object, arrayPush([this.value()], arguments));
  16000. };
  16001. }
  16002. });
  16003. return object;
  16004. }
  16005. /**
  16006. * Reverts the `_` variable to its previous value and returns a reference to
  16007. * the `lodash` function.
  16008. *
  16009. * @static
  16010. * @since 0.1.0
  16011. * @memberOf _
  16012. * @category Util
  16013. * @returns {Function} Returns the `lodash` function.
  16014. * @example
  16015. *
  16016. * var lodash = _.noConflict();
  16017. */
  16018. function noConflict() {
  16019. if (root._ === this) {
  16020. root._ = oldDash;
  16021. }
  16022. return this;
  16023. }
  16024. /**
  16025. * This method returns `undefined`.
  16026. *
  16027. * @static
  16028. * @memberOf _
  16029. * @since 2.3.0
  16030. * @category Util
  16031. * @example
  16032. *
  16033. * _.times(2, _.noop);
  16034. * // => [undefined, undefined]
  16035. */
  16036. function noop() {
  16037. // No operation performed.
  16038. }
  16039. /**
  16040. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16041. * the nth argument from the end is returned.
  16042. *
  16043. * @static
  16044. * @memberOf _
  16045. * @since 4.0.0
  16046. * @category Util
  16047. * @param {number} [n=0] The index of the argument to return.
  16048. * @returns {Function} Returns the new pass-thru function.
  16049. * @example
  16050. *
  16051. * var func = _.nthArg(1);
  16052. * func('a', 'b', 'c', 'd');
  16053. * // => 'b'
  16054. *
  16055. * var func = _.nthArg(-2);
  16056. * func('a', 'b', 'c', 'd');
  16057. * // => 'c'
  16058. */
  16059. function nthArg(n) {
  16060. n = toInteger(n);
  16061. return baseRest(function(args) {
  16062. return baseNth(args, n);
  16063. });
  16064. }
  16065. /**
  16066. * Creates a function that invokes `iteratees` with the arguments it receives
  16067. * and returns their results.
  16068. *
  16069. * @static
  16070. * @memberOf _
  16071. * @since 4.0.0
  16072. * @category Util
  16073. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16074. * The iteratees to invoke.
  16075. * @returns {Function} Returns the new function.
  16076. * @example
  16077. *
  16078. * var func = _.over([Math.max, Math.min]);
  16079. *
  16080. * func(1, 2, 3, 4);
  16081. * // => [4, 1]
  16082. */
  16083. var over = createOver(arrayMap);
  16084. /**
  16085. * Creates a function that checks if **all** of the `predicates` return
  16086. * truthy when invoked with the arguments it receives.
  16087. *
  16088. * Following shorthands are possible for providing predicates.
  16089. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16090. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16091. *
  16092. * @static
  16093. * @memberOf _
  16094. * @since 4.0.0
  16095. * @category Util
  16096. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16097. * The predicates to check.
  16098. * @returns {Function} Returns the new function.
  16099. * @example
  16100. *
  16101. * var func = _.overEvery([Boolean, isFinite]);
  16102. *
  16103. * func('1');
  16104. * // => true
  16105. *
  16106. * func(null);
  16107. * // => false
  16108. *
  16109. * func(NaN);
  16110. * // => false
  16111. */
  16112. var overEvery = createOver(arrayEvery);
  16113. /**
  16114. * Creates a function that checks if **any** of the `predicates` return
  16115. * truthy when invoked with the arguments it receives.
  16116. *
  16117. * Following shorthands are possible for providing predicates.
  16118. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16119. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16120. *
  16121. * @static
  16122. * @memberOf _
  16123. * @since 4.0.0
  16124. * @category Util
  16125. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16126. * The predicates to check.
  16127. * @returns {Function} Returns the new function.
  16128. * @example
  16129. *
  16130. * var func = _.overSome([Boolean, isFinite]);
  16131. *
  16132. * func('1');
  16133. * // => true
  16134. *
  16135. * func(null);
  16136. * // => true
  16137. *
  16138. * func(NaN);
  16139. * // => false
  16140. *
  16141. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16142. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16143. */
  16144. var overSome = createOver(arraySome);
  16145. /**
  16146. * Creates a function that returns the value at `path` of a given object.
  16147. *
  16148. * @static
  16149. * @memberOf _
  16150. * @since 2.4.0
  16151. * @category Util
  16152. * @param {Array|string} path The path of the property to get.
  16153. * @returns {Function} Returns the new accessor function.
  16154. * @example
  16155. *
  16156. * var objects = [
  16157. * { 'a': { 'b': 2 } },
  16158. * { 'a': { 'b': 1 } }
  16159. * ];
  16160. *
  16161. * _.map(objects, _.property('a.b'));
  16162. * // => [2, 1]
  16163. *
  16164. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16165. * // => [1, 2]
  16166. */
  16167. function property(path) {
  16168. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16169. }
  16170. /**
  16171. * The opposite of `_.property`; this method creates a function that returns
  16172. * the value at a given path of `object`.
  16173. *
  16174. * @static
  16175. * @memberOf _
  16176. * @since 3.0.0
  16177. * @category Util
  16178. * @param {Object} object The object to query.
  16179. * @returns {Function} Returns the new accessor function.
  16180. * @example
  16181. *
  16182. * var array = [0, 1, 2],
  16183. * object = { 'a': array, 'b': array, 'c': array };
  16184. *
  16185. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16186. * // => [2, 0]
  16187. *
  16188. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16189. * // => [2, 0]
  16190. */
  16191. function propertyOf(object) {
  16192. return function(path) {
  16193. return object == null ? undefined : baseGet(object, path);
  16194. };
  16195. }
  16196. /**
  16197. * Creates an array of numbers (positive and/or negative) progressing from
  16198. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16199. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16200. * it's set to `start` with `start` then set to `0`.
  16201. *
  16202. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16203. * floating-point values which can produce unexpected results.
  16204. *
  16205. * @static
  16206. * @since 0.1.0
  16207. * @memberOf _
  16208. * @category Util
  16209. * @param {number} [start=0] The start of the range.
  16210. * @param {number} end The end of the range.
  16211. * @param {number} [step=1] The value to increment or decrement by.
  16212. * @returns {Array} Returns the range of numbers.
  16213. * @see _.inRange, _.rangeRight
  16214. * @example
  16215. *
  16216. * _.range(4);
  16217. * // => [0, 1, 2, 3]
  16218. *
  16219. * _.range(-4);
  16220. * // => [0, -1, -2, -3]
  16221. *
  16222. * _.range(1, 5);
  16223. * // => [1, 2, 3, 4]
  16224. *
  16225. * _.range(0, 20, 5);
  16226. * // => [0, 5, 10, 15]
  16227. *
  16228. * _.range(0, -4, -1);
  16229. * // => [0, -1, -2, -3]
  16230. *
  16231. * _.range(1, 4, 0);
  16232. * // => [1, 1, 1]
  16233. *
  16234. * _.range(0);
  16235. * // => []
  16236. */
  16237. var range = createRange();
  16238. /**
  16239. * This method is like `_.range` except that it populates values in
  16240. * descending order.
  16241. *
  16242. * @static
  16243. * @memberOf _
  16244. * @since 4.0.0
  16245. * @category Util
  16246. * @param {number} [start=0] The start of the range.
  16247. * @param {number} end The end of the range.
  16248. * @param {number} [step=1] The value to increment or decrement by.
  16249. * @returns {Array} Returns the range of numbers.
  16250. * @see _.inRange, _.range
  16251. * @example
  16252. *
  16253. * _.rangeRight(4);
  16254. * // => [3, 2, 1, 0]
  16255. *
  16256. * _.rangeRight(-4);
  16257. * // => [-3, -2, -1, 0]
  16258. *
  16259. * _.rangeRight(1, 5);
  16260. * // => [4, 3, 2, 1]
  16261. *
  16262. * _.rangeRight(0, 20, 5);
  16263. * // => [15, 10, 5, 0]
  16264. *
  16265. * _.rangeRight(0, -4, -1);
  16266. * // => [-3, -2, -1, 0]
  16267. *
  16268. * _.rangeRight(1, 4, 0);
  16269. * // => [1, 1, 1]
  16270. *
  16271. * _.rangeRight(0);
  16272. * // => []
  16273. */
  16274. var rangeRight = createRange(true);
  16275. /**
  16276. * This method returns a new empty array.
  16277. *
  16278. * @static
  16279. * @memberOf _
  16280. * @since 4.13.0
  16281. * @category Util
  16282. * @returns {Array} Returns the new empty array.
  16283. * @example
  16284. *
  16285. * var arrays = _.times(2, _.stubArray);
  16286. *
  16287. * console.log(arrays);
  16288. * // => [[], []]
  16289. *
  16290. * console.log(arrays[0] === arrays[1]);
  16291. * // => false
  16292. */
  16293. function stubArray() {
  16294. return [];
  16295. }
  16296. /**
  16297. * This method returns `false`.
  16298. *
  16299. * @static
  16300. * @memberOf _
  16301. * @since 4.13.0
  16302. * @category Util
  16303. * @returns {boolean} Returns `false`.
  16304. * @example
  16305. *
  16306. * _.times(2, _.stubFalse);
  16307. * // => [false, false]
  16308. */
  16309. function stubFalse() {
  16310. return false;
  16311. }
  16312. /**
  16313. * This method returns a new empty object.
  16314. *
  16315. * @static
  16316. * @memberOf _
  16317. * @since 4.13.0
  16318. * @category Util
  16319. * @returns {Object} Returns the new empty object.
  16320. * @example
  16321. *
  16322. * var objects = _.times(2, _.stubObject);
  16323. *
  16324. * console.log(objects);
  16325. * // => [{}, {}]
  16326. *
  16327. * console.log(objects[0] === objects[1]);
  16328. * // => false
  16329. */
  16330. function stubObject() {
  16331. return {};
  16332. }
  16333. /**
  16334. * This method returns an empty string.
  16335. *
  16336. * @static
  16337. * @memberOf _
  16338. * @since 4.13.0
  16339. * @category Util
  16340. * @returns {string} Returns the empty string.
  16341. * @example
  16342. *
  16343. * _.times(2, _.stubString);
  16344. * // => ['', '']
  16345. */
  16346. function stubString() {
  16347. return '';
  16348. }
  16349. /**
  16350. * This method returns `true`.
  16351. *
  16352. * @static
  16353. * @memberOf _
  16354. * @since 4.13.0
  16355. * @category Util
  16356. * @returns {boolean} Returns `true`.
  16357. * @example
  16358. *
  16359. * _.times(2, _.stubTrue);
  16360. * // => [true, true]
  16361. */
  16362. function stubTrue() {
  16363. return true;
  16364. }
  16365. /**
  16366. * Invokes the iteratee `n` times, returning an array of the results of
  16367. * each invocation. The iteratee is invoked with one argument; (index).
  16368. *
  16369. * @static
  16370. * @since 0.1.0
  16371. * @memberOf _
  16372. * @category Util
  16373. * @param {number} n The number of times to invoke `iteratee`.
  16374. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16375. * @returns {Array} Returns the array of results.
  16376. * @example
  16377. *
  16378. * _.times(3, String);
  16379. * // => ['0', '1', '2']
  16380. *
  16381. * _.times(4, _.constant(0));
  16382. * // => [0, 0, 0, 0]
  16383. */
  16384. function times(n, iteratee) {
  16385. n = toInteger(n);
  16386. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16387. return [];
  16388. }
  16389. var index = MAX_ARRAY_LENGTH,
  16390. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16391. iteratee = getIteratee(iteratee);
  16392. n -= MAX_ARRAY_LENGTH;
  16393. var result = baseTimes(length, iteratee);
  16394. while (++index < n) {
  16395. iteratee(index);
  16396. }
  16397. return result;
  16398. }
  16399. /**
  16400. * Converts `value` to a property path array.
  16401. *
  16402. * @static
  16403. * @memberOf _
  16404. * @since 4.0.0
  16405. * @category Util
  16406. * @param {*} value The value to convert.
  16407. * @returns {Array} Returns the new property path array.
  16408. * @example
  16409. *
  16410. * _.toPath('a.b.c');
  16411. * // => ['a', 'b', 'c']
  16412. *
  16413. * _.toPath('a[0].b.c');
  16414. * // => ['a', '0', 'b', 'c']
  16415. */
  16416. function toPath(value) {
  16417. if (isArray(value)) {
  16418. return arrayMap(value, toKey);
  16419. }
  16420. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16421. }
  16422. /**
  16423. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16424. *
  16425. * @static
  16426. * @since 0.1.0
  16427. * @memberOf _
  16428. * @category Util
  16429. * @param {string} [prefix=''] The value to prefix the ID with.
  16430. * @returns {string} Returns the unique ID.
  16431. * @example
  16432. *
  16433. * _.uniqueId('contact_');
  16434. * // => 'contact_104'
  16435. *
  16436. * _.uniqueId();
  16437. * // => '105'
  16438. */
  16439. function uniqueId(prefix) {
  16440. var id = ++idCounter;
  16441. return toString(prefix) + id;
  16442. }
  16443. /*------------------------------------------------------------------------*/
  16444. /**
  16445. * Adds two numbers.
  16446. *
  16447. * @static
  16448. * @memberOf _
  16449. * @since 3.4.0
  16450. * @category Math
  16451. * @param {number} augend The first number in an addition.
  16452. * @param {number} addend The second number in an addition.
  16453. * @returns {number} Returns the total.
  16454. * @example
  16455. *
  16456. * _.add(6, 4);
  16457. * // => 10
  16458. */
  16459. var add = createMathOperation(function(augend, addend) {
  16460. return augend + addend;
  16461. }, 0);
  16462. /**
  16463. * Computes `number` rounded up to `precision`.
  16464. *
  16465. * @static
  16466. * @memberOf _
  16467. * @since 3.10.0
  16468. * @category Math
  16469. * @param {number} number The number to round up.
  16470. * @param {number} [precision=0] The precision to round up to.
  16471. * @returns {number} Returns the rounded up number.
  16472. * @example
  16473. *
  16474. * _.ceil(4.006);
  16475. * // => 5
  16476. *
  16477. * _.ceil(6.004, 2);
  16478. * // => 6.01
  16479. *
  16480. * _.ceil(6040, -2);
  16481. * // => 6100
  16482. */
  16483. var ceil = createRound('ceil');
  16484. /**
  16485. * Divide two numbers.
  16486. *
  16487. * @static
  16488. * @memberOf _
  16489. * @since 4.7.0
  16490. * @category Math
  16491. * @param {number} dividend The first number in a division.
  16492. * @param {number} divisor The second number in a division.
  16493. * @returns {number} Returns the quotient.
  16494. * @example
  16495. *
  16496. * _.divide(6, 4);
  16497. * // => 1.5
  16498. */
  16499. var divide = createMathOperation(function(dividend, divisor) {
  16500. return dividend / divisor;
  16501. }, 1);
  16502. /**
  16503. * Computes `number` rounded down to `precision`.
  16504. *
  16505. * @static
  16506. * @memberOf _
  16507. * @since 3.10.0
  16508. * @category Math
  16509. * @param {number} number The number to round down.
  16510. * @param {number} [precision=0] The precision to round down to.
  16511. * @returns {number} Returns the rounded down number.
  16512. * @example
  16513. *
  16514. * _.floor(4.006);
  16515. * // => 4
  16516. *
  16517. * _.floor(0.046, 2);
  16518. * // => 0.04
  16519. *
  16520. * _.floor(4060, -2);
  16521. * // => 4000
  16522. */
  16523. var floor = createRound('floor');
  16524. /**
  16525. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16526. * `undefined` is returned.
  16527. *
  16528. * @static
  16529. * @since 0.1.0
  16530. * @memberOf _
  16531. * @category Math
  16532. * @param {Array} array The array to iterate over.
  16533. * @returns {*} Returns the maximum value.
  16534. * @example
  16535. *
  16536. * _.max([4, 2, 8, 6]);
  16537. * // => 8
  16538. *
  16539. * _.max([]);
  16540. * // => undefined
  16541. */
  16542. function max(array) {
  16543. return (array && array.length)
  16544. ? baseExtremum(array, identity, baseGt)
  16545. : undefined;
  16546. }
  16547. /**
  16548. * This method is like `_.max` except that it accepts `iteratee` which is
  16549. * invoked for each element in `array` to generate the criterion by which
  16550. * the value is ranked. The iteratee is invoked with one argument: (value).
  16551. *
  16552. * @static
  16553. * @memberOf _
  16554. * @since 4.0.0
  16555. * @category Math
  16556. * @param {Array} array The array to iterate over.
  16557. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16558. * @returns {*} Returns the maximum value.
  16559. * @example
  16560. *
  16561. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16562. *
  16563. * _.maxBy(objects, function(o) { return o.n; });
  16564. * // => { 'n': 2 }
  16565. *
  16566. * // The `_.property` iteratee shorthand.
  16567. * _.maxBy(objects, 'n');
  16568. * // => { 'n': 2 }
  16569. */
  16570. function maxBy(array, iteratee) {
  16571. return (array && array.length)
  16572. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16573. : undefined;
  16574. }
  16575. /**
  16576. * Computes the mean of the values in `array`.
  16577. *
  16578. * @static
  16579. * @memberOf _
  16580. * @since 4.0.0
  16581. * @category Math
  16582. * @param {Array} array The array to iterate over.
  16583. * @returns {number} Returns the mean.
  16584. * @example
  16585. *
  16586. * _.mean([4, 2, 8, 6]);
  16587. * // => 5
  16588. */
  16589. function mean(array) {
  16590. return baseMean(array, identity);
  16591. }
  16592. /**
  16593. * This method is like `_.mean` except that it accepts `iteratee` which is
  16594. * invoked for each element in `array` to generate the value to be averaged.
  16595. * The iteratee is invoked with one argument: (value).
  16596. *
  16597. * @static
  16598. * @memberOf _
  16599. * @since 4.7.0
  16600. * @category Math
  16601. * @param {Array} array The array to iterate over.
  16602. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16603. * @returns {number} Returns the mean.
  16604. * @example
  16605. *
  16606. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16607. *
  16608. * _.meanBy(objects, function(o) { return o.n; });
  16609. * // => 5
  16610. *
  16611. * // The `_.property` iteratee shorthand.
  16612. * _.meanBy(objects, 'n');
  16613. * // => 5
  16614. */
  16615. function meanBy(array, iteratee) {
  16616. return baseMean(array, getIteratee(iteratee, 2));
  16617. }
  16618. /**
  16619. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16620. * `undefined` is returned.
  16621. *
  16622. * @static
  16623. * @since 0.1.0
  16624. * @memberOf _
  16625. * @category Math
  16626. * @param {Array} array The array to iterate over.
  16627. * @returns {*} Returns the minimum value.
  16628. * @example
  16629. *
  16630. * _.min([4, 2, 8, 6]);
  16631. * // => 2
  16632. *
  16633. * _.min([]);
  16634. * // => undefined
  16635. */
  16636. function min(array) {
  16637. return (array && array.length)
  16638. ? baseExtremum(array, identity, baseLt)
  16639. : undefined;
  16640. }
  16641. /**
  16642. * This method is like `_.min` except that it accepts `iteratee` which is
  16643. * invoked for each element in `array` to generate the criterion by which
  16644. * the value is ranked. The iteratee is invoked with one argument: (value).
  16645. *
  16646. * @static
  16647. * @memberOf _
  16648. * @since 4.0.0
  16649. * @category Math
  16650. * @param {Array} array The array to iterate over.
  16651. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16652. * @returns {*} Returns the minimum value.
  16653. * @example
  16654. *
  16655. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16656. *
  16657. * _.minBy(objects, function(o) { return o.n; });
  16658. * // => { 'n': 1 }
  16659. *
  16660. * // The `_.property` iteratee shorthand.
  16661. * _.minBy(objects, 'n');
  16662. * // => { 'n': 1 }
  16663. */
  16664. function minBy(array, iteratee) {
  16665. return (array && array.length)
  16666. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16667. : undefined;
  16668. }
  16669. /**
  16670. * Multiply two numbers.
  16671. *
  16672. * @static
  16673. * @memberOf _
  16674. * @since 4.7.0
  16675. * @category Math
  16676. * @param {number} multiplier The first number in a multiplication.
  16677. * @param {number} multiplicand The second number in a multiplication.
  16678. * @returns {number} Returns the product.
  16679. * @example
  16680. *
  16681. * _.multiply(6, 4);
  16682. * // => 24
  16683. */
  16684. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16685. return multiplier * multiplicand;
  16686. }, 1);
  16687. /**
  16688. * Computes `number` rounded to `precision`.
  16689. *
  16690. * @static
  16691. * @memberOf _
  16692. * @since 3.10.0
  16693. * @category Math
  16694. * @param {number} number The number to round.
  16695. * @param {number} [precision=0] The precision to round to.
  16696. * @returns {number} Returns the rounded number.
  16697. * @example
  16698. *
  16699. * _.round(4.006);
  16700. * // => 4
  16701. *
  16702. * _.round(4.006, 2);
  16703. * // => 4.01
  16704. *
  16705. * _.round(4060, -2);
  16706. * // => 4100
  16707. */
  16708. var round = createRound('round');
  16709. /**
  16710. * Subtract two numbers.
  16711. *
  16712. * @static
  16713. * @memberOf _
  16714. * @since 4.0.0
  16715. * @category Math
  16716. * @param {number} minuend The first number in a subtraction.
  16717. * @param {number} subtrahend The second number in a subtraction.
  16718. * @returns {number} Returns the difference.
  16719. * @example
  16720. *
  16721. * _.subtract(6, 4);
  16722. * // => 2
  16723. */
  16724. var subtract = createMathOperation(function(minuend, subtrahend) {
  16725. return minuend - subtrahend;
  16726. }, 0);
  16727. /**
  16728. * Computes the sum of the values in `array`.
  16729. *
  16730. * @static
  16731. * @memberOf _
  16732. * @since 3.4.0
  16733. * @category Math
  16734. * @param {Array} array The array to iterate over.
  16735. * @returns {number} Returns the sum.
  16736. * @example
  16737. *
  16738. * _.sum([4, 2, 8, 6]);
  16739. * // => 20
  16740. */
  16741. function sum(array) {
  16742. return (array && array.length)
  16743. ? baseSum(array, identity)
  16744. : 0;
  16745. }
  16746. /**
  16747. * This method is like `_.sum` except that it accepts `iteratee` which is
  16748. * invoked for each element in `array` to generate the value to be summed.
  16749. * The iteratee is invoked with one argument: (value).
  16750. *
  16751. * @static
  16752. * @memberOf _
  16753. * @since 4.0.0
  16754. * @category Math
  16755. * @param {Array} array The array to iterate over.
  16756. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16757. * @returns {number} Returns the sum.
  16758. * @example
  16759. *
  16760. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16761. *
  16762. * _.sumBy(objects, function(o) { return o.n; });
  16763. * // => 20
  16764. *
  16765. * // The `_.property` iteratee shorthand.
  16766. * _.sumBy(objects, 'n');
  16767. * // => 20
  16768. */
  16769. function sumBy(array, iteratee) {
  16770. return (array && array.length)
  16771. ? baseSum(array, getIteratee(iteratee, 2))
  16772. : 0;
  16773. }
  16774. /*------------------------------------------------------------------------*/
  16775. // Add methods that return wrapped values in chain sequences.
  16776. lodash.after = after;
  16777. lodash.ary = ary;
  16778. lodash.assign = assign;
  16779. lodash.assignIn = assignIn;
  16780. lodash.assignInWith = assignInWith;
  16781. lodash.assignWith = assignWith;
  16782. lodash.at = at;
  16783. lodash.before = before;
  16784. lodash.bind = bind;
  16785. lodash.bindAll = bindAll;
  16786. lodash.bindKey = bindKey;
  16787. lodash.castArray = castArray;
  16788. lodash.chain = chain;
  16789. lodash.chunk = chunk;
  16790. lodash.compact = compact;
  16791. lodash.concat = concat;
  16792. lodash.cond = cond;
  16793. lodash.conforms = conforms;
  16794. lodash.constant = constant;
  16795. lodash.countBy = countBy;
  16796. lodash.create = create;
  16797. lodash.curry = curry;
  16798. lodash.curryRight = curryRight;
  16799. lodash.debounce = debounce;
  16800. lodash.defaults = defaults;
  16801. lodash.defaultsDeep = defaultsDeep;
  16802. lodash.defer = defer;
  16803. lodash.delay = delay;
  16804. lodash.difference = difference;
  16805. lodash.differenceBy = differenceBy;
  16806. lodash.differenceWith = differenceWith;
  16807. lodash.drop = drop;
  16808. lodash.dropRight = dropRight;
  16809. lodash.dropRightWhile = dropRightWhile;
  16810. lodash.dropWhile = dropWhile;
  16811. lodash.fill = fill;
  16812. lodash.filter = filter;
  16813. lodash.flatMap = flatMap;
  16814. lodash.flatMapDeep = flatMapDeep;
  16815. lodash.flatMapDepth = flatMapDepth;
  16816. lodash.flatten = flatten;
  16817. lodash.flattenDeep = flattenDeep;
  16818. lodash.flattenDepth = flattenDepth;
  16819. lodash.flip = flip;
  16820. lodash.flow = flow;
  16821. lodash.flowRight = flowRight;
  16822. lodash.fromPairs = fromPairs;
  16823. lodash.functions = functions;
  16824. lodash.functionsIn = functionsIn;
  16825. lodash.groupBy = groupBy;
  16826. lodash.initial = initial;
  16827. lodash.intersection = intersection;
  16828. lodash.intersectionBy = intersectionBy;
  16829. lodash.intersectionWith = intersectionWith;
  16830. lodash.invert = invert;
  16831. lodash.invertBy = invertBy;
  16832. lodash.invokeMap = invokeMap;
  16833. lodash.iteratee = iteratee;
  16834. lodash.keyBy = keyBy;
  16835. lodash.keys = keys;
  16836. lodash.keysIn = keysIn;
  16837. lodash.map = map;
  16838. lodash.mapKeys = mapKeys;
  16839. lodash.mapValues = mapValues;
  16840. lodash.matches = matches;
  16841. lodash.matchesProperty = matchesProperty;
  16842. lodash.memoize = memoize;
  16843. lodash.merge = merge;
  16844. lodash.mergeWith = mergeWith;
  16845. lodash.method = method;
  16846. lodash.methodOf = methodOf;
  16847. lodash.mixin = mixin;
  16848. lodash.negate = negate;
  16849. lodash.nthArg = nthArg;
  16850. lodash.omit = omit;
  16851. lodash.omitBy = omitBy;
  16852. lodash.once = once;
  16853. lodash.orderBy = orderBy;
  16854. lodash.over = over;
  16855. lodash.overArgs = overArgs;
  16856. lodash.overEvery = overEvery;
  16857. lodash.overSome = overSome;
  16858. lodash.partial = partial;
  16859. lodash.partialRight = partialRight;
  16860. lodash.partition = partition;
  16861. lodash.pick = pick;
  16862. lodash.pickBy = pickBy;
  16863. lodash.property = property;
  16864. lodash.propertyOf = propertyOf;
  16865. lodash.pull = pull;
  16866. lodash.pullAll = pullAll;
  16867. lodash.pullAllBy = pullAllBy;
  16868. lodash.pullAllWith = pullAllWith;
  16869. lodash.pullAt = pullAt;
  16870. lodash.range = range;
  16871. lodash.rangeRight = rangeRight;
  16872. lodash.rearg = rearg;
  16873. lodash.reject = reject;
  16874. lodash.remove = remove;
  16875. lodash.rest = rest;
  16876. lodash.reverse = reverse;
  16877. lodash.sampleSize = sampleSize;
  16878. lodash.set = set;
  16879. lodash.setWith = setWith;
  16880. lodash.shuffle = shuffle;
  16881. lodash.slice = slice;
  16882. lodash.sortBy = sortBy;
  16883. lodash.sortedUniq = sortedUniq;
  16884. lodash.sortedUniqBy = sortedUniqBy;
  16885. lodash.split = split;
  16886. lodash.spread = spread;
  16887. lodash.tail = tail;
  16888. lodash.take = take;
  16889. lodash.takeRight = takeRight;
  16890. lodash.takeRightWhile = takeRightWhile;
  16891. lodash.takeWhile = takeWhile;
  16892. lodash.tap = tap;
  16893. lodash.throttle = throttle;
  16894. lodash.thru = thru;
  16895. lodash.toArray = toArray;
  16896. lodash.toPairs = toPairs;
  16897. lodash.toPairsIn = toPairsIn;
  16898. lodash.toPath = toPath;
  16899. lodash.toPlainObject = toPlainObject;
  16900. lodash.transform = transform;
  16901. lodash.unary = unary;
  16902. lodash.union = union;
  16903. lodash.unionBy = unionBy;
  16904. lodash.unionWith = unionWith;
  16905. lodash.uniq = uniq;
  16906. lodash.uniqBy = uniqBy;
  16907. lodash.uniqWith = uniqWith;
  16908. lodash.unset = unset;
  16909. lodash.unzip = unzip;
  16910. lodash.unzipWith = unzipWith;
  16911. lodash.update = update;
  16912. lodash.updateWith = updateWith;
  16913. lodash.values = values;
  16914. lodash.valuesIn = valuesIn;
  16915. lodash.without = without;
  16916. lodash.words = words;
  16917. lodash.wrap = wrap;
  16918. lodash.xor = xor;
  16919. lodash.xorBy = xorBy;
  16920. lodash.xorWith = xorWith;
  16921. lodash.zip = zip;
  16922. lodash.zipObject = zipObject;
  16923. lodash.zipObjectDeep = zipObjectDeep;
  16924. lodash.zipWith = zipWith;
  16925. // Add aliases.
  16926. lodash.entries = toPairs;
  16927. lodash.entriesIn = toPairsIn;
  16928. lodash.extend = assignIn;
  16929. lodash.extendWith = assignInWith;
  16930. // Add methods to `lodash.prototype`.
  16931. mixin(lodash, lodash);
  16932. /*------------------------------------------------------------------------*/
  16933. // Add methods that return unwrapped values in chain sequences.
  16934. lodash.add = add;
  16935. lodash.attempt = attempt;
  16936. lodash.camelCase = camelCase;
  16937. lodash.capitalize = capitalize;
  16938. lodash.ceil = ceil;
  16939. lodash.clamp = clamp;
  16940. lodash.clone = clone;
  16941. lodash.cloneDeep = cloneDeep;
  16942. lodash.cloneDeepWith = cloneDeepWith;
  16943. lodash.cloneWith = cloneWith;
  16944. lodash.conformsTo = conformsTo;
  16945. lodash.deburr = deburr;
  16946. lodash.defaultTo = defaultTo;
  16947. lodash.divide = divide;
  16948. lodash.endsWith = endsWith;
  16949. lodash.eq = eq;
  16950. lodash.escape = escape;
  16951. lodash.escapeRegExp = escapeRegExp;
  16952. lodash.every = every;
  16953. lodash.find = find;
  16954. lodash.findIndex = findIndex;
  16955. lodash.findKey = findKey;
  16956. lodash.findLast = findLast;
  16957. lodash.findLastIndex = findLastIndex;
  16958. lodash.findLastKey = findLastKey;
  16959. lodash.floor = floor;
  16960. lodash.forEach = forEach;
  16961. lodash.forEachRight = forEachRight;
  16962. lodash.forIn = forIn;
  16963. lodash.forInRight = forInRight;
  16964. lodash.forOwn = forOwn;
  16965. lodash.forOwnRight = forOwnRight;
  16966. lodash.get = get;
  16967. lodash.gt = gt;
  16968. lodash.gte = gte;
  16969. lodash.has = has;
  16970. lodash.hasIn = hasIn;
  16971. lodash.head = head;
  16972. lodash.identity = identity;
  16973. lodash.includes = includes;
  16974. lodash.indexOf = indexOf;
  16975. lodash.inRange = inRange;
  16976. lodash.invoke = invoke;
  16977. lodash.isArguments = isArguments;
  16978. lodash.isArray = isArray;
  16979. lodash.isArrayBuffer = isArrayBuffer;
  16980. lodash.isArrayLike = isArrayLike;
  16981. lodash.isArrayLikeObject = isArrayLikeObject;
  16982. lodash.isBoolean = isBoolean;
  16983. lodash.isBuffer = isBuffer;
  16984. lodash.isDate = isDate;
  16985. lodash.isElement = isElement;
  16986. lodash.isEmpty = isEmpty;
  16987. lodash.isEqual = isEqual;
  16988. lodash.isEqualWith = isEqualWith;
  16989. lodash.isError = isError;
  16990. lodash.isFinite = isFinite;
  16991. lodash.isFunction = isFunction;
  16992. lodash.isInteger = isInteger;
  16993. lodash.isLength = isLength;
  16994. lodash.isMap = isMap;
  16995. lodash.isMatch = isMatch;
  16996. lodash.isMatchWith = isMatchWith;
  16997. lodash.isNaN = isNaN;
  16998. lodash.isNative = isNative;
  16999. lodash.isNil = isNil;
  17000. lodash.isNull = isNull;
  17001. lodash.isNumber = isNumber;
  17002. lodash.isObject = isObject;
  17003. lodash.isObjectLike = isObjectLike;
  17004. lodash.isPlainObject = isPlainObject;
  17005. lodash.isRegExp = isRegExp;
  17006. lodash.isSafeInteger = isSafeInteger;
  17007. lodash.isSet = isSet;
  17008. lodash.isString = isString;
  17009. lodash.isSymbol = isSymbol;
  17010. lodash.isTypedArray = isTypedArray;
  17011. lodash.isUndefined = isUndefined;
  17012. lodash.isWeakMap = isWeakMap;
  17013. lodash.isWeakSet = isWeakSet;
  17014. lodash.join = join;
  17015. lodash.kebabCase = kebabCase;
  17016. lodash.last = last;
  17017. lodash.lastIndexOf = lastIndexOf;
  17018. lodash.lowerCase = lowerCase;
  17019. lodash.lowerFirst = lowerFirst;
  17020. lodash.lt = lt;
  17021. lodash.lte = lte;
  17022. lodash.max = max;
  17023. lodash.maxBy = maxBy;
  17024. lodash.mean = mean;
  17025. lodash.meanBy = meanBy;
  17026. lodash.min = min;
  17027. lodash.minBy = minBy;
  17028. lodash.stubArray = stubArray;
  17029. lodash.stubFalse = stubFalse;
  17030. lodash.stubObject = stubObject;
  17031. lodash.stubString = stubString;
  17032. lodash.stubTrue = stubTrue;
  17033. lodash.multiply = multiply;
  17034. lodash.nth = nth;
  17035. lodash.noConflict = noConflict;
  17036. lodash.noop = noop;
  17037. lodash.now = now;
  17038. lodash.pad = pad;
  17039. lodash.padEnd = padEnd;
  17040. lodash.padStart = padStart;
  17041. lodash.parseInt = parseInt;
  17042. lodash.random = random;
  17043. lodash.reduce = reduce;
  17044. lodash.reduceRight = reduceRight;
  17045. lodash.repeat = repeat;
  17046. lodash.replace = replace;
  17047. lodash.result = result;
  17048. lodash.round = round;
  17049. lodash.runInContext = runInContext;
  17050. lodash.sample = sample;
  17051. lodash.size = size;
  17052. lodash.snakeCase = snakeCase;
  17053. lodash.some = some;
  17054. lodash.sortedIndex = sortedIndex;
  17055. lodash.sortedIndexBy = sortedIndexBy;
  17056. lodash.sortedIndexOf = sortedIndexOf;
  17057. lodash.sortedLastIndex = sortedLastIndex;
  17058. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17059. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17060. lodash.startCase = startCase;
  17061. lodash.startsWith = startsWith;
  17062. lodash.subtract = subtract;
  17063. lodash.sum = sum;
  17064. lodash.sumBy = sumBy;
  17065. lodash.template = template;
  17066. lodash.times = times;
  17067. lodash.toFinite = toFinite;
  17068. lodash.toInteger = toInteger;
  17069. lodash.toLength = toLength;
  17070. lodash.toLower = toLower;
  17071. lodash.toNumber = toNumber;
  17072. lodash.toSafeInteger = toSafeInteger;
  17073. lodash.toString = toString;
  17074. lodash.toUpper = toUpper;
  17075. lodash.trim = trim;
  17076. lodash.trimEnd = trimEnd;
  17077. lodash.trimStart = trimStart;
  17078. lodash.truncate = truncate;
  17079. lodash.unescape = unescape;
  17080. lodash.uniqueId = uniqueId;
  17081. lodash.upperCase = upperCase;
  17082. lodash.upperFirst = upperFirst;
  17083. // Add aliases.
  17084. lodash.each = forEach;
  17085. lodash.eachRight = forEachRight;
  17086. lodash.first = head;
  17087. mixin(lodash, (function() {
  17088. var source = {};
  17089. baseForOwn(lodash, function(func, methodName) {
  17090. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17091. source[methodName] = func;
  17092. }
  17093. });
  17094. return source;
  17095. }()), { 'chain': false });
  17096. /*------------------------------------------------------------------------*/
  17097. /**
  17098. * The semantic version number.
  17099. *
  17100. * @static
  17101. * @memberOf _
  17102. * @type {string}
  17103. */
  17104. lodash.VERSION = VERSION;
  17105. // Assign default placeholders.
  17106. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17107. lodash[methodName].placeholder = lodash;
  17108. });
  17109. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17110. arrayEach(['drop', 'take'], function(methodName, index) {
  17111. LazyWrapper.prototype[methodName] = function(n) {
  17112. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17113. var result = (this.__filtered__ && !index)
  17114. ? new LazyWrapper(this)
  17115. : this.clone();
  17116. if (result.__filtered__) {
  17117. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17118. } else {
  17119. result.__views__.push({
  17120. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17121. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17122. });
  17123. }
  17124. return result;
  17125. };
  17126. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17127. return this.reverse()[methodName](n).reverse();
  17128. };
  17129. });
  17130. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17131. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17132. var type = index + 1,
  17133. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17134. LazyWrapper.prototype[methodName] = function(iteratee) {
  17135. var result = this.clone();
  17136. result.__iteratees__.push({
  17137. 'iteratee': getIteratee(iteratee, 3),
  17138. 'type': type
  17139. });
  17140. result.__filtered__ = result.__filtered__ || isFilter;
  17141. return result;
  17142. };
  17143. });
  17144. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17145. arrayEach(['head', 'last'], function(methodName, index) {
  17146. var takeName = 'take' + (index ? 'Right' : '');
  17147. LazyWrapper.prototype[methodName] = function() {
  17148. return this[takeName](1).value()[0];
  17149. };
  17150. });
  17151. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17152. arrayEach(['initial', 'tail'], function(methodName, index) {
  17153. var dropName = 'drop' + (index ? '' : 'Right');
  17154. LazyWrapper.prototype[methodName] = function() {
  17155. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17156. };
  17157. });
  17158. LazyWrapper.prototype.compact = function() {
  17159. return this.filter(identity);
  17160. };
  17161. LazyWrapper.prototype.find = function(predicate) {
  17162. return this.filter(predicate).head();
  17163. };
  17164. LazyWrapper.prototype.findLast = function(predicate) {
  17165. return this.reverse().find(predicate);
  17166. };
  17167. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17168. if (typeof path == 'function') {
  17169. return new LazyWrapper(this);
  17170. }
  17171. return this.map(function(value) {
  17172. return baseInvoke(value, path, args);
  17173. });
  17174. });
  17175. LazyWrapper.prototype.reject = function(predicate) {
  17176. return this.filter(negate(getIteratee(predicate)));
  17177. };
  17178. LazyWrapper.prototype.slice = function(start, end) {
  17179. start = toInteger(start);
  17180. var result = this;
  17181. if (result.__filtered__ && (start > 0 || end < 0)) {
  17182. return new LazyWrapper(result);
  17183. }
  17184. if (start < 0) {
  17185. result = result.takeRight(-start);
  17186. } else if (start) {
  17187. result = result.drop(start);
  17188. }
  17189. if (end !== undefined) {
  17190. end = toInteger(end);
  17191. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17192. }
  17193. return result;
  17194. };
  17195. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17196. return this.reverse().takeWhile(predicate).reverse();
  17197. };
  17198. LazyWrapper.prototype.toArray = function() {
  17199. return this.take(MAX_ARRAY_LENGTH);
  17200. };
  17201. // Add `LazyWrapper` methods to `lodash.prototype`.
  17202. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17203. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17204. isTaker = /^(?:head|last)$/.test(methodName),
  17205. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17206. retUnwrapped = isTaker || /^find/.test(methodName);
  17207. if (!lodashFunc) {
  17208. return;
  17209. }
  17210. lodash.prototype[methodName] = function() {
  17211. var value = this.__wrapped__,
  17212. args = isTaker ? [1] : arguments,
  17213. isLazy = value instanceof LazyWrapper,
  17214. iteratee = args[0],
  17215. useLazy = isLazy || isArray(value);
  17216. var interceptor = function(value) {
  17217. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17218. return (isTaker && chainAll) ? result[0] : result;
  17219. };
  17220. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17221. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17222. isLazy = useLazy = false;
  17223. }
  17224. var chainAll = this.__chain__,
  17225. isHybrid = !!this.__actions__.length,
  17226. isUnwrapped = retUnwrapped && !chainAll,
  17227. onlyLazy = isLazy && !isHybrid;
  17228. if (!retUnwrapped && useLazy) {
  17229. value = onlyLazy ? value : new LazyWrapper(this);
  17230. var result = func.apply(value, args);
  17231. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17232. return new LodashWrapper(result, chainAll);
  17233. }
  17234. if (isUnwrapped && onlyLazy) {
  17235. return func.apply(this, args);
  17236. }
  17237. result = this.thru(interceptor);
  17238. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17239. };
  17240. });
  17241. // Add `Array` methods to `lodash.prototype`.
  17242. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17243. var func = arrayProto[methodName],
  17244. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17245. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17246. lodash.prototype[methodName] = function() {
  17247. var args = arguments;
  17248. if (retUnwrapped && !this.__chain__) {
  17249. var value = this.value();
  17250. return func.apply(isArray(value) ? value : [], args);
  17251. }
  17252. return this[chainName](function(value) {
  17253. return func.apply(isArray(value) ? value : [], args);
  17254. });
  17255. };
  17256. });
  17257. // Map minified method names to their real names.
  17258. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17259. var lodashFunc = lodash[methodName];
  17260. if (lodashFunc) {
  17261. var key = lodashFunc.name + '';
  17262. if (!hasOwnProperty.call(realNames, key)) {
  17263. realNames[key] = [];
  17264. }
  17265. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17266. }
  17267. });
  17268. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17269. 'name': 'wrapper',
  17270. 'func': undefined
  17271. }];
  17272. // Add methods to `LazyWrapper`.
  17273. LazyWrapper.prototype.clone = lazyClone;
  17274. LazyWrapper.prototype.reverse = lazyReverse;
  17275. LazyWrapper.prototype.value = lazyValue;
  17276. // Add chain sequence methods to the `lodash` wrapper.
  17277. lodash.prototype.at = wrapperAt;
  17278. lodash.prototype.chain = wrapperChain;
  17279. lodash.prototype.commit = wrapperCommit;
  17280. lodash.prototype.next = wrapperNext;
  17281. lodash.prototype.plant = wrapperPlant;
  17282. lodash.prototype.reverse = wrapperReverse;
  17283. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17284. // Add lazy aliases.
  17285. lodash.prototype.first = lodash.prototype.head;
  17286. if (symIterator) {
  17287. lodash.prototype[symIterator] = wrapperToIterator;
  17288. }
  17289. return lodash;
  17290. });
  17291. /*--------------------------------------------------------------------------*/
  17292. // Export lodash.
  17293. var _ = runInContext();
  17294. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17295. if (true) {
  17296. // Expose Lodash on the global object to prevent errors when Lodash is
  17297. // loaded by a script tag in the presence of an AMD loader.
  17298. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17299. // Use `_.noConflict` to remove Lodash from the global object.
  17300. root._ = _;
  17301. // Define as an anonymous module so, through path mapping, it can be
  17302. // referenced as the "underscore" module.
  17303. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17304. return _;
  17305. }).call(exports, __webpack_require__, exports, module),
  17306. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17307. }
  17308. // Check for `exports` after `define` in case a build optimizer adds it.
  17309. else {}
  17310. }.call(this));
  17311. /***/ }),
  17312. /***/ "./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":
  17313. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17314. !*** ./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 ***!
  17315. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17316. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17317. "use strict";
  17318. __webpack_require__.r(__webpack_exports__);
  17319. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17320. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17321. /* harmony export */ });
  17322. /* 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");
  17323. /* 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__);
  17324. /* 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");
  17325. var options = {};
  17326. options.insert = "head";
  17327. options.singleton = false;
  17328. 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);
  17329. /* 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 || {});
  17330. /***/ }),
  17331. /***/ "./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":
  17332. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17333. !*** ./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 ***!
  17334. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17335. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17336. "use strict";
  17337. __webpack_require__.r(__webpack_exports__);
  17338. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17339. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17340. /* harmony export */ });
  17341. /* 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");
  17342. /* 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__);
  17343. /* 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");
  17344. var options = {};
  17345. options.insert = "head";
  17346. options.singleton = false;
  17347. 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);
  17348. /* 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 || {});
  17349. /***/ }),
  17350. /***/ "./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":
  17351. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17352. !*** ./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 ***!
  17353. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17354. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17355. "use strict";
  17356. __webpack_require__.r(__webpack_exports__);
  17357. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17358. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17359. /* harmony export */ });
  17360. /* 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");
  17361. /* 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__);
  17362. /* 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");
  17363. var options = {};
  17364. options.insert = "head";
  17365. options.singleton = false;
  17366. 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);
  17367. /* 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 || {});
  17368. /***/ }),
  17369. /***/ "./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":
  17370. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17371. !*** ./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 ***!
  17372. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17373. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17374. "use strict";
  17375. __webpack_require__.r(__webpack_exports__);
  17376. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17377. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17378. /* harmony export */ });
  17379. /* 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");
  17380. /* 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__);
  17381. /* 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");
  17382. var options = {};
  17383. options.insert = "head";
  17384. options.singleton = false;
  17385. 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);
  17386. /* 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 || {});
  17387. /***/ }),
  17388. /***/ "./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":
  17389. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17390. !*** ./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 ***!
  17391. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17392. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17393. "use strict";
  17394. __webpack_require__.r(__webpack_exports__);
  17395. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17396. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17397. /* harmony export */ });
  17398. /* 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");
  17399. /* 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__);
  17400. /* 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");
  17401. var options = {};
  17402. options.insert = "head";
  17403. options.singleton = false;
  17404. 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);
  17405. /* 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 || {});
  17406. /***/ }),
  17407. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17408. /*!******************************************************!*\
  17409. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17410. \******************************************************/
  17411. /***/ ((__unused_webpack_module, exports) => {
  17412. "use strict";
  17413. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17414. // runtime helper for setting properties on components
  17415. // in a tree-shakable way
  17416. exports["default"] = (sfc, props) => {
  17417. const target = sfc.__vccOpts || sfc;
  17418. for (const [key, val] of props) {
  17419. target[key] = val;
  17420. }
  17421. return target;
  17422. };
  17423. /***/ }),
  17424. /***/ "./resources/js/components/AppButtonLink.vue":
  17425. /*!***************************************************!*\
  17426. !*** ./resources/js/components/AppButtonLink.vue ***!
  17427. \***************************************************/
  17428. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17429. "use strict";
  17430. __webpack_require__.r(__webpack_exports__);
  17431. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17432. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17433. /* harmony export */ });
  17434. /* 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");
  17435. /* 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");
  17436. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17437. ;
  17438. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17439. /* hot reload */
  17440. if (false) {}
  17441. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17442. /***/ }),
  17443. /***/ "./resources/js/components/AppFooter.vue":
  17444. /*!***********************************************!*\
  17445. !*** ./resources/js/components/AppFooter.vue ***!
  17446. \***********************************************/
  17447. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17448. "use strict";
  17449. __webpack_require__.r(__webpack_exports__);
  17450. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17451. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17452. /* harmony export */ });
  17453. /* 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");
  17454. /* 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");
  17455. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17456. const script = {}
  17457. ;
  17458. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17459. /* hot reload */
  17460. if (false) {}
  17461. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17462. /***/ }),
  17463. /***/ "./resources/js/components/AppMessage.vue":
  17464. /*!************************************************!*\
  17465. !*** ./resources/js/components/AppMessage.vue ***!
  17466. \************************************************/
  17467. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17468. "use strict";
  17469. __webpack_require__.r(__webpack_exports__);
  17470. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17471. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17472. /* harmony export */ });
  17473. /* 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");
  17474. /* 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");
  17475. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17476. ;
  17477. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17478. /* hot reload */
  17479. if (false) {}
  17480. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17481. /***/ }),
  17482. /***/ "./resources/js/components/AppPagination.vue":
  17483. /*!***************************************************!*\
  17484. !*** ./resources/js/components/AppPagination.vue ***!
  17485. \***************************************************/
  17486. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17487. "use strict";
  17488. __webpack_require__.r(__webpack_exports__);
  17489. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17490. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17491. /* harmony export */ });
  17492. /* 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");
  17493. /* 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");
  17494. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17495. ;
  17496. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17497. /* hot reload */
  17498. if (false) {}
  17499. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17500. /***/ }),
  17501. /***/ "./resources/js/components/AppSidebar.vue":
  17502. /*!************************************************!*\
  17503. !*** ./resources/js/components/AppSidebar.vue ***!
  17504. \************************************************/
  17505. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17506. "use strict";
  17507. __webpack_require__.r(__webpack_exports__);
  17508. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17509. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17510. /* harmony export */ });
  17511. /* 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");
  17512. /* 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");
  17513. /* 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");
  17514. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17515. ;
  17516. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17517. /* hot reload */
  17518. if (false) {}
  17519. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17520. /***/ }),
  17521. /***/ "./resources/js/components/AppSubSidebar.vue":
  17522. /*!***************************************************!*\
  17523. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17524. \***************************************************/
  17525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17526. "use strict";
  17527. __webpack_require__.r(__webpack_exports__);
  17528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17529. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17530. /* harmony export */ });
  17531. /* 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");
  17532. /* 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");
  17533. /* 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");
  17534. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17535. ;
  17536. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17537. /* hot reload */
  17538. if (false) {}
  17539. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17540. /***/ }),
  17541. /***/ "./resources/js/components/AppTopBar.vue":
  17542. /*!***********************************************!*\
  17543. !*** ./resources/js/components/AppTopBar.vue ***!
  17544. \***********************************************/
  17545. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17546. "use strict";
  17547. __webpack_require__.r(__webpack_exports__);
  17548. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17549. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17550. /* harmony export */ });
  17551. /* 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");
  17552. /* 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");
  17553. /* 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");
  17554. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17555. ;
  17556. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17557. /* hot reload */
  17558. if (false) {}
  17559. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17560. /***/ }),
  17561. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17562. /*!**************************************************!*\
  17563. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17564. \**************************************************/
  17565. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17566. "use strict";
  17567. __webpack_require__.r(__webpack_exports__);
  17568. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17569. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17570. /* harmony export */ });
  17571. /* 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");
  17572. /* 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");
  17573. /* 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");
  17574. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17575. ;
  17576. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17577. /* hot reload */
  17578. if (false) {}
  17579. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17580. /***/ }),
  17581. /***/ "./resources/js/pages/user/Index.vue":
  17582. /*!*******************************************!*\
  17583. !*** ./resources/js/pages/user/Index.vue ***!
  17584. \*******************************************/
  17585. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17586. "use strict";
  17587. __webpack_require__.r(__webpack_exports__);
  17588. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17589. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17590. /* harmony export */ });
  17591. /* harmony import */ var _Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=3aca4497 */ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497");
  17592. /* 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");
  17593. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17594. ;
  17595. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/user/Index.vue"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17601. /*!**************************************************************************************!*\
  17602. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17603. \**************************************************************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* 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"])
  17609. /* harmony export */ });
  17610. /* 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");
  17611. /***/ }),
  17612. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17613. /*!***********************************************************************************!*\
  17614. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17615. \***********************************************************************************/
  17616. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17617. "use strict";
  17618. __webpack_require__.r(__webpack_exports__);
  17619. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17620. /* 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"])
  17621. /* harmony export */ });
  17622. /* 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");
  17623. /***/ }),
  17624. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17625. /*!**************************************************************************************!*\
  17626. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17627. \**************************************************************************************/
  17628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17629. "use strict";
  17630. __webpack_require__.r(__webpack_exports__);
  17631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17632. /* 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"])
  17633. /* harmony export */ });
  17634. /* 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");
  17635. /***/ }),
  17636. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17637. /*!***********************************************************************************!*\
  17638. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17639. \***********************************************************************************/
  17640. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17641. "use strict";
  17642. __webpack_require__.r(__webpack_exports__);
  17643. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17644. /* 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"])
  17645. /* harmony export */ });
  17646. /* 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");
  17647. /***/ }),
  17648. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17649. /*!**************************************************************************************!*\
  17650. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17651. \**************************************************************************************/
  17652. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17653. "use strict";
  17654. __webpack_require__.r(__webpack_exports__);
  17655. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17656. /* 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"])
  17657. /* harmony export */ });
  17658. /* 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");
  17659. /***/ }),
  17660. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17661. /*!**********************************************************************************!*\
  17662. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17663. \**********************************************************************************/
  17664. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17665. "use strict";
  17666. __webpack_require__.r(__webpack_exports__);
  17667. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17668. /* 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"])
  17669. /* harmony export */ });
  17670. /* 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");
  17671. /***/ }),
  17672. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17673. /*!*************************************************************************************!*\
  17674. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17675. \*************************************************************************************/
  17676. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17677. "use strict";
  17678. __webpack_require__.r(__webpack_exports__);
  17679. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17680. /* 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"])
  17681. /* harmony export */ });
  17682. /* 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");
  17683. /***/ }),
  17684. /***/ "./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  17685. /*!******************************************************************************!*\
  17686. !*** ./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  17687. \******************************************************************************/
  17688. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17689. "use strict";
  17690. __webpack_require__.r(__webpack_exports__);
  17691. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17692. /* 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"])
  17693. /* harmony export */ });
  17694. /* 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");
  17695. /***/ }),
  17696. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17697. /*!*********************************************************************************!*\
  17698. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17699. \*********************************************************************************/
  17700. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17701. "use strict";
  17702. __webpack_require__.r(__webpack_exports__);
  17703. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17704. /* 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)
  17705. /* harmony export */ });
  17706. /* 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");
  17707. /***/ }),
  17708. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17709. /*!*****************************************************************************************!*\
  17710. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17711. \*****************************************************************************************/
  17712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17713. "use strict";
  17714. __webpack_require__.r(__webpack_exports__);
  17715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17716. /* 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)
  17717. /* harmony export */ });
  17718. /* 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");
  17719. /***/ }),
  17720. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17721. /*!******************************************************************************!*\
  17722. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17723. \******************************************************************************/
  17724. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17725. "use strict";
  17726. __webpack_require__.r(__webpack_exports__);
  17727. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17728. /* 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)
  17729. /* harmony export */ });
  17730. /* 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");
  17731. /***/ }),
  17732. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17733. /*!*********************************************************************************!*\
  17734. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17735. \*********************************************************************************/
  17736. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17737. "use strict";
  17738. __webpack_require__.r(__webpack_exports__);
  17739. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17740. /* 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)
  17741. /* harmony export */ });
  17742. /* 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");
  17743. /***/ }),
  17744. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17745. /*!******************************************************************************************!*\
  17746. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17747. \******************************************************************************************/
  17748. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17749. "use strict";
  17750. __webpack_require__.r(__webpack_exports__);
  17751. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17752. /* 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)
  17753. /* harmony export */ });
  17754. /* 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");
  17755. /***/ }),
  17756. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17757. /*!*********************************************************************************************!*\
  17758. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17759. \*********************************************************************************************/
  17760. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17761. "use strict";
  17762. __webpack_require__.r(__webpack_exports__);
  17763. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17764. /* 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)
  17765. /* harmony export */ });
  17766. /* 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");
  17767. /***/ }),
  17768. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17769. /*!*****************************************************************************************!*\
  17770. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17771. \*****************************************************************************************/
  17772. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17773. "use strict";
  17774. __webpack_require__.r(__webpack_exports__);
  17775. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17776. /* 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)
  17777. /* harmony export */ });
  17778. /* 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");
  17779. /***/ }),
  17780. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17781. /*!********************************************************************************************!*\
  17782. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17783. \********************************************************************************************/
  17784. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17785. "use strict";
  17786. __webpack_require__.r(__webpack_exports__);
  17787. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17788. /* 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)
  17789. /* harmony export */ });
  17790. /* 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");
  17791. /***/ }),
  17792. /***/ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  17793. /*!*************************************************************************!*\
  17794. !*** ./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  17795. \*************************************************************************/
  17796. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17797. "use strict";
  17798. __webpack_require__.r(__webpack_exports__);
  17799. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17800. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render)
  17801. /* harmony export */ });
  17802. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=3aca4497 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497");
  17803. /***/ }),
  17804. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17805. /*!********************************************************************************************************!*\
  17806. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17807. \********************************************************************************************************/
  17808. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17809. "use strict";
  17810. __webpack_require__.r(__webpack_exports__);
  17811. /* 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");
  17812. /***/ }),
  17813. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17814. /*!*********************************************************************************************************!*\
  17815. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17816. \*********************************************************************************************************/
  17817. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17818. "use strict";
  17819. __webpack_require__.r(__webpack_exports__);
  17820. /* 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");
  17821. /***/ }),
  17822. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17823. /*!************************************************************************************************************!*\
  17824. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17825. \************************************************************************************************************/
  17826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17827. "use strict";
  17828. __webpack_require__.r(__webpack_exports__);
  17829. /* 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");
  17830. /***/ }),
  17831. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17832. /*!********************************************************************************************************!*\
  17833. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17834. \********************************************************************************************************/
  17835. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17836. "use strict";
  17837. __webpack_require__.r(__webpack_exports__);
  17838. /* 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");
  17839. /***/ }),
  17840. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17841. /*!***********************************************************************************************************!*\
  17842. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17843. \***********************************************************************************************************/
  17844. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17845. "use strict";
  17846. __webpack_require__.r(__webpack_exports__);
  17847. /* 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");
  17848. /***/ })
  17849. }]);