resources_js_pages_Customers_Index_vue.js 694KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Customers_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: String,
  21. label: String,
  22. classButton: String
  23. },
  24. setup: function setup(__props, _ref) {
  25. var expose = _ref.expose;
  26. expose();
  27. var __returned__ = {
  28. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  29. };
  30. Object.defineProperty(__returned__, '__isScriptSetup', {
  31. enumerable: false,
  32. value: true
  33. });
  34. return __returned__;
  35. }
  36. });
  37. /***/ }),
  38. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  39. /*!***************************************************************************************************************************************************************************************************************!*\
  40. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  41. \***************************************************************************************************************************************************************************************************************/
  42. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  43. "use strict";
  44. __webpack_require__.r(__webpack_exports__);
  45. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  46. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  47. /* harmony export */ });
  48. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  49. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  50. __name: 'AppMessage',
  51. setup: function setup(__props, _ref) {
  52. var expose = _ref.expose;
  53. expose();
  54. var onClose = function onClose() {
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  56. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  58. };
  59. var __returned__ = {
  60. onClose: onClose,
  61. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  62. };
  63. Object.defineProperty(__returned__, '__isScriptSetup', {
  64. enumerable: false,
  65. value: true
  66. });
  67. return __returned__;
  68. }
  69. });
  70. /***/ }),
  71. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  72. /*!******************************************************************************************************************************************************************************************************************!*\
  73. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  74. \******************************************************************************************************************************************************************************************************************/
  75. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  76. "use strict";
  77. __webpack_require__.r(__webpack_exports__);
  78. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  79. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  80. /* harmony export */ });
  81. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  82. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  83. __name: 'AppPagination',
  84. props: {
  85. links: Array
  86. },
  87. setup: function setup(__props, _ref) {
  88. var expose = _ref.expose;
  89. expose();
  90. var __returned__ = {
  91. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  92. };
  93. Object.defineProperty(__returned__, '__isScriptSetup', {
  94. enumerable: false,
  95. value: true
  96. });
  97. return __returned__;
  98. }
  99. });
  100. /***/ }),
  101. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  102. /*!***************************************************************************************************************************************************************************************************************!*\
  103. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  104. \***************************************************************************************************************************************************************************************************************/
  105. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  106. "use strict";
  107. __webpack_require__.r(__webpack_exports__);
  108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  110. /* harmony export */ });
  111. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  112. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  113. __name: 'AppSidebar',
  114. props: {
  115. menu: Array
  116. },
  117. setup: function setup(__props, _ref) {
  118. var expose = _ref.expose;
  119. expose();
  120. var __returned__ = {
  121. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  122. };
  123. Object.defineProperty(__returned__, '__isScriptSetup', {
  124. enumerable: false,
  125. value: true
  126. });
  127. return __returned__;
  128. }
  129. });
  130. /***/ }),
  131. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  132. /*!******************************************************************************************************************************************************************************************************************!*\
  133. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  134. \******************************************************************************************************************************************************************************************************************/
  135. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  136. "use strict";
  137. __webpack_require__.r(__webpack_exports__);
  138. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  139. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  140. /* harmony export */ });
  141. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  142. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  143. __name: 'AppSubSidebar',
  144. props: {
  145. items: Array,
  146. root: {
  147. type: Boolean,
  148. "default": false
  149. }
  150. },
  151. setup: function setup(__props, _ref) {
  152. var expose = _ref.expose;
  153. expose();
  154. var __returned__ = {
  155. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  156. };
  157. Object.defineProperty(__returned__, '__isScriptSetup', {
  158. enumerable: false,
  159. value: true
  160. });
  161. return __returned__;
  162. }
  163. });
  164. /***/ }),
  165. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  166. /*!**************************************************************************************************************************************************************************************************************!*\
  167. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  168. \**************************************************************************************************************************************************************************************************************/
  169. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  170. "use strict";
  171. __webpack_require__.r(__webpack_exports__);
  172. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  173. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  174. /* harmony export */ });
  175. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  177. __name: 'AppTopBar',
  178. emits: ['menu-toggle'],
  179. setup: function setup(__props, _ref) {
  180. var expose = _ref.expose;
  181. expose();
  182. var __returned__ = {
  183. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  184. };
  185. Object.defineProperty(__returned__, '__isScriptSetup', {
  186. enumerable: false,
  187. value: true
  188. });
  189. return __returned__;
  190. }
  191. });
  192. /***/ }),
  193. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  194. /*!*****************************************************************************************************************************************************************************************************************!*\
  195. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  196. \*****************************************************************************************************************************************************************************************************************/
  197. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  198. "use strict";
  199. __webpack_require__.r(__webpack_exports__);
  200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  202. /* harmony export */ });
  203. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  204. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  205. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  206. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  207. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  208. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  209. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  210. __name: 'DashboardLayout',
  211. setup: function setup(__props, _ref) {
  212. var expose = _ref.expose;
  213. expose();
  214. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  215. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var isDesktop = function isDesktop() {
  218. return window.innerWidth >= 992;
  219. };
  220. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  221. return ['layout-wrapper', {
  222. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  223. 'layout-mobile-sidebar-active': mobileMenuActive.value
  224. }];
  225. });
  226. var onWrapperClick = function onWrapperClick() {
  227. if (!menuClick.value) {
  228. mobileMenuActive.value = false;
  229. }
  230. menuClick.value = false;
  231. };
  232. var onMenuToggle = function onMenuToggle(event) {
  233. menuClick.value = true;
  234. if (isDesktop()) {
  235. staticMenuInactive.value = !staticMenuInactive.value;
  236. } else {
  237. mobileMenuActive.value = !mobileMenuActive.value;
  238. }
  239. event.preventDefault();
  240. };
  241. var __returned__ = {
  242. mobileMenuActive: mobileMenuActive,
  243. staticMenuInactive: staticMenuInactive,
  244. menuClick: menuClick,
  245. isDesktop: isDesktop,
  246. containerClass: containerClass,
  247. onWrapperClick: onWrapperClick,
  248. onMenuToggle: onMenuToggle,
  249. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  250. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  251. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  252. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  253. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  266. /*!***************************************************************************************************************************************************************************************************************!*\
  267. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  268. \***************************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/Customers/tableHeader.js");
  281. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  282. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  283. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  284. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  286. __name: 'Index',
  287. props: {
  288. customers: Object,
  289. initialSearch: String
  290. },
  291. setup: function setup(__props, _ref) {
  292. var expose = _ref.expose;
  293. expose();
  294. var props = __props;
  295. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  296. search = _useSearchText.search;
  297. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  298. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/customers', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var __returned__ = {
  305. props: props,
  306. search: search,
  307. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  310. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  311. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  312. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  313. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  314. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  316. };
  317. Object.defineProperty(__returned__, '__isScriptSetup', {
  318. enumerable: false,
  319. value: true
  320. });
  321. return __returned__;
  322. }
  323. });
  324. /***/ }),
  325. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  326. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  327. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  328. \***********************************************************************************************************************************************************************************************************************************************************************************/
  329. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  330. "use strict";
  331. __webpack_require__.r(__webpack_exports__);
  332. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  333. /* harmony export */ "render": () => (/* binding */ render)
  334. /* harmony export */ });
  335. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  336. var _hoisted_1 = {
  337. key: 1,
  338. "class": "p-button-label"
  339. };
  340. var _hoisted_2 = {
  341. key: 1,
  342. "class": "p-button-label"
  343. };
  344. function render(_ctx, _cache, $props, $setup, $data, $options) {
  345. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  346. key: 0,
  347. "class": "p-button p-component",
  348. as: "button",
  349. type: "button"
  350. }, {
  351. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  352. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  353. key: 0,
  354. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  355. }, null, 2
  356. /* CLASS */
  357. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  358. /* TEXT */
  359. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  360. }),
  361. _: 1
  362. /* STABLE */
  363. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  364. key: 1,
  365. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  366. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  367. key: 0,
  368. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  369. }, null, 2
  370. /* CLASS */
  371. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  372. /* TEXT */
  373. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  374. /* CLASS */
  375. ));
  376. }
  377. /***/ }),
  378. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  379. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  380. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  381. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  382. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  383. "use strict";
  384. __webpack_require__.r(__webpack_exports__);
  385. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  386. /* harmony export */ "render": () => (/* binding */ render)
  387. /* harmony export */ });
  388. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  389. var _withScopeId = function _withScopeId(n) {
  390. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  391. };
  392. var _hoisted_1 = {
  393. "class": "layout-footer"
  394. };
  395. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  396. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  397. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  398. href: "https://dijitalcode.com",
  399. target: "_blank",
  400. "class": "font-medium ml-2"
  401. }, "DijitalCODE", -1
  402. /* HOISTED */
  403. );
  404. });
  405. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  406. function render(_ctx, _cache) {
  407. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  408. }
  409. /***/ }),
  410. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  411. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  412. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  413. \********************************************************************************************************************************************************************************************************************************************************************************/
  414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  415. "use strict";
  416. __webpack_require__.r(__webpack_exports__);
  417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  418. /* harmony export */ "render": () => (/* binding */ render)
  419. /* harmony export */ });
  420. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  421. var _hoisted_1 = {
  422. key: 0
  423. };
  424. var _hoisted_2 = {
  425. key: 1
  426. };
  427. function render(_ctx, _cache, $props, $setup, $data, $options) {
  428. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  429. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  430. key: 0,
  431. severity: "success",
  432. onClose: $setup.onClose
  433. }, {
  434. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  435. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  436. /* TEXT */
  437. )];
  438. }),
  439. _: 1
  440. /* STABLE */
  441. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  442. key: 1,
  443. severity: "error",
  444. onClose: $setup.onClose
  445. }, {
  446. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  447. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  448. /* TEXT */
  449. )];
  450. }),
  451. _: 1
  452. /* STABLE */
  453. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  454. key: 2,
  455. severity: "error",
  456. onClose: $setup.onClose
  457. }, {
  458. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  459. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  460. /* TEXT */
  461. ))];
  462. }),
  463. _: 1
  464. /* STABLE */
  465. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  466. /* STABLE_FRAGMENT */
  467. );
  468. }
  469. /***/ }),
  470. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  471. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  472. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  473. \***********************************************************************************************************************************************************************************************************************************************************************************/
  474. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  475. "use strict";
  476. __webpack_require__.r(__webpack_exports__);
  477. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  478. /* harmony export */ "render": () => (/* binding */ render)
  479. /* harmony export */ });
  480. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  481. var _hoisted_1 = {
  482. key: 0,
  483. "class": "p-paginator p-component flex justify-content-start"
  484. };
  485. var _hoisted_2 = {
  486. "class": "p-paginator-pages"
  487. };
  488. var _hoisted_3 = ["innerHTML"];
  489. function render(_ctx, _cache, $props, $setup, $data, $options) {
  490. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  491. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  492. key: "link-".concat(key),
  493. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  494. 'p-disabled': link
  495. }]),
  496. innerHTML: link.label
  497. }, null, 10
  498. /* CLASS, PROPS */
  499. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  500. key: "link-".concat(key),
  501. href: link.url,
  502. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  503. 'p-highlight': link.active
  504. }, "p-paginator-page p-paginator-element p-link"]),
  505. innerHTML: link.label
  506. }, null, 8
  507. /* PROPS */
  508. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  509. /* STABLE_FRAGMENT */
  510. );
  511. }), 256
  512. /* UNKEYED_FRAGMENT */
  513. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  514. }
  515. /***/ }),
  516. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  517. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  518. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  519. \********************************************************************************************************************************************************************************************************************************************************************************************/
  520. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  521. "use strict";
  522. __webpack_require__.r(__webpack_exports__);
  523. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  524. /* harmony export */ "render": () => (/* binding */ render)
  525. /* harmony export */ });
  526. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  527. function render(_ctx, _cache, $props, $setup, $data, $options) {
  528. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  529. "class": "layout-menu",
  530. items: $props.menu,
  531. root: true
  532. }, null, 8
  533. /* PROPS */
  534. , ["items"])]);
  535. }
  536. /***/ }),
  537. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  538. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  539. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  540. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  542. "use strict";
  543. __webpack_require__.r(__webpack_exports__);
  544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  545. /* harmony export */ "render": () => (/* binding */ render)
  546. /* harmony export */ });
  547. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  548. var _withScopeId = function _withScopeId(n) {
  549. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  550. };
  551. var _hoisted_1 = {
  552. key: 0
  553. };
  554. var _hoisted_2 = ["aria-label"];
  555. var _hoisted_3 = ["aria-label"];
  556. function render(_ctx, _cache, $props, $setup, $data, $options) {
  557. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  558. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  559. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  560. key: i,
  561. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  562. 'layout-menuitem-category': $props.root
  563. }]),
  564. role: "none"
  565. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  566. key: 0
  567. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  568. "class": "layout-menuitem-root-text",
  569. "aria-label": item.label
  570. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  571. /* TEXT, PROPS */
  572. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  573. items: item.items
  574. }, null, 8
  575. /* PROPS */
  576. , ["items"])], 64
  577. /* STABLE_FRAGMENT */
  578. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  579. key: 1
  580. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  581. key: 0,
  582. role: "menuitem",
  583. href: item.to,
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  585. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  586. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  587. }]),
  588. "aria-label": item.label
  589. }, {
  590. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  591. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  593. }, null, 2
  594. /* CLASS */
  595. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  596. /* TEXT */
  597. )];
  598. }),
  599. _: 2
  600. /* DYNAMIC */
  601. }, 1032
  602. /* PROPS, DYNAMIC_SLOTS */
  603. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  604. key: 1,
  605. href: "#",
  606. role: "menuitem",
  607. "aria-label": item.label
  608. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  609. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  610. }, null, 2
  611. /* CLASS */
  612. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  613. /* TEXT */
  614. )], 8
  615. /* PROPS */
  616. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  617. items: item.items
  618. }, null, 8
  619. /* PROPS */
  620. , ["items"])], 64
  621. /* STABLE_FRAGMENT */
  622. ))], 2
  623. /* CLASS */
  624. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  625. /* STABLE_FRAGMENT */
  626. );
  627. }), 256
  628. /* UNKEYED_FRAGMENT */
  629. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  630. }
  631. /***/ }),
  632. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  633. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  634. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  635. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  637. "use strict";
  638. __webpack_require__.r(__webpack_exports__);
  639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  640. /* harmony export */ "render": () => (/* binding */ render)
  641. /* harmony export */ });
  642. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  643. var _withScopeId = function _withScopeId(n) {
  644. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  645. };
  646. var _hoisted_1 = {
  647. "class": "layout-topbar"
  648. };
  649. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  650. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  651. alt: "Brand Logo",
  652. src: "/images/logo.svg",
  653. "class": "md:mr-3"
  654. }, null, -1
  655. /* HOISTED */
  656. );
  657. });
  658. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  659. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  660. /* HOISTED */
  661. );
  662. });
  663. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  664. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  665. "class": "pi pi-bars"
  666. }, null, -1
  667. /* HOISTED */
  668. );
  669. });
  670. var _hoisted_5 = [_hoisted_4];
  671. var _hoisted_6 = {
  672. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  673. };
  674. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  675. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  676. "class": "pi pi-ellipsis-v"
  677. }, null, -1
  678. /* HOISTED */
  679. );
  680. });
  681. var _hoisted_8 = [_hoisted_7];
  682. var _hoisted_9 = {
  683. "class": "layout-topbar-menu hidden lg:flex origin-top"
  684. };
  685. var _hoisted_10 = {
  686. "class": "align-self-center"
  687. };
  688. var _hoisted_11 = {
  689. "class": "hidden lg:inline"
  690. };
  691. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  692. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  693. "class": "pi pi-user"
  694. }, null, -1
  695. /* HOISTED */
  696. );
  697. });
  698. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  699. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  700. /* HOISTED */
  701. );
  702. });
  703. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  704. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  705. "class": "pi pi-sign-out"
  706. }, null, -1
  707. /* HOISTED */
  708. );
  709. });
  710. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  711. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  712. /* HOISTED */
  713. );
  714. });
  715. function render(_ctx, _cache, $props, $setup, $data, $options) {
  716. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  717. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  718. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  719. href: "/",
  720. "class": "layout-topbar-logo"
  721. }, {
  722. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  723. return [_hoisted_2, _hoisted_3];
  724. }),
  725. _: 1
  726. /* STABLE */
  727. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  728. "class": "p-link layout-menu-button layout-topbar-button",
  729. onClick: _cache[0] || (_cache[0] = function ($event) {
  730. return _ctx.$emit('menu-toggle', $event);
  731. })
  732. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  733. selector: '@next',
  734. enterClass: 'hidden',
  735. enterActiveClass: 'scalein',
  736. leaveToClass: 'hidden',
  737. leaveActiveClass: 'fadeout',
  738. hideOnOutsideClick: true
  739. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  740. /* TEXT */
  741. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  742. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  743. "class": "p-link layout-topbar-button"
  744. }, {
  745. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  746. return [_hoisted_12, _hoisted_13];
  747. }),
  748. _: 1
  749. /* STABLE */
  750. }, 8
  751. /* PROPS */
  752. , ["href"])), [[_directive_tooltip, {
  753. value: 'Ubah Profil',
  754. "class": 'layout-topbar-menu-tooltip'
  755. }, void 0, {
  756. bottom: true
  757. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  758. href: _ctx.route('logout'),
  759. as: "button",
  760. method: "post",
  761. "class": "p-link layout-topbar-button"
  762. }, {
  763. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  764. return [_hoisted_14, _hoisted_15];
  765. }),
  766. _: 1
  767. /* STABLE */
  768. }, 8
  769. /* PROPS */
  770. , ["href"])), [[_directive_tooltip, {
  771. value: 'Keluar',
  772. "class": 'layout-topbar-menu-tooltip'
  773. }, void 0, {
  774. bottom: true
  775. }]])])])]);
  776. }
  777. /***/ }),
  778. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  779. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  780. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  781. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  783. "use strict";
  784. __webpack_require__.r(__webpack_exports__);
  785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  786. /* harmony export */ "render": () => (/* binding */ render)
  787. /* harmony export */ });
  788. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  789. var _withScopeId = function _withScopeId(n) {
  790. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  791. };
  792. var _hoisted_1 = {
  793. "class": "layout-sidebar"
  794. };
  795. var _hoisted_2 = {
  796. "class": "layout-main-container"
  797. };
  798. var _hoisted_3 = {
  799. "class": "layout-main"
  800. };
  801. var _hoisted_4 = {
  802. key: 0,
  803. "class": "layout-mask p-component-overlay"
  804. };
  805. function render(_ctx, _cache, $props, $setup, $data, $options) {
  806. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  807. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  808. onClick: $setup.onWrapperClick
  809. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  810. onMenuToggle: $setup.onMenuToggle
  811. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  812. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  813. }, null, 8
  814. /* PROPS */
  815. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  816. name: "layout-mask"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. })], 2
  824. /* CLASS */
  825. );
  826. }
  827. /***/ }),
  828. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  829. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  830. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  831. \********************************************************************************************************************************************************************************************************************************************************************************/
  832. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  833. "use strict";
  834. __webpack_require__.r(__webpack_exports__);
  835. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  836. /* harmony export */ "render": () => (/* binding */ render)
  837. /* harmony export */ });
  838. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  839. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pelanggan", -1
  840. /* HOISTED */
  841. );
  842. var _hoisted_2 = {
  843. "class": "grid"
  844. };
  845. var _hoisted_3 = {
  846. "class": "col-12 md:col-8"
  847. };
  848. var _hoisted_4 = {
  849. "class": "flex align-items-center"
  850. };
  851. var _hoisted_5 = {
  852. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  853. };
  854. function render(_ctx, _cache, $props, $setup, $data, $options) {
  855. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  856. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  857. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  858. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  859. 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"], {
  860. title: "Daftar Pelanggan"
  861. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  862. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  863. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  864. responsiveLayout: "scroll",
  865. columnResizeMode: "expand",
  866. value: $props.customers.data,
  867. rowHover: true,
  868. stripedRows: true
  869. }, {
  870. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  871. 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, {
  872. "class": "w-full md:w-27rem",
  873. placeholder: "cari, contoh: tina, 08xx, 0x",
  874. modelValue: $setup.search,
  875. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  876. return $setup.search = $event;
  877. })
  878. }, null, 8
  879. /* PROPS */
  880. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  881. label: "Tambah Pelanggan",
  882. icon: "pi pi-pencil",
  883. "class": "p-button-outlined",
  884. href: _ctx.route('customers.create')
  885. }, null, 8
  886. /* PROPS */
  887. , ["href"])])])];
  888. }),
  889. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  890. 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) {
  891. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  892. field: value.field,
  893. header: value.header,
  894. key: value.field
  895. }, null, 8
  896. /* PROPS */
  897. , ["field", "header"]);
  898. }), 128
  899. /* KEYED_FRAGMENT */
  900. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  901. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  902. var data = _ref.data;
  903. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  904. icon: "pi pi-pencil",
  905. "class": "p-button-icon-only p-button-rounded p-button-text",
  906. href: _ctx.route('customers.edit', data.id)
  907. }, null, 8
  908. /* PROPS */
  909. , ["href"]), [[_directive_tooltip, 'Ubah Pelanggan', void 0, {
  910. bottom: true
  911. }]])];
  912. }),
  913. _: 1
  914. /* STABLE */
  915. })];
  916. }),
  917. _: 1
  918. /* STABLE */
  919. }, 8
  920. /* PROPS */
  921. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  922. links: $props.customers.links
  923. }, null, 8
  924. /* PROPS */
  925. , ["links"])];
  926. }),
  927. _: 1
  928. /* STABLE */
  929. })], 64
  930. /* STABLE_FRAGMENT */
  931. );
  932. }
  933. /***/ }),
  934. /***/ "./resources/js/components/useSearchText.js":
  935. /*!**************************************************!*\
  936. !*** ./resources/js/components/useSearchText.js ***!
  937. \**************************************************/
  938. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  939. "use strict";
  940. __webpack_require__.r(__webpack_exports__);
  941. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  942. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  943. /* harmony export */ });
  944. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  945. function useSearchText(props) {
  946. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  947. return {
  948. search: search
  949. };
  950. }
  951. /***/ }),
  952. /***/ "./resources/js/pages/Customers/tableHeader.js":
  953. /*!*****************************************************!*\
  954. !*** ./resources/js/pages/Customers/tableHeader.js ***!
  955. \*****************************************************/
  956. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  957. "use strict";
  958. __webpack_require__.r(__webpack_exports__);
  959. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  960. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  961. /* harmony export */ });
  962. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  963. field: 'name',
  964. header: 'Nama'
  965. }, {
  966. field: 'address',
  967. header: 'Alamat'
  968. }, {
  969. field: 'phone',
  970. header: 'No HP'
  971. }, {
  972. field: 'npwp',
  973. header: 'NPWP'
  974. }]);
  975. /***/ }),
  976. /***/ "./resources/js/utils/menu.js":
  977. /*!************************************!*\
  978. !*** ./resources/js/utils/menu.js ***!
  979. \************************************/
  980. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  981. "use strict";
  982. __webpack_require__.r(__webpack_exports__);
  983. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  984. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  985. /* harmony export */ });
  986. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  987. // Admin
  988. 1: [{
  989. label: 'Home',
  990. items: [{
  991. label: 'Dashboard',
  992. icon: 'pi pi-chart-bar',
  993. to: '/dashboards',
  994. component: 'Dashboards/Index'
  995. }]
  996. }, {
  997. label: 'Laporan',
  998. items: []
  999. }, {
  1000. label: 'Master',
  1001. items: [{
  1002. label: 'User',
  1003. icon: 'pi pi-user',
  1004. to: '/users',
  1005. component: 'Users/Index'
  1006. }]
  1007. }],
  1008. // Supervisor
  1009. 2: [{
  1010. label: 'Home',
  1011. items: [{
  1012. label: 'Dashboard',
  1013. icon: 'pi pi-chart-bar',
  1014. to: '/dashboards',
  1015. component: 'Dashboards/Index'
  1016. }]
  1017. }, {
  1018. label: 'Master',
  1019. items: [{
  1020. label: 'Pelanggan',
  1021. icon: 'pi pi-users',
  1022. to: '/customers',
  1023. component: 'Customers/Index'
  1024. }, {
  1025. label: 'Pembelian',
  1026. icon: 'pi pi-shopping-cart',
  1027. to: '/purchases',
  1028. component: 'Purchases/Index'
  1029. }, {
  1030. label: 'Penjualan',
  1031. icon: 'pi pi-tag',
  1032. to: '/sales',
  1033. component: 'Sales/Index'
  1034. }, {
  1035. label: 'Produk',
  1036. icon: 'pi pi-th-large',
  1037. to: '/products',
  1038. component: 'Products/Index'
  1039. }]
  1040. }],
  1041. // Operator
  1042. 3: [{
  1043. label: 'Home',
  1044. items: [{
  1045. label: 'Dashboard',
  1046. icon: 'pi pi-chart-bar',
  1047. to: '/dashboards',
  1048. component: 'Dashboards/Index'
  1049. }]
  1050. }, {
  1051. label: 'Master',
  1052. items: [{
  1053. label: 'Supplier',
  1054. icon: 'pi pi-shopping-cart',
  1055. to: '/suppliers',
  1056. component: 'Suppliers/Index'
  1057. }, {
  1058. label: 'Stok Barang',
  1059. icon: 'pi pi-box',
  1060. to: '/stock-products',
  1061. component: 'StockProducts/Index'
  1062. }]
  1063. }]
  1064. });
  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. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1069. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1070. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1071. "use strict";
  1072. __webpack_require__.r(__webpack_exports__);
  1073. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1074. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1075. /* harmony export */ });
  1076. /* 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");
  1077. /* 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__);
  1078. // Imports
  1079. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1080. // Module
  1081. ___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}", ""]);
  1082. // Exports
  1083. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1088. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1089. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1090. "use strict";
  1091. __webpack_require__.r(__webpack_exports__);
  1092. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1093. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1094. /* harmony export */ });
  1095. /* 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");
  1096. /* 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__);
  1097. // Imports
  1098. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1099. // Module
  1100. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1101. // Exports
  1102. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1107. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1108. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1109. "use strict";
  1110. __webpack_require__.r(__webpack_exports__);
  1111. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1112. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1113. /* harmony export */ });
  1114. /* 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");
  1115. /* 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__);
  1116. // Imports
  1117. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1118. // Module
  1119. ___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}", ""]);
  1120. // Exports
  1121. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1126. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1127. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1128. "use strict";
  1129. __webpack_require__.r(__webpack_exports__);
  1130. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1131. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1132. /* harmony export */ });
  1133. /* 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");
  1134. /* 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__);
  1135. // Imports
  1136. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1137. // Module
  1138. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1139. // Exports
  1140. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1145. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1146. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1147. "use strict";
  1148. __webpack_require__.r(__webpack_exports__);
  1149. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1150. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1151. /* harmony export */ });
  1152. /* 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");
  1153. /* 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__);
  1154. // Imports
  1155. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1156. // Module
  1157. ___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: 996;\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: 995;\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}", ""]);
  1158. // Exports
  1159. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1160. /***/ }),
  1161. /***/ "./node_modules/lodash/lodash.js":
  1162. /*!***************************************!*\
  1163. !*** ./node_modules/lodash/lodash.js ***!
  1164. \***************************************/
  1165. /***/ (function(module, exports, __webpack_require__) {
  1166. /* module decorator */ module = __webpack_require__.nmd(module);
  1167. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1168. * @license
  1169. * Lodash <https://lodash.com/>
  1170. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1171. * Released under MIT license <https://lodash.com/license>
  1172. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1173. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1174. */
  1175. ;(function() {
  1176. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1177. var undefined;
  1178. /** Used as the semantic version number. */
  1179. var VERSION = '4.17.21';
  1180. /** Used as the size to enable large array optimizations. */
  1181. var LARGE_ARRAY_SIZE = 200;
  1182. /** Error message constants. */
  1183. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1184. FUNC_ERROR_TEXT = 'Expected a function',
  1185. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1186. /** Used to stand-in for `undefined` hash values. */
  1187. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1188. /** Used as the maximum memoize cache size. */
  1189. var MAX_MEMOIZE_SIZE = 500;
  1190. /** Used as the internal argument placeholder. */
  1191. var PLACEHOLDER = '__lodash_placeholder__';
  1192. /** Used to compose bitmasks for cloning. */
  1193. var CLONE_DEEP_FLAG = 1,
  1194. CLONE_FLAT_FLAG = 2,
  1195. CLONE_SYMBOLS_FLAG = 4;
  1196. /** Used to compose bitmasks for value comparisons. */
  1197. var COMPARE_PARTIAL_FLAG = 1,
  1198. COMPARE_UNORDERED_FLAG = 2;
  1199. /** Used to compose bitmasks for function metadata. */
  1200. var WRAP_BIND_FLAG = 1,
  1201. WRAP_BIND_KEY_FLAG = 2,
  1202. WRAP_CURRY_BOUND_FLAG = 4,
  1203. WRAP_CURRY_FLAG = 8,
  1204. WRAP_CURRY_RIGHT_FLAG = 16,
  1205. WRAP_PARTIAL_FLAG = 32,
  1206. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1207. WRAP_ARY_FLAG = 128,
  1208. WRAP_REARG_FLAG = 256,
  1209. WRAP_FLIP_FLAG = 512;
  1210. /** Used as default options for `_.truncate`. */
  1211. var DEFAULT_TRUNC_LENGTH = 30,
  1212. DEFAULT_TRUNC_OMISSION = '...';
  1213. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1214. var HOT_COUNT = 800,
  1215. HOT_SPAN = 16;
  1216. /** Used to indicate the type of lazy iteratees. */
  1217. var LAZY_FILTER_FLAG = 1,
  1218. LAZY_MAP_FLAG = 2,
  1219. LAZY_WHILE_FLAG = 3;
  1220. /** Used as references for various `Number` constants. */
  1221. var INFINITY = 1 / 0,
  1222. MAX_SAFE_INTEGER = 9007199254740991,
  1223. MAX_INTEGER = 1.7976931348623157e+308,
  1224. NAN = 0 / 0;
  1225. /** Used as references for the maximum length and index of an array. */
  1226. var MAX_ARRAY_LENGTH = 4294967295,
  1227. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1228. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1229. /** Used to associate wrap methods with their bit flags. */
  1230. var wrapFlags = [
  1231. ['ary', WRAP_ARY_FLAG],
  1232. ['bind', WRAP_BIND_FLAG],
  1233. ['bindKey', WRAP_BIND_KEY_FLAG],
  1234. ['curry', WRAP_CURRY_FLAG],
  1235. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1236. ['flip', WRAP_FLIP_FLAG],
  1237. ['partial', WRAP_PARTIAL_FLAG],
  1238. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1239. ['rearg', WRAP_REARG_FLAG]
  1240. ];
  1241. /** `Object#toString` result references. */
  1242. var argsTag = '[object Arguments]',
  1243. arrayTag = '[object Array]',
  1244. asyncTag = '[object AsyncFunction]',
  1245. boolTag = '[object Boolean]',
  1246. dateTag = '[object Date]',
  1247. domExcTag = '[object DOMException]',
  1248. errorTag = '[object Error]',
  1249. funcTag = '[object Function]',
  1250. genTag = '[object GeneratorFunction]',
  1251. mapTag = '[object Map]',
  1252. numberTag = '[object Number]',
  1253. nullTag = '[object Null]',
  1254. objectTag = '[object Object]',
  1255. promiseTag = '[object Promise]',
  1256. proxyTag = '[object Proxy]',
  1257. regexpTag = '[object RegExp]',
  1258. setTag = '[object Set]',
  1259. stringTag = '[object String]',
  1260. symbolTag = '[object Symbol]',
  1261. undefinedTag = '[object Undefined]',
  1262. weakMapTag = '[object WeakMap]',
  1263. weakSetTag = '[object WeakSet]';
  1264. var arrayBufferTag = '[object ArrayBuffer]',
  1265. dataViewTag = '[object DataView]',
  1266. float32Tag = '[object Float32Array]',
  1267. float64Tag = '[object Float64Array]',
  1268. int8Tag = '[object Int8Array]',
  1269. int16Tag = '[object Int16Array]',
  1270. int32Tag = '[object Int32Array]',
  1271. uint8Tag = '[object Uint8Array]',
  1272. uint8ClampedTag = '[object Uint8ClampedArray]',
  1273. uint16Tag = '[object Uint16Array]',
  1274. uint32Tag = '[object Uint32Array]';
  1275. /** Used to match empty string literals in compiled template source. */
  1276. var reEmptyStringLeading = /\b__p \+= '';/g,
  1277. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1278. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1279. /** Used to match HTML entities and HTML characters. */
  1280. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1281. reUnescapedHtml = /[&<>"']/g,
  1282. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1283. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1284. /** Used to match template delimiters. */
  1285. var reEscape = /<%-([\s\S]+?)%>/g,
  1286. reEvaluate = /<%([\s\S]+?)%>/g,
  1287. reInterpolate = /<%=([\s\S]+?)%>/g;
  1288. /** Used to match property names within property paths. */
  1289. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1290. reIsPlainProp = /^\w*$/,
  1291. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1292. /**
  1293. * Used to match `RegExp`
  1294. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1295. */
  1296. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1297. reHasRegExpChar = RegExp(reRegExpChar.source);
  1298. /** Used to match leading whitespace. */
  1299. var reTrimStart = /^\s+/;
  1300. /** Used to match a single whitespace character. */
  1301. var reWhitespace = /\s/;
  1302. /** Used to match wrap detail comments. */
  1303. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1304. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1305. reSplitDetails = /,? & /;
  1306. /** Used to match words composed of alphanumeric characters. */
  1307. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1308. /**
  1309. * Used to validate the `validate` option in `_.template` variable.
  1310. *
  1311. * Forbids characters which could potentially change the meaning of the function argument definition:
  1312. * - "()," (modification of function parameters)
  1313. * - "=" (default value)
  1314. * - "[]{}" (destructuring of function parameters)
  1315. * - "/" (beginning of a comment)
  1316. * - whitespace
  1317. */
  1318. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1319. /** Used to match backslashes in property paths. */
  1320. var reEscapeChar = /\\(\\)?/g;
  1321. /**
  1322. * Used to match
  1323. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1324. */
  1325. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1326. /** Used to match `RegExp` flags from their coerced string values. */
  1327. var reFlags = /\w*$/;
  1328. /** Used to detect bad signed hexadecimal string values. */
  1329. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1330. /** Used to detect binary string values. */
  1331. var reIsBinary = /^0b[01]+$/i;
  1332. /** Used to detect host constructors (Safari). */
  1333. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1334. /** Used to detect octal string values. */
  1335. var reIsOctal = /^0o[0-7]+$/i;
  1336. /** Used to detect unsigned integer values. */
  1337. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1338. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1339. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1340. /** Used to ensure capturing order of template delimiters. */
  1341. var reNoMatch = /($^)/;
  1342. /** Used to match unescaped characters in compiled string literals. */
  1343. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1344. /** Used to compose unicode character classes. */
  1345. var rsAstralRange = '\\ud800-\\udfff',
  1346. rsComboMarksRange = '\\u0300-\\u036f',
  1347. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1348. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1349. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1350. rsDingbatRange = '\\u2700-\\u27bf',
  1351. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1352. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1353. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1354. rsPunctuationRange = '\\u2000-\\u206f',
  1355. 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',
  1356. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1357. rsVarRange = '\\ufe0e\\ufe0f',
  1358. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1359. /** Used to compose unicode capture groups. */
  1360. var rsApos = "['\u2019]",
  1361. rsAstral = '[' + rsAstralRange + ']',
  1362. rsBreak = '[' + rsBreakRange + ']',
  1363. rsCombo = '[' + rsComboRange + ']',
  1364. rsDigits = '\\d+',
  1365. rsDingbat = '[' + rsDingbatRange + ']',
  1366. rsLower = '[' + rsLowerRange + ']',
  1367. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1368. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1369. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1370. rsNonAstral = '[^' + rsAstralRange + ']',
  1371. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1372. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1373. rsUpper = '[' + rsUpperRange + ']',
  1374. rsZWJ = '\\u200d';
  1375. /** Used to compose unicode regexes. */
  1376. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1377. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1378. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1379. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1380. reOptMod = rsModifier + '?',
  1381. rsOptVar = '[' + rsVarRange + ']?',
  1382. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1383. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1384. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1385. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1386. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1387. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1388. /** Used to match apostrophes. */
  1389. var reApos = RegExp(rsApos, 'g');
  1390. /**
  1391. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1392. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1393. */
  1394. var reComboMark = RegExp(rsCombo, 'g');
  1395. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1396. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1397. /** Used to match complex or compound words. */
  1398. var reUnicodeWord = RegExp([
  1399. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1400. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1401. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1402. rsUpper + '+' + rsOptContrUpper,
  1403. rsOrdUpper,
  1404. rsOrdLower,
  1405. rsDigits,
  1406. rsEmoji
  1407. ].join('|'), 'g');
  1408. /** 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/). */
  1409. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1410. /** Used to detect strings that need a more robust regexp to match words. */
  1411. 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 ]/;
  1412. /** Used to assign default `context` object properties. */
  1413. var contextProps = [
  1414. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1415. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1416. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1417. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1418. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1419. ];
  1420. /** Used to make template sourceURLs easier to identify. */
  1421. var templateCounter = -1;
  1422. /** Used to identify `toStringTag` values of typed arrays. */
  1423. var typedArrayTags = {};
  1424. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1425. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1426. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1427. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1428. typedArrayTags[uint32Tag] = true;
  1429. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1430. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1431. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1432. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1433. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1434. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1435. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1436. typedArrayTags[weakMapTag] = false;
  1437. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1438. var cloneableTags = {};
  1439. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1440. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1441. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1442. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1443. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1444. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1445. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1446. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1447. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1448. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1449. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1450. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1451. cloneableTags[weakMapTag] = false;
  1452. /** Used to map Latin Unicode letters to basic Latin letters. */
  1453. var deburredLetters = {
  1454. // Latin-1 Supplement block.
  1455. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1456. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1457. '\xc7': 'C', '\xe7': 'c',
  1458. '\xd0': 'D', '\xf0': 'd',
  1459. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1460. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1461. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1462. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1463. '\xd1': 'N', '\xf1': 'n',
  1464. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1465. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1466. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1467. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1468. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1469. '\xc6': 'Ae', '\xe6': 'ae',
  1470. '\xde': 'Th', '\xfe': 'th',
  1471. '\xdf': 'ss',
  1472. // Latin Extended-A block.
  1473. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1474. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1475. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1476. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1477. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1478. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1479. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1480. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1481. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1482. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1483. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1484. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1485. '\u0134': 'J', '\u0135': 'j',
  1486. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1487. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1488. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1489. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1490. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1491. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1492. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1493. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1494. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1495. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1496. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1497. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1498. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1499. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1500. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1501. '\u0174': 'W', '\u0175': 'w',
  1502. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1503. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1504. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1505. '\u0132': 'IJ', '\u0133': 'ij',
  1506. '\u0152': 'Oe', '\u0153': 'oe',
  1507. '\u0149': "'n", '\u017f': 's'
  1508. };
  1509. /** Used to map characters to HTML entities. */
  1510. var htmlEscapes = {
  1511. '&': '&amp;',
  1512. '<': '&lt;',
  1513. '>': '&gt;',
  1514. '"': '&quot;',
  1515. "'": '&#39;'
  1516. };
  1517. /** Used to map HTML entities to characters. */
  1518. var htmlUnescapes = {
  1519. '&amp;': '&',
  1520. '&lt;': '<',
  1521. '&gt;': '>',
  1522. '&quot;': '"',
  1523. '&#39;': "'"
  1524. };
  1525. /** Used to escape characters for inclusion in compiled string literals. */
  1526. var stringEscapes = {
  1527. '\\': '\\',
  1528. "'": "'",
  1529. '\n': 'n',
  1530. '\r': 'r',
  1531. '\u2028': 'u2028',
  1532. '\u2029': 'u2029'
  1533. };
  1534. /** Built-in method references without a dependency on `root`. */
  1535. var freeParseFloat = parseFloat,
  1536. freeParseInt = parseInt;
  1537. /** Detect free variable `global` from Node.js. */
  1538. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1539. /** Detect free variable `self`. */
  1540. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1541. /** Used as a reference to the global object. */
  1542. var root = freeGlobal || freeSelf || Function('return this')();
  1543. /** Detect free variable `exports`. */
  1544. var freeExports = true && exports && !exports.nodeType && exports;
  1545. /** Detect free variable `module`. */
  1546. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1547. /** Detect the popular CommonJS extension `module.exports`. */
  1548. var moduleExports = freeModule && freeModule.exports === freeExports;
  1549. /** Detect free variable `process` from Node.js. */
  1550. var freeProcess = moduleExports && freeGlobal.process;
  1551. /** Used to access faster Node.js helpers. */
  1552. var nodeUtil = (function() {
  1553. try {
  1554. // Use `util.types` for Node.js 10+.
  1555. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1556. if (types) {
  1557. return types;
  1558. }
  1559. // Legacy `process.binding('util')` for Node.js < 10.
  1560. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1561. } catch (e) {}
  1562. }());
  1563. /* Node.js helper references. */
  1564. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1565. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1566. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1567. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1568. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1569. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1570. /*--------------------------------------------------------------------------*/
  1571. /**
  1572. * A faster alternative to `Function#apply`, this function invokes `func`
  1573. * with the `this` binding of `thisArg` and the arguments of `args`.
  1574. *
  1575. * @private
  1576. * @param {Function} func The function to invoke.
  1577. * @param {*} thisArg The `this` binding of `func`.
  1578. * @param {Array} args The arguments to invoke `func` with.
  1579. * @returns {*} Returns the result of `func`.
  1580. */
  1581. function apply(func, thisArg, args) {
  1582. switch (args.length) {
  1583. case 0: return func.call(thisArg);
  1584. case 1: return func.call(thisArg, args[0]);
  1585. case 2: return func.call(thisArg, args[0], args[1]);
  1586. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1587. }
  1588. return func.apply(thisArg, args);
  1589. }
  1590. /**
  1591. * A specialized version of `baseAggregator` for arrays.
  1592. *
  1593. * @private
  1594. * @param {Array} [array] The array to iterate over.
  1595. * @param {Function} setter The function to set `accumulator` values.
  1596. * @param {Function} iteratee The iteratee to transform keys.
  1597. * @param {Object} accumulator The initial aggregated object.
  1598. * @returns {Function} Returns `accumulator`.
  1599. */
  1600. function arrayAggregator(array, setter, iteratee, accumulator) {
  1601. var index = -1,
  1602. length = array == null ? 0 : array.length;
  1603. while (++index < length) {
  1604. var value = array[index];
  1605. setter(accumulator, value, iteratee(value), array);
  1606. }
  1607. return accumulator;
  1608. }
  1609. /**
  1610. * A specialized version of `_.forEach` for arrays without support for
  1611. * iteratee shorthands.
  1612. *
  1613. * @private
  1614. * @param {Array} [array] The array to iterate over.
  1615. * @param {Function} iteratee The function invoked per iteration.
  1616. * @returns {Array} Returns `array`.
  1617. */
  1618. function arrayEach(array, iteratee) {
  1619. var index = -1,
  1620. length = array == null ? 0 : array.length;
  1621. while (++index < length) {
  1622. if (iteratee(array[index], index, array) === false) {
  1623. break;
  1624. }
  1625. }
  1626. return array;
  1627. }
  1628. /**
  1629. * A specialized version of `_.forEachRight` for arrays without support for
  1630. * iteratee shorthands.
  1631. *
  1632. * @private
  1633. * @param {Array} [array] The array to iterate over.
  1634. * @param {Function} iteratee The function invoked per iteration.
  1635. * @returns {Array} Returns `array`.
  1636. */
  1637. function arrayEachRight(array, iteratee) {
  1638. var length = array == null ? 0 : array.length;
  1639. while (length--) {
  1640. if (iteratee(array[length], length, array) === false) {
  1641. break;
  1642. }
  1643. }
  1644. return array;
  1645. }
  1646. /**
  1647. * A specialized version of `_.every` for arrays without support for
  1648. * iteratee shorthands.
  1649. *
  1650. * @private
  1651. * @param {Array} [array] The array to iterate over.
  1652. * @param {Function} predicate The function invoked per iteration.
  1653. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1654. * else `false`.
  1655. */
  1656. function arrayEvery(array, predicate) {
  1657. var index = -1,
  1658. length = array == null ? 0 : array.length;
  1659. while (++index < length) {
  1660. if (!predicate(array[index], index, array)) {
  1661. return false;
  1662. }
  1663. }
  1664. return true;
  1665. }
  1666. /**
  1667. * A specialized version of `_.filter` for arrays without support for
  1668. * iteratee shorthands.
  1669. *
  1670. * @private
  1671. * @param {Array} [array] The array to iterate over.
  1672. * @param {Function} predicate The function invoked per iteration.
  1673. * @returns {Array} Returns the new filtered array.
  1674. */
  1675. function arrayFilter(array, predicate) {
  1676. var index = -1,
  1677. length = array == null ? 0 : array.length,
  1678. resIndex = 0,
  1679. result = [];
  1680. while (++index < length) {
  1681. var value = array[index];
  1682. if (predicate(value, index, array)) {
  1683. result[resIndex++] = value;
  1684. }
  1685. }
  1686. return result;
  1687. }
  1688. /**
  1689. * A specialized version of `_.includes` for arrays without support for
  1690. * specifying an index to search from.
  1691. *
  1692. * @private
  1693. * @param {Array} [array] The array to inspect.
  1694. * @param {*} target The value to search for.
  1695. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1696. */
  1697. function arrayIncludes(array, value) {
  1698. var length = array == null ? 0 : array.length;
  1699. return !!length && baseIndexOf(array, value, 0) > -1;
  1700. }
  1701. /**
  1702. * This function is like `arrayIncludes` except that it accepts a comparator.
  1703. *
  1704. * @private
  1705. * @param {Array} [array] The array to inspect.
  1706. * @param {*} target The value to search for.
  1707. * @param {Function} comparator The comparator invoked per element.
  1708. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1709. */
  1710. function arrayIncludesWith(array, value, comparator) {
  1711. var index = -1,
  1712. length = array == null ? 0 : array.length;
  1713. while (++index < length) {
  1714. if (comparator(value, array[index])) {
  1715. return true;
  1716. }
  1717. }
  1718. return false;
  1719. }
  1720. /**
  1721. * A specialized version of `_.map` for arrays without support for iteratee
  1722. * shorthands.
  1723. *
  1724. * @private
  1725. * @param {Array} [array] The array to iterate over.
  1726. * @param {Function} iteratee The function invoked per iteration.
  1727. * @returns {Array} Returns the new mapped array.
  1728. */
  1729. function arrayMap(array, iteratee) {
  1730. var index = -1,
  1731. length = array == null ? 0 : array.length,
  1732. result = Array(length);
  1733. while (++index < length) {
  1734. result[index] = iteratee(array[index], index, array);
  1735. }
  1736. return result;
  1737. }
  1738. /**
  1739. * Appends the elements of `values` to `array`.
  1740. *
  1741. * @private
  1742. * @param {Array} array The array to modify.
  1743. * @param {Array} values The values to append.
  1744. * @returns {Array} Returns `array`.
  1745. */
  1746. function arrayPush(array, values) {
  1747. var index = -1,
  1748. length = values.length,
  1749. offset = array.length;
  1750. while (++index < length) {
  1751. array[offset + index] = values[index];
  1752. }
  1753. return array;
  1754. }
  1755. /**
  1756. * A specialized version of `_.reduce` for arrays without support for
  1757. * iteratee shorthands.
  1758. *
  1759. * @private
  1760. * @param {Array} [array] The array to iterate over.
  1761. * @param {Function} iteratee The function invoked per iteration.
  1762. * @param {*} [accumulator] The initial value.
  1763. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1764. * the initial value.
  1765. * @returns {*} Returns the accumulated value.
  1766. */
  1767. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1768. var index = -1,
  1769. length = array == null ? 0 : array.length;
  1770. if (initAccum && length) {
  1771. accumulator = array[++index];
  1772. }
  1773. while (++index < length) {
  1774. accumulator = iteratee(accumulator, array[index], index, array);
  1775. }
  1776. return accumulator;
  1777. }
  1778. /**
  1779. * A specialized version of `_.reduceRight` for arrays without support for
  1780. * iteratee shorthands.
  1781. *
  1782. * @private
  1783. * @param {Array} [array] The array to iterate over.
  1784. * @param {Function} iteratee The function invoked per iteration.
  1785. * @param {*} [accumulator] The initial value.
  1786. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1787. * the initial value.
  1788. * @returns {*} Returns the accumulated value.
  1789. */
  1790. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1791. var length = array == null ? 0 : array.length;
  1792. if (initAccum && length) {
  1793. accumulator = array[--length];
  1794. }
  1795. while (length--) {
  1796. accumulator = iteratee(accumulator, array[length], length, array);
  1797. }
  1798. return accumulator;
  1799. }
  1800. /**
  1801. * A specialized version of `_.some` for arrays without support for iteratee
  1802. * shorthands.
  1803. *
  1804. * @private
  1805. * @param {Array} [array] The array to iterate over.
  1806. * @param {Function} predicate The function invoked per iteration.
  1807. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1808. * else `false`.
  1809. */
  1810. function arraySome(array, predicate) {
  1811. var index = -1,
  1812. length = array == null ? 0 : array.length;
  1813. while (++index < length) {
  1814. if (predicate(array[index], index, array)) {
  1815. return true;
  1816. }
  1817. }
  1818. return false;
  1819. }
  1820. /**
  1821. * Gets the size of an ASCII `string`.
  1822. *
  1823. * @private
  1824. * @param {string} string The string inspect.
  1825. * @returns {number} Returns the string size.
  1826. */
  1827. var asciiSize = baseProperty('length');
  1828. /**
  1829. * Converts an ASCII `string` to an array.
  1830. *
  1831. * @private
  1832. * @param {string} string The string to convert.
  1833. * @returns {Array} Returns the converted array.
  1834. */
  1835. function asciiToArray(string) {
  1836. return string.split('');
  1837. }
  1838. /**
  1839. * Splits an ASCII `string` into an array of its words.
  1840. *
  1841. * @private
  1842. * @param {string} The string to inspect.
  1843. * @returns {Array} Returns the words of `string`.
  1844. */
  1845. function asciiWords(string) {
  1846. return string.match(reAsciiWord) || [];
  1847. }
  1848. /**
  1849. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1850. * without support for iteratee shorthands, which iterates over `collection`
  1851. * using `eachFunc`.
  1852. *
  1853. * @private
  1854. * @param {Array|Object} collection The collection to inspect.
  1855. * @param {Function} predicate The function invoked per iteration.
  1856. * @param {Function} eachFunc The function to iterate over `collection`.
  1857. * @returns {*} Returns the found element or its key, else `undefined`.
  1858. */
  1859. function baseFindKey(collection, predicate, eachFunc) {
  1860. var result;
  1861. eachFunc(collection, function(value, key, collection) {
  1862. if (predicate(value, key, collection)) {
  1863. result = key;
  1864. return false;
  1865. }
  1866. });
  1867. return result;
  1868. }
  1869. /**
  1870. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1871. * support for iteratee shorthands.
  1872. *
  1873. * @private
  1874. * @param {Array} array The array to inspect.
  1875. * @param {Function} predicate The function invoked per iteration.
  1876. * @param {number} fromIndex The index to search from.
  1877. * @param {boolean} [fromRight] Specify iterating from right to left.
  1878. * @returns {number} Returns the index of the matched value, else `-1`.
  1879. */
  1880. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1881. var length = array.length,
  1882. index = fromIndex + (fromRight ? 1 : -1);
  1883. while ((fromRight ? index-- : ++index < length)) {
  1884. if (predicate(array[index], index, array)) {
  1885. return index;
  1886. }
  1887. }
  1888. return -1;
  1889. }
  1890. /**
  1891. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1892. *
  1893. * @private
  1894. * @param {Array} array The array to inspect.
  1895. * @param {*} value The value to search for.
  1896. * @param {number} fromIndex The index to search from.
  1897. * @returns {number} Returns the index of the matched value, else `-1`.
  1898. */
  1899. function baseIndexOf(array, value, fromIndex) {
  1900. return value === value
  1901. ? strictIndexOf(array, value, fromIndex)
  1902. : baseFindIndex(array, baseIsNaN, fromIndex);
  1903. }
  1904. /**
  1905. * This function is like `baseIndexOf` except that it accepts a comparator.
  1906. *
  1907. * @private
  1908. * @param {Array} array The array to inspect.
  1909. * @param {*} value The value to search for.
  1910. * @param {number} fromIndex The index to search from.
  1911. * @param {Function} comparator The comparator invoked per element.
  1912. * @returns {number} Returns the index of the matched value, else `-1`.
  1913. */
  1914. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1915. var index = fromIndex - 1,
  1916. length = array.length;
  1917. while (++index < length) {
  1918. if (comparator(array[index], value)) {
  1919. return index;
  1920. }
  1921. }
  1922. return -1;
  1923. }
  1924. /**
  1925. * The base implementation of `_.isNaN` without support for number objects.
  1926. *
  1927. * @private
  1928. * @param {*} value The value to check.
  1929. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1930. */
  1931. function baseIsNaN(value) {
  1932. return value !== value;
  1933. }
  1934. /**
  1935. * The base implementation of `_.mean` and `_.meanBy` without support for
  1936. * iteratee shorthands.
  1937. *
  1938. * @private
  1939. * @param {Array} array The array to iterate over.
  1940. * @param {Function} iteratee The function invoked per iteration.
  1941. * @returns {number} Returns the mean.
  1942. */
  1943. function baseMean(array, iteratee) {
  1944. var length = array == null ? 0 : array.length;
  1945. return length ? (baseSum(array, iteratee) / length) : NAN;
  1946. }
  1947. /**
  1948. * The base implementation of `_.property` without support for deep paths.
  1949. *
  1950. * @private
  1951. * @param {string} key The key of the property to get.
  1952. * @returns {Function} Returns the new accessor function.
  1953. */
  1954. function baseProperty(key) {
  1955. return function(object) {
  1956. return object == null ? undefined : object[key];
  1957. };
  1958. }
  1959. /**
  1960. * The base implementation of `_.propertyOf` without support for deep paths.
  1961. *
  1962. * @private
  1963. * @param {Object} object The object to query.
  1964. * @returns {Function} Returns the new accessor function.
  1965. */
  1966. function basePropertyOf(object) {
  1967. return function(key) {
  1968. return object == null ? undefined : object[key];
  1969. };
  1970. }
  1971. /**
  1972. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1973. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1974. *
  1975. * @private
  1976. * @param {Array|Object} collection The collection to iterate over.
  1977. * @param {Function} iteratee The function invoked per iteration.
  1978. * @param {*} accumulator The initial value.
  1979. * @param {boolean} initAccum Specify using the first or last element of
  1980. * `collection` as the initial value.
  1981. * @param {Function} eachFunc The function to iterate over `collection`.
  1982. * @returns {*} Returns the accumulated value.
  1983. */
  1984. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1985. eachFunc(collection, function(value, index, collection) {
  1986. accumulator = initAccum
  1987. ? (initAccum = false, value)
  1988. : iteratee(accumulator, value, index, collection);
  1989. });
  1990. return accumulator;
  1991. }
  1992. /**
  1993. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1994. * sort order of `array` and replaces criteria objects with their corresponding
  1995. * values.
  1996. *
  1997. * @private
  1998. * @param {Array} array The array to sort.
  1999. * @param {Function} comparer The function to define sort order.
  2000. * @returns {Array} Returns `array`.
  2001. */
  2002. function baseSortBy(array, comparer) {
  2003. var length = array.length;
  2004. array.sort(comparer);
  2005. while (length--) {
  2006. array[length] = array[length].value;
  2007. }
  2008. return array;
  2009. }
  2010. /**
  2011. * The base implementation of `_.sum` and `_.sumBy` without support for
  2012. * iteratee shorthands.
  2013. *
  2014. * @private
  2015. * @param {Array} array The array to iterate over.
  2016. * @param {Function} iteratee The function invoked per iteration.
  2017. * @returns {number} Returns the sum.
  2018. */
  2019. function baseSum(array, iteratee) {
  2020. var result,
  2021. index = -1,
  2022. length = array.length;
  2023. while (++index < length) {
  2024. var current = iteratee(array[index]);
  2025. if (current !== undefined) {
  2026. result = result === undefined ? current : (result + current);
  2027. }
  2028. }
  2029. return result;
  2030. }
  2031. /**
  2032. * The base implementation of `_.times` without support for iteratee shorthands
  2033. * or max array length checks.
  2034. *
  2035. * @private
  2036. * @param {number} n The number of times to invoke `iteratee`.
  2037. * @param {Function} iteratee The function invoked per iteration.
  2038. * @returns {Array} Returns the array of results.
  2039. */
  2040. function baseTimes(n, iteratee) {
  2041. var index = -1,
  2042. result = Array(n);
  2043. while (++index < n) {
  2044. result[index] = iteratee(index);
  2045. }
  2046. return result;
  2047. }
  2048. /**
  2049. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2050. * of key-value pairs for `object` corresponding to the property names of `props`.
  2051. *
  2052. * @private
  2053. * @param {Object} object The object to query.
  2054. * @param {Array} props The property names to get values for.
  2055. * @returns {Object} Returns the key-value pairs.
  2056. */
  2057. function baseToPairs(object, props) {
  2058. return arrayMap(props, function(key) {
  2059. return [key, object[key]];
  2060. });
  2061. }
  2062. /**
  2063. * The base implementation of `_.trim`.
  2064. *
  2065. * @private
  2066. * @param {string} string The string to trim.
  2067. * @returns {string} Returns the trimmed string.
  2068. */
  2069. function baseTrim(string) {
  2070. return string
  2071. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2072. : string;
  2073. }
  2074. /**
  2075. * The base implementation of `_.unary` without support for storing metadata.
  2076. *
  2077. * @private
  2078. * @param {Function} func The function to cap arguments for.
  2079. * @returns {Function} Returns the new capped function.
  2080. */
  2081. function baseUnary(func) {
  2082. return function(value) {
  2083. return func(value);
  2084. };
  2085. }
  2086. /**
  2087. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2088. * array of `object` property values corresponding to the property names
  2089. * of `props`.
  2090. *
  2091. * @private
  2092. * @param {Object} object The object to query.
  2093. * @param {Array} props The property names to get values for.
  2094. * @returns {Object} Returns the array of property values.
  2095. */
  2096. function baseValues(object, props) {
  2097. return arrayMap(props, function(key) {
  2098. return object[key];
  2099. });
  2100. }
  2101. /**
  2102. * Checks if a `cache` value for `key` exists.
  2103. *
  2104. * @private
  2105. * @param {Object} cache The cache to query.
  2106. * @param {string} key The key of the entry to check.
  2107. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2108. */
  2109. function cacheHas(cache, key) {
  2110. return cache.has(key);
  2111. }
  2112. /**
  2113. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2114. * that is not found in the character symbols.
  2115. *
  2116. * @private
  2117. * @param {Array} strSymbols The string symbols to inspect.
  2118. * @param {Array} chrSymbols The character symbols to find.
  2119. * @returns {number} Returns the index of the first unmatched string symbol.
  2120. */
  2121. function charsStartIndex(strSymbols, chrSymbols) {
  2122. var index = -1,
  2123. length = strSymbols.length;
  2124. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2125. return index;
  2126. }
  2127. /**
  2128. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2129. * that is not found in the character symbols.
  2130. *
  2131. * @private
  2132. * @param {Array} strSymbols The string symbols to inspect.
  2133. * @param {Array} chrSymbols The character symbols to find.
  2134. * @returns {number} Returns the index of the last unmatched string symbol.
  2135. */
  2136. function charsEndIndex(strSymbols, chrSymbols) {
  2137. var index = strSymbols.length;
  2138. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2139. return index;
  2140. }
  2141. /**
  2142. * Gets the number of `placeholder` occurrences in `array`.
  2143. *
  2144. * @private
  2145. * @param {Array} array The array to inspect.
  2146. * @param {*} placeholder The placeholder to search for.
  2147. * @returns {number} Returns the placeholder count.
  2148. */
  2149. function countHolders(array, placeholder) {
  2150. var length = array.length,
  2151. result = 0;
  2152. while (length--) {
  2153. if (array[length] === placeholder) {
  2154. ++result;
  2155. }
  2156. }
  2157. return result;
  2158. }
  2159. /**
  2160. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2161. * letters to basic Latin letters.
  2162. *
  2163. * @private
  2164. * @param {string} letter The matched letter to deburr.
  2165. * @returns {string} Returns the deburred letter.
  2166. */
  2167. var deburrLetter = basePropertyOf(deburredLetters);
  2168. /**
  2169. * Used by `_.escape` to convert characters to HTML entities.
  2170. *
  2171. * @private
  2172. * @param {string} chr The matched character to escape.
  2173. * @returns {string} Returns the escaped character.
  2174. */
  2175. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2176. /**
  2177. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2178. *
  2179. * @private
  2180. * @param {string} chr The matched character to escape.
  2181. * @returns {string} Returns the escaped character.
  2182. */
  2183. function escapeStringChar(chr) {
  2184. return '\\' + stringEscapes[chr];
  2185. }
  2186. /**
  2187. * Gets the value at `key` of `object`.
  2188. *
  2189. * @private
  2190. * @param {Object} [object] The object to query.
  2191. * @param {string} key The key of the property to get.
  2192. * @returns {*} Returns the property value.
  2193. */
  2194. function getValue(object, key) {
  2195. return object == null ? undefined : object[key];
  2196. }
  2197. /**
  2198. * Checks if `string` contains Unicode symbols.
  2199. *
  2200. * @private
  2201. * @param {string} string The string to inspect.
  2202. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2203. */
  2204. function hasUnicode(string) {
  2205. return reHasUnicode.test(string);
  2206. }
  2207. /**
  2208. * Checks if `string` contains a word composed of Unicode symbols.
  2209. *
  2210. * @private
  2211. * @param {string} string The string to inspect.
  2212. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2213. */
  2214. function hasUnicodeWord(string) {
  2215. return reHasUnicodeWord.test(string);
  2216. }
  2217. /**
  2218. * Converts `iterator` to an array.
  2219. *
  2220. * @private
  2221. * @param {Object} iterator The iterator to convert.
  2222. * @returns {Array} Returns the converted array.
  2223. */
  2224. function iteratorToArray(iterator) {
  2225. var data,
  2226. result = [];
  2227. while (!(data = iterator.next()).done) {
  2228. result.push(data.value);
  2229. }
  2230. return result;
  2231. }
  2232. /**
  2233. * Converts `map` to its key-value pairs.
  2234. *
  2235. * @private
  2236. * @param {Object} map The map to convert.
  2237. * @returns {Array} Returns the key-value pairs.
  2238. */
  2239. function mapToArray(map) {
  2240. var index = -1,
  2241. result = Array(map.size);
  2242. map.forEach(function(value, key) {
  2243. result[++index] = [key, value];
  2244. });
  2245. return result;
  2246. }
  2247. /**
  2248. * Creates a unary function that invokes `func` with its argument transformed.
  2249. *
  2250. * @private
  2251. * @param {Function} func The function to wrap.
  2252. * @param {Function} transform The argument transform.
  2253. * @returns {Function} Returns the new function.
  2254. */
  2255. function overArg(func, transform) {
  2256. return function(arg) {
  2257. return func(transform(arg));
  2258. };
  2259. }
  2260. /**
  2261. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2262. * and returns an array of their indexes.
  2263. *
  2264. * @private
  2265. * @param {Array} array The array to modify.
  2266. * @param {*} placeholder The placeholder to replace.
  2267. * @returns {Array} Returns the new array of placeholder indexes.
  2268. */
  2269. function replaceHolders(array, placeholder) {
  2270. var index = -1,
  2271. length = array.length,
  2272. resIndex = 0,
  2273. result = [];
  2274. while (++index < length) {
  2275. var value = array[index];
  2276. if (value === placeholder || value === PLACEHOLDER) {
  2277. array[index] = PLACEHOLDER;
  2278. result[resIndex++] = index;
  2279. }
  2280. }
  2281. return result;
  2282. }
  2283. /**
  2284. * Converts `set` to an array of its values.
  2285. *
  2286. * @private
  2287. * @param {Object} set The set to convert.
  2288. * @returns {Array} Returns the values.
  2289. */
  2290. function setToArray(set) {
  2291. var index = -1,
  2292. result = Array(set.size);
  2293. set.forEach(function(value) {
  2294. result[++index] = value;
  2295. });
  2296. return result;
  2297. }
  2298. /**
  2299. * Converts `set` to its value-value pairs.
  2300. *
  2301. * @private
  2302. * @param {Object} set The set to convert.
  2303. * @returns {Array} Returns the value-value pairs.
  2304. */
  2305. function setToPairs(set) {
  2306. var index = -1,
  2307. result = Array(set.size);
  2308. set.forEach(function(value) {
  2309. result[++index] = [value, value];
  2310. });
  2311. return result;
  2312. }
  2313. /**
  2314. * A specialized version of `_.indexOf` which performs strict equality
  2315. * comparisons of values, i.e. `===`.
  2316. *
  2317. * @private
  2318. * @param {Array} array The array to inspect.
  2319. * @param {*} value The value to search for.
  2320. * @param {number} fromIndex The index to search from.
  2321. * @returns {number} Returns the index of the matched value, else `-1`.
  2322. */
  2323. function strictIndexOf(array, value, fromIndex) {
  2324. var index = fromIndex - 1,
  2325. length = array.length;
  2326. while (++index < length) {
  2327. if (array[index] === value) {
  2328. return index;
  2329. }
  2330. }
  2331. return -1;
  2332. }
  2333. /**
  2334. * A specialized version of `_.lastIndexOf` which performs strict equality
  2335. * comparisons of values, i.e. `===`.
  2336. *
  2337. * @private
  2338. * @param {Array} array The array to inspect.
  2339. * @param {*} value The value to search for.
  2340. * @param {number} fromIndex The index to search from.
  2341. * @returns {number} Returns the index of the matched value, else `-1`.
  2342. */
  2343. function strictLastIndexOf(array, value, fromIndex) {
  2344. var index = fromIndex + 1;
  2345. while (index--) {
  2346. if (array[index] === value) {
  2347. return index;
  2348. }
  2349. }
  2350. return index;
  2351. }
  2352. /**
  2353. * Gets the number of symbols in `string`.
  2354. *
  2355. * @private
  2356. * @param {string} string The string to inspect.
  2357. * @returns {number} Returns the string size.
  2358. */
  2359. function stringSize(string) {
  2360. return hasUnicode(string)
  2361. ? unicodeSize(string)
  2362. : asciiSize(string);
  2363. }
  2364. /**
  2365. * Converts `string` to an array.
  2366. *
  2367. * @private
  2368. * @param {string} string The string to convert.
  2369. * @returns {Array} Returns the converted array.
  2370. */
  2371. function stringToArray(string) {
  2372. return hasUnicode(string)
  2373. ? unicodeToArray(string)
  2374. : asciiToArray(string);
  2375. }
  2376. /**
  2377. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2378. * character of `string`.
  2379. *
  2380. * @private
  2381. * @param {string} string The string to inspect.
  2382. * @returns {number} Returns the index of the last non-whitespace character.
  2383. */
  2384. function trimmedEndIndex(string) {
  2385. var index = string.length;
  2386. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2387. return index;
  2388. }
  2389. /**
  2390. * Used by `_.unescape` to convert HTML entities to characters.
  2391. *
  2392. * @private
  2393. * @param {string} chr The matched character to unescape.
  2394. * @returns {string} Returns the unescaped character.
  2395. */
  2396. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2397. /**
  2398. * Gets the size of a Unicode `string`.
  2399. *
  2400. * @private
  2401. * @param {string} string The string inspect.
  2402. * @returns {number} Returns the string size.
  2403. */
  2404. function unicodeSize(string) {
  2405. var result = reUnicode.lastIndex = 0;
  2406. while (reUnicode.test(string)) {
  2407. ++result;
  2408. }
  2409. return result;
  2410. }
  2411. /**
  2412. * Converts a Unicode `string` to an array.
  2413. *
  2414. * @private
  2415. * @param {string} string The string to convert.
  2416. * @returns {Array} Returns the converted array.
  2417. */
  2418. function unicodeToArray(string) {
  2419. return string.match(reUnicode) || [];
  2420. }
  2421. /**
  2422. * Splits a Unicode `string` into an array of its words.
  2423. *
  2424. * @private
  2425. * @param {string} The string to inspect.
  2426. * @returns {Array} Returns the words of `string`.
  2427. */
  2428. function unicodeWords(string) {
  2429. return string.match(reUnicodeWord) || [];
  2430. }
  2431. /*--------------------------------------------------------------------------*/
  2432. /**
  2433. * Create a new pristine `lodash` function using the `context` object.
  2434. *
  2435. * @static
  2436. * @memberOf _
  2437. * @since 1.1.0
  2438. * @category Util
  2439. * @param {Object} [context=root] The context object.
  2440. * @returns {Function} Returns a new `lodash` function.
  2441. * @example
  2442. *
  2443. * _.mixin({ 'foo': _.constant('foo') });
  2444. *
  2445. * var lodash = _.runInContext();
  2446. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2447. *
  2448. * _.isFunction(_.foo);
  2449. * // => true
  2450. * _.isFunction(_.bar);
  2451. * // => false
  2452. *
  2453. * lodash.isFunction(lodash.foo);
  2454. * // => false
  2455. * lodash.isFunction(lodash.bar);
  2456. * // => true
  2457. *
  2458. * // Create a suped-up `defer` in Node.js.
  2459. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2460. */
  2461. var runInContext = (function runInContext(context) {
  2462. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2463. /** Built-in constructor references. */
  2464. var Array = context.Array,
  2465. Date = context.Date,
  2466. Error = context.Error,
  2467. Function = context.Function,
  2468. Math = context.Math,
  2469. Object = context.Object,
  2470. RegExp = context.RegExp,
  2471. String = context.String,
  2472. TypeError = context.TypeError;
  2473. /** Used for built-in method references. */
  2474. var arrayProto = Array.prototype,
  2475. funcProto = Function.prototype,
  2476. objectProto = Object.prototype;
  2477. /** Used to detect overreaching core-js shims. */
  2478. var coreJsData = context['__core-js_shared__'];
  2479. /** Used to resolve the decompiled source of functions. */
  2480. var funcToString = funcProto.toString;
  2481. /** Used to check objects for own properties. */
  2482. var hasOwnProperty = objectProto.hasOwnProperty;
  2483. /** Used to generate unique IDs. */
  2484. var idCounter = 0;
  2485. /** Used to detect methods masquerading as native. */
  2486. var maskSrcKey = (function() {
  2487. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2488. return uid ? ('Symbol(src)_1.' + uid) : '';
  2489. }());
  2490. /**
  2491. * Used to resolve the
  2492. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2493. * of values.
  2494. */
  2495. var nativeObjectToString = objectProto.toString;
  2496. /** Used to infer the `Object` constructor. */
  2497. var objectCtorString = funcToString.call(Object);
  2498. /** Used to restore the original `_` reference in `_.noConflict`. */
  2499. var oldDash = root._;
  2500. /** Used to detect if a method is native. */
  2501. var reIsNative = RegExp('^' +
  2502. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2503. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2504. );
  2505. /** Built-in value references. */
  2506. var Buffer = moduleExports ? context.Buffer : undefined,
  2507. Symbol = context.Symbol,
  2508. Uint8Array = context.Uint8Array,
  2509. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2510. getPrototype = overArg(Object.getPrototypeOf, Object),
  2511. objectCreate = Object.create,
  2512. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2513. splice = arrayProto.splice,
  2514. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2515. symIterator = Symbol ? Symbol.iterator : undefined,
  2516. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2517. var defineProperty = (function() {
  2518. try {
  2519. var func = getNative(Object, 'defineProperty');
  2520. func({}, '', {});
  2521. return func;
  2522. } catch (e) {}
  2523. }());
  2524. /** Mocked built-ins. */
  2525. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2526. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2527. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2528. /* Built-in method references for those with the same name as other `lodash` methods. */
  2529. var nativeCeil = Math.ceil,
  2530. nativeFloor = Math.floor,
  2531. nativeGetSymbols = Object.getOwnPropertySymbols,
  2532. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2533. nativeIsFinite = context.isFinite,
  2534. nativeJoin = arrayProto.join,
  2535. nativeKeys = overArg(Object.keys, Object),
  2536. nativeMax = Math.max,
  2537. nativeMin = Math.min,
  2538. nativeNow = Date.now,
  2539. nativeParseInt = context.parseInt,
  2540. nativeRandom = Math.random,
  2541. nativeReverse = arrayProto.reverse;
  2542. /* Built-in method references that are verified to be native. */
  2543. var DataView = getNative(context, 'DataView'),
  2544. Map = getNative(context, 'Map'),
  2545. Promise = getNative(context, 'Promise'),
  2546. Set = getNative(context, 'Set'),
  2547. WeakMap = getNative(context, 'WeakMap'),
  2548. nativeCreate = getNative(Object, 'create');
  2549. /** Used to store function metadata. */
  2550. var metaMap = WeakMap && new WeakMap;
  2551. /** Used to lookup unminified function names. */
  2552. var realNames = {};
  2553. /** Used to detect maps, sets, and weakmaps. */
  2554. var dataViewCtorString = toSource(DataView),
  2555. mapCtorString = toSource(Map),
  2556. promiseCtorString = toSource(Promise),
  2557. setCtorString = toSource(Set),
  2558. weakMapCtorString = toSource(WeakMap);
  2559. /** Used to convert symbols to primitives and strings. */
  2560. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2561. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2562. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2563. /*------------------------------------------------------------------------*/
  2564. /**
  2565. * Creates a `lodash` object which wraps `value` to enable implicit method
  2566. * chain sequences. Methods that operate on and return arrays, collections,
  2567. * and functions can be chained together. Methods that retrieve a single value
  2568. * or may return a primitive value will automatically end the chain sequence
  2569. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2570. * with `_#value`.
  2571. *
  2572. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2573. * enabled using `_.chain`.
  2574. *
  2575. * The execution of chained methods is lazy, that is, it's deferred until
  2576. * `_#value` is implicitly or explicitly called.
  2577. *
  2578. * Lazy evaluation allows several methods to support shortcut fusion.
  2579. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2580. * the creation of intermediate arrays and can greatly reduce the number of
  2581. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2582. * fusion if the section is applied to an array and iteratees accept only
  2583. * one argument. The heuristic for whether a section qualifies for shortcut
  2584. * fusion is subject to change.
  2585. *
  2586. * Chaining is supported in custom builds as long as the `_#value` method is
  2587. * directly or indirectly included in the build.
  2588. *
  2589. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2590. *
  2591. * The wrapper `Array` methods are:
  2592. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2593. *
  2594. * The wrapper `String` methods are:
  2595. * `replace` and `split`
  2596. *
  2597. * The wrapper methods that support shortcut fusion are:
  2598. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2599. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2600. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2601. *
  2602. * The chainable wrapper methods are:
  2603. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2604. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2605. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2606. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2607. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2608. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2609. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2610. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2611. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2612. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2613. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2614. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2615. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2616. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2617. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2618. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2619. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2620. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2621. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2622. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2623. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2624. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2625. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2626. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2627. *
  2628. * The wrapper methods that are **not** chainable by default are:
  2629. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2630. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2631. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2632. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2633. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2634. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2635. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2636. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2637. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2638. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2639. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2640. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2641. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2642. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2643. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2644. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2645. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2646. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2647. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2648. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2649. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2650. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2651. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2652. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2653. * `upperFirst`, `value`, and `words`
  2654. *
  2655. * @name _
  2656. * @constructor
  2657. * @category Seq
  2658. * @param {*} value The value to wrap in a `lodash` instance.
  2659. * @returns {Object} Returns the new `lodash` wrapper instance.
  2660. * @example
  2661. *
  2662. * function square(n) {
  2663. * return n * n;
  2664. * }
  2665. *
  2666. * var wrapped = _([1, 2, 3]);
  2667. *
  2668. * // Returns an unwrapped value.
  2669. * wrapped.reduce(_.add);
  2670. * // => 6
  2671. *
  2672. * // Returns a wrapped value.
  2673. * var squares = wrapped.map(square);
  2674. *
  2675. * _.isArray(squares);
  2676. * // => false
  2677. *
  2678. * _.isArray(squares.value());
  2679. * // => true
  2680. */
  2681. function lodash(value) {
  2682. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2683. if (value instanceof LodashWrapper) {
  2684. return value;
  2685. }
  2686. if (hasOwnProperty.call(value, '__wrapped__')) {
  2687. return wrapperClone(value);
  2688. }
  2689. }
  2690. return new LodashWrapper(value);
  2691. }
  2692. /**
  2693. * The base implementation of `_.create` without support for assigning
  2694. * properties to the created object.
  2695. *
  2696. * @private
  2697. * @param {Object} proto The object to inherit from.
  2698. * @returns {Object} Returns the new object.
  2699. */
  2700. var baseCreate = (function() {
  2701. function object() {}
  2702. return function(proto) {
  2703. if (!isObject(proto)) {
  2704. return {};
  2705. }
  2706. if (objectCreate) {
  2707. return objectCreate(proto);
  2708. }
  2709. object.prototype = proto;
  2710. var result = new object;
  2711. object.prototype = undefined;
  2712. return result;
  2713. };
  2714. }());
  2715. /**
  2716. * The function whose prototype chain sequence wrappers inherit from.
  2717. *
  2718. * @private
  2719. */
  2720. function baseLodash() {
  2721. // No operation performed.
  2722. }
  2723. /**
  2724. * The base constructor for creating `lodash` wrapper objects.
  2725. *
  2726. * @private
  2727. * @param {*} value The value to wrap.
  2728. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2729. */
  2730. function LodashWrapper(value, chainAll) {
  2731. this.__wrapped__ = value;
  2732. this.__actions__ = [];
  2733. this.__chain__ = !!chainAll;
  2734. this.__index__ = 0;
  2735. this.__values__ = undefined;
  2736. }
  2737. /**
  2738. * By default, the template delimiters used by lodash are like those in
  2739. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2740. * following template settings to use alternative delimiters.
  2741. *
  2742. * @static
  2743. * @memberOf _
  2744. * @type {Object}
  2745. */
  2746. lodash.templateSettings = {
  2747. /**
  2748. * Used to detect `data` property values to be HTML-escaped.
  2749. *
  2750. * @memberOf _.templateSettings
  2751. * @type {RegExp}
  2752. */
  2753. 'escape': reEscape,
  2754. /**
  2755. * Used to detect code to be evaluated.
  2756. *
  2757. * @memberOf _.templateSettings
  2758. * @type {RegExp}
  2759. */
  2760. 'evaluate': reEvaluate,
  2761. /**
  2762. * Used to detect `data` property values to inject.
  2763. *
  2764. * @memberOf _.templateSettings
  2765. * @type {RegExp}
  2766. */
  2767. 'interpolate': reInterpolate,
  2768. /**
  2769. * Used to reference the data object in the template text.
  2770. *
  2771. * @memberOf _.templateSettings
  2772. * @type {string}
  2773. */
  2774. 'variable': '',
  2775. /**
  2776. * Used to import variables into the compiled template.
  2777. *
  2778. * @memberOf _.templateSettings
  2779. * @type {Object}
  2780. */
  2781. 'imports': {
  2782. /**
  2783. * A reference to the `lodash` function.
  2784. *
  2785. * @memberOf _.templateSettings.imports
  2786. * @type {Function}
  2787. */
  2788. '_': lodash
  2789. }
  2790. };
  2791. // Ensure wrappers are instances of `baseLodash`.
  2792. lodash.prototype = baseLodash.prototype;
  2793. lodash.prototype.constructor = lodash;
  2794. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2795. LodashWrapper.prototype.constructor = LodashWrapper;
  2796. /*------------------------------------------------------------------------*/
  2797. /**
  2798. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2799. *
  2800. * @private
  2801. * @constructor
  2802. * @param {*} value The value to wrap.
  2803. */
  2804. function LazyWrapper(value) {
  2805. this.__wrapped__ = value;
  2806. this.__actions__ = [];
  2807. this.__dir__ = 1;
  2808. this.__filtered__ = false;
  2809. this.__iteratees__ = [];
  2810. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2811. this.__views__ = [];
  2812. }
  2813. /**
  2814. * Creates a clone of the lazy wrapper object.
  2815. *
  2816. * @private
  2817. * @name clone
  2818. * @memberOf LazyWrapper
  2819. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2820. */
  2821. function lazyClone() {
  2822. var result = new LazyWrapper(this.__wrapped__);
  2823. result.__actions__ = copyArray(this.__actions__);
  2824. result.__dir__ = this.__dir__;
  2825. result.__filtered__ = this.__filtered__;
  2826. result.__iteratees__ = copyArray(this.__iteratees__);
  2827. result.__takeCount__ = this.__takeCount__;
  2828. result.__views__ = copyArray(this.__views__);
  2829. return result;
  2830. }
  2831. /**
  2832. * Reverses the direction of lazy iteration.
  2833. *
  2834. * @private
  2835. * @name reverse
  2836. * @memberOf LazyWrapper
  2837. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2838. */
  2839. function lazyReverse() {
  2840. if (this.__filtered__) {
  2841. var result = new LazyWrapper(this);
  2842. result.__dir__ = -1;
  2843. result.__filtered__ = true;
  2844. } else {
  2845. result = this.clone();
  2846. result.__dir__ *= -1;
  2847. }
  2848. return result;
  2849. }
  2850. /**
  2851. * Extracts the unwrapped value from its lazy wrapper.
  2852. *
  2853. * @private
  2854. * @name value
  2855. * @memberOf LazyWrapper
  2856. * @returns {*} Returns the unwrapped value.
  2857. */
  2858. function lazyValue() {
  2859. var array = this.__wrapped__.value(),
  2860. dir = this.__dir__,
  2861. isArr = isArray(array),
  2862. isRight = dir < 0,
  2863. arrLength = isArr ? array.length : 0,
  2864. view = getView(0, arrLength, this.__views__),
  2865. start = view.start,
  2866. end = view.end,
  2867. length = end - start,
  2868. index = isRight ? end : (start - 1),
  2869. iteratees = this.__iteratees__,
  2870. iterLength = iteratees.length,
  2871. resIndex = 0,
  2872. takeCount = nativeMin(length, this.__takeCount__);
  2873. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2874. return baseWrapperValue(array, this.__actions__);
  2875. }
  2876. var result = [];
  2877. outer:
  2878. while (length-- && resIndex < takeCount) {
  2879. index += dir;
  2880. var iterIndex = -1,
  2881. value = array[index];
  2882. while (++iterIndex < iterLength) {
  2883. var data = iteratees[iterIndex],
  2884. iteratee = data.iteratee,
  2885. type = data.type,
  2886. computed = iteratee(value);
  2887. if (type == LAZY_MAP_FLAG) {
  2888. value = computed;
  2889. } else if (!computed) {
  2890. if (type == LAZY_FILTER_FLAG) {
  2891. continue outer;
  2892. } else {
  2893. break outer;
  2894. }
  2895. }
  2896. }
  2897. result[resIndex++] = value;
  2898. }
  2899. return result;
  2900. }
  2901. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2902. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2903. LazyWrapper.prototype.constructor = LazyWrapper;
  2904. /*------------------------------------------------------------------------*/
  2905. /**
  2906. * Creates a hash object.
  2907. *
  2908. * @private
  2909. * @constructor
  2910. * @param {Array} [entries] The key-value pairs to cache.
  2911. */
  2912. function Hash(entries) {
  2913. var index = -1,
  2914. length = entries == null ? 0 : entries.length;
  2915. this.clear();
  2916. while (++index < length) {
  2917. var entry = entries[index];
  2918. this.set(entry[0], entry[1]);
  2919. }
  2920. }
  2921. /**
  2922. * Removes all key-value entries from the hash.
  2923. *
  2924. * @private
  2925. * @name clear
  2926. * @memberOf Hash
  2927. */
  2928. function hashClear() {
  2929. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2930. this.size = 0;
  2931. }
  2932. /**
  2933. * Removes `key` and its value from the hash.
  2934. *
  2935. * @private
  2936. * @name delete
  2937. * @memberOf Hash
  2938. * @param {Object} hash The hash to modify.
  2939. * @param {string} key The key of the value to remove.
  2940. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2941. */
  2942. function hashDelete(key) {
  2943. var result = this.has(key) && delete this.__data__[key];
  2944. this.size -= result ? 1 : 0;
  2945. return result;
  2946. }
  2947. /**
  2948. * Gets the hash value for `key`.
  2949. *
  2950. * @private
  2951. * @name get
  2952. * @memberOf Hash
  2953. * @param {string} key The key of the value to get.
  2954. * @returns {*} Returns the entry value.
  2955. */
  2956. function hashGet(key) {
  2957. var data = this.__data__;
  2958. if (nativeCreate) {
  2959. var result = data[key];
  2960. return result === HASH_UNDEFINED ? undefined : result;
  2961. }
  2962. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2963. }
  2964. /**
  2965. * Checks if a hash value for `key` exists.
  2966. *
  2967. * @private
  2968. * @name has
  2969. * @memberOf Hash
  2970. * @param {string} key The key of the entry to check.
  2971. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2972. */
  2973. function hashHas(key) {
  2974. var data = this.__data__;
  2975. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2976. }
  2977. /**
  2978. * Sets the hash `key` to `value`.
  2979. *
  2980. * @private
  2981. * @name set
  2982. * @memberOf Hash
  2983. * @param {string} key The key of the value to set.
  2984. * @param {*} value The value to set.
  2985. * @returns {Object} Returns the hash instance.
  2986. */
  2987. function hashSet(key, value) {
  2988. var data = this.__data__;
  2989. this.size += this.has(key) ? 0 : 1;
  2990. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2991. return this;
  2992. }
  2993. // Add methods to `Hash`.
  2994. Hash.prototype.clear = hashClear;
  2995. Hash.prototype['delete'] = hashDelete;
  2996. Hash.prototype.get = hashGet;
  2997. Hash.prototype.has = hashHas;
  2998. Hash.prototype.set = hashSet;
  2999. /*------------------------------------------------------------------------*/
  3000. /**
  3001. * Creates an list cache object.
  3002. *
  3003. * @private
  3004. * @constructor
  3005. * @param {Array} [entries] The key-value pairs to cache.
  3006. */
  3007. function ListCache(entries) {
  3008. var index = -1,
  3009. length = entries == null ? 0 : entries.length;
  3010. this.clear();
  3011. while (++index < length) {
  3012. var entry = entries[index];
  3013. this.set(entry[0], entry[1]);
  3014. }
  3015. }
  3016. /**
  3017. * Removes all key-value entries from the list cache.
  3018. *
  3019. * @private
  3020. * @name clear
  3021. * @memberOf ListCache
  3022. */
  3023. function listCacheClear() {
  3024. this.__data__ = [];
  3025. this.size = 0;
  3026. }
  3027. /**
  3028. * Removes `key` and its value from the list cache.
  3029. *
  3030. * @private
  3031. * @name delete
  3032. * @memberOf ListCache
  3033. * @param {string} key The key of the value to remove.
  3034. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3035. */
  3036. function listCacheDelete(key) {
  3037. var data = this.__data__,
  3038. index = assocIndexOf(data, key);
  3039. if (index < 0) {
  3040. return false;
  3041. }
  3042. var lastIndex = data.length - 1;
  3043. if (index == lastIndex) {
  3044. data.pop();
  3045. } else {
  3046. splice.call(data, index, 1);
  3047. }
  3048. --this.size;
  3049. return true;
  3050. }
  3051. /**
  3052. * Gets the list cache value for `key`.
  3053. *
  3054. * @private
  3055. * @name get
  3056. * @memberOf ListCache
  3057. * @param {string} key The key of the value to get.
  3058. * @returns {*} Returns the entry value.
  3059. */
  3060. function listCacheGet(key) {
  3061. var data = this.__data__,
  3062. index = assocIndexOf(data, key);
  3063. return index < 0 ? undefined : data[index][1];
  3064. }
  3065. /**
  3066. * Checks if a list cache value for `key` exists.
  3067. *
  3068. * @private
  3069. * @name has
  3070. * @memberOf ListCache
  3071. * @param {string} key The key of the entry to check.
  3072. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3073. */
  3074. function listCacheHas(key) {
  3075. return assocIndexOf(this.__data__, key) > -1;
  3076. }
  3077. /**
  3078. * Sets the list cache `key` to `value`.
  3079. *
  3080. * @private
  3081. * @name set
  3082. * @memberOf ListCache
  3083. * @param {string} key The key of the value to set.
  3084. * @param {*} value The value to set.
  3085. * @returns {Object} Returns the list cache instance.
  3086. */
  3087. function listCacheSet(key, value) {
  3088. var data = this.__data__,
  3089. index = assocIndexOf(data, key);
  3090. if (index < 0) {
  3091. ++this.size;
  3092. data.push([key, value]);
  3093. } else {
  3094. data[index][1] = value;
  3095. }
  3096. return this;
  3097. }
  3098. // Add methods to `ListCache`.
  3099. ListCache.prototype.clear = listCacheClear;
  3100. ListCache.prototype['delete'] = listCacheDelete;
  3101. ListCache.prototype.get = listCacheGet;
  3102. ListCache.prototype.has = listCacheHas;
  3103. ListCache.prototype.set = listCacheSet;
  3104. /*------------------------------------------------------------------------*/
  3105. /**
  3106. * Creates a map cache object to store key-value pairs.
  3107. *
  3108. * @private
  3109. * @constructor
  3110. * @param {Array} [entries] The key-value pairs to cache.
  3111. */
  3112. function MapCache(entries) {
  3113. var index = -1,
  3114. length = entries == null ? 0 : entries.length;
  3115. this.clear();
  3116. while (++index < length) {
  3117. var entry = entries[index];
  3118. this.set(entry[0], entry[1]);
  3119. }
  3120. }
  3121. /**
  3122. * Removes all key-value entries from the map.
  3123. *
  3124. * @private
  3125. * @name clear
  3126. * @memberOf MapCache
  3127. */
  3128. function mapCacheClear() {
  3129. this.size = 0;
  3130. this.__data__ = {
  3131. 'hash': new Hash,
  3132. 'map': new (Map || ListCache),
  3133. 'string': new Hash
  3134. };
  3135. }
  3136. /**
  3137. * Removes `key` and its value from the map.
  3138. *
  3139. * @private
  3140. * @name delete
  3141. * @memberOf MapCache
  3142. * @param {string} key The key of the value to remove.
  3143. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3144. */
  3145. function mapCacheDelete(key) {
  3146. var result = getMapData(this, key)['delete'](key);
  3147. this.size -= result ? 1 : 0;
  3148. return result;
  3149. }
  3150. /**
  3151. * Gets the map value for `key`.
  3152. *
  3153. * @private
  3154. * @name get
  3155. * @memberOf MapCache
  3156. * @param {string} key The key of the value to get.
  3157. * @returns {*} Returns the entry value.
  3158. */
  3159. function mapCacheGet(key) {
  3160. return getMapData(this, key).get(key);
  3161. }
  3162. /**
  3163. * Checks if a map value for `key` exists.
  3164. *
  3165. * @private
  3166. * @name has
  3167. * @memberOf MapCache
  3168. * @param {string} key The key of the entry to check.
  3169. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3170. */
  3171. function mapCacheHas(key) {
  3172. return getMapData(this, key).has(key);
  3173. }
  3174. /**
  3175. * Sets the map `key` to `value`.
  3176. *
  3177. * @private
  3178. * @name set
  3179. * @memberOf MapCache
  3180. * @param {string} key The key of the value to set.
  3181. * @param {*} value The value to set.
  3182. * @returns {Object} Returns the map cache instance.
  3183. */
  3184. function mapCacheSet(key, value) {
  3185. var data = getMapData(this, key),
  3186. size = data.size;
  3187. data.set(key, value);
  3188. this.size += data.size == size ? 0 : 1;
  3189. return this;
  3190. }
  3191. // Add methods to `MapCache`.
  3192. MapCache.prototype.clear = mapCacheClear;
  3193. MapCache.prototype['delete'] = mapCacheDelete;
  3194. MapCache.prototype.get = mapCacheGet;
  3195. MapCache.prototype.has = mapCacheHas;
  3196. MapCache.prototype.set = mapCacheSet;
  3197. /*------------------------------------------------------------------------*/
  3198. /**
  3199. *
  3200. * Creates an array cache object to store unique values.
  3201. *
  3202. * @private
  3203. * @constructor
  3204. * @param {Array} [values] The values to cache.
  3205. */
  3206. function SetCache(values) {
  3207. var index = -1,
  3208. length = values == null ? 0 : values.length;
  3209. this.__data__ = new MapCache;
  3210. while (++index < length) {
  3211. this.add(values[index]);
  3212. }
  3213. }
  3214. /**
  3215. * Adds `value` to the array cache.
  3216. *
  3217. * @private
  3218. * @name add
  3219. * @memberOf SetCache
  3220. * @alias push
  3221. * @param {*} value The value to cache.
  3222. * @returns {Object} Returns the cache instance.
  3223. */
  3224. function setCacheAdd(value) {
  3225. this.__data__.set(value, HASH_UNDEFINED);
  3226. return this;
  3227. }
  3228. /**
  3229. * Checks if `value` is in the array cache.
  3230. *
  3231. * @private
  3232. * @name has
  3233. * @memberOf SetCache
  3234. * @param {*} value The value to search for.
  3235. * @returns {number} Returns `true` if `value` is found, else `false`.
  3236. */
  3237. function setCacheHas(value) {
  3238. return this.__data__.has(value);
  3239. }
  3240. // Add methods to `SetCache`.
  3241. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3242. SetCache.prototype.has = setCacheHas;
  3243. /*------------------------------------------------------------------------*/
  3244. /**
  3245. * Creates a stack cache object to store key-value pairs.
  3246. *
  3247. * @private
  3248. * @constructor
  3249. * @param {Array} [entries] The key-value pairs to cache.
  3250. */
  3251. function Stack(entries) {
  3252. var data = this.__data__ = new ListCache(entries);
  3253. this.size = data.size;
  3254. }
  3255. /**
  3256. * Removes all key-value entries from the stack.
  3257. *
  3258. * @private
  3259. * @name clear
  3260. * @memberOf Stack
  3261. */
  3262. function stackClear() {
  3263. this.__data__ = new ListCache;
  3264. this.size = 0;
  3265. }
  3266. /**
  3267. * Removes `key` and its value from the stack.
  3268. *
  3269. * @private
  3270. * @name delete
  3271. * @memberOf Stack
  3272. * @param {string} key The key of the value to remove.
  3273. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3274. */
  3275. function stackDelete(key) {
  3276. var data = this.__data__,
  3277. result = data['delete'](key);
  3278. this.size = data.size;
  3279. return result;
  3280. }
  3281. /**
  3282. * Gets the stack value for `key`.
  3283. *
  3284. * @private
  3285. * @name get
  3286. * @memberOf Stack
  3287. * @param {string} key The key of the value to get.
  3288. * @returns {*} Returns the entry value.
  3289. */
  3290. function stackGet(key) {
  3291. return this.__data__.get(key);
  3292. }
  3293. /**
  3294. * Checks if a stack value for `key` exists.
  3295. *
  3296. * @private
  3297. * @name has
  3298. * @memberOf Stack
  3299. * @param {string} key The key of the entry to check.
  3300. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3301. */
  3302. function stackHas(key) {
  3303. return this.__data__.has(key);
  3304. }
  3305. /**
  3306. * Sets the stack `key` to `value`.
  3307. *
  3308. * @private
  3309. * @name set
  3310. * @memberOf Stack
  3311. * @param {string} key The key of the value to set.
  3312. * @param {*} value The value to set.
  3313. * @returns {Object} Returns the stack cache instance.
  3314. */
  3315. function stackSet(key, value) {
  3316. var data = this.__data__;
  3317. if (data instanceof ListCache) {
  3318. var pairs = data.__data__;
  3319. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3320. pairs.push([key, value]);
  3321. this.size = ++data.size;
  3322. return this;
  3323. }
  3324. data = this.__data__ = new MapCache(pairs);
  3325. }
  3326. data.set(key, value);
  3327. this.size = data.size;
  3328. return this;
  3329. }
  3330. // Add methods to `Stack`.
  3331. Stack.prototype.clear = stackClear;
  3332. Stack.prototype['delete'] = stackDelete;
  3333. Stack.prototype.get = stackGet;
  3334. Stack.prototype.has = stackHas;
  3335. Stack.prototype.set = stackSet;
  3336. /*------------------------------------------------------------------------*/
  3337. /**
  3338. * Creates an array of the enumerable property names of the array-like `value`.
  3339. *
  3340. * @private
  3341. * @param {*} value The value to query.
  3342. * @param {boolean} inherited Specify returning inherited property names.
  3343. * @returns {Array} Returns the array of property names.
  3344. */
  3345. function arrayLikeKeys(value, inherited) {
  3346. var isArr = isArray(value),
  3347. isArg = !isArr && isArguments(value),
  3348. isBuff = !isArr && !isArg && isBuffer(value),
  3349. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3350. skipIndexes = isArr || isArg || isBuff || isType,
  3351. result = skipIndexes ? baseTimes(value.length, String) : [],
  3352. length = result.length;
  3353. for (var key in value) {
  3354. if ((inherited || hasOwnProperty.call(value, key)) &&
  3355. !(skipIndexes && (
  3356. // Safari 9 has enumerable `arguments.length` in strict mode.
  3357. key == 'length' ||
  3358. // Node.js 0.10 has enumerable non-index properties on buffers.
  3359. (isBuff && (key == 'offset' || key == 'parent')) ||
  3360. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3361. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3362. // Skip index properties.
  3363. isIndex(key, length)
  3364. ))) {
  3365. result.push(key);
  3366. }
  3367. }
  3368. return result;
  3369. }
  3370. /**
  3371. * A specialized version of `_.sample` for arrays.
  3372. *
  3373. * @private
  3374. * @param {Array} array The array to sample.
  3375. * @returns {*} Returns the random element.
  3376. */
  3377. function arraySample(array) {
  3378. var length = array.length;
  3379. return length ? array[baseRandom(0, length - 1)] : undefined;
  3380. }
  3381. /**
  3382. * A specialized version of `_.sampleSize` for arrays.
  3383. *
  3384. * @private
  3385. * @param {Array} array The array to sample.
  3386. * @param {number} n The number of elements to sample.
  3387. * @returns {Array} Returns the random elements.
  3388. */
  3389. function arraySampleSize(array, n) {
  3390. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3391. }
  3392. /**
  3393. * A specialized version of `_.shuffle` for arrays.
  3394. *
  3395. * @private
  3396. * @param {Array} array The array to shuffle.
  3397. * @returns {Array} Returns the new shuffled array.
  3398. */
  3399. function arrayShuffle(array) {
  3400. return shuffleSelf(copyArray(array));
  3401. }
  3402. /**
  3403. * This function is like `assignValue` except that it doesn't assign
  3404. * `undefined` values.
  3405. *
  3406. * @private
  3407. * @param {Object} object The object to modify.
  3408. * @param {string} key The key of the property to assign.
  3409. * @param {*} value The value to assign.
  3410. */
  3411. function assignMergeValue(object, key, value) {
  3412. if ((value !== undefined && !eq(object[key], value)) ||
  3413. (value === undefined && !(key in object))) {
  3414. baseAssignValue(object, key, value);
  3415. }
  3416. }
  3417. /**
  3418. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3419. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3420. * for equality comparisons.
  3421. *
  3422. * @private
  3423. * @param {Object} object The object to modify.
  3424. * @param {string} key The key of the property to assign.
  3425. * @param {*} value The value to assign.
  3426. */
  3427. function assignValue(object, key, value) {
  3428. var objValue = object[key];
  3429. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3430. (value === undefined && !(key in object))) {
  3431. baseAssignValue(object, key, value);
  3432. }
  3433. }
  3434. /**
  3435. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3436. *
  3437. * @private
  3438. * @param {Array} array The array to inspect.
  3439. * @param {*} key The key to search for.
  3440. * @returns {number} Returns the index of the matched value, else `-1`.
  3441. */
  3442. function assocIndexOf(array, key) {
  3443. var length = array.length;
  3444. while (length--) {
  3445. if (eq(array[length][0], key)) {
  3446. return length;
  3447. }
  3448. }
  3449. return -1;
  3450. }
  3451. /**
  3452. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3453. * by `iteratee` and values set by `setter`.
  3454. *
  3455. * @private
  3456. * @param {Array|Object} collection The collection to iterate over.
  3457. * @param {Function} setter The function to set `accumulator` values.
  3458. * @param {Function} iteratee The iteratee to transform keys.
  3459. * @param {Object} accumulator The initial aggregated object.
  3460. * @returns {Function} Returns `accumulator`.
  3461. */
  3462. function baseAggregator(collection, setter, iteratee, accumulator) {
  3463. baseEach(collection, function(value, key, collection) {
  3464. setter(accumulator, value, iteratee(value), collection);
  3465. });
  3466. return accumulator;
  3467. }
  3468. /**
  3469. * The base implementation of `_.assign` without support for multiple sources
  3470. * or `customizer` functions.
  3471. *
  3472. * @private
  3473. * @param {Object} object The destination object.
  3474. * @param {Object} source The source object.
  3475. * @returns {Object} Returns `object`.
  3476. */
  3477. function baseAssign(object, source) {
  3478. return object && copyObject(source, keys(source), object);
  3479. }
  3480. /**
  3481. * The base implementation of `_.assignIn` without support for multiple sources
  3482. * or `customizer` functions.
  3483. *
  3484. * @private
  3485. * @param {Object} object The destination object.
  3486. * @param {Object} source The source object.
  3487. * @returns {Object} Returns `object`.
  3488. */
  3489. function baseAssignIn(object, source) {
  3490. return object && copyObject(source, keysIn(source), object);
  3491. }
  3492. /**
  3493. * The base implementation of `assignValue` and `assignMergeValue` without
  3494. * value checks.
  3495. *
  3496. * @private
  3497. * @param {Object} object The object to modify.
  3498. * @param {string} key The key of the property to assign.
  3499. * @param {*} value The value to assign.
  3500. */
  3501. function baseAssignValue(object, key, value) {
  3502. if (key == '__proto__' && defineProperty) {
  3503. defineProperty(object, key, {
  3504. 'configurable': true,
  3505. 'enumerable': true,
  3506. 'value': value,
  3507. 'writable': true
  3508. });
  3509. } else {
  3510. object[key] = value;
  3511. }
  3512. }
  3513. /**
  3514. * The base implementation of `_.at` without support for individual paths.
  3515. *
  3516. * @private
  3517. * @param {Object} object The object to iterate over.
  3518. * @param {string[]} paths The property paths to pick.
  3519. * @returns {Array} Returns the picked elements.
  3520. */
  3521. function baseAt(object, paths) {
  3522. var index = -1,
  3523. length = paths.length,
  3524. result = Array(length),
  3525. skip = object == null;
  3526. while (++index < length) {
  3527. result[index] = skip ? undefined : get(object, paths[index]);
  3528. }
  3529. return result;
  3530. }
  3531. /**
  3532. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3533. *
  3534. * @private
  3535. * @param {number} number The number to clamp.
  3536. * @param {number} [lower] The lower bound.
  3537. * @param {number} upper The upper bound.
  3538. * @returns {number} Returns the clamped number.
  3539. */
  3540. function baseClamp(number, lower, upper) {
  3541. if (number === number) {
  3542. if (upper !== undefined) {
  3543. number = number <= upper ? number : upper;
  3544. }
  3545. if (lower !== undefined) {
  3546. number = number >= lower ? number : lower;
  3547. }
  3548. }
  3549. return number;
  3550. }
  3551. /**
  3552. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3553. * traversed objects.
  3554. *
  3555. * @private
  3556. * @param {*} value The value to clone.
  3557. * @param {boolean} bitmask The bitmask flags.
  3558. * 1 - Deep clone
  3559. * 2 - Flatten inherited properties
  3560. * 4 - Clone symbols
  3561. * @param {Function} [customizer] The function to customize cloning.
  3562. * @param {string} [key] The key of `value`.
  3563. * @param {Object} [object] The parent object of `value`.
  3564. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3565. * @returns {*} Returns the cloned value.
  3566. */
  3567. function baseClone(value, bitmask, customizer, key, object, stack) {
  3568. var result,
  3569. isDeep = bitmask & CLONE_DEEP_FLAG,
  3570. isFlat = bitmask & CLONE_FLAT_FLAG,
  3571. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3572. if (customizer) {
  3573. result = object ? customizer(value, key, object, stack) : customizer(value);
  3574. }
  3575. if (result !== undefined) {
  3576. return result;
  3577. }
  3578. if (!isObject(value)) {
  3579. return value;
  3580. }
  3581. var isArr = isArray(value);
  3582. if (isArr) {
  3583. result = initCloneArray(value);
  3584. if (!isDeep) {
  3585. return copyArray(value, result);
  3586. }
  3587. } else {
  3588. var tag = getTag(value),
  3589. isFunc = tag == funcTag || tag == genTag;
  3590. if (isBuffer(value)) {
  3591. return cloneBuffer(value, isDeep);
  3592. }
  3593. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3594. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3595. if (!isDeep) {
  3596. return isFlat
  3597. ? copySymbolsIn(value, baseAssignIn(result, value))
  3598. : copySymbols(value, baseAssign(result, value));
  3599. }
  3600. } else {
  3601. if (!cloneableTags[tag]) {
  3602. return object ? value : {};
  3603. }
  3604. result = initCloneByTag(value, tag, isDeep);
  3605. }
  3606. }
  3607. // Check for circular references and return its corresponding clone.
  3608. stack || (stack = new Stack);
  3609. var stacked = stack.get(value);
  3610. if (stacked) {
  3611. return stacked;
  3612. }
  3613. stack.set(value, result);
  3614. if (isSet(value)) {
  3615. value.forEach(function(subValue) {
  3616. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3617. });
  3618. } else if (isMap(value)) {
  3619. value.forEach(function(subValue, key) {
  3620. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3621. });
  3622. }
  3623. var keysFunc = isFull
  3624. ? (isFlat ? getAllKeysIn : getAllKeys)
  3625. : (isFlat ? keysIn : keys);
  3626. var props = isArr ? undefined : keysFunc(value);
  3627. arrayEach(props || value, function(subValue, key) {
  3628. if (props) {
  3629. key = subValue;
  3630. subValue = value[key];
  3631. }
  3632. // Recursively populate clone (susceptible to call stack limits).
  3633. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3634. });
  3635. return result;
  3636. }
  3637. /**
  3638. * The base implementation of `_.conforms` which doesn't clone `source`.
  3639. *
  3640. * @private
  3641. * @param {Object} source The object of property predicates to conform to.
  3642. * @returns {Function} Returns the new spec function.
  3643. */
  3644. function baseConforms(source) {
  3645. var props = keys(source);
  3646. return function(object) {
  3647. return baseConformsTo(object, source, props);
  3648. };
  3649. }
  3650. /**
  3651. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3652. *
  3653. * @private
  3654. * @param {Object} object The object to inspect.
  3655. * @param {Object} source The object of property predicates to conform to.
  3656. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3657. */
  3658. function baseConformsTo(object, source, props) {
  3659. var length = props.length;
  3660. if (object == null) {
  3661. return !length;
  3662. }
  3663. object = Object(object);
  3664. while (length--) {
  3665. var key = props[length],
  3666. predicate = source[key],
  3667. value = object[key];
  3668. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3669. return false;
  3670. }
  3671. }
  3672. return true;
  3673. }
  3674. /**
  3675. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3676. * to provide to `func`.
  3677. *
  3678. * @private
  3679. * @param {Function} func The function to delay.
  3680. * @param {number} wait The number of milliseconds to delay invocation.
  3681. * @param {Array} args The arguments to provide to `func`.
  3682. * @returns {number|Object} Returns the timer id or timeout object.
  3683. */
  3684. function baseDelay(func, wait, args) {
  3685. if (typeof func != 'function') {
  3686. throw new TypeError(FUNC_ERROR_TEXT);
  3687. }
  3688. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3689. }
  3690. /**
  3691. * The base implementation of methods like `_.difference` without support
  3692. * for excluding multiple arrays or iteratee shorthands.
  3693. *
  3694. * @private
  3695. * @param {Array} array The array to inspect.
  3696. * @param {Array} values The values to exclude.
  3697. * @param {Function} [iteratee] The iteratee invoked per element.
  3698. * @param {Function} [comparator] The comparator invoked per element.
  3699. * @returns {Array} Returns the new array of filtered values.
  3700. */
  3701. function baseDifference(array, values, iteratee, comparator) {
  3702. var index = -1,
  3703. includes = arrayIncludes,
  3704. isCommon = true,
  3705. length = array.length,
  3706. result = [],
  3707. valuesLength = values.length;
  3708. if (!length) {
  3709. return result;
  3710. }
  3711. if (iteratee) {
  3712. values = arrayMap(values, baseUnary(iteratee));
  3713. }
  3714. if (comparator) {
  3715. includes = arrayIncludesWith;
  3716. isCommon = false;
  3717. }
  3718. else if (values.length >= LARGE_ARRAY_SIZE) {
  3719. includes = cacheHas;
  3720. isCommon = false;
  3721. values = new SetCache(values);
  3722. }
  3723. outer:
  3724. while (++index < length) {
  3725. var value = array[index],
  3726. computed = iteratee == null ? value : iteratee(value);
  3727. value = (comparator || value !== 0) ? value : 0;
  3728. if (isCommon && computed === computed) {
  3729. var valuesIndex = valuesLength;
  3730. while (valuesIndex--) {
  3731. if (values[valuesIndex] === computed) {
  3732. continue outer;
  3733. }
  3734. }
  3735. result.push(value);
  3736. }
  3737. else if (!includes(values, computed, comparator)) {
  3738. result.push(value);
  3739. }
  3740. }
  3741. return result;
  3742. }
  3743. /**
  3744. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3745. *
  3746. * @private
  3747. * @param {Array|Object} collection The collection to iterate over.
  3748. * @param {Function} iteratee The function invoked per iteration.
  3749. * @returns {Array|Object} Returns `collection`.
  3750. */
  3751. var baseEach = createBaseEach(baseForOwn);
  3752. /**
  3753. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3754. *
  3755. * @private
  3756. * @param {Array|Object} collection The collection to iterate over.
  3757. * @param {Function} iteratee The function invoked per iteration.
  3758. * @returns {Array|Object} Returns `collection`.
  3759. */
  3760. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3761. /**
  3762. * The base implementation of `_.every` without support for iteratee shorthands.
  3763. *
  3764. * @private
  3765. * @param {Array|Object} collection The collection to iterate over.
  3766. * @param {Function} predicate The function invoked per iteration.
  3767. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3768. * else `false`
  3769. */
  3770. function baseEvery(collection, predicate) {
  3771. var result = true;
  3772. baseEach(collection, function(value, index, collection) {
  3773. result = !!predicate(value, index, collection);
  3774. return result;
  3775. });
  3776. return result;
  3777. }
  3778. /**
  3779. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3780. * `comparator` to determine the extremum value.
  3781. *
  3782. * @private
  3783. * @param {Array} array The array to iterate over.
  3784. * @param {Function} iteratee The iteratee invoked per iteration.
  3785. * @param {Function} comparator The comparator used to compare values.
  3786. * @returns {*} Returns the extremum value.
  3787. */
  3788. function baseExtremum(array, iteratee, comparator) {
  3789. var index = -1,
  3790. length = array.length;
  3791. while (++index < length) {
  3792. var value = array[index],
  3793. current = iteratee(value);
  3794. if (current != null && (computed === undefined
  3795. ? (current === current && !isSymbol(current))
  3796. : comparator(current, computed)
  3797. )) {
  3798. var computed = current,
  3799. result = value;
  3800. }
  3801. }
  3802. return result;
  3803. }
  3804. /**
  3805. * The base implementation of `_.fill` without an iteratee call guard.
  3806. *
  3807. * @private
  3808. * @param {Array} array The array to fill.
  3809. * @param {*} value The value to fill `array` with.
  3810. * @param {number} [start=0] The start position.
  3811. * @param {number} [end=array.length] The end position.
  3812. * @returns {Array} Returns `array`.
  3813. */
  3814. function baseFill(array, value, start, end) {
  3815. var length = array.length;
  3816. start = toInteger(start);
  3817. if (start < 0) {
  3818. start = -start > length ? 0 : (length + start);
  3819. }
  3820. end = (end === undefined || end > length) ? length : toInteger(end);
  3821. if (end < 0) {
  3822. end += length;
  3823. }
  3824. end = start > end ? 0 : toLength(end);
  3825. while (start < end) {
  3826. array[start++] = value;
  3827. }
  3828. return array;
  3829. }
  3830. /**
  3831. * The base implementation of `_.filter` without support for iteratee shorthands.
  3832. *
  3833. * @private
  3834. * @param {Array|Object} collection The collection to iterate over.
  3835. * @param {Function} predicate The function invoked per iteration.
  3836. * @returns {Array} Returns the new filtered array.
  3837. */
  3838. function baseFilter(collection, predicate) {
  3839. var result = [];
  3840. baseEach(collection, function(value, index, collection) {
  3841. if (predicate(value, index, collection)) {
  3842. result.push(value);
  3843. }
  3844. });
  3845. return result;
  3846. }
  3847. /**
  3848. * The base implementation of `_.flatten` with support for restricting flattening.
  3849. *
  3850. * @private
  3851. * @param {Array} array The array to flatten.
  3852. * @param {number} depth The maximum recursion depth.
  3853. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3854. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3855. * @param {Array} [result=[]] The initial result value.
  3856. * @returns {Array} Returns the new flattened array.
  3857. */
  3858. function baseFlatten(array, depth, predicate, isStrict, result) {
  3859. var index = -1,
  3860. length = array.length;
  3861. predicate || (predicate = isFlattenable);
  3862. result || (result = []);
  3863. while (++index < length) {
  3864. var value = array[index];
  3865. if (depth > 0 && predicate(value)) {
  3866. if (depth > 1) {
  3867. // Recursively flatten arrays (susceptible to call stack limits).
  3868. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3869. } else {
  3870. arrayPush(result, value);
  3871. }
  3872. } else if (!isStrict) {
  3873. result[result.length] = value;
  3874. }
  3875. }
  3876. return result;
  3877. }
  3878. /**
  3879. * The base implementation of `baseForOwn` which iterates over `object`
  3880. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3881. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3882. *
  3883. * @private
  3884. * @param {Object} object The object to iterate over.
  3885. * @param {Function} iteratee The function invoked per iteration.
  3886. * @param {Function} keysFunc The function to get the keys of `object`.
  3887. * @returns {Object} Returns `object`.
  3888. */
  3889. var baseFor = createBaseFor();
  3890. /**
  3891. * This function is like `baseFor` except that it iterates over properties
  3892. * in the opposite order.
  3893. *
  3894. * @private
  3895. * @param {Object} object The object to iterate over.
  3896. * @param {Function} iteratee The function invoked per iteration.
  3897. * @param {Function} keysFunc The function to get the keys of `object`.
  3898. * @returns {Object} Returns `object`.
  3899. */
  3900. var baseForRight = createBaseFor(true);
  3901. /**
  3902. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3903. *
  3904. * @private
  3905. * @param {Object} object The object to iterate over.
  3906. * @param {Function} iteratee The function invoked per iteration.
  3907. * @returns {Object} Returns `object`.
  3908. */
  3909. function baseForOwn(object, iteratee) {
  3910. return object && baseFor(object, iteratee, keys);
  3911. }
  3912. /**
  3913. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3914. *
  3915. * @private
  3916. * @param {Object} object The object to iterate over.
  3917. * @param {Function} iteratee The function invoked per iteration.
  3918. * @returns {Object} Returns `object`.
  3919. */
  3920. function baseForOwnRight(object, iteratee) {
  3921. return object && baseForRight(object, iteratee, keys);
  3922. }
  3923. /**
  3924. * The base implementation of `_.functions` which creates an array of
  3925. * `object` function property names filtered from `props`.
  3926. *
  3927. * @private
  3928. * @param {Object} object The object to inspect.
  3929. * @param {Array} props The property names to filter.
  3930. * @returns {Array} Returns the function names.
  3931. */
  3932. function baseFunctions(object, props) {
  3933. return arrayFilter(props, function(key) {
  3934. return isFunction(object[key]);
  3935. });
  3936. }
  3937. /**
  3938. * The base implementation of `_.get` without support for default values.
  3939. *
  3940. * @private
  3941. * @param {Object} object The object to query.
  3942. * @param {Array|string} path The path of the property to get.
  3943. * @returns {*} Returns the resolved value.
  3944. */
  3945. function baseGet(object, path) {
  3946. path = castPath(path, object);
  3947. var index = 0,
  3948. length = path.length;
  3949. while (object != null && index < length) {
  3950. object = object[toKey(path[index++])];
  3951. }
  3952. return (index && index == length) ? object : undefined;
  3953. }
  3954. /**
  3955. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3956. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3957. * symbols of `object`.
  3958. *
  3959. * @private
  3960. * @param {Object} object The object to query.
  3961. * @param {Function} keysFunc The function to get the keys of `object`.
  3962. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3963. * @returns {Array} Returns the array of property names and symbols.
  3964. */
  3965. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3966. var result = keysFunc(object);
  3967. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3968. }
  3969. /**
  3970. * The base implementation of `getTag` without fallbacks for buggy environments.
  3971. *
  3972. * @private
  3973. * @param {*} value The value to query.
  3974. * @returns {string} Returns the `toStringTag`.
  3975. */
  3976. function baseGetTag(value) {
  3977. if (value == null) {
  3978. return value === undefined ? undefinedTag : nullTag;
  3979. }
  3980. return (symToStringTag && symToStringTag in Object(value))
  3981. ? getRawTag(value)
  3982. : objectToString(value);
  3983. }
  3984. /**
  3985. * The base implementation of `_.gt` which doesn't coerce arguments.
  3986. *
  3987. * @private
  3988. * @param {*} value The value to compare.
  3989. * @param {*} other The other value to compare.
  3990. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3991. * else `false`.
  3992. */
  3993. function baseGt(value, other) {
  3994. return value > other;
  3995. }
  3996. /**
  3997. * The base implementation of `_.has` without support for deep paths.
  3998. *
  3999. * @private
  4000. * @param {Object} [object] The object to query.
  4001. * @param {Array|string} key The key to check.
  4002. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4003. */
  4004. function baseHas(object, key) {
  4005. return object != null && hasOwnProperty.call(object, key);
  4006. }
  4007. /**
  4008. * The base implementation of `_.hasIn` without support for deep paths.
  4009. *
  4010. * @private
  4011. * @param {Object} [object] The object to query.
  4012. * @param {Array|string} key The key to check.
  4013. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4014. */
  4015. function baseHasIn(object, key) {
  4016. return object != null && key in Object(object);
  4017. }
  4018. /**
  4019. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4020. *
  4021. * @private
  4022. * @param {number} number The number to check.
  4023. * @param {number} start The start of the range.
  4024. * @param {number} end The end of the range.
  4025. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4026. */
  4027. function baseInRange(number, start, end) {
  4028. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4029. }
  4030. /**
  4031. * The base implementation of methods like `_.intersection`, without support
  4032. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4033. *
  4034. * @private
  4035. * @param {Array} arrays The arrays to inspect.
  4036. * @param {Function} [iteratee] The iteratee invoked per element.
  4037. * @param {Function} [comparator] The comparator invoked per element.
  4038. * @returns {Array} Returns the new array of shared values.
  4039. */
  4040. function baseIntersection(arrays, iteratee, comparator) {
  4041. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4042. length = arrays[0].length,
  4043. othLength = arrays.length,
  4044. othIndex = othLength,
  4045. caches = Array(othLength),
  4046. maxLength = Infinity,
  4047. result = [];
  4048. while (othIndex--) {
  4049. var array = arrays[othIndex];
  4050. if (othIndex && iteratee) {
  4051. array = arrayMap(array, baseUnary(iteratee));
  4052. }
  4053. maxLength = nativeMin(array.length, maxLength);
  4054. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4055. ? new SetCache(othIndex && array)
  4056. : undefined;
  4057. }
  4058. array = arrays[0];
  4059. var index = -1,
  4060. seen = caches[0];
  4061. outer:
  4062. while (++index < length && result.length < maxLength) {
  4063. var value = array[index],
  4064. computed = iteratee ? iteratee(value) : value;
  4065. value = (comparator || value !== 0) ? value : 0;
  4066. if (!(seen
  4067. ? cacheHas(seen, computed)
  4068. : includes(result, computed, comparator)
  4069. )) {
  4070. othIndex = othLength;
  4071. while (--othIndex) {
  4072. var cache = caches[othIndex];
  4073. if (!(cache
  4074. ? cacheHas(cache, computed)
  4075. : includes(arrays[othIndex], computed, comparator))
  4076. ) {
  4077. continue outer;
  4078. }
  4079. }
  4080. if (seen) {
  4081. seen.push(computed);
  4082. }
  4083. result.push(value);
  4084. }
  4085. }
  4086. return result;
  4087. }
  4088. /**
  4089. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4090. * `object` with values transformed by `iteratee` and set by `setter`.
  4091. *
  4092. * @private
  4093. * @param {Object} object The object to iterate over.
  4094. * @param {Function} setter The function to set `accumulator` values.
  4095. * @param {Function} iteratee The iteratee to transform values.
  4096. * @param {Object} accumulator The initial inverted object.
  4097. * @returns {Function} Returns `accumulator`.
  4098. */
  4099. function baseInverter(object, setter, iteratee, accumulator) {
  4100. baseForOwn(object, function(value, key, object) {
  4101. setter(accumulator, iteratee(value), key, object);
  4102. });
  4103. return accumulator;
  4104. }
  4105. /**
  4106. * The base implementation of `_.invoke` without support for individual
  4107. * method arguments.
  4108. *
  4109. * @private
  4110. * @param {Object} object The object to query.
  4111. * @param {Array|string} path The path of the method to invoke.
  4112. * @param {Array} args The arguments to invoke the method with.
  4113. * @returns {*} Returns the result of the invoked method.
  4114. */
  4115. function baseInvoke(object, path, args) {
  4116. path = castPath(path, object);
  4117. object = parent(object, path);
  4118. var func = object == null ? object : object[toKey(last(path))];
  4119. return func == null ? undefined : apply(func, object, args);
  4120. }
  4121. /**
  4122. * The base implementation of `_.isArguments`.
  4123. *
  4124. * @private
  4125. * @param {*} value The value to check.
  4126. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4127. */
  4128. function baseIsArguments(value) {
  4129. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4130. }
  4131. /**
  4132. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4133. *
  4134. * @private
  4135. * @param {*} value The value to check.
  4136. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4137. */
  4138. function baseIsArrayBuffer(value) {
  4139. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4140. }
  4141. /**
  4142. * The base implementation of `_.isDate` without Node.js optimizations.
  4143. *
  4144. * @private
  4145. * @param {*} value The value to check.
  4146. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4147. */
  4148. function baseIsDate(value) {
  4149. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4150. }
  4151. /**
  4152. * The base implementation of `_.isEqual` which supports partial comparisons
  4153. * and tracks traversed objects.
  4154. *
  4155. * @private
  4156. * @param {*} value The value to compare.
  4157. * @param {*} other The other value to compare.
  4158. * @param {boolean} bitmask The bitmask flags.
  4159. * 1 - Unordered comparison
  4160. * 2 - Partial comparison
  4161. * @param {Function} [customizer] The function to customize comparisons.
  4162. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4163. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4164. */
  4165. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4166. if (value === other) {
  4167. return true;
  4168. }
  4169. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4170. return value !== value && other !== other;
  4171. }
  4172. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4173. }
  4174. /**
  4175. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4176. * deep comparisons and tracks traversed objects enabling objects with circular
  4177. * references to be compared.
  4178. *
  4179. * @private
  4180. * @param {Object} object The object to compare.
  4181. * @param {Object} other The other object to compare.
  4182. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4183. * @param {Function} customizer The function to customize comparisons.
  4184. * @param {Function} equalFunc The function to determine equivalents of values.
  4185. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4186. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4187. */
  4188. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4189. var objIsArr = isArray(object),
  4190. othIsArr = isArray(other),
  4191. objTag = objIsArr ? arrayTag : getTag(object),
  4192. othTag = othIsArr ? arrayTag : getTag(other);
  4193. objTag = objTag == argsTag ? objectTag : objTag;
  4194. othTag = othTag == argsTag ? objectTag : othTag;
  4195. var objIsObj = objTag == objectTag,
  4196. othIsObj = othTag == objectTag,
  4197. isSameTag = objTag == othTag;
  4198. if (isSameTag && isBuffer(object)) {
  4199. if (!isBuffer(other)) {
  4200. return false;
  4201. }
  4202. objIsArr = true;
  4203. objIsObj = false;
  4204. }
  4205. if (isSameTag && !objIsObj) {
  4206. stack || (stack = new Stack);
  4207. return (objIsArr || isTypedArray(object))
  4208. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4209. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4210. }
  4211. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4212. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4213. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4214. if (objIsWrapped || othIsWrapped) {
  4215. var objUnwrapped = objIsWrapped ? object.value() : object,
  4216. othUnwrapped = othIsWrapped ? other.value() : other;
  4217. stack || (stack = new Stack);
  4218. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4219. }
  4220. }
  4221. if (!isSameTag) {
  4222. return false;
  4223. }
  4224. stack || (stack = new Stack);
  4225. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4226. }
  4227. /**
  4228. * The base implementation of `_.isMap` without Node.js optimizations.
  4229. *
  4230. * @private
  4231. * @param {*} value The value to check.
  4232. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4233. */
  4234. function baseIsMap(value) {
  4235. return isObjectLike(value) && getTag(value) == mapTag;
  4236. }
  4237. /**
  4238. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4239. *
  4240. * @private
  4241. * @param {Object} object The object to inspect.
  4242. * @param {Object} source The object of property values to match.
  4243. * @param {Array} matchData The property names, values, and compare flags to match.
  4244. * @param {Function} [customizer] The function to customize comparisons.
  4245. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4246. */
  4247. function baseIsMatch(object, source, matchData, customizer) {
  4248. var index = matchData.length,
  4249. length = index,
  4250. noCustomizer = !customizer;
  4251. if (object == null) {
  4252. return !length;
  4253. }
  4254. object = Object(object);
  4255. while (index--) {
  4256. var data = matchData[index];
  4257. if ((noCustomizer && data[2])
  4258. ? data[1] !== object[data[0]]
  4259. : !(data[0] in object)
  4260. ) {
  4261. return false;
  4262. }
  4263. }
  4264. while (++index < length) {
  4265. data = matchData[index];
  4266. var key = data[0],
  4267. objValue = object[key],
  4268. srcValue = data[1];
  4269. if (noCustomizer && data[2]) {
  4270. if (objValue === undefined && !(key in object)) {
  4271. return false;
  4272. }
  4273. } else {
  4274. var stack = new Stack;
  4275. if (customizer) {
  4276. var result = customizer(objValue, srcValue, key, object, source, stack);
  4277. }
  4278. if (!(result === undefined
  4279. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4280. : result
  4281. )) {
  4282. return false;
  4283. }
  4284. }
  4285. }
  4286. return true;
  4287. }
  4288. /**
  4289. * The base implementation of `_.isNative` without bad shim checks.
  4290. *
  4291. * @private
  4292. * @param {*} value The value to check.
  4293. * @returns {boolean} Returns `true` if `value` is a native function,
  4294. * else `false`.
  4295. */
  4296. function baseIsNative(value) {
  4297. if (!isObject(value) || isMasked(value)) {
  4298. return false;
  4299. }
  4300. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4301. return pattern.test(toSource(value));
  4302. }
  4303. /**
  4304. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4305. *
  4306. * @private
  4307. * @param {*} value The value to check.
  4308. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4309. */
  4310. function baseIsRegExp(value) {
  4311. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4312. }
  4313. /**
  4314. * The base implementation of `_.isSet` without Node.js optimizations.
  4315. *
  4316. * @private
  4317. * @param {*} value The value to check.
  4318. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4319. */
  4320. function baseIsSet(value) {
  4321. return isObjectLike(value) && getTag(value) == setTag;
  4322. }
  4323. /**
  4324. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4325. *
  4326. * @private
  4327. * @param {*} value The value to check.
  4328. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4329. */
  4330. function baseIsTypedArray(value) {
  4331. return isObjectLike(value) &&
  4332. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4333. }
  4334. /**
  4335. * The base implementation of `_.iteratee`.
  4336. *
  4337. * @private
  4338. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4339. * @returns {Function} Returns the iteratee.
  4340. */
  4341. function baseIteratee(value) {
  4342. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4343. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4344. if (typeof value == 'function') {
  4345. return value;
  4346. }
  4347. if (value == null) {
  4348. return identity;
  4349. }
  4350. if (typeof value == 'object') {
  4351. return isArray(value)
  4352. ? baseMatchesProperty(value[0], value[1])
  4353. : baseMatches(value);
  4354. }
  4355. return property(value);
  4356. }
  4357. /**
  4358. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4359. *
  4360. * @private
  4361. * @param {Object} object The object to query.
  4362. * @returns {Array} Returns the array of property names.
  4363. */
  4364. function baseKeys(object) {
  4365. if (!isPrototype(object)) {
  4366. return nativeKeys(object);
  4367. }
  4368. var result = [];
  4369. for (var key in Object(object)) {
  4370. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4371. result.push(key);
  4372. }
  4373. }
  4374. return result;
  4375. }
  4376. /**
  4377. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4378. *
  4379. * @private
  4380. * @param {Object} object The object to query.
  4381. * @returns {Array} Returns the array of property names.
  4382. */
  4383. function baseKeysIn(object) {
  4384. if (!isObject(object)) {
  4385. return nativeKeysIn(object);
  4386. }
  4387. var isProto = isPrototype(object),
  4388. result = [];
  4389. for (var key in object) {
  4390. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4391. result.push(key);
  4392. }
  4393. }
  4394. return result;
  4395. }
  4396. /**
  4397. * The base implementation of `_.lt` which doesn't coerce arguments.
  4398. *
  4399. * @private
  4400. * @param {*} value The value to compare.
  4401. * @param {*} other The other value to compare.
  4402. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4403. * else `false`.
  4404. */
  4405. function baseLt(value, other) {
  4406. return value < other;
  4407. }
  4408. /**
  4409. * The base implementation of `_.map` without support for iteratee shorthands.
  4410. *
  4411. * @private
  4412. * @param {Array|Object} collection The collection to iterate over.
  4413. * @param {Function} iteratee The function invoked per iteration.
  4414. * @returns {Array} Returns the new mapped array.
  4415. */
  4416. function baseMap(collection, iteratee) {
  4417. var index = -1,
  4418. result = isArrayLike(collection) ? Array(collection.length) : [];
  4419. baseEach(collection, function(value, key, collection) {
  4420. result[++index] = iteratee(value, key, collection);
  4421. });
  4422. return result;
  4423. }
  4424. /**
  4425. * The base implementation of `_.matches` which doesn't clone `source`.
  4426. *
  4427. * @private
  4428. * @param {Object} source The object of property values to match.
  4429. * @returns {Function} Returns the new spec function.
  4430. */
  4431. function baseMatches(source) {
  4432. var matchData = getMatchData(source);
  4433. if (matchData.length == 1 && matchData[0][2]) {
  4434. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4435. }
  4436. return function(object) {
  4437. return object === source || baseIsMatch(object, source, matchData);
  4438. };
  4439. }
  4440. /**
  4441. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4442. *
  4443. * @private
  4444. * @param {string} path The path of the property to get.
  4445. * @param {*} srcValue The value to match.
  4446. * @returns {Function} Returns the new spec function.
  4447. */
  4448. function baseMatchesProperty(path, srcValue) {
  4449. if (isKey(path) && isStrictComparable(srcValue)) {
  4450. return matchesStrictComparable(toKey(path), srcValue);
  4451. }
  4452. return function(object) {
  4453. var objValue = get(object, path);
  4454. return (objValue === undefined && objValue === srcValue)
  4455. ? hasIn(object, path)
  4456. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4457. };
  4458. }
  4459. /**
  4460. * The base implementation of `_.merge` without support for multiple sources.
  4461. *
  4462. * @private
  4463. * @param {Object} object The destination object.
  4464. * @param {Object} source The source object.
  4465. * @param {number} srcIndex The index of `source`.
  4466. * @param {Function} [customizer] The function to customize merged values.
  4467. * @param {Object} [stack] Tracks traversed source values and their merged
  4468. * counterparts.
  4469. */
  4470. function baseMerge(object, source, srcIndex, customizer, stack) {
  4471. if (object === source) {
  4472. return;
  4473. }
  4474. baseFor(source, function(srcValue, key) {
  4475. stack || (stack = new Stack);
  4476. if (isObject(srcValue)) {
  4477. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4478. }
  4479. else {
  4480. var newValue = customizer
  4481. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4482. : undefined;
  4483. if (newValue === undefined) {
  4484. newValue = srcValue;
  4485. }
  4486. assignMergeValue(object, key, newValue);
  4487. }
  4488. }, keysIn);
  4489. }
  4490. /**
  4491. * A specialized version of `baseMerge` for arrays and objects which performs
  4492. * deep merges and tracks traversed objects enabling objects with circular
  4493. * references to be merged.
  4494. *
  4495. * @private
  4496. * @param {Object} object The destination object.
  4497. * @param {Object} source The source object.
  4498. * @param {string} key The key of the value to merge.
  4499. * @param {number} srcIndex The index of `source`.
  4500. * @param {Function} mergeFunc The function to merge values.
  4501. * @param {Function} [customizer] The function to customize assigned values.
  4502. * @param {Object} [stack] Tracks traversed source values and their merged
  4503. * counterparts.
  4504. */
  4505. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4506. var objValue = safeGet(object, key),
  4507. srcValue = safeGet(source, key),
  4508. stacked = stack.get(srcValue);
  4509. if (stacked) {
  4510. assignMergeValue(object, key, stacked);
  4511. return;
  4512. }
  4513. var newValue = customizer
  4514. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4515. : undefined;
  4516. var isCommon = newValue === undefined;
  4517. if (isCommon) {
  4518. var isArr = isArray(srcValue),
  4519. isBuff = !isArr && isBuffer(srcValue),
  4520. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4521. newValue = srcValue;
  4522. if (isArr || isBuff || isTyped) {
  4523. if (isArray(objValue)) {
  4524. newValue = objValue;
  4525. }
  4526. else if (isArrayLikeObject(objValue)) {
  4527. newValue = copyArray(objValue);
  4528. }
  4529. else if (isBuff) {
  4530. isCommon = false;
  4531. newValue = cloneBuffer(srcValue, true);
  4532. }
  4533. else if (isTyped) {
  4534. isCommon = false;
  4535. newValue = cloneTypedArray(srcValue, true);
  4536. }
  4537. else {
  4538. newValue = [];
  4539. }
  4540. }
  4541. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4542. newValue = objValue;
  4543. if (isArguments(objValue)) {
  4544. newValue = toPlainObject(objValue);
  4545. }
  4546. else if (!isObject(objValue) || isFunction(objValue)) {
  4547. newValue = initCloneObject(srcValue);
  4548. }
  4549. }
  4550. else {
  4551. isCommon = false;
  4552. }
  4553. }
  4554. if (isCommon) {
  4555. // Recursively merge objects and arrays (susceptible to call stack limits).
  4556. stack.set(srcValue, newValue);
  4557. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4558. stack['delete'](srcValue);
  4559. }
  4560. assignMergeValue(object, key, newValue);
  4561. }
  4562. /**
  4563. * The base implementation of `_.nth` which doesn't coerce arguments.
  4564. *
  4565. * @private
  4566. * @param {Array} array The array to query.
  4567. * @param {number} n The index of the element to return.
  4568. * @returns {*} Returns the nth element of `array`.
  4569. */
  4570. function baseNth(array, n) {
  4571. var length = array.length;
  4572. if (!length) {
  4573. return;
  4574. }
  4575. n += n < 0 ? length : 0;
  4576. return isIndex(n, length) ? array[n] : undefined;
  4577. }
  4578. /**
  4579. * The base implementation of `_.orderBy` without param guards.
  4580. *
  4581. * @private
  4582. * @param {Array|Object} collection The collection to iterate over.
  4583. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4584. * @param {string[]} orders The sort orders of `iteratees`.
  4585. * @returns {Array} Returns the new sorted array.
  4586. */
  4587. function baseOrderBy(collection, iteratees, orders) {
  4588. if (iteratees.length) {
  4589. iteratees = arrayMap(iteratees, function(iteratee) {
  4590. if (isArray(iteratee)) {
  4591. return function(value) {
  4592. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4593. }
  4594. }
  4595. return iteratee;
  4596. });
  4597. } else {
  4598. iteratees = [identity];
  4599. }
  4600. var index = -1;
  4601. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4602. var result = baseMap(collection, function(value, key, collection) {
  4603. var criteria = arrayMap(iteratees, function(iteratee) {
  4604. return iteratee(value);
  4605. });
  4606. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4607. });
  4608. return baseSortBy(result, function(object, other) {
  4609. return compareMultiple(object, other, orders);
  4610. });
  4611. }
  4612. /**
  4613. * The base implementation of `_.pick` without support for individual
  4614. * property identifiers.
  4615. *
  4616. * @private
  4617. * @param {Object} object The source object.
  4618. * @param {string[]} paths The property paths to pick.
  4619. * @returns {Object} Returns the new object.
  4620. */
  4621. function basePick(object, paths) {
  4622. return basePickBy(object, paths, function(value, path) {
  4623. return hasIn(object, path);
  4624. });
  4625. }
  4626. /**
  4627. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4628. *
  4629. * @private
  4630. * @param {Object} object The source object.
  4631. * @param {string[]} paths The property paths to pick.
  4632. * @param {Function} predicate The function invoked per property.
  4633. * @returns {Object} Returns the new object.
  4634. */
  4635. function basePickBy(object, paths, predicate) {
  4636. var index = -1,
  4637. length = paths.length,
  4638. result = {};
  4639. while (++index < length) {
  4640. var path = paths[index],
  4641. value = baseGet(object, path);
  4642. if (predicate(value, path)) {
  4643. baseSet(result, castPath(path, object), value);
  4644. }
  4645. }
  4646. return result;
  4647. }
  4648. /**
  4649. * A specialized version of `baseProperty` which supports deep paths.
  4650. *
  4651. * @private
  4652. * @param {Array|string} path The path of the property to get.
  4653. * @returns {Function} Returns the new accessor function.
  4654. */
  4655. function basePropertyDeep(path) {
  4656. return function(object) {
  4657. return baseGet(object, path);
  4658. };
  4659. }
  4660. /**
  4661. * The base implementation of `_.pullAllBy` without support for iteratee
  4662. * shorthands.
  4663. *
  4664. * @private
  4665. * @param {Array} array The array to modify.
  4666. * @param {Array} values The values to remove.
  4667. * @param {Function} [iteratee] The iteratee invoked per element.
  4668. * @param {Function} [comparator] The comparator invoked per element.
  4669. * @returns {Array} Returns `array`.
  4670. */
  4671. function basePullAll(array, values, iteratee, comparator) {
  4672. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4673. index = -1,
  4674. length = values.length,
  4675. seen = array;
  4676. if (array === values) {
  4677. values = copyArray(values);
  4678. }
  4679. if (iteratee) {
  4680. seen = arrayMap(array, baseUnary(iteratee));
  4681. }
  4682. while (++index < length) {
  4683. var fromIndex = 0,
  4684. value = values[index],
  4685. computed = iteratee ? iteratee(value) : value;
  4686. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4687. if (seen !== array) {
  4688. splice.call(seen, fromIndex, 1);
  4689. }
  4690. splice.call(array, fromIndex, 1);
  4691. }
  4692. }
  4693. return array;
  4694. }
  4695. /**
  4696. * The base implementation of `_.pullAt` without support for individual
  4697. * indexes or capturing the removed elements.
  4698. *
  4699. * @private
  4700. * @param {Array} array The array to modify.
  4701. * @param {number[]} indexes The indexes of elements to remove.
  4702. * @returns {Array} Returns `array`.
  4703. */
  4704. function basePullAt(array, indexes) {
  4705. var length = array ? indexes.length : 0,
  4706. lastIndex = length - 1;
  4707. while (length--) {
  4708. var index = indexes[length];
  4709. if (length == lastIndex || index !== previous) {
  4710. var previous = index;
  4711. if (isIndex(index)) {
  4712. splice.call(array, index, 1);
  4713. } else {
  4714. baseUnset(array, index);
  4715. }
  4716. }
  4717. }
  4718. return array;
  4719. }
  4720. /**
  4721. * The base implementation of `_.random` without support for returning
  4722. * floating-point numbers.
  4723. *
  4724. * @private
  4725. * @param {number} lower The lower bound.
  4726. * @param {number} upper The upper bound.
  4727. * @returns {number} Returns the random number.
  4728. */
  4729. function baseRandom(lower, upper) {
  4730. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4731. }
  4732. /**
  4733. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4734. * coerce arguments.
  4735. *
  4736. * @private
  4737. * @param {number} start The start of the range.
  4738. * @param {number} end The end of the range.
  4739. * @param {number} step The value to increment or decrement by.
  4740. * @param {boolean} [fromRight] Specify iterating from right to left.
  4741. * @returns {Array} Returns the range of numbers.
  4742. */
  4743. function baseRange(start, end, step, fromRight) {
  4744. var index = -1,
  4745. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4746. result = Array(length);
  4747. while (length--) {
  4748. result[fromRight ? length : ++index] = start;
  4749. start += step;
  4750. }
  4751. return result;
  4752. }
  4753. /**
  4754. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4755. *
  4756. * @private
  4757. * @param {string} string The string to repeat.
  4758. * @param {number} n The number of times to repeat the string.
  4759. * @returns {string} Returns the repeated string.
  4760. */
  4761. function baseRepeat(string, n) {
  4762. var result = '';
  4763. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4764. return result;
  4765. }
  4766. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4767. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4768. do {
  4769. if (n % 2) {
  4770. result += string;
  4771. }
  4772. n = nativeFloor(n / 2);
  4773. if (n) {
  4774. string += string;
  4775. }
  4776. } while (n);
  4777. return result;
  4778. }
  4779. /**
  4780. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4781. *
  4782. * @private
  4783. * @param {Function} func The function to apply a rest parameter to.
  4784. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4785. * @returns {Function} Returns the new function.
  4786. */
  4787. function baseRest(func, start) {
  4788. return setToString(overRest(func, start, identity), func + '');
  4789. }
  4790. /**
  4791. * The base implementation of `_.sample`.
  4792. *
  4793. * @private
  4794. * @param {Array|Object} collection The collection to sample.
  4795. * @returns {*} Returns the random element.
  4796. */
  4797. function baseSample(collection) {
  4798. return arraySample(values(collection));
  4799. }
  4800. /**
  4801. * The base implementation of `_.sampleSize` without param guards.
  4802. *
  4803. * @private
  4804. * @param {Array|Object} collection The collection to sample.
  4805. * @param {number} n The number of elements to sample.
  4806. * @returns {Array} Returns the random elements.
  4807. */
  4808. function baseSampleSize(collection, n) {
  4809. var array = values(collection);
  4810. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4811. }
  4812. /**
  4813. * The base implementation of `_.set`.
  4814. *
  4815. * @private
  4816. * @param {Object} object The object to modify.
  4817. * @param {Array|string} path The path of the property to set.
  4818. * @param {*} value The value to set.
  4819. * @param {Function} [customizer] The function to customize path creation.
  4820. * @returns {Object} Returns `object`.
  4821. */
  4822. function baseSet(object, path, value, customizer) {
  4823. if (!isObject(object)) {
  4824. return object;
  4825. }
  4826. path = castPath(path, object);
  4827. var index = -1,
  4828. length = path.length,
  4829. lastIndex = length - 1,
  4830. nested = object;
  4831. while (nested != null && ++index < length) {
  4832. var key = toKey(path[index]),
  4833. newValue = value;
  4834. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4835. return object;
  4836. }
  4837. if (index != lastIndex) {
  4838. var objValue = nested[key];
  4839. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4840. if (newValue === undefined) {
  4841. newValue = isObject(objValue)
  4842. ? objValue
  4843. : (isIndex(path[index + 1]) ? [] : {});
  4844. }
  4845. }
  4846. assignValue(nested, key, newValue);
  4847. nested = nested[key];
  4848. }
  4849. return object;
  4850. }
  4851. /**
  4852. * The base implementation of `setData` without support for hot loop shorting.
  4853. *
  4854. * @private
  4855. * @param {Function} func The function to associate metadata with.
  4856. * @param {*} data The metadata.
  4857. * @returns {Function} Returns `func`.
  4858. */
  4859. var baseSetData = !metaMap ? identity : function(func, data) {
  4860. metaMap.set(func, data);
  4861. return func;
  4862. };
  4863. /**
  4864. * The base implementation of `setToString` without support for hot loop shorting.
  4865. *
  4866. * @private
  4867. * @param {Function} func The function to modify.
  4868. * @param {Function} string The `toString` result.
  4869. * @returns {Function} Returns `func`.
  4870. */
  4871. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4872. return defineProperty(func, 'toString', {
  4873. 'configurable': true,
  4874. 'enumerable': false,
  4875. 'value': constant(string),
  4876. 'writable': true
  4877. });
  4878. };
  4879. /**
  4880. * The base implementation of `_.shuffle`.
  4881. *
  4882. * @private
  4883. * @param {Array|Object} collection The collection to shuffle.
  4884. * @returns {Array} Returns the new shuffled array.
  4885. */
  4886. function baseShuffle(collection) {
  4887. return shuffleSelf(values(collection));
  4888. }
  4889. /**
  4890. * The base implementation of `_.slice` without an iteratee call guard.
  4891. *
  4892. * @private
  4893. * @param {Array} array The array to slice.
  4894. * @param {number} [start=0] The start position.
  4895. * @param {number} [end=array.length] The end position.
  4896. * @returns {Array} Returns the slice of `array`.
  4897. */
  4898. function baseSlice(array, start, end) {
  4899. var index = -1,
  4900. length = array.length;
  4901. if (start < 0) {
  4902. start = -start > length ? 0 : (length + start);
  4903. }
  4904. end = end > length ? length : end;
  4905. if (end < 0) {
  4906. end += length;
  4907. }
  4908. length = start > end ? 0 : ((end - start) >>> 0);
  4909. start >>>= 0;
  4910. var result = Array(length);
  4911. while (++index < length) {
  4912. result[index] = array[index + start];
  4913. }
  4914. return result;
  4915. }
  4916. /**
  4917. * The base implementation of `_.some` without support for iteratee shorthands.
  4918. *
  4919. * @private
  4920. * @param {Array|Object} collection The collection to iterate over.
  4921. * @param {Function} predicate The function invoked per iteration.
  4922. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4923. * else `false`.
  4924. */
  4925. function baseSome(collection, predicate) {
  4926. var result;
  4927. baseEach(collection, function(value, index, collection) {
  4928. result = predicate(value, index, collection);
  4929. return !result;
  4930. });
  4931. return !!result;
  4932. }
  4933. /**
  4934. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4935. * performs a binary search of `array` to determine the index at which `value`
  4936. * should be inserted into `array` in order to maintain its sort order.
  4937. *
  4938. * @private
  4939. * @param {Array} array The sorted array to inspect.
  4940. * @param {*} value The value to evaluate.
  4941. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4942. * @returns {number} Returns the index at which `value` should be inserted
  4943. * into `array`.
  4944. */
  4945. function baseSortedIndex(array, value, retHighest) {
  4946. var low = 0,
  4947. high = array == null ? low : array.length;
  4948. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4949. while (low < high) {
  4950. var mid = (low + high) >>> 1,
  4951. computed = array[mid];
  4952. if (computed !== null && !isSymbol(computed) &&
  4953. (retHighest ? (computed <= value) : (computed < value))) {
  4954. low = mid + 1;
  4955. } else {
  4956. high = mid;
  4957. }
  4958. }
  4959. return high;
  4960. }
  4961. return baseSortedIndexBy(array, value, identity, retHighest);
  4962. }
  4963. /**
  4964. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4965. * which invokes `iteratee` for `value` and each element of `array` to compute
  4966. * their sort ranking. The iteratee is invoked with one argument; (value).
  4967. *
  4968. * @private
  4969. * @param {Array} array The sorted array to inspect.
  4970. * @param {*} value The value to evaluate.
  4971. * @param {Function} iteratee The iteratee invoked per element.
  4972. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4973. * @returns {number} Returns the index at which `value` should be inserted
  4974. * into `array`.
  4975. */
  4976. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4977. var low = 0,
  4978. high = array == null ? 0 : array.length;
  4979. if (high === 0) {
  4980. return 0;
  4981. }
  4982. value = iteratee(value);
  4983. var valIsNaN = value !== value,
  4984. valIsNull = value === null,
  4985. valIsSymbol = isSymbol(value),
  4986. valIsUndefined = value === undefined;
  4987. while (low < high) {
  4988. var mid = nativeFloor((low + high) / 2),
  4989. computed = iteratee(array[mid]),
  4990. othIsDefined = computed !== undefined,
  4991. othIsNull = computed === null,
  4992. othIsReflexive = computed === computed,
  4993. othIsSymbol = isSymbol(computed);
  4994. if (valIsNaN) {
  4995. var setLow = retHighest || othIsReflexive;
  4996. } else if (valIsUndefined) {
  4997. setLow = othIsReflexive && (retHighest || othIsDefined);
  4998. } else if (valIsNull) {
  4999. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5000. } else if (valIsSymbol) {
  5001. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5002. } else if (othIsNull || othIsSymbol) {
  5003. setLow = false;
  5004. } else {
  5005. setLow = retHighest ? (computed <= value) : (computed < value);
  5006. }
  5007. if (setLow) {
  5008. low = mid + 1;
  5009. } else {
  5010. high = mid;
  5011. }
  5012. }
  5013. return nativeMin(high, MAX_ARRAY_INDEX);
  5014. }
  5015. /**
  5016. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5017. * support for iteratee shorthands.
  5018. *
  5019. * @private
  5020. * @param {Array} array The array to inspect.
  5021. * @param {Function} [iteratee] The iteratee invoked per element.
  5022. * @returns {Array} Returns the new duplicate free array.
  5023. */
  5024. function baseSortedUniq(array, iteratee) {
  5025. var index = -1,
  5026. length = array.length,
  5027. resIndex = 0,
  5028. result = [];
  5029. while (++index < length) {
  5030. var value = array[index],
  5031. computed = iteratee ? iteratee(value) : value;
  5032. if (!index || !eq(computed, seen)) {
  5033. var seen = computed;
  5034. result[resIndex++] = value === 0 ? 0 : value;
  5035. }
  5036. }
  5037. return result;
  5038. }
  5039. /**
  5040. * The base implementation of `_.toNumber` which doesn't ensure correct
  5041. * conversions of binary, hexadecimal, or octal string values.
  5042. *
  5043. * @private
  5044. * @param {*} value The value to process.
  5045. * @returns {number} Returns the number.
  5046. */
  5047. function baseToNumber(value) {
  5048. if (typeof value == 'number') {
  5049. return value;
  5050. }
  5051. if (isSymbol(value)) {
  5052. return NAN;
  5053. }
  5054. return +value;
  5055. }
  5056. /**
  5057. * The base implementation of `_.toString` which doesn't convert nullish
  5058. * values to empty strings.
  5059. *
  5060. * @private
  5061. * @param {*} value The value to process.
  5062. * @returns {string} Returns the string.
  5063. */
  5064. function baseToString(value) {
  5065. // Exit early for strings to avoid a performance hit in some environments.
  5066. if (typeof value == 'string') {
  5067. return value;
  5068. }
  5069. if (isArray(value)) {
  5070. // Recursively convert values (susceptible to call stack limits).
  5071. return arrayMap(value, baseToString) + '';
  5072. }
  5073. if (isSymbol(value)) {
  5074. return symbolToString ? symbolToString.call(value) : '';
  5075. }
  5076. var result = (value + '');
  5077. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5078. }
  5079. /**
  5080. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5081. *
  5082. * @private
  5083. * @param {Array} array The array to inspect.
  5084. * @param {Function} [iteratee] The iteratee invoked per element.
  5085. * @param {Function} [comparator] The comparator invoked per element.
  5086. * @returns {Array} Returns the new duplicate free array.
  5087. */
  5088. function baseUniq(array, iteratee, comparator) {
  5089. var index = -1,
  5090. includes = arrayIncludes,
  5091. length = array.length,
  5092. isCommon = true,
  5093. result = [],
  5094. seen = result;
  5095. if (comparator) {
  5096. isCommon = false;
  5097. includes = arrayIncludesWith;
  5098. }
  5099. else if (length >= LARGE_ARRAY_SIZE) {
  5100. var set = iteratee ? null : createSet(array);
  5101. if (set) {
  5102. return setToArray(set);
  5103. }
  5104. isCommon = false;
  5105. includes = cacheHas;
  5106. seen = new SetCache;
  5107. }
  5108. else {
  5109. seen = iteratee ? [] : result;
  5110. }
  5111. outer:
  5112. while (++index < length) {
  5113. var value = array[index],
  5114. computed = iteratee ? iteratee(value) : value;
  5115. value = (comparator || value !== 0) ? value : 0;
  5116. if (isCommon && computed === computed) {
  5117. var seenIndex = seen.length;
  5118. while (seenIndex--) {
  5119. if (seen[seenIndex] === computed) {
  5120. continue outer;
  5121. }
  5122. }
  5123. if (iteratee) {
  5124. seen.push(computed);
  5125. }
  5126. result.push(value);
  5127. }
  5128. else if (!includes(seen, computed, comparator)) {
  5129. if (seen !== result) {
  5130. seen.push(computed);
  5131. }
  5132. result.push(value);
  5133. }
  5134. }
  5135. return result;
  5136. }
  5137. /**
  5138. * The base implementation of `_.unset`.
  5139. *
  5140. * @private
  5141. * @param {Object} object The object to modify.
  5142. * @param {Array|string} path The property path to unset.
  5143. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5144. */
  5145. function baseUnset(object, path) {
  5146. path = castPath(path, object);
  5147. object = parent(object, path);
  5148. return object == null || delete object[toKey(last(path))];
  5149. }
  5150. /**
  5151. * The base implementation of `_.update`.
  5152. *
  5153. * @private
  5154. * @param {Object} object The object to modify.
  5155. * @param {Array|string} path The path of the property to update.
  5156. * @param {Function} updater The function to produce the updated value.
  5157. * @param {Function} [customizer] The function to customize path creation.
  5158. * @returns {Object} Returns `object`.
  5159. */
  5160. function baseUpdate(object, path, updater, customizer) {
  5161. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5162. }
  5163. /**
  5164. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5165. * without support for iteratee shorthands.
  5166. *
  5167. * @private
  5168. * @param {Array} array The array to query.
  5169. * @param {Function} predicate The function invoked per iteration.
  5170. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5171. * @param {boolean} [fromRight] Specify iterating from right to left.
  5172. * @returns {Array} Returns the slice of `array`.
  5173. */
  5174. function baseWhile(array, predicate, isDrop, fromRight) {
  5175. var length = array.length,
  5176. index = fromRight ? length : -1;
  5177. while ((fromRight ? index-- : ++index < length) &&
  5178. predicate(array[index], index, array)) {}
  5179. return isDrop
  5180. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5181. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5182. }
  5183. /**
  5184. * The base implementation of `wrapperValue` which returns the result of
  5185. * performing a sequence of actions on the unwrapped `value`, where each
  5186. * successive action is supplied the return value of the previous.
  5187. *
  5188. * @private
  5189. * @param {*} value The unwrapped value.
  5190. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5191. * @returns {*} Returns the resolved value.
  5192. */
  5193. function baseWrapperValue(value, actions) {
  5194. var result = value;
  5195. if (result instanceof LazyWrapper) {
  5196. result = result.value();
  5197. }
  5198. return arrayReduce(actions, function(result, action) {
  5199. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5200. }, result);
  5201. }
  5202. /**
  5203. * The base implementation of methods like `_.xor`, without support for
  5204. * iteratee shorthands, that accepts an array of arrays to inspect.
  5205. *
  5206. * @private
  5207. * @param {Array} arrays The arrays to inspect.
  5208. * @param {Function} [iteratee] The iteratee invoked per element.
  5209. * @param {Function} [comparator] The comparator invoked per element.
  5210. * @returns {Array} Returns the new array of values.
  5211. */
  5212. function baseXor(arrays, iteratee, comparator) {
  5213. var length = arrays.length;
  5214. if (length < 2) {
  5215. return length ? baseUniq(arrays[0]) : [];
  5216. }
  5217. var index = -1,
  5218. result = Array(length);
  5219. while (++index < length) {
  5220. var array = arrays[index],
  5221. othIndex = -1;
  5222. while (++othIndex < length) {
  5223. if (othIndex != index) {
  5224. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5225. }
  5226. }
  5227. }
  5228. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5229. }
  5230. /**
  5231. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5232. *
  5233. * @private
  5234. * @param {Array} props The property identifiers.
  5235. * @param {Array} values The property values.
  5236. * @param {Function} assignFunc The function to assign values.
  5237. * @returns {Object} Returns the new object.
  5238. */
  5239. function baseZipObject(props, values, assignFunc) {
  5240. var index = -1,
  5241. length = props.length,
  5242. valsLength = values.length,
  5243. result = {};
  5244. while (++index < length) {
  5245. var value = index < valsLength ? values[index] : undefined;
  5246. assignFunc(result, props[index], value);
  5247. }
  5248. return result;
  5249. }
  5250. /**
  5251. * Casts `value` to an empty array if it's not an array like object.
  5252. *
  5253. * @private
  5254. * @param {*} value The value to inspect.
  5255. * @returns {Array|Object} Returns the cast array-like object.
  5256. */
  5257. function castArrayLikeObject(value) {
  5258. return isArrayLikeObject(value) ? value : [];
  5259. }
  5260. /**
  5261. * Casts `value` to `identity` if it's not a function.
  5262. *
  5263. * @private
  5264. * @param {*} value The value to inspect.
  5265. * @returns {Function} Returns cast function.
  5266. */
  5267. function castFunction(value) {
  5268. return typeof value == 'function' ? value : identity;
  5269. }
  5270. /**
  5271. * Casts `value` to a path array if it's not one.
  5272. *
  5273. * @private
  5274. * @param {*} value The value to inspect.
  5275. * @param {Object} [object] The object to query keys on.
  5276. * @returns {Array} Returns the cast property path array.
  5277. */
  5278. function castPath(value, object) {
  5279. if (isArray(value)) {
  5280. return value;
  5281. }
  5282. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5283. }
  5284. /**
  5285. * A `baseRest` alias which can be replaced with `identity` by module
  5286. * replacement plugins.
  5287. *
  5288. * @private
  5289. * @type {Function}
  5290. * @param {Function} func The function to apply a rest parameter to.
  5291. * @returns {Function} Returns the new function.
  5292. */
  5293. var castRest = baseRest;
  5294. /**
  5295. * Casts `array` to a slice if it's needed.
  5296. *
  5297. * @private
  5298. * @param {Array} array The array to inspect.
  5299. * @param {number} start The start position.
  5300. * @param {number} [end=array.length] The end position.
  5301. * @returns {Array} Returns the cast slice.
  5302. */
  5303. function castSlice(array, start, end) {
  5304. var length = array.length;
  5305. end = end === undefined ? length : end;
  5306. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5307. }
  5308. /**
  5309. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5310. *
  5311. * @private
  5312. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5313. */
  5314. var clearTimeout = ctxClearTimeout || function(id) {
  5315. return root.clearTimeout(id);
  5316. };
  5317. /**
  5318. * Creates a clone of `buffer`.
  5319. *
  5320. * @private
  5321. * @param {Buffer} buffer The buffer to clone.
  5322. * @param {boolean} [isDeep] Specify a deep clone.
  5323. * @returns {Buffer} Returns the cloned buffer.
  5324. */
  5325. function cloneBuffer(buffer, isDeep) {
  5326. if (isDeep) {
  5327. return buffer.slice();
  5328. }
  5329. var length = buffer.length,
  5330. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5331. buffer.copy(result);
  5332. return result;
  5333. }
  5334. /**
  5335. * Creates a clone of `arrayBuffer`.
  5336. *
  5337. * @private
  5338. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5339. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5340. */
  5341. function cloneArrayBuffer(arrayBuffer) {
  5342. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5343. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5344. return result;
  5345. }
  5346. /**
  5347. * Creates a clone of `dataView`.
  5348. *
  5349. * @private
  5350. * @param {Object} dataView The data view to clone.
  5351. * @param {boolean} [isDeep] Specify a deep clone.
  5352. * @returns {Object} Returns the cloned data view.
  5353. */
  5354. function cloneDataView(dataView, isDeep) {
  5355. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5356. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5357. }
  5358. /**
  5359. * Creates a clone of `regexp`.
  5360. *
  5361. * @private
  5362. * @param {Object} regexp The regexp to clone.
  5363. * @returns {Object} Returns the cloned regexp.
  5364. */
  5365. function cloneRegExp(regexp) {
  5366. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5367. result.lastIndex = regexp.lastIndex;
  5368. return result;
  5369. }
  5370. /**
  5371. * Creates a clone of the `symbol` object.
  5372. *
  5373. * @private
  5374. * @param {Object} symbol The symbol object to clone.
  5375. * @returns {Object} Returns the cloned symbol object.
  5376. */
  5377. function cloneSymbol(symbol) {
  5378. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5379. }
  5380. /**
  5381. * Creates a clone of `typedArray`.
  5382. *
  5383. * @private
  5384. * @param {Object} typedArray The typed array to clone.
  5385. * @param {boolean} [isDeep] Specify a deep clone.
  5386. * @returns {Object} Returns the cloned typed array.
  5387. */
  5388. function cloneTypedArray(typedArray, isDeep) {
  5389. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5390. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5391. }
  5392. /**
  5393. * Compares values to sort them in ascending order.
  5394. *
  5395. * @private
  5396. * @param {*} value The value to compare.
  5397. * @param {*} other The other value to compare.
  5398. * @returns {number} Returns the sort order indicator for `value`.
  5399. */
  5400. function compareAscending(value, other) {
  5401. if (value !== other) {
  5402. var valIsDefined = value !== undefined,
  5403. valIsNull = value === null,
  5404. valIsReflexive = value === value,
  5405. valIsSymbol = isSymbol(value);
  5406. var othIsDefined = other !== undefined,
  5407. othIsNull = other === null,
  5408. othIsReflexive = other === other,
  5409. othIsSymbol = isSymbol(other);
  5410. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5411. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5412. (valIsNull && othIsDefined && othIsReflexive) ||
  5413. (!valIsDefined && othIsReflexive) ||
  5414. !valIsReflexive) {
  5415. return 1;
  5416. }
  5417. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5418. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5419. (othIsNull && valIsDefined && valIsReflexive) ||
  5420. (!othIsDefined && valIsReflexive) ||
  5421. !othIsReflexive) {
  5422. return -1;
  5423. }
  5424. }
  5425. return 0;
  5426. }
  5427. /**
  5428. * Used by `_.orderBy` to compare multiple properties of a value to another
  5429. * and stable sort them.
  5430. *
  5431. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5432. * specify an order of "desc" for descending or "asc" for ascending sort order
  5433. * of corresponding values.
  5434. *
  5435. * @private
  5436. * @param {Object} object The object to compare.
  5437. * @param {Object} other The other object to compare.
  5438. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5439. * @returns {number} Returns the sort order indicator for `object`.
  5440. */
  5441. function compareMultiple(object, other, orders) {
  5442. var index = -1,
  5443. objCriteria = object.criteria,
  5444. othCriteria = other.criteria,
  5445. length = objCriteria.length,
  5446. ordersLength = orders.length;
  5447. while (++index < length) {
  5448. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5449. if (result) {
  5450. if (index >= ordersLength) {
  5451. return result;
  5452. }
  5453. var order = orders[index];
  5454. return result * (order == 'desc' ? -1 : 1);
  5455. }
  5456. }
  5457. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5458. // that causes it, under certain circumstances, to provide the same value for
  5459. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5460. // for more details.
  5461. //
  5462. // This also ensures a stable sort in V8 and other engines.
  5463. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5464. return object.index - other.index;
  5465. }
  5466. /**
  5467. * Creates an array that is the composition of partially applied arguments,
  5468. * placeholders, and provided arguments into a single array of arguments.
  5469. *
  5470. * @private
  5471. * @param {Array} args The provided arguments.
  5472. * @param {Array} partials The arguments to prepend to those provided.
  5473. * @param {Array} holders The `partials` placeholder indexes.
  5474. * @params {boolean} [isCurried] Specify composing for a curried function.
  5475. * @returns {Array} Returns the new array of composed arguments.
  5476. */
  5477. function composeArgs(args, partials, holders, isCurried) {
  5478. var argsIndex = -1,
  5479. argsLength = args.length,
  5480. holdersLength = holders.length,
  5481. leftIndex = -1,
  5482. leftLength = partials.length,
  5483. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5484. result = Array(leftLength + rangeLength),
  5485. isUncurried = !isCurried;
  5486. while (++leftIndex < leftLength) {
  5487. result[leftIndex] = partials[leftIndex];
  5488. }
  5489. while (++argsIndex < holdersLength) {
  5490. if (isUncurried || argsIndex < argsLength) {
  5491. result[holders[argsIndex]] = args[argsIndex];
  5492. }
  5493. }
  5494. while (rangeLength--) {
  5495. result[leftIndex++] = args[argsIndex++];
  5496. }
  5497. return result;
  5498. }
  5499. /**
  5500. * This function is like `composeArgs` except that the arguments composition
  5501. * is tailored for `_.partialRight`.
  5502. *
  5503. * @private
  5504. * @param {Array} args The provided arguments.
  5505. * @param {Array} partials The arguments to append to those provided.
  5506. * @param {Array} holders The `partials` placeholder indexes.
  5507. * @params {boolean} [isCurried] Specify composing for a curried function.
  5508. * @returns {Array} Returns the new array of composed arguments.
  5509. */
  5510. function composeArgsRight(args, partials, holders, isCurried) {
  5511. var argsIndex = -1,
  5512. argsLength = args.length,
  5513. holdersIndex = -1,
  5514. holdersLength = holders.length,
  5515. rightIndex = -1,
  5516. rightLength = partials.length,
  5517. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5518. result = Array(rangeLength + rightLength),
  5519. isUncurried = !isCurried;
  5520. while (++argsIndex < rangeLength) {
  5521. result[argsIndex] = args[argsIndex];
  5522. }
  5523. var offset = argsIndex;
  5524. while (++rightIndex < rightLength) {
  5525. result[offset + rightIndex] = partials[rightIndex];
  5526. }
  5527. while (++holdersIndex < holdersLength) {
  5528. if (isUncurried || argsIndex < argsLength) {
  5529. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5530. }
  5531. }
  5532. return result;
  5533. }
  5534. /**
  5535. * Copies the values of `source` to `array`.
  5536. *
  5537. * @private
  5538. * @param {Array} source The array to copy values from.
  5539. * @param {Array} [array=[]] The array to copy values to.
  5540. * @returns {Array} Returns `array`.
  5541. */
  5542. function copyArray(source, array) {
  5543. var index = -1,
  5544. length = source.length;
  5545. array || (array = Array(length));
  5546. while (++index < length) {
  5547. array[index] = source[index];
  5548. }
  5549. return array;
  5550. }
  5551. /**
  5552. * Copies properties of `source` to `object`.
  5553. *
  5554. * @private
  5555. * @param {Object} source The object to copy properties from.
  5556. * @param {Array} props The property identifiers to copy.
  5557. * @param {Object} [object={}] The object to copy properties to.
  5558. * @param {Function} [customizer] The function to customize copied values.
  5559. * @returns {Object} Returns `object`.
  5560. */
  5561. function copyObject(source, props, object, customizer) {
  5562. var isNew = !object;
  5563. object || (object = {});
  5564. var index = -1,
  5565. length = props.length;
  5566. while (++index < length) {
  5567. var key = props[index];
  5568. var newValue = customizer
  5569. ? customizer(object[key], source[key], key, object, source)
  5570. : undefined;
  5571. if (newValue === undefined) {
  5572. newValue = source[key];
  5573. }
  5574. if (isNew) {
  5575. baseAssignValue(object, key, newValue);
  5576. } else {
  5577. assignValue(object, key, newValue);
  5578. }
  5579. }
  5580. return object;
  5581. }
  5582. /**
  5583. * Copies own symbols of `source` to `object`.
  5584. *
  5585. * @private
  5586. * @param {Object} source The object to copy symbols from.
  5587. * @param {Object} [object={}] The object to copy symbols to.
  5588. * @returns {Object} Returns `object`.
  5589. */
  5590. function copySymbols(source, object) {
  5591. return copyObject(source, getSymbols(source), object);
  5592. }
  5593. /**
  5594. * Copies own and inherited symbols of `source` to `object`.
  5595. *
  5596. * @private
  5597. * @param {Object} source The object to copy symbols from.
  5598. * @param {Object} [object={}] The object to copy symbols to.
  5599. * @returns {Object} Returns `object`.
  5600. */
  5601. function copySymbolsIn(source, object) {
  5602. return copyObject(source, getSymbolsIn(source), object);
  5603. }
  5604. /**
  5605. * Creates a function like `_.groupBy`.
  5606. *
  5607. * @private
  5608. * @param {Function} setter The function to set accumulator values.
  5609. * @param {Function} [initializer] The accumulator object initializer.
  5610. * @returns {Function} Returns the new aggregator function.
  5611. */
  5612. function createAggregator(setter, initializer) {
  5613. return function(collection, iteratee) {
  5614. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5615. accumulator = initializer ? initializer() : {};
  5616. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5617. };
  5618. }
  5619. /**
  5620. * Creates a function like `_.assign`.
  5621. *
  5622. * @private
  5623. * @param {Function} assigner The function to assign values.
  5624. * @returns {Function} Returns the new assigner function.
  5625. */
  5626. function createAssigner(assigner) {
  5627. return baseRest(function(object, sources) {
  5628. var index = -1,
  5629. length = sources.length,
  5630. customizer = length > 1 ? sources[length - 1] : undefined,
  5631. guard = length > 2 ? sources[2] : undefined;
  5632. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5633. ? (length--, customizer)
  5634. : undefined;
  5635. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5636. customizer = length < 3 ? undefined : customizer;
  5637. length = 1;
  5638. }
  5639. object = Object(object);
  5640. while (++index < length) {
  5641. var source = sources[index];
  5642. if (source) {
  5643. assigner(object, source, index, customizer);
  5644. }
  5645. }
  5646. return object;
  5647. });
  5648. }
  5649. /**
  5650. * Creates a `baseEach` or `baseEachRight` function.
  5651. *
  5652. * @private
  5653. * @param {Function} eachFunc The function to iterate over a collection.
  5654. * @param {boolean} [fromRight] Specify iterating from right to left.
  5655. * @returns {Function} Returns the new base function.
  5656. */
  5657. function createBaseEach(eachFunc, fromRight) {
  5658. return function(collection, iteratee) {
  5659. if (collection == null) {
  5660. return collection;
  5661. }
  5662. if (!isArrayLike(collection)) {
  5663. return eachFunc(collection, iteratee);
  5664. }
  5665. var length = collection.length,
  5666. index = fromRight ? length : -1,
  5667. iterable = Object(collection);
  5668. while ((fromRight ? index-- : ++index < length)) {
  5669. if (iteratee(iterable[index], index, iterable) === false) {
  5670. break;
  5671. }
  5672. }
  5673. return collection;
  5674. };
  5675. }
  5676. /**
  5677. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5678. *
  5679. * @private
  5680. * @param {boolean} [fromRight] Specify iterating from right to left.
  5681. * @returns {Function} Returns the new base function.
  5682. */
  5683. function createBaseFor(fromRight) {
  5684. return function(object, iteratee, keysFunc) {
  5685. var index = -1,
  5686. iterable = Object(object),
  5687. props = keysFunc(object),
  5688. length = props.length;
  5689. while (length--) {
  5690. var key = props[fromRight ? length : ++index];
  5691. if (iteratee(iterable[key], key, iterable) === false) {
  5692. break;
  5693. }
  5694. }
  5695. return object;
  5696. };
  5697. }
  5698. /**
  5699. * Creates a function that wraps `func` to invoke it with the optional `this`
  5700. * binding of `thisArg`.
  5701. *
  5702. * @private
  5703. * @param {Function} func The function to wrap.
  5704. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5705. * @param {*} [thisArg] The `this` binding of `func`.
  5706. * @returns {Function} Returns the new wrapped function.
  5707. */
  5708. function createBind(func, bitmask, thisArg) {
  5709. var isBind = bitmask & WRAP_BIND_FLAG,
  5710. Ctor = createCtor(func);
  5711. function wrapper() {
  5712. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5713. return fn.apply(isBind ? thisArg : this, arguments);
  5714. }
  5715. return wrapper;
  5716. }
  5717. /**
  5718. * Creates a function like `_.lowerFirst`.
  5719. *
  5720. * @private
  5721. * @param {string} methodName The name of the `String` case method to use.
  5722. * @returns {Function} Returns the new case function.
  5723. */
  5724. function createCaseFirst(methodName) {
  5725. return function(string) {
  5726. string = toString(string);
  5727. var strSymbols = hasUnicode(string)
  5728. ? stringToArray(string)
  5729. : undefined;
  5730. var chr = strSymbols
  5731. ? strSymbols[0]
  5732. : string.charAt(0);
  5733. var trailing = strSymbols
  5734. ? castSlice(strSymbols, 1).join('')
  5735. : string.slice(1);
  5736. return chr[methodName]() + trailing;
  5737. };
  5738. }
  5739. /**
  5740. * Creates a function like `_.camelCase`.
  5741. *
  5742. * @private
  5743. * @param {Function} callback The function to combine each word.
  5744. * @returns {Function} Returns the new compounder function.
  5745. */
  5746. function createCompounder(callback) {
  5747. return function(string) {
  5748. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5749. };
  5750. }
  5751. /**
  5752. * Creates a function that produces an instance of `Ctor` regardless of
  5753. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5754. *
  5755. * @private
  5756. * @param {Function} Ctor The constructor to wrap.
  5757. * @returns {Function} Returns the new wrapped function.
  5758. */
  5759. function createCtor(Ctor) {
  5760. return function() {
  5761. // Use a `switch` statement to work with class constructors. See
  5762. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5763. // for more details.
  5764. var args = arguments;
  5765. switch (args.length) {
  5766. case 0: return new Ctor;
  5767. case 1: return new Ctor(args[0]);
  5768. case 2: return new Ctor(args[0], args[1]);
  5769. case 3: return new Ctor(args[0], args[1], args[2]);
  5770. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5771. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5772. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5773. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5774. }
  5775. var thisBinding = baseCreate(Ctor.prototype),
  5776. result = Ctor.apply(thisBinding, args);
  5777. // Mimic the constructor's `return` behavior.
  5778. // See https://es5.github.io/#x13.2.2 for more details.
  5779. return isObject(result) ? result : thisBinding;
  5780. };
  5781. }
  5782. /**
  5783. * Creates a function that wraps `func` to enable currying.
  5784. *
  5785. * @private
  5786. * @param {Function} func The function to wrap.
  5787. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5788. * @param {number} arity The arity of `func`.
  5789. * @returns {Function} Returns the new wrapped function.
  5790. */
  5791. function createCurry(func, bitmask, arity) {
  5792. var Ctor = createCtor(func);
  5793. function wrapper() {
  5794. var length = arguments.length,
  5795. args = Array(length),
  5796. index = length,
  5797. placeholder = getHolder(wrapper);
  5798. while (index--) {
  5799. args[index] = arguments[index];
  5800. }
  5801. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5802. ? []
  5803. : replaceHolders(args, placeholder);
  5804. length -= holders.length;
  5805. if (length < arity) {
  5806. return createRecurry(
  5807. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5808. args, holders, undefined, undefined, arity - length);
  5809. }
  5810. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5811. return apply(fn, this, args);
  5812. }
  5813. return wrapper;
  5814. }
  5815. /**
  5816. * Creates a `_.find` or `_.findLast` function.
  5817. *
  5818. * @private
  5819. * @param {Function} findIndexFunc The function to find the collection index.
  5820. * @returns {Function} Returns the new find function.
  5821. */
  5822. function createFind(findIndexFunc) {
  5823. return function(collection, predicate, fromIndex) {
  5824. var iterable = Object(collection);
  5825. if (!isArrayLike(collection)) {
  5826. var iteratee = getIteratee(predicate, 3);
  5827. collection = keys(collection);
  5828. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5829. }
  5830. var index = findIndexFunc(collection, predicate, fromIndex);
  5831. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5832. };
  5833. }
  5834. /**
  5835. * Creates a `_.flow` or `_.flowRight` function.
  5836. *
  5837. * @private
  5838. * @param {boolean} [fromRight] Specify iterating from right to left.
  5839. * @returns {Function} Returns the new flow function.
  5840. */
  5841. function createFlow(fromRight) {
  5842. return flatRest(function(funcs) {
  5843. var length = funcs.length,
  5844. index = length,
  5845. prereq = LodashWrapper.prototype.thru;
  5846. if (fromRight) {
  5847. funcs.reverse();
  5848. }
  5849. while (index--) {
  5850. var func = funcs[index];
  5851. if (typeof func != 'function') {
  5852. throw new TypeError(FUNC_ERROR_TEXT);
  5853. }
  5854. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5855. var wrapper = new LodashWrapper([], true);
  5856. }
  5857. }
  5858. index = wrapper ? index : length;
  5859. while (++index < length) {
  5860. func = funcs[index];
  5861. var funcName = getFuncName(func),
  5862. data = funcName == 'wrapper' ? getData(func) : undefined;
  5863. if (data && isLaziable(data[0]) &&
  5864. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5865. !data[4].length && data[9] == 1
  5866. ) {
  5867. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5868. } else {
  5869. wrapper = (func.length == 1 && isLaziable(func))
  5870. ? wrapper[funcName]()
  5871. : wrapper.thru(func);
  5872. }
  5873. }
  5874. return function() {
  5875. var args = arguments,
  5876. value = args[0];
  5877. if (wrapper && args.length == 1 && isArray(value)) {
  5878. return wrapper.plant(value).value();
  5879. }
  5880. var index = 0,
  5881. result = length ? funcs[index].apply(this, args) : value;
  5882. while (++index < length) {
  5883. result = funcs[index].call(this, result);
  5884. }
  5885. return result;
  5886. };
  5887. });
  5888. }
  5889. /**
  5890. * Creates a function that wraps `func` to invoke it with optional `this`
  5891. * binding of `thisArg`, partial application, and currying.
  5892. *
  5893. * @private
  5894. * @param {Function|string} func The function or method name to wrap.
  5895. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5896. * @param {*} [thisArg] The `this` binding of `func`.
  5897. * @param {Array} [partials] The arguments to prepend to those provided to
  5898. * the new function.
  5899. * @param {Array} [holders] The `partials` placeholder indexes.
  5900. * @param {Array} [partialsRight] The arguments to append to those provided
  5901. * to the new function.
  5902. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5903. * @param {Array} [argPos] The argument positions of the new function.
  5904. * @param {number} [ary] The arity cap of `func`.
  5905. * @param {number} [arity] The arity of `func`.
  5906. * @returns {Function} Returns the new wrapped function.
  5907. */
  5908. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5909. var isAry = bitmask & WRAP_ARY_FLAG,
  5910. isBind = bitmask & WRAP_BIND_FLAG,
  5911. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5912. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5913. isFlip = bitmask & WRAP_FLIP_FLAG,
  5914. Ctor = isBindKey ? undefined : createCtor(func);
  5915. function wrapper() {
  5916. var length = arguments.length,
  5917. args = Array(length),
  5918. index = length;
  5919. while (index--) {
  5920. args[index] = arguments[index];
  5921. }
  5922. if (isCurried) {
  5923. var placeholder = getHolder(wrapper),
  5924. holdersCount = countHolders(args, placeholder);
  5925. }
  5926. if (partials) {
  5927. args = composeArgs(args, partials, holders, isCurried);
  5928. }
  5929. if (partialsRight) {
  5930. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5931. }
  5932. length -= holdersCount;
  5933. if (isCurried && length < arity) {
  5934. var newHolders = replaceHolders(args, placeholder);
  5935. return createRecurry(
  5936. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5937. args, newHolders, argPos, ary, arity - length
  5938. );
  5939. }
  5940. var thisBinding = isBind ? thisArg : this,
  5941. fn = isBindKey ? thisBinding[func] : func;
  5942. length = args.length;
  5943. if (argPos) {
  5944. args = reorder(args, argPos);
  5945. } else if (isFlip && length > 1) {
  5946. args.reverse();
  5947. }
  5948. if (isAry && ary < length) {
  5949. args.length = ary;
  5950. }
  5951. if (this && this !== root && this instanceof wrapper) {
  5952. fn = Ctor || createCtor(fn);
  5953. }
  5954. return fn.apply(thisBinding, args);
  5955. }
  5956. return wrapper;
  5957. }
  5958. /**
  5959. * Creates a function like `_.invertBy`.
  5960. *
  5961. * @private
  5962. * @param {Function} setter The function to set accumulator values.
  5963. * @param {Function} toIteratee The function to resolve iteratees.
  5964. * @returns {Function} Returns the new inverter function.
  5965. */
  5966. function createInverter(setter, toIteratee) {
  5967. return function(object, iteratee) {
  5968. return baseInverter(object, setter, toIteratee(iteratee), {});
  5969. };
  5970. }
  5971. /**
  5972. * Creates a function that performs a mathematical operation on two values.
  5973. *
  5974. * @private
  5975. * @param {Function} operator The function to perform the operation.
  5976. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5977. * @returns {Function} Returns the new mathematical operation function.
  5978. */
  5979. function createMathOperation(operator, defaultValue) {
  5980. return function(value, other) {
  5981. var result;
  5982. if (value === undefined && other === undefined) {
  5983. return defaultValue;
  5984. }
  5985. if (value !== undefined) {
  5986. result = value;
  5987. }
  5988. if (other !== undefined) {
  5989. if (result === undefined) {
  5990. return other;
  5991. }
  5992. if (typeof value == 'string' || typeof other == 'string') {
  5993. value = baseToString(value);
  5994. other = baseToString(other);
  5995. } else {
  5996. value = baseToNumber(value);
  5997. other = baseToNumber(other);
  5998. }
  5999. result = operator(value, other);
  6000. }
  6001. return result;
  6002. };
  6003. }
  6004. /**
  6005. * Creates a function like `_.over`.
  6006. *
  6007. * @private
  6008. * @param {Function} arrayFunc The function to iterate over iteratees.
  6009. * @returns {Function} Returns the new over function.
  6010. */
  6011. function createOver(arrayFunc) {
  6012. return flatRest(function(iteratees) {
  6013. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6014. return baseRest(function(args) {
  6015. var thisArg = this;
  6016. return arrayFunc(iteratees, function(iteratee) {
  6017. return apply(iteratee, thisArg, args);
  6018. });
  6019. });
  6020. });
  6021. }
  6022. /**
  6023. * Creates the padding for `string` based on `length`. The `chars` string
  6024. * is truncated if the number of characters exceeds `length`.
  6025. *
  6026. * @private
  6027. * @param {number} length The padding length.
  6028. * @param {string} [chars=' '] The string used as padding.
  6029. * @returns {string} Returns the padding for `string`.
  6030. */
  6031. function createPadding(length, chars) {
  6032. chars = chars === undefined ? ' ' : baseToString(chars);
  6033. var charsLength = chars.length;
  6034. if (charsLength < 2) {
  6035. return charsLength ? baseRepeat(chars, length) : chars;
  6036. }
  6037. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6038. return hasUnicode(chars)
  6039. ? castSlice(stringToArray(result), 0, length).join('')
  6040. : result.slice(0, length);
  6041. }
  6042. /**
  6043. * Creates a function that wraps `func` to invoke it with the `this` binding
  6044. * of `thisArg` and `partials` prepended to the arguments it receives.
  6045. *
  6046. * @private
  6047. * @param {Function} func The function to wrap.
  6048. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6049. * @param {*} thisArg The `this` binding of `func`.
  6050. * @param {Array} partials The arguments to prepend to those provided to
  6051. * the new function.
  6052. * @returns {Function} Returns the new wrapped function.
  6053. */
  6054. function createPartial(func, bitmask, thisArg, partials) {
  6055. var isBind = bitmask & WRAP_BIND_FLAG,
  6056. Ctor = createCtor(func);
  6057. function wrapper() {
  6058. var argsIndex = -1,
  6059. argsLength = arguments.length,
  6060. leftIndex = -1,
  6061. leftLength = partials.length,
  6062. args = Array(leftLength + argsLength),
  6063. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6064. while (++leftIndex < leftLength) {
  6065. args[leftIndex] = partials[leftIndex];
  6066. }
  6067. while (argsLength--) {
  6068. args[leftIndex++] = arguments[++argsIndex];
  6069. }
  6070. return apply(fn, isBind ? thisArg : this, args);
  6071. }
  6072. return wrapper;
  6073. }
  6074. /**
  6075. * Creates a `_.range` or `_.rangeRight` function.
  6076. *
  6077. * @private
  6078. * @param {boolean} [fromRight] Specify iterating from right to left.
  6079. * @returns {Function} Returns the new range function.
  6080. */
  6081. function createRange(fromRight) {
  6082. return function(start, end, step) {
  6083. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6084. end = step = undefined;
  6085. }
  6086. // Ensure the sign of `-0` is preserved.
  6087. start = toFinite(start);
  6088. if (end === undefined) {
  6089. end = start;
  6090. start = 0;
  6091. } else {
  6092. end = toFinite(end);
  6093. }
  6094. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6095. return baseRange(start, end, step, fromRight);
  6096. };
  6097. }
  6098. /**
  6099. * Creates a function that performs a relational operation on two values.
  6100. *
  6101. * @private
  6102. * @param {Function} operator The function to perform the operation.
  6103. * @returns {Function} Returns the new relational operation function.
  6104. */
  6105. function createRelationalOperation(operator) {
  6106. return function(value, other) {
  6107. if (!(typeof value == 'string' && typeof other == 'string')) {
  6108. value = toNumber(value);
  6109. other = toNumber(other);
  6110. }
  6111. return operator(value, other);
  6112. };
  6113. }
  6114. /**
  6115. * Creates a function that wraps `func` to continue currying.
  6116. *
  6117. * @private
  6118. * @param {Function} func The function to wrap.
  6119. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6120. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6121. * @param {*} placeholder The placeholder value.
  6122. * @param {*} [thisArg] The `this` binding of `func`.
  6123. * @param {Array} [partials] The arguments to prepend to those provided to
  6124. * the new function.
  6125. * @param {Array} [holders] The `partials` placeholder indexes.
  6126. * @param {Array} [argPos] The argument positions of the new function.
  6127. * @param {number} [ary] The arity cap of `func`.
  6128. * @param {number} [arity] The arity of `func`.
  6129. * @returns {Function} Returns the new wrapped function.
  6130. */
  6131. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6132. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6133. newHolders = isCurry ? holders : undefined,
  6134. newHoldersRight = isCurry ? undefined : holders,
  6135. newPartials = isCurry ? partials : undefined,
  6136. newPartialsRight = isCurry ? undefined : partials;
  6137. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6138. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6139. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6140. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6141. }
  6142. var newData = [
  6143. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6144. newHoldersRight, argPos, ary, arity
  6145. ];
  6146. var result = wrapFunc.apply(undefined, newData);
  6147. if (isLaziable(func)) {
  6148. setData(result, newData);
  6149. }
  6150. result.placeholder = placeholder;
  6151. return setWrapToString(result, func, bitmask);
  6152. }
  6153. /**
  6154. * Creates a function like `_.round`.
  6155. *
  6156. * @private
  6157. * @param {string} methodName The name of the `Math` method to use when rounding.
  6158. * @returns {Function} Returns the new round function.
  6159. */
  6160. function createRound(methodName) {
  6161. var func = Math[methodName];
  6162. return function(number, precision) {
  6163. number = toNumber(number);
  6164. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6165. if (precision && nativeIsFinite(number)) {
  6166. // Shift with exponential notation to avoid floating-point issues.
  6167. // See [MDN](https://mdn.io/round#Examples) for more details.
  6168. var pair = (toString(number) + 'e').split('e'),
  6169. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6170. pair = (toString(value) + 'e').split('e');
  6171. return +(pair[0] + 'e' + (+pair[1] - precision));
  6172. }
  6173. return func(number);
  6174. };
  6175. }
  6176. /**
  6177. * Creates a set object of `values`.
  6178. *
  6179. * @private
  6180. * @param {Array} values The values to add to the set.
  6181. * @returns {Object} Returns the new set.
  6182. */
  6183. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6184. return new Set(values);
  6185. };
  6186. /**
  6187. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6188. *
  6189. * @private
  6190. * @param {Function} keysFunc The function to get the keys of a given object.
  6191. * @returns {Function} Returns the new pairs function.
  6192. */
  6193. function createToPairs(keysFunc) {
  6194. return function(object) {
  6195. var tag = getTag(object);
  6196. if (tag == mapTag) {
  6197. return mapToArray(object);
  6198. }
  6199. if (tag == setTag) {
  6200. return setToPairs(object);
  6201. }
  6202. return baseToPairs(object, keysFunc(object));
  6203. };
  6204. }
  6205. /**
  6206. * Creates a function that either curries or invokes `func` with optional
  6207. * `this` binding and partially applied arguments.
  6208. *
  6209. * @private
  6210. * @param {Function|string} func The function or method name to wrap.
  6211. * @param {number} bitmask The bitmask flags.
  6212. * 1 - `_.bind`
  6213. * 2 - `_.bindKey`
  6214. * 4 - `_.curry` or `_.curryRight` of a bound function
  6215. * 8 - `_.curry`
  6216. * 16 - `_.curryRight`
  6217. * 32 - `_.partial`
  6218. * 64 - `_.partialRight`
  6219. * 128 - `_.rearg`
  6220. * 256 - `_.ary`
  6221. * 512 - `_.flip`
  6222. * @param {*} [thisArg] The `this` binding of `func`.
  6223. * @param {Array} [partials] The arguments to be partially applied.
  6224. * @param {Array} [holders] The `partials` placeholder indexes.
  6225. * @param {Array} [argPos] The argument positions of the new function.
  6226. * @param {number} [ary] The arity cap of `func`.
  6227. * @param {number} [arity] The arity of `func`.
  6228. * @returns {Function} Returns the new wrapped function.
  6229. */
  6230. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6231. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6232. if (!isBindKey && typeof func != 'function') {
  6233. throw new TypeError(FUNC_ERROR_TEXT);
  6234. }
  6235. var length = partials ? partials.length : 0;
  6236. if (!length) {
  6237. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6238. partials = holders = undefined;
  6239. }
  6240. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6241. arity = arity === undefined ? arity : toInteger(arity);
  6242. length -= holders ? holders.length : 0;
  6243. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6244. var partialsRight = partials,
  6245. holdersRight = holders;
  6246. partials = holders = undefined;
  6247. }
  6248. var data = isBindKey ? undefined : getData(func);
  6249. var newData = [
  6250. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6251. argPos, ary, arity
  6252. ];
  6253. if (data) {
  6254. mergeData(newData, data);
  6255. }
  6256. func = newData[0];
  6257. bitmask = newData[1];
  6258. thisArg = newData[2];
  6259. partials = newData[3];
  6260. holders = newData[4];
  6261. arity = newData[9] = newData[9] === undefined
  6262. ? (isBindKey ? 0 : func.length)
  6263. : nativeMax(newData[9] - length, 0);
  6264. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6265. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6266. }
  6267. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6268. var result = createBind(func, bitmask, thisArg);
  6269. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6270. result = createCurry(func, bitmask, arity);
  6271. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6272. result = createPartial(func, bitmask, thisArg, partials);
  6273. } else {
  6274. result = createHybrid.apply(undefined, newData);
  6275. }
  6276. var setter = data ? baseSetData : setData;
  6277. return setWrapToString(setter(result, newData), func, bitmask);
  6278. }
  6279. /**
  6280. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6281. * of source objects to the destination object for all destination properties
  6282. * that resolve to `undefined`.
  6283. *
  6284. * @private
  6285. * @param {*} objValue The destination value.
  6286. * @param {*} srcValue The source value.
  6287. * @param {string} key The key of the property to assign.
  6288. * @param {Object} object The parent object of `objValue`.
  6289. * @returns {*} Returns the value to assign.
  6290. */
  6291. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6292. if (objValue === undefined ||
  6293. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6294. return srcValue;
  6295. }
  6296. return objValue;
  6297. }
  6298. /**
  6299. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6300. * objects into destination objects that are passed thru.
  6301. *
  6302. * @private
  6303. * @param {*} objValue The destination value.
  6304. * @param {*} srcValue The source value.
  6305. * @param {string} key The key of the property to merge.
  6306. * @param {Object} object The parent object of `objValue`.
  6307. * @param {Object} source The parent object of `srcValue`.
  6308. * @param {Object} [stack] Tracks traversed source values and their merged
  6309. * counterparts.
  6310. * @returns {*} Returns the value to assign.
  6311. */
  6312. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6313. if (isObject(objValue) && isObject(srcValue)) {
  6314. // Recursively merge objects and arrays (susceptible to call stack limits).
  6315. stack.set(srcValue, objValue);
  6316. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6317. stack['delete'](srcValue);
  6318. }
  6319. return objValue;
  6320. }
  6321. /**
  6322. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6323. * objects.
  6324. *
  6325. * @private
  6326. * @param {*} value The value to inspect.
  6327. * @param {string} key The key of the property to inspect.
  6328. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6329. */
  6330. function customOmitClone(value) {
  6331. return isPlainObject(value) ? undefined : value;
  6332. }
  6333. /**
  6334. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6335. * partial deep comparisons.
  6336. *
  6337. * @private
  6338. * @param {Array} array The array to compare.
  6339. * @param {Array} other The other array to compare.
  6340. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6341. * @param {Function} customizer The function to customize comparisons.
  6342. * @param {Function} equalFunc The function to determine equivalents of values.
  6343. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6344. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6345. */
  6346. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6347. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6348. arrLength = array.length,
  6349. othLength = other.length;
  6350. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6351. return false;
  6352. }
  6353. // Check that cyclic values are equal.
  6354. var arrStacked = stack.get(array);
  6355. var othStacked = stack.get(other);
  6356. if (arrStacked && othStacked) {
  6357. return arrStacked == other && othStacked == array;
  6358. }
  6359. var index = -1,
  6360. result = true,
  6361. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6362. stack.set(array, other);
  6363. stack.set(other, array);
  6364. // Ignore non-index properties.
  6365. while (++index < arrLength) {
  6366. var arrValue = array[index],
  6367. othValue = other[index];
  6368. if (customizer) {
  6369. var compared = isPartial
  6370. ? customizer(othValue, arrValue, index, other, array, stack)
  6371. : customizer(arrValue, othValue, index, array, other, stack);
  6372. }
  6373. if (compared !== undefined) {
  6374. if (compared) {
  6375. continue;
  6376. }
  6377. result = false;
  6378. break;
  6379. }
  6380. // Recursively compare arrays (susceptible to call stack limits).
  6381. if (seen) {
  6382. if (!arraySome(other, function(othValue, othIndex) {
  6383. if (!cacheHas(seen, othIndex) &&
  6384. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6385. return seen.push(othIndex);
  6386. }
  6387. })) {
  6388. result = false;
  6389. break;
  6390. }
  6391. } else if (!(
  6392. arrValue === othValue ||
  6393. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6394. )) {
  6395. result = false;
  6396. break;
  6397. }
  6398. }
  6399. stack['delete'](array);
  6400. stack['delete'](other);
  6401. return result;
  6402. }
  6403. /**
  6404. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6405. * the same `toStringTag`.
  6406. *
  6407. * **Note:** This function only supports comparing values with tags of
  6408. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6409. *
  6410. * @private
  6411. * @param {Object} object The object to compare.
  6412. * @param {Object} other The other object to compare.
  6413. * @param {string} tag The `toStringTag` of the objects to compare.
  6414. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6415. * @param {Function} customizer The function to customize comparisons.
  6416. * @param {Function} equalFunc The function to determine equivalents of values.
  6417. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6418. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6419. */
  6420. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6421. switch (tag) {
  6422. case dataViewTag:
  6423. if ((object.byteLength != other.byteLength) ||
  6424. (object.byteOffset != other.byteOffset)) {
  6425. return false;
  6426. }
  6427. object = object.buffer;
  6428. other = other.buffer;
  6429. case arrayBufferTag:
  6430. if ((object.byteLength != other.byteLength) ||
  6431. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6432. return false;
  6433. }
  6434. return true;
  6435. case boolTag:
  6436. case dateTag:
  6437. case numberTag:
  6438. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6439. // Invalid dates are coerced to `NaN`.
  6440. return eq(+object, +other);
  6441. case errorTag:
  6442. return object.name == other.name && object.message == other.message;
  6443. case regexpTag:
  6444. case stringTag:
  6445. // Coerce regexes to strings and treat strings, primitives and objects,
  6446. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6447. // for more details.
  6448. return object == (other + '');
  6449. case mapTag:
  6450. var convert = mapToArray;
  6451. case setTag:
  6452. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6453. convert || (convert = setToArray);
  6454. if (object.size != other.size && !isPartial) {
  6455. return false;
  6456. }
  6457. // Assume cyclic values are equal.
  6458. var stacked = stack.get(object);
  6459. if (stacked) {
  6460. return stacked == other;
  6461. }
  6462. bitmask |= COMPARE_UNORDERED_FLAG;
  6463. // Recursively compare objects (susceptible to call stack limits).
  6464. stack.set(object, other);
  6465. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6466. stack['delete'](object);
  6467. return result;
  6468. case symbolTag:
  6469. if (symbolValueOf) {
  6470. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6471. }
  6472. }
  6473. return false;
  6474. }
  6475. /**
  6476. * A specialized version of `baseIsEqualDeep` for objects with support for
  6477. * partial deep comparisons.
  6478. *
  6479. * @private
  6480. * @param {Object} object The object to compare.
  6481. * @param {Object} other The other object to compare.
  6482. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6483. * @param {Function} customizer The function to customize comparisons.
  6484. * @param {Function} equalFunc The function to determine equivalents of values.
  6485. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6486. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6487. */
  6488. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6489. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6490. objProps = getAllKeys(object),
  6491. objLength = objProps.length,
  6492. othProps = getAllKeys(other),
  6493. othLength = othProps.length;
  6494. if (objLength != othLength && !isPartial) {
  6495. return false;
  6496. }
  6497. var index = objLength;
  6498. while (index--) {
  6499. var key = objProps[index];
  6500. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6501. return false;
  6502. }
  6503. }
  6504. // Check that cyclic values are equal.
  6505. var objStacked = stack.get(object);
  6506. var othStacked = stack.get(other);
  6507. if (objStacked && othStacked) {
  6508. return objStacked == other && othStacked == object;
  6509. }
  6510. var result = true;
  6511. stack.set(object, other);
  6512. stack.set(other, object);
  6513. var skipCtor = isPartial;
  6514. while (++index < objLength) {
  6515. key = objProps[index];
  6516. var objValue = object[key],
  6517. othValue = other[key];
  6518. if (customizer) {
  6519. var compared = isPartial
  6520. ? customizer(othValue, objValue, key, other, object, stack)
  6521. : customizer(objValue, othValue, key, object, other, stack);
  6522. }
  6523. // Recursively compare objects (susceptible to call stack limits).
  6524. if (!(compared === undefined
  6525. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6526. : compared
  6527. )) {
  6528. result = false;
  6529. break;
  6530. }
  6531. skipCtor || (skipCtor = key == 'constructor');
  6532. }
  6533. if (result && !skipCtor) {
  6534. var objCtor = object.constructor,
  6535. othCtor = other.constructor;
  6536. // Non `Object` object instances with different constructors are not equal.
  6537. if (objCtor != othCtor &&
  6538. ('constructor' in object && 'constructor' in other) &&
  6539. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6540. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6541. result = false;
  6542. }
  6543. }
  6544. stack['delete'](object);
  6545. stack['delete'](other);
  6546. return result;
  6547. }
  6548. /**
  6549. * A specialized version of `baseRest` which flattens the rest array.
  6550. *
  6551. * @private
  6552. * @param {Function} func The function to apply a rest parameter to.
  6553. * @returns {Function} Returns the new function.
  6554. */
  6555. function flatRest(func) {
  6556. return setToString(overRest(func, undefined, flatten), func + '');
  6557. }
  6558. /**
  6559. * Creates an array of own enumerable property names and symbols of `object`.
  6560. *
  6561. * @private
  6562. * @param {Object} object The object to query.
  6563. * @returns {Array} Returns the array of property names and symbols.
  6564. */
  6565. function getAllKeys(object) {
  6566. return baseGetAllKeys(object, keys, getSymbols);
  6567. }
  6568. /**
  6569. * Creates an array of own and inherited enumerable property names and
  6570. * symbols of `object`.
  6571. *
  6572. * @private
  6573. * @param {Object} object The object to query.
  6574. * @returns {Array} Returns the array of property names and symbols.
  6575. */
  6576. function getAllKeysIn(object) {
  6577. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6578. }
  6579. /**
  6580. * Gets metadata for `func`.
  6581. *
  6582. * @private
  6583. * @param {Function} func The function to query.
  6584. * @returns {*} Returns the metadata for `func`.
  6585. */
  6586. var getData = !metaMap ? noop : function(func) {
  6587. return metaMap.get(func);
  6588. };
  6589. /**
  6590. * Gets the name of `func`.
  6591. *
  6592. * @private
  6593. * @param {Function} func The function to query.
  6594. * @returns {string} Returns the function name.
  6595. */
  6596. function getFuncName(func) {
  6597. var result = (func.name + ''),
  6598. array = realNames[result],
  6599. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6600. while (length--) {
  6601. var data = array[length],
  6602. otherFunc = data.func;
  6603. if (otherFunc == null || otherFunc == func) {
  6604. return data.name;
  6605. }
  6606. }
  6607. return result;
  6608. }
  6609. /**
  6610. * Gets the argument placeholder value for `func`.
  6611. *
  6612. * @private
  6613. * @param {Function} func The function to inspect.
  6614. * @returns {*} Returns the placeholder value.
  6615. */
  6616. function getHolder(func) {
  6617. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6618. return object.placeholder;
  6619. }
  6620. /**
  6621. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6622. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6623. * If arguments are provided, the chosen function is invoked with them and
  6624. * its result is returned.
  6625. *
  6626. * @private
  6627. * @param {*} [value] The value to convert to an iteratee.
  6628. * @param {number} [arity] The arity of the created iteratee.
  6629. * @returns {Function} Returns the chosen function or its result.
  6630. */
  6631. function getIteratee() {
  6632. var result = lodash.iteratee || iteratee;
  6633. result = result === iteratee ? baseIteratee : result;
  6634. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6635. }
  6636. /**
  6637. * Gets the data for `map`.
  6638. *
  6639. * @private
  6640. * @param {Object} map The map to query.
  6641. * @param {string} key The reference key.
  6642. * @returns {*} Returns the map data.
  6643. */
  6644. function getMapData(map, key) {
  6645. var data = map.__data__;
  6646. return isKeyable(key)
  6647. ? data[typeof key == 'string' ? 'string' : 'hash']
  6648. : data.map;
  6649. }
  6650. /**
  6651. * Gets the property names, values, and compare flags of `object`.
  6652. *
  6653. * @private
  6654. * @param {Object} object The object to query.
  6655. * @returns {Array} Returns the match data of `object`.
  6656. */
  6657. function getMatchData(object) {
  6658. var result = keys(object),
  6659. length = result.length;
  6660. while (length--) {
  6661. var key = result[length],
  6662. value = object[key];
  6663. result[length] = [key, value, isStrictComparable(value)];
  6664. }
  6665. return result;
  6666. }
  6667. /**
  6668. * Gets the native function at `key` of `object`.
  6669. *
  6670. * @private
  6671. * @param {Object} object The object to query.
  6672. * @param {string} key The key of the method to get.
  6673. * @returns {*} Returns the function if it's native, else `undefined`.
  6674. */
  6675. function getNative(object, key) {
  6676. var value = getValue(object, key);
  6677. return baseIsNative(value) ? value : undefined;
  6678. }
  6679. /**
  6680. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6681. *
  6682. * @private
  6683. * @param {*} value The value to query.
  6684. * @returns {string} Returns the raw `toStringTag`.
  6685. */
  6686. function getRawTag(value) {
  6687. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6688. tag = value[symToStringTag];
  6689. try {
  6690. value[symToStringTag] = undefined;
  6691. var unmasked = true;
  6692. } catch (e) {}
  6693. var result = nativeObjectToString.call(value);
  6694. if (unmasked) {
  6695. if (isOwn) {
  6696. value[symToStringTag] = tag;
  6697. } else {
  6698. delete value[symToStringTag];
  6699. }
  6700. }
  6701. return result;
  6702. }
  6703. /**
  6704. * Creates an array of the own enumerable symbols of `object`.
  6705. *
  6706. * @private
  6707. * @param {Object} object The object to query.
  6708. * @returns {Array} Returns the array of symbols.
  6709. */
  6710. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6711. if (object == null) {
  6712. return [];
  6713. }
  6714. object = Object(object);
  6715. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6716. return propertyIsEnumerable.call(object, symbol);
  6717. });
  6718. };
  6719. /**
  6720. * Creates an array of the own and inherited enumerable symbols of `object`.
  6721. *
  6722. * @private
  6723. * @param {Object} object The object to query.
  6724. * @returns {Array} Returns the array of symbols.
  6725. */
  6726. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6727. var result = [];
  6728. while (object) {
  6729. arrayPush(result, getSymbols(object));
  6730. object = getPrototype(object);
  6731. }
  6732. return result;
  6733. };
  6734. /**
  6735. * Gets the `toStringTag` of `value`.
  6736. *
  6737. * @private
  6738. * @param {*} value The value to query.
  6739. * @returns {string} Returns the `toStringTag`.
  6740. */
  6741. var getTag = baseGetTag;
  6742. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6743. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6744. (Map && getTag(new Map) != mapTag) ||
  6745. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6746. (Set && getTag(new Set) != setTag) ||
  6747. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6748. getTag = function(value) {
  6749. var result = baseGetTag(value),
  6750. Ctor = result == objectTag ? value.constructor : undefined,
  6751. ctorString = Ctor ? toSource(Ctor) : '';
  6752. if (ctorString) {
  6753. switch (ctorString) {
  6754. case dataViewCtorString: return dataViewTag;
  6755. case mapCtorString: return mapTag;
  6756. case promiseCtorString: return promiseTag;
  6757. case setCtorString: return setTag;
  6758. case weakMapCtorString: return weakMapTag;
  6759. }
  6760. }
  6761. return result;
  6762. };
  6763. }
  6764. /**
  6765. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6766. *
  6767. * @private
  6768. * @param {number} start The start of the view.
  6769. * @param {number} end The end of the view.
  6770. * @param {Array} transforms The transformations to apply to the view.
  6771. * @returns {Object} Returns an object containing the `start` and `end`
  6772. * positions of the view.
  6773. */
  6774. function getView(start, end, transforms) {
  6775. var index = -1,
  6776. length = transforms.length;
  6777. while (++index < length) {
  6778. var data = transforms[index],
  6779. size = data.size;
  6780. switch (data.type) {
  6781. case 'drop': start += size; break;
  6782. case 'dropRight': end -= size; break;
  6783. case 'take': end = nativeMin(end, start + size); break;
  6784. case 'takeRight': start = nativeMax(start, end - size); break;
  6785. }
  6786. }
  6787. return { 'start': start, 'end': end };
  6788. }
  6789. /**
  6790. * Extracts wrapper details from the `source` body comment.
  6791. *
  6792. * @private
  6793. * @param {string} source The source to inspect.
  6794. * @returns {Array} Returns the wrapper details.
  6795. */
  6796. function getWrapDetails(source) {
  6797. var match = source.match(reWrapDetails);
  6798. return match ? match[1].split(reSplitDetails) : [];
  6799. }
  6800. /**
  6801. * Checks if `path` exists on `object`.
  6802. *
  6803. * @private
  6804. * @param {Object} object The object to query.
  6805. * @param {Array|string} path The path to check.
  6806. * @param {Function} hasFunc The function to check properties.
  6807. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6808. */
  6809. function hasPath(object, path, hasFunc) {
  6810. path = castPath(path, object);
  6811. var index = -1,
  6812. length = path.length,
  6813. result = false;
  6814. while (++index < length) {
  6815. var key = toKey(path[index]);
  6816. if (!(result = object != null && hasFunc(object, key))) {
  6817. break;
  6818. }
  6819. object = object[key];
  6820. }
  6821. if (result || ++index != length) {
  6822. return result;
  6823. }
  6824. length = object == null ? 0 : object.length;
  6825. return !!length && isLength(length) && isIndex(key, length) &&
  6826. (isArray(object) || isArguments(object));
  6827. }
  6828. /**
  6829. * Initializes an array clone.
  6830. *
  6831. * @private
  6832. * @param {Array} array The array to clone.
  6833. * @returns {Array} Returns the initialized clone.
  6834. */
  6835. function initCloneArray(array) {
  6836. var length = array.length,
  6837. result = new array.constructor(length);
  6838. // Add properties assigned by `RegExp#exec`.
  6839. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6840. result.index = array.index;
  6841. result.input = array.input;
  6842. }
  6843. return result;
  6844. }
  6845. /**
  6846. * Initializes an object clone.
  6847. *
  6848. * @private
  6849. * @param {Object} object The object to clone.
  6850. * @returns {Object} Returns the initialized clone.
  6851. */
  6852. function initCloneObject(object) {
  6853. return (typeof object.constructor == 'function' && !isPrototype(object))
  6854. ? baseCreate(getPrototype(object))
  6855. : {};
  6856. }
  6857. /**
  6858. * Initializes an object clone based on its `toStringTag`.
  6859. *
  6860. * **Note:** This function only supports cloning values with tags of
  6861. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6862. *
  6863. * @private
  6864. * @param {Object} object The object to clone.
  6865. * @param {string} tag The `toStringTag` of the object to clone.
  6866. * @param {boolean} [isDeep] Specify a deep clone.
  6867. * @returns {Object} Returns the initialized clone.
  6868. */
  6869. function initCloneByTag(object, tag, isDeep) {
  6870. var Ctor = object.constructor;
  6871. switch (tag) {
  6872. case arrayBufferTag:
  6873. return cloneArrayBuffer(object);
  6874. case boolTag:
  6875. case dateTag:
  6876. return new Ctor(+object);
  6877. case dataViewTag:
  6878. return cloneDataView(object, isDeep);
  6879. case float32Tag: case float64Tag:
  6880. case int8Tag: case int16Tag: case int32Tag:
  6881. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6882. return cloneTypedArray(object, isDeep);
  6883. case mapTag:
  6884. return new Ctor;
  6885. case numberTag:
  6886. case stringTag:
  6887. return new Ctor(object);
  6888. case regexpTag:
  6889. return cloneRegExp(object);
  6890. case setTag:
  6891. return new Ctor;
  6892. case symbolTag:
  6893. return cloneSymbol(object);
  6894. }
  6895. }
  6896. /**
  6897. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6898. *
  6899. * @private
  6900. * @param {string} source The source to modify.
  6901. * @returns {Array} details The details to insert.
  6902. * @returns {string} Returns the modified source.
  6903. */
  6904. function insertWrapDetails(source, details) {
  6905. var length = details.length;
  6906. if (!length) {
  6907. return source;
  6908. }
  6909. var lastIndex = length - 1;
  6910. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6911. details = details.join(length > 2 ? ', ' : ' ');
  6912. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6913. }
  6914. /**
  6915. * Checks if `value` is a flattenable `arguments` object or array.
  6916. *
  6917. * @private
  6918. * @param {*} value The value to check.
  6919. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6920. */
  6921. function isFlattenable(value) {
  6922. return isArray(value) || isArguments(value) ||
  6923. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6924. }
  6925. /**
  6926. * Checks if `value` is a valid array-like index.
  6927. *
  6928. * @private
  6929. * @param {*} value The value to check.
  6930. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6931. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6932. */
  6933. function isIndex(value, length) {
  6934. var type = typeof value;
  6935. length = length == null ? MAX_SAFE_INTEGER : length;
  6936. return !!length &&
  6937. (type == 'number' ||
  6938. (type != 'symbol' && reIsUint.test(value))) &&
  6939. (value > -1 && value % 1 == 0 && value < length);
  6940. }
  6941. /**
  6942. * Checks if the given arguments are from an iteratee call.
  6943. *
  6944. * @private
  6945. * @param {*} value The potential iteratee value argument.
  6946. * @param {*} index The potential iteratee index or key argument.
  6947. * @param {*} object The potential iteratee object argument.
  6948. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6949. * else `false`.
  6950. */
  6951. function isIterateeCall(value, index, object) {
  6952. if (!isObject(object)) {
  6953. return false;
  6954. }
  6955. var type = typeof index;
  6956. if (type == 'number'
  6957. ? (isArrayLike(object) && isIndex(index, object.length))
  6958. : (type == 'string' && index in object)
  6959. ) {
  6960. return eq(object[index], value);
  6961. }
  6962. return false;
  6963. }
  6964. /**
  6965. * Checks if `value` is a property name and not a property path.
  6966. *
  6967. * @private
  6968. * @param {*} value The value to check.
  6969. * @param {Object} [object] The object to query keys on.
  6970. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6971. */
  6972. function isKey(value, object) {
  6973. if (isArray(value)) {
  6974. return false;
  6975. }
  6976. var type = typeof value;
  6977. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6978. value == null || isSymbol(value)) {
  6979. return true;
  6980. }
  6981. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6982. (object != null && value in Object(object));
  6983. }
  6984. /**
  6985. * Checks if `value` is suitable for use as unique object key.
  6986. *
  6987. * @private
  6988. * @param {*} value The value to check.
  6989. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6990. */
  6991. function isKeyable(value) {
  6992. var type = typeof value;
  6993. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6994. ? (value !== '__proto__')
  6995. : (value === null);
  6996. }
  6997. /**
  6998. * Checks if `func` has a lazy counterpart.
  6999. *
  7000. * @private
  7001. * @param {Function} func The function to check.
  7002. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7003. * else `false`.
  7004. */
  7005. function isLaziable(func) {
  7006. var funcName = getFuncName(func),
  7007. other = lodash[funcName];
  7008. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7009. return false;
  7010. }
  7011. if (func === other) {
  7012. return true;
  7013. }
  7014. var data = getData(other);
  7015. return !!data && func === data[0];
  7016. }
  7017. /**
  7018. * Checks if `func` has its source masked.
  7019. *
  7020. * @private
  7021. * @param {Function} func The function to check.
  7022. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7023. */
  7024. function isMasked(func) {
  7025. return !!maskSrcKey && (maskSrcKey in func);
  7026. }
  7027. /**
  7028. * Checks if `func` is capable of being masked.
  7029. *
  7030. * @private
  7031. * @param {*} value The value to check.
  7032. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7033. */
  7034. var isMaskable = coreJsData ? isFunction : stubFalse;
  7035. /**
  7036. * Checks if `value` is likely a prototype object.
  7037. *
  7038. * @private
  7039. * @param {*} value The value to check.
  7040. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7041. */
  7042. function isPrototype(value) {
  7043. var Ctor = value && value.constructor,
  7044. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7045. return value === proto;
  7046. }
  7047. /**
  7048. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7049. *
  7050. * @private
  7051. * @param {*} value The value to check.
  7052. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7053. * equality comparisons, else `false`.
  7054. */
  7055. function isStrictComparable(value) {
  7056. return value === value && !isObject(value);
  7057. }
  7058. /**
  7059. * A specialized version of `matchesProperty` for source values suitable
  7060. * for strict equality comparisons, i.e. `===`.
  7061. *
  7062. * @private
  7063. * @param {string} key The key of the property to get.
  7064. * @param {*} srcValue The value to match.
  7065. * @returns {Function} Returns the new spec function.
  7066. */
  7067. function matchesStrictComparable(key, srcValue) {
  7068. return function(object) {
  7069. if (object == null) {
  7070. return false;
  7071. }
  7072. return object[key] === srcValue &&
  7073. (srcValue !== undefined || (key in Object(object)));
  7074. };
  7075. }
  7076. /**
  7077. * A specialized version of `_.memoize` which clears the memoized function's
  7078. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7079. *
  7080. * @private
  7081. * @param {Function} func The function to have its output memoized.
  7082. * @returns {Function} Returns the new memoized function.
  7083. */
  7084. function memoizeCapped(func) {
  7085. var result = memoize(func, function(key) {
  7086. if (cache.size === MAX_MEMOIZE_SIZE) {
  7087. cache.clear();
  7088. }
  7089. return key;
  7090. });
  7091. var cache = result.cache;
  7092. return result;
  7093. }
  7094. /**
  7095. * Merges the function metadata of `source` into `data`.
  7096. *
  7097. * Merging metadata reduces the number of wrappers used to invoke a function.
  7098. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7099. * may be applied regardless of execution order. Methods like `_.ary` and
  7100. * `_.rearg` modify function arguments, making the order in which they are
  7101. * executed important, preventing the merging of metadata. However, we make
  7102. * an exception for a safe combined case where curried functions have `_.ary`
  7103. * and or `_.rearg` applied.
  7104. *
  7105. * @private
  7106. * @param {Array} data The destination metadata.
  7107. * @param {Array} source The source metadata.
  7108. * @returns {Array} Returns `data`.
  7109. */
  7110. function mergeData(data, source) {
  7111. var bitmask = data[1],
  7112. srcBitmask = source[1],
  7113. newBitmask = bitmask | srcBitmask,
  7114. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7115. var isCombo =
  7116. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7117. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7118. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7119. // Exit early if metadata can't be merged.
  7120. if (!(isCommon || isCombo)) {
  7121. return data;
  7122. }
  7123. // Use source `thisArg` if available.
  7124. if (srcBitmask & WRAP_BIND_FLAG) {
  7125. data[2] = source[2];
  7126. // Set when currying a bound function.
  7127. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7128. }
  7129. // Compose partial arguments.
  7130. var value = source[3];
  7131. if (value) {
  7132. var partials = data[3];
  7133. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7134. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7135. }
  7136. // Compose partial right arguments.
  7137. value = source[5];
  7138. if (value) {
  7139. partials = data[5];
  7140. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7141. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7142. }
  7143. // Use source `argPos` if available.
  7144. value = source[7];
  7145. if (value) {
  7146. data[7] = value;
  7147. }
  7148. // Use source `ary` if it's smaller.
  7149. if (srcBitmask & WRAP_ARY_FLAG) {
  7150. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7151. }
  7152. // Use source `arity` if one is not provided.
  7153. if (data[9] == null) {
  7154. data[9] = source[9];
  7155. }
  7156. // Use source `func` and merge bitmasks.
  7157. data[0] = source[0];
  7158. data[1] = newBitmask;
  7159. return data;
  7160. }
  7161. /**
  7162. * This function is like
  7163. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7164. * except that it includes inherited enumerable properties.
  7165. *
  7166. * @private
  7167. * @param {Object} object The object to query.
  7168. * @returns {Array} Returns the array of property names.
  7169. */
  7170. function nativeKeysIn(object) {
  7171. var result = [];
  7172. if (object != null) {
  7173. for (var key in Object(object)) {
  7174. result.push(key);
  7175. }
  7176. }
  7177. return result;
  7178. }
  7179. /**
  7180. * Converts `value` to a string using `Object.prototype.toString`.
  7181. *
  7182. * @private
  7183. * @param {*} value The value to convert.
  7184. * @returns {string} Returns the converted string.
  7185. */
  7186. function objectToString(value) {
  7187. return nativeObjectToString.call(value);
  7188. }
  7189. /**
  7190. * A specialized version of `baseRest` which transforms the rest array.
  7191. *
  7192. * @private
  7193. * @param {Function} func The function to apply a rest parameter to.
  7194. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7195. * @param {Function} transform The rest array transform.
  7196. * @returns {Function} Returns the new function.
  7197. */
  7198. function overRest(func, start, transform) {
  7199. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7200. return function() {
  7201. var args = arguments,
  7202. index = -1,
  7203. length = nativeMax(args.length - start, 0),
  7204. array = Array(length);
  7205. while (++index < length) {
  7206. array[index] = args[start + index];
  7207. }
  7208. index = -1;
  7209. var otherArgs = Array(start + 1);
  7210. while (++index < start) {
  7211. otherArgs[index] = args[index];
  7212. }
  7213. otherArgs[start] = transform(array);
  7214. return apply(func, this, otherArgs);
  7215. };
  7216. }
  7217. /**
  7218. * Gets the parent value at `path` of `object`.
  7219. *
  7220. * @private
  7221. * @param {Object} object The object to query.
  7222. * @param {Array} path The path to get the parent value of.
  7223. * @returns {*} Returns the parent value.
  7224. */
  7225. function parent(object, path) {
  7226. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7227. }
  7228. /**
  7229. * Reorder `array` according to the specified indexes where the element at
  7230. * the first index is assigned as the first element, the element at
  7231. * the second index is assigned as the second element, and so on.
  7232. *
  7233. * @private
  7234. * @param {Array} array The array to reorder.
  7235. * @param {Array} indexes The arranged array indexes.
  7236. * @returns {Array} Returns `array`.
  7237. */
  7238. function reorder(array, indexes) {
  7239. var arrLength = array.length,
  7240. length = nativeMin(indexes.length, arrLength),
  7241. oldArray = copyArray(array);
  7242. while (length--) {
  7243. var index = indexes[length];
  7244. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7245. }
  7246. return array;
  7247. }
  7248. /**
  7249. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7250. *
  7251. * @private
  7252. * @param {Object} object The object to query.
  7253. * @param {string} key The key of the property to get.
  7254. * @returns {*} Returns the property value.
  7255. */
  7256. function safeGet(object, key) {
  7257. if (key === 'constructor' && typeof object[key] === 'function') {
  7258. return;
  7259. }
  7260. if (key == '__proto__') {
  7261. return;
  7262. }
  7263. return object[key];
  7264. }
  7265. /**
  7266. * Sets metadata for `func`.
  7267. *
  7268. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7269. * period of time, it will trip its breaker and transition to an identity
  7270. * function to avoid garbage collection pauses in V8. See
  7271. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7272. * for more details.
  7273. *
  7274. * @private
  7275. * @param {Function} func The function to associate metadata with.
  7276. * @param {*} data The metadata.
  7277. * @returns {Function} Returns `func`.
  7278. */
  7279. var setData = shortOut(baseSetData);
  7280. /**
  7281. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7282. *
  7283. * @private
  7284. * @param {Function} func The function to delay.
  7285. * @param {number} wait The number of milliseconds to delay invocation.
  7286. * @returns {number|Object} Returns the timer id or timeout object.
  7287. */
  7288. var setTimeout = ctxSetTimeout || function(func, wait) {
  7289. return root.setTimeout(func, wait);
  7290. };
  7291. /**
  7292. * Sets the `toString` method of `func` to return `string`.
  7293. *
  7294. * @private
  7295. * @param {Function} func The function to modify.
  7296. * @param {Function} string The `toString` result.
  7297. * @returns {Function} Returns `func`.
  7298. */
  7299. var setToString = shortOut(baseSetToString);
  7300. /**
  7301. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7302. * with wrapper details in a comment at the top of the source body.
  7303. *
  7304. * @private
  7305. * @param {Function} wrapper The function to modify.
  7306. * @param {Function} reference The reference function.
  7307. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7308. * @returns {Function} Returns `wrapper`.
  7309. */
  7310. function setWrapToString(wrapper, reference, bitmask) {
  7311. var source = (reference + '');
  7312. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7313. }
  7314. /**
  7315. * Creates a function that'll short out and invoke `identity` instead
  7316. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7317. * milliseconds.
  7318. *
  7319. * @private
  7320. * @param {Function} func The function to restrict.
  7321. * @returns {Function} Returns the new shortable function.
  7322. */
  7323. function shortOut(func) {
  7324. var count = 0,
  7325. lastCalled = 0;
  7326. return function() {
  7327. var stamp = nativeNow(),
  7328. remaining = HOT_SPAN - (stamp - lastCalled);
  7329. lastCalled = stamp;
  7330. if (remaining > 0) {
  7331. if (++count >= HOT_COUNT) {
  7332. return arguments[0];
  7333. }
  7334. } else {
  7335. count = 0;
  7336. }
  7337. return func.apply(undefined, arguments);
  7338. };
  7339. }
  7340. /**
  7341. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7342. *
  7343. * @private
  7344. * @param {Array} array The array to shuffle.
  7345. * @param {number} [size=array.length] The size of `array`.
  7346. * @returns {Array} Returns `array`.
  7347. */
  7348. function shuffleSelf(array, size) {
  7349. var index = -1,
  7350. length = array.length,
  7351. lastIndex = length - 1;
  7352. size = size === undefined ? length : size;
  7353. while (++index < size) {
  7354. var rand = baseRandom(index, lastIndex),
  7355. value = array[rand];
  7356. array[rand] = array[index];
  7357. array[index] = value;
  7358. }
  7359. array.length = size;
  7360. return array;
  7361. }
  7362. /**
  7363. * Converts `string` to a property path array.
  7364. *
  7365. * @private
  7366. * @param {string} string The string to convert.
  7367. * @returns {Array} Returns the property path array.
  7368. */
  7369. var stringToPath = memoizeCapped(function(string) {
  7370. var result = [];
  7371. if (string.charCodeAt(0) === 46 /* . */) {
  7372. result.push('');
  7373. }
  7374. string.replace(rePropName, function(match, number, quote, subString) {
  7375. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7376. });
  7377. return result;
  7378. });
  7379. /**
  7380. * Converts `value` to a string key if it's not a string or symbol.
  7381. *
  7382. * @private
  7383. * @param {*} value The value to inspect.
  7384. * @returns {string|symbol} Returns the key.
  7385. */
  7386. function toKey(value) {
  7387. if (typeof value == 'string' || isSymbol(value)) {
  7388. return value;
  7389. }
  7390. var result = (value + '');
  7391. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7392. }
  7393. /**
  7394. * Converts `func` to its source code.
  7395. *
  7396. * @private
  7397. * @param {Function} func The function to convert.
  7398. * @returns {string} Returns the source code.
  7399. */
  7400. function toSource(func) {
  7401. if (func != null) {
  7402. try {
  7403. return funcToString.call(func);
  7404. } catch (e) {}
  7405. try {
  7406. return (func + '');
  7407. } catch (e) {}
  7408. }
  7409. return '';
  7410. }
  7411. /**
  7412. * Updates wrapper `details` based on `bitmask` flags.
  7413. *
  7414. * @private
  7415. * @returns {Array} details The details to modify.
  7416. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7417. * @returns {Array} Returns `details`.
  7418. */
  7419. function updateWrapDetails(details, bitmask) {
  7420. arrayEach(wrapFlags, function(pair) {
  7421. var value = '_.' + pair[0];
  7422. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7423. details.push(value);
  7424. }
  7425. });
  7426. return details.sort();
  7427. }
  7428. /**
  7429. * Creates a clone of `wrapper`.
  7430. *
  7431. * @private
  7432. * @param {Object} wrapper The wrapper to clone.
  7433. * @returns {Object} Returns the cloned wrapper.
  7434. */
  7435. function wrapperClone(wrapper) {
  7436. if (wrapper instanceof LazyWrapper) {
  7437. return wrapper.clone();
  7438. }
  7439. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7440. result.__actions__ = copyArray(wrapper.__actions__);
  7441. result.__index__ = wrapper.__index__;
  7442. result.__values__ = wrapper.__values__;
  7443. return result;
  7444. }
  7445. /*------------------------------------------------------------------------*/
  7446. /**
  7447. * Creates an array of elements split into groups the length of `size`.
  7448. * If `array` can't be split evenly, the final chunk will be the remaining
  7449. * elements.
  7450. *
  7451. * @static
  7452. * @memberOf _
  7453. * @since 3.0.0
  7454. * @category Array
  7455. * @param {Array} array The array to process.
  7456. * @param {number} [size=1] The length of each chunk
  7457. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7458. * @returns {Array} Returns the new array of chunks.
  7459. * @example
  7460. *
  7461. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7462. * // => [['a', 'b'], ['c', 'd']]
  7463. *
  7464. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7465. * // => [['a', 'b', 'c'], ['d']]
  7466. */
  7467. function chunk(array, size, guard) {
  7468. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7469. size = 1;
  7470. } else {
  7471. size = nativeMax(toInteger(size), 0);
  7472. }
  7473. var length = array == null ? 0 : array.length;
  7474. if (!length || size < 1) {
  7475. return [];
  7476. }
  7477. var index = 0,
  7478. resIndex = 0,
  7479. result = Array(nativeCeil(length / size));
  7480. while (index < length) {
  7481. result[resIndex++] = baseSlice(array, index, (index += size));
  7482. }
  7483. return result;
  7484. }
  7485. /**
  7486. * Creates an array with all falsey values removed. The values `false`, `null`,
  7487. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7488. *
  7489. * @static
  7490. * @memberOf _
  7491. * @since 0.1.0
  7492. * @category Array
  7493. * @param {Array} array The array to compact.
  7494. * @returns {Array} Returns the new array of filtered values.
  7495. * @example
  7496. *
  7497. * _.compact([0, 1, false, 2, '', 3]);
  7498. * // => [1, 2, 3]
  7499. */
  7500. function compact(array) {
  7501. var index = -1,
  7502. length = array == null ? 0 : array.length,
  7503. resIndex = 0,
  7504. result = [];
  7505. while (++index < length) {
  7506. var value = array[index];
  7507. if (value) {
  7508. result[resIndex++] = value;
  7509. }
  7510. }
  7511. return result;
  7512. }
  7513. /**
  7514. * Creates a new array concatenating `array` with any additional arrays
  7515. * and/or values.
  7516. *
  7517. * @static
  7518. * @memberOf _
  7519. * @since 4.0.0
  7520. * @category Array
  7521. * @param {Array} array The array to concatenate.
  7522. * @param {...*} [values] The values to concatenate.
  7523. * @returns {Array} Returns the new concatenated array.
  7524. * @example
  7525. *
  7526. * var array = [1];
  7527. * var other = _.concat(array, 2, [3], [[4]]);
  7528. *
  7529. * console.log(other);
  7530. * // => [1, 2, 3, [4]]
  7531. *
  7532. * console.log(array);
  7533. * // => [1]
  7534. */
  7535. function concat() {
  7536. var length = arguments.length;
  7537. if (!length) {
  7538. return [];
  7539. }
  7540. var args = Array(length - 1),
  7541. array = arguments[0],
  7542. index = length;
  7543. while (index--) {
  7544. args[index - 1] = arguments[index];
  7545. }
  7546. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7547. }
  7548. /**
  7549. * Creates an array of `array` values not included in the other given arrays
  7550. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7551. * for equality comparisons. The order and references of result values are
  7552. * determined by the first array.
  7553. *
  7554. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7555. *
  7556. * @static
  7557. * @memberOf _
  7558. * @since 0.1.0
  7559. * @category Array
  7560. * @param {Array} array The array to inspect.
  7561. * @param {...Array} [values] The values to exclude.
  7562. * @returns {Array} Returns the new array of filtered values.
  7563. * @see _.without, _.xor
  7564. * @example
  7565. *
  7566. * _.difference([2, 1], [2, 3]);
  7567. * // => [1]
  7568. */
  7569. var difference = baseRest(function(array, values) {
  7570. return isArrayLikeObject(array)
  7571. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7572. : [];
  7573. });
  7574. /**
  7575. * This method is like `_.difference` except that it accepts `iteratee` which
  7576. * is invoked for each element of `array` and `values` to generate the criterion
  7577. * by which they're compared. The order and references of result values are
  7578. * determined by the first array. The iteratee is invoked with one argument:
  7579. * (value).
  7580. *
  7581. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7582. *
  7583. * @static
  7584. * @memberOf _
  7585. * @since 4.0.0
  7586. * @category Array
  7587. * @param {Array} array The array to inspect.
  7588. * @param {...Array} [values] The values to exclude.
  7589. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7590. * @returns {Array} Returns the new array of filtered values.
  7591. * @example
  7592. *
  7593. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7594. * // => [1.2]
  7595. *
  7596. * // The `_.property` iteratee shorthand.
  7597. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7598. * // => [{ 'x': 2 }]
  7599. */
  7600. var differenceBy = baseRest(function(array, values) {
  7601. var iteratee = last(values);
  7602. if (isArrayLikeObject(iteratee)) {
  7603. iteratee = undefined;
  7604. }
  7605. return isArrayLikeObject(array)
  7606. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7607. : [];
  7608. });
  7609. /**
  7610. * This method is like `_.difference` except that it accepts `comparator`
  7611. * which is invoked to compare elements of `array` to `values`. The order and
  7612. * references of result values are determined by the first array. The comparator
  7613. * is invoked with two arguments: (arrVal, othVal).
  7614. *
  7615. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7616. *
  7617. * @static
  7618. * @memberOf _
  7619. * @since 4.0.0
  7620. * @category Array
  7621. * @param {Array} array The array to inspect.
  7622. * @param {...Array} [values] The values to exclude.
  7623. * @param {Function} [comparator] The comparator invoked per element.
  7624. * @returns {Array} Returns the new array of filtered values.
  7625. * @example
  7626. *
  7627. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7628. *
  7629. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7630. * // => [{ 'x': 2, 'y': 1 }]
  7631. */
  7632. var differenceWith = baseRest(function(array, values) {
  7633. var comparator = last(values);
  7634. if (isArrayLikeObject(comparator)) {
  7635. comparator = undefined;
  7636. }
  7637. return isArrayLikeObject(array)
  7638. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7639. : [];
  7640. });
  7641. /**
  7642. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7643. *
  7644. * @static
  7645. * @memberOf _
  7646. * @since 0.5.0
  7647. * @category Array
  7648. * @param {Array} array The array to query.
  7649. * @param {number} [n=1] The number of elements to drop.
  7650. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7651. * @returns {Array} Returns the slice of `array`.
  7652. * @example
  7653. *
  7654. * _.drop([1, 2, 3]);
  7655. * // => [2, 3]
  7656. *
  7657. * _.drop([1, 2, 3], 2);
  7658. * // => [3]
  7659. *
  7660. * _.drop([1, 2, 3], 5);
  7661. * // => []
  7662. *
  7663. * _.drop([1, 2, 3], 0);
  7664. * // => [1, 2, 3]
  7665. */
  7666. function drop(array, n, guard) {
  7667. var length = array == null ? 0 : array.length;
  7668. if (!length) {
  7669. return [];
  7670. }
  7671. n = (guard || n === undefined) ? 1 : toInteger(n);
  7672. return baseSlice(array, n < 0 ? 0 : n, length);
  7673. }
  7674. /**
  7675. * Creates a slice of `array` with `n` elements dropped from the end.
  7676. *
  7677. * @static
  7678. * @memberOf _
  7679. * @since 3.0.0
  7680. * @category Array
  7681. * @param {Array} array The array to query.
  7682. * @param {number} [n=1] The number of elements to drop.
  7683. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7684. * @returns {Array} Returns the slice of `array`.
  7685. * @example
  7686. *
  7687. * _.dropRight([1, 2, 3]);
  7688. * // => [1, 2]
  7689. *
  7690. * _.dropRight([1, 2, 3], 2);
  7691. * // => [1]
  7692. *
  7693. * _.dropRight([1, 2, 3], 5);
  7694. * // => []
  7695. *
  7696. * _.dropRight([1, 2, 3], 0);
  7697. * // => [1, 2, 3]
  7698. */
  7699. function dropRight(array, n, guard) {
  7700. var length = array == null ? 0 : array.length;
  7701. if (!length) {
  7702. return [];
  7703. }
  7704. n = (guard || n === undefined) ? 1 : toInteger(n);
  7705. n = length - n;
  7706. return baseSlice(array, 0, n < 0 ? 0 : n);
  7707. }
  7708. /**
  7709. * Creates a slice of `array` excluding elements dropped from the end.
  7710. * Elements are dropped until `predicate` returns falsey. The predicate is
  7711. * invoked with three arguments: (value, index, array).
  7712. *
  7713. * @static
  7714. * @memberOf _
  7715. * @since 3.0.0
  7716. * @category Array
  7717. * @param {Array} array The array to query.
  7718. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7719. * @returns {Array} Returns the slice of `array`.
  7720. * @example
  7721. *
  7722. * var users = [
  7723. * { 'user': 'barney', 'active': true },
  7724. * { 'user': 'fred', 'active': false },
  7725. * { 'user': 'pebbles', 'active': false }
  7726. * ];
  7727. *
  7728. * _.dropRightWhile(users, function(o) { return !o.active; });
  7729. * // => objects for ['barney']
  7730. *
  7731. * // The `_.matches` iteratee shorthand.
  7732. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7733. * // => objects for ['barney', 'fred']
  7734. *
  7735. * // The `_.matchesProperty` iteratee shorthand.
  7736. * _.dropRightWhile(users, ['active', false]);
  7737. * // => objects for ['barney']
  7738. *
  7739. * // The `_.property` iteratee shorthand.
  7740. * _.dropRightWhile(users, 'active');
  7741. * // => objects for ['barney', 'fred', 'pebbles']
  7742. */
  7743. function dropRightWhile(array, predicate) {
  7744. return (array && array.length)
  7745. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7746. : [];
  7747. }
  7748. /**
  7749. * Creates a slice of `array` excluding elements dropped from the beginning.
  7750. * Elements are dropped until `predicate` returns falsey. The predicate is
  7751. * invoked with three arguments: (value, index, array).
  7752. *
  7753. * @static
  7754. * @memberOf _
  7755. * @since 3.0.0
  7756. * @category Array
  7757. * @param {Array} array The array to query.
  7758. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7759. * @returns {Array} Returns the slice of `array`.
  7760. * @example
  7761. *
  7762. * var users = [
  7763. * { 'user': 'barney', 'active': false },
  7764. * { 'user': 'fred', 'active': false },
  7765. * { 'user': 'pebbles', 'active': true }
  7766. * ];
  7767. *
  7768. * _.dropWhile(users, function(o) { return !o.active; });
  7769. * // => objects for ['pebbles']
  7770. *
  7771. * // The `_.matches` iteratee shorthand.
  7772. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7773. * // => objects for ['fred', 'pebbles']
  7774. *
  7775. * // The `_.matchesProperty` iteratee shorthand.
  7776. * _.dropWhile(users, ['active', false]);
  7777. * // => objects for ['pebbles']
  7778. *
  7779. * // The `_.property` iteratee shorthand.
  7780. * _.dropWhile(users, 'active');
  7781. * // => objects for ['barney', 'fred', 'pebbles']
  7782. */
  7783. function dropWhile(array, predicate) {
  7784. return (array && array.length)
  7785. ? baseWhile(array, getIteratee(predicate, 3), true)
  7786. : [];
  7787. }
  7788. /**
  7789. * Fills elements of `array` with `value` from `start` up to, but not
  7790. * including, `end`.
  7791. *
  7792. * **Note:** This method mutates `array`.
  7793. *
  7794. * @static
  7795. * @memberOf _
  7796. * @since 3.2.0
  7797. * @category Array
  7798. * @param {Array} array The array to fill.
  7799. * @param {*} value The value to fill `array` with.
  7800. * @param {number} [start=0] The start position.
  7801. * @param {number} [end=array.length] The end position.
  7802. * @returns {Array} Returns `array`.
  7803. * @example
  7804. *
  7805. * var array = [1, 2, 3];
  7806. *
  7807. * _.fill(array, 'a');
  7808. * console.log(array);
  7809. * // => ['a', 'a', 'a']
  7810. *
  7811. * _.fill(Array(3), 2);
  7812. * // => [2, 2, 2]
  7813. *
  7814. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7815. * // => [4, '*', '*', 10]
  7816. */
  7817. function fill(array, value, start, end) {
  7818. var length = array == null ? 0 : array.length;
  7819. if (!length) {
  7820. return [];
  7821. }
  7822. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7823. start = 0;
  7824. end = length;
  7825. }
  7826. return baseFill(array, value, start, end);
  7827. }
  7828. /**
  7829. * This method is like `_.find` except that it returns the index of the first
  7830. * element `predicate` returns truthy for instead of the element itself.
  7831. *
  7832. * @static
  7833. * @memberOf _
  7834. * @since 1.1.0
  7835. * @category Array
  7836. * @param {Array} array The array to inspect.
  7837. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7838. * @param {number} [fromIndex=0] The index to search from.
  7839. * @returns {number} Returns the index of the found element, else `-1`.
  7840. * @example
  7841. *
  7842. * var users = [
  7843. * { 'user': 'barney', 'active': false },
  7844. * { 'user': 'fred', 'active': false },
  7845. * { 'user': 'pebbles', 'active': true }
  7846. * ];
  7847. *
  7848. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7849. * // => 0
  7850. *
  7851. * // The `_.matches` iteratee shorthand.
  7852. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7853. * // => 1
  7854. *
  7855. * // The `_.matchesProperty` iteratee shorthand.
  7856. * _.findIndex(users, ['active', false]);
  7857. * // => 0
  7858. *
  7859. * // The `_.property` iteratee shorthand.
  7860. * _.findIndex(users, 'active');
  7861. * // => 2
  7862. */
  7863. function findIndex(array, predicate, fromIndex) {
  7864. var length = array == null ? 0 : array.length;
  7865. if (!length) {
  7866. return -1;
  7867. }
  7868. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7869. if (index < 0) {
  7870. index = nativeMax(length + index, 0);
  7871. }
  7872. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7873. }
  7874. /**
  7875. * This method is like `_.findIndex` except that it iterates over elements
  7876. * of `collection` from right to left.
  7877. *
  7878. * @static
  7879. * @memberOf _
  7880. * @since 2.0.0
  7881. * @category Array
  7882. * @param {Array} array The array to inspect.
  7883. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7884. * @param {number} [fromIndex=array.length-1] The index to search from.
  7885. * @returns {number} Returns the index of the found element, else `-1`.
  7886. * @example
  7887. *
  7888. * var users = [
  7889. * { 'user': 'barney', 'active': true },
  7890. * { 'user': 'fred', 'active': false },
  7891. * { 'user': 'pebbles', 'active': false }
  7892. * ];
  7893. *
  7894. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7895. * // => 2
  7896. *
  7897. * // The `_.matches` iteratee shorthand.
  7898. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7899. * // => 0
  7900. *
  7901. * // The `_.matchesProperty` iteratee shorthand.
  7902. * _.findLastIndex(users, ['active', false]);
  7903. * // => 2
  7904. *
  7905. * // The `_.property` iteratee shorthand.
  7906. * _.findLastIndex(users, 'active');
  7907. * // => 0
  7908. */
  7909. function findLastIndex(array, predicate, fromIndex) {
  7910. var length = array == null ? 0 : array.length;
  7911. if (!length) {
  7912. return -1;
  7913. }
  7914. var index = length - 1;
  7915. if (fromIndex !== undefined) {
  7916. index = toInteger(fromIndex);
  7917. index = fromIndex < 0
  7918. ? nativeMax(length + index, 0)
  7919. : nativeMin(index, length - 1);
  7920. }
  7921. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7922. }
  7923. /**
  7924. * Flattens `array` a single level deep.
  7925. *
  7926. * @static
  7927. * @memberOf _
  7928. * @since 0.1.0
  7929. * @category Array
  7930. * @param {Array} array The array to flatten.
  7931. * @returns {Array} Returns the new flattened array.
  7932. * @example
  7933. *
  7934. * _.flatten([1, [2, [3, [4]], 5]]);
  7935. * // => [1, 2, [3, [4]], 5]
  7936. */
  7937. function flatten(array) {
  7938. var length = array == null ? 0 : array.length;
  7939. return length ? baseFlatten(array, 1) : [];
  7940. }
  7941. /**
  7942. * Recursively flattens `array`.
  7943. *
  7944. * @static
  7945. * @memberOf _
  7946. * @since 3.0.0
  7947. * @category Array
  7948. * @param {Array} array The array to flatten.
  7949. * @returns {Array} Returns the new flattened array.
  7950. * @example
  7951. *
  7952. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7953. * // => [1, 2, 3, 4, 5]
  7954. */
  7955. function flattenDeep(array) {
  7956. var length = array == null ? 0 : array.length;
  7957. return length ? baseFlatten(array, INFINITY) : [];
  7958. }
  7959. /**
  7960. * Recursively flatten `array` up to `depth` times.
  7961. *
  7962. * @static
  7963. * @memberOf _
  7964. * @since 4.4.0
  7965. * @category Array
  7966. * @param {Array} array The array to flatten.
  7967. * @param {number} [depth=1] The maximum recursion depth.
  7968. * @returns {Array} Returns the new flattened array.
  7969. * @example
  7970. *
  7971. * var array = [1, [2, [3, [4]], 5]];
  7972. *
  7973. * _.flattenDepth(array, 1);
  7974. * // => [1, 2, [3, [4]], 5]
  7975. *
  7976. * _.flattenDepth(array, 2);
  7977. * // => [1, 2, 3, [4], 5]
  7978. */
  7979. function flattenDepth(array, depth) {
  7980. var length = array == null ? 0 : array.length;
  7981. if (!length) {
  7982. return [];
  7983. }
  7984. depth = depth === undefined ? 1 : toInteger(depth);
  7985. return baseFlatten(array, depth);
  7986. }
  7987. /**
  7988. * The inverse of `_.toPairs`; this method returns an object composed
  7989. * from key-value `pairs`.
  7990. *
  7991. * @static
  7992. * @memberOf _
  7993. * @since 4.0.0
  7994. * @category Array
  7995. * @param {Array} pairs The key-value pairs.
  7996. * @returns {Object} Returns the new object.
  7997. * @example
  7998. *
  7999. * _.fromPairs([['a', 1], ['b', 2]]);
  8000. * // => { 'a': 1, 'b': 2 }
  8001. */
  8002. function fromPairs(pairs) {
  8003. var index = -1,
  8004. length = pairs == null ? 0 : pairs.length,
  8005. result = {};
  8006. while (++index < length) {
  8007. var pair = pairs[index];
  8008. result[pair[0]] = pair[1];
  8009. }
  8010. return result;
  8011. }
  8012. /**
  8013. * Gets the first element of `array`.
  8014. *
  8015. * @static
  8016. * @memberOf _
  8017. * @since 0.1.0
  8018. * @alias first
  8019. * @category Array
  8020. * @param {Array} array The array to query.
  8021. * @returns {*} Returns the first element of `array`.
  8022. * @example
  8023. *
  8024. * _.head([1, 2, 3]);
  8025. * // => 1
  8026. *
  8027. * _.head([]);
  8028. * // => undefined
  8029. */
  8030. function head(array) {
  8031. return (array && array.length) ? array[0] : undefined;
  8032. }
  8033. /**
  8034. * Gets the index at which the first occurrence of `value` is found in `array`
  8035. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8036. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8037. * offset from the end of `array`.
  8038. *
  8039. * @static
  8040. * @memberOf _
  8041. * @since 0.1.0
  8042. * @category Array
  8043. * @param {Array} array The array to inspect.
  8044. * @param {*} value The value to search for.
  8045. * @param {number} [fromIndex=0] The index to search from.
  8046. * @returns {number} Returns the index of the matched value, else `-1`.
  8047. * @example
  8048. *
  8049. * _.indexOf([1, 2, 1, 2], 2);
  8050. * // => 1
  8051. *
  8052. * // Search from the `fromIndex`.
  8053. * _.indexOf([1, 2, 1, 2], 2, 2);
  8054. * // => 3
  8055. */
  8056. function indexOf(array, value, fromIndex) {
  8057. var length = array == null ? 0 : array.length;
  8058. if (!length) {
  8059. return -1;
  8060. }
  8061. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8062. if (index < 0) {
  8063. index = nativeMax(length + index, 0);
  8064. }
  8065. return baseIndexOf(array, value, index);
  8066. }
  8067. /**
  8068. * Gets all but the last element of `array`.
  8069. *
  8070. * @static
  8071. * @memberOf _
  8072. * @since 0.1.0
  8073. * @category Array
  8074. * @param {Array} array The array to query.
  8075. * @returns {Array} Returns the slice of `array`.
  8076. * @example
  8077. *
  8078. * _.initial([1, 2, 3]);
  8079. * // => [1, 2]
  8080. */
  8081. function initial(array) {
  8082. var length = array == null ? 0 : array.length;
  8083. return length ? baseSlice(array, 0, -1) : [];
  8084. }
  8085. /**
  8086. * Creates an array of unique values that are included in all given arrays
  8087. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8088. * for equality comparisons. The order and references of result values are
  8089. * determined by the first array.
  8090. *
  8091. * @static
  8092. * @memberOf _
  8093. * @since 0.1.0
  8094. * @category Array
  8095. * @param {...Array} [arrays] The arrays to inspect.
  8096. * @returns {Array} Returns the new array of intersecting values.
  8097. * @example
  8098. *
  8099. * _.intersection([2, 1], [2, 3]);
  8100. * // => [2]
  8101. */
  8102. var intersection = baseRest(function(arrays) {
  8103. var mapped = arrayMap(arrays, castArrayLikeObject);
  8104. return (mapped.length && mapped[0] === arrays[0])
  8105. ? baseIntersection(mapped)
  8106. : [];
  8107. });
  8108. /**
  8109. * This method is like `_.intersection` except that it accepts `iteratee`
  8110. * which is invoked for each element of each `arrays` to generate the criterion
  8111. * by which they're compared. The order and references of result values are
  8112. * determined by the first array. The iteratee is invoked with one argument:
  8113. * (value).
  8114. *
  8115. * @static
  8116. * @memberOf _
  8117. * @since 4.0.0
  8118. * @category Array
  8119. * @param {...Array} [arrays] The arrays to inspect.
  8120. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8121. * @returns {Array} Returns the new array of intersecting values.
  8122. * @example
  8123. *
  8124. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8125. * // => [2.1]
  8126. *
  8127. * // The `_.property` iteratee shorthand.
  8128. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8129. * // => [{ 'x': 1 }]
  8130. */
  8131. var intersectionBy = baseRest(function(arrays) {
  8132. var iteratee = last(arrays),
  8133. mapped = arrayMap(arrays, castArrayLikeObject);
  8134. if (iteratee === last(mapped)) {
  8135. iteratee = undefined;
  8136. } else {
  8137. mapped.pop();
  8138. }
  8139. return (mapped.length && mapped[0] === arrays[0])
  8140. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8141. : [];
  8142. });
  8143. /**
  8144. * This method is like `_.intersection` except that it accepts `comparator`
  8145. * which is invoked to compare elements of `arrays`. The order and references
  8146. * of result values are determined by the first array. The comparator is
  8147. * invoked with two arguments: (arrVal, othVal).
  8148. *
  8149. * @static
  8150. * @memberOf _
  8151. * @since 4.0.0
  8152. * @category Array
  8153. * @param {...Array} [arrays] The arrays to inspect.
  8154. * @param {Function} [comparator] The comparator invoked per element.
  8155. * @returns {Array} Returns the new array of intersecting values.
  8156. * @example
  8157. *
  8158. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8159. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8160. *
  8161. * _.intersectionWith(objects, others, _.isEqual);
  8162. * // => [{ 'x': 1, 'y': 2 }]
  8163. */
  8164. var intersectionWith = baseRest(function(arrays) {
  8165. var comparator = last(arrays),
  8166. mapped = arrayMap(arrays, castArrayLikeObject);
  8167. comparator = typeof comparator == 'function' ? comparator : undefined;
  8168. if (comparator) {
  8169. mapped.pop();
  8170. }
  8171. return (mapped.length && mapped[0] === arrays[0])
  8172. ? baseIntersection(mapped, undefined, comparator)
  8173. : [];
  8174. });
  8175. /**
  8176. * Converts all elements in `array` into a string separated by `separator`.
  8177. *
  8178. * @static
  8179. * @memberOf _
  8180. * @since 4.0.0
  8181. * @category Array
  8182. * @param {Array} array The array to convert.
  8183. * @param {string} [separator=','] The element separator.
  8184. * @returns {string} Returns the joined string.
  8185. * @example
  8186. *
  8187. * _.join(['a', 'b', 'c'], '~');
  8188. * // => 'a~b~c'
  8189. */
  8190. function join(array, separator) {
  8191. return array == null ? '' : nativeJoin.call(array, separator);
  8192. }
  8193. /**
  8194. * Gets the last element of `array`.
  8195. *
  8196. * @static
  8197. * @memberOf _
  8198. * @since 0.1.0
  8199. * @category Array
  8200. * @param {Array} array The array to query.
  8201. * @returns {*} Returns the last element of `array`.
  8202. * @example
  8203. *
  8204. * _.last([1, 2, 3]);
  8205. * // => 3
  8206. */
  8207. function last(array) {
  8208. var length = array == null ? 0 : array.length;
  8209. return length ? array[length - 1] : undefined;
  8210. }
  8211. /**
  8212. * This method is like `_.indexOf` except that it iterates over elements of
  8213. * `array` from right to left.
  8214. *
  8215. * @static
  8216. * @memberOf _
  8217. * @since 0.1.0
  8218. * @category Array
  8219. * @param {Array} array The array to inspect.
  8220. * @param {*} value The value to search for.
  8221. * @param {number} [fromIndex=array.length-1] The index to search from.
  8222. * @returns {number} Returns the index of the matched value, else `-1`.
  8223. * @example
  8224. *
  8225. * _.lastIndexOf([1, 2, 1, 2], 2);
  8226. * // => 3
  8227. *
  8228. * // Search from the `fromIndex`.
  8229. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8230. * // => 1
  8231. */
  8232. function lastIndexOf(array, value, fromIndex) {
  8233. var length = array == null ? 0 : array.length;
  8234. if (!length) {
  8235. return -1;
  8236. }
  8237. var index = length;
  8238. if (fromIndex !== undefined) {
  8239. index = toInteger(fromIndex);
  8240. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8241. }
  8242. return value === value
  8243. ? strictLastIndexOf(array, value, index)
  8244. : baseFindIndex(array, baseIsNaN, index, true);
  8245. }
  8246. /**
  8247. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8248. * element from the end is returned.
  8249. *
  8250. * @static
  8251. * @memberOf _
  8252. * @since 4.11.0
  8253. * @category Array
  8254. * @param {Array} array The array to query.
  8255. * @param {number} [n=0] The index of the element to return.
  8256. * @returns {*} Returns the nth element of `array`.
  8257. * @example
  8258. *
  8259. * var array = ['a', 'b', 'c', 'd'];
  8260. *
  8261. * _.nth(array, 1);
  8262. * // => 'b'
  8263. *
  8264. * _.nth(array, -2);
  8265. * // => 'c';
  8266. */
  8267. function nth(array, n) {
  8268. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8269. }
  8270. /**
  8271. * Removes all given values from `array` using
  8272. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8273. * for equality comparisons.
  8274. *
  8275. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8276. * to remove elements from an array by predicate.
  8277. *
  8278. * @static
  8279. * @memberOf _
  8280. * @since 2.0.0
  8281. * @category Array
  8282. * @param {Array} array The array to modify.
  8283. * @param {...*} [values] The values to remove.
  8284. * @returns {Array} Returns `array`.
  8285. * @example
  8286. *
  8287. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8288. *
  8289. * _.pull(array, 'a', 'c');
  8290. * console.log(array);
  8291. * // => ['b', 'b']
  8292. */
  8293. var pull = baseRest(pullAll);
  8294. /**
  8295. * This method is like `_.pull` except that it accepts an array of values to remove.
  8296. *
  8297. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8298. *
  8299. * @static
  8300. * @memberOf _
  8301. * @since 4.0.0
  8302. * @category Array
  8303. * @param {Array} array The array to modify.
  8304. * @param {Array} values The values to remove.
  8305. * @returns {Array} Returns `array`.
  8306. * @example
  8307. *
  8308. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8309. *
  8310. * _.pullAll(array, ['a', 'c']);
  8311. * console.log(array);
  8312. * // => ['b', 'b']
  8313. */
  8314. function pullAll(array, values) {
  8315. return (array && array.length && values && values.length)
  8316. ? basePullAll(array, values)
  8317. : array;
  8318. }
  8319. /**
  8320. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8321. * invoked for each element of `array` and `values` to generate the criterion
  8322. * by which they're compared. The iteratee is invoked with one argument: (value).
  8323. *
  8324. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8325. *
  8326. * @static
  8327. * @memberOf _
  8328. * @since 4.0.0
  8329. * @category Array
  8330. * @param {Array} array The array to modify.
  8331. * @param {Array} values The values to remove.
  8332. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8333. * @returns {Array} Returns `array`.
  8334. * @example
  8335. *
  8336. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8337. *
  8338. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8339. * console.log(array);
  8340. * // => [{ 'x': 2 }]
  8341. */
  8342. function pullAllBy(array, values, iteratee) {
  8343. return (array && array.length && values && values.length)
  8344. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8345. : array;
  8346. }
  8347. /**
  8348. * This method is like `_.pullAll` except that it accepts `comparator` which
  8349. * is invoked to compare elements of `array` to `values`. The comparator is
  8350. * invoked with two arguments: (arrVal, othVal).
  8351. *
  8352. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8353. *
  8354. * @static
  8355. * @memberOf _
  8356. * @since 4.6.0
  8357. * @category Array
  8358. * @param {Array} array The array to modify.
  8359. * @param {Array} values The values to remove.
  8360. * @param {Function} [comparator] The comparator invoked per element.
  8361. * @returns {Array} Returns `array`.
  8362. * @example
  8363. *
  8364. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8365. *
  8366. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8367. * console.log(array);
  8368. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8369. */
  8370. function pullAllWith(array, values, comparator) {
  8371. return (array && array.length && values && values.length)
  8372. ? basePullAll(array, values, undefined, comparator)
  8373. : array;
  8374. }
  8375. /**
  8376. * Removes elements from `array` corresponding to `indexes` and returns an
  8377. * array of removed elements.
  8378. *
  8379. * **Note:** Unlike `_.at`, this method mutates `array`.
  8380. *
  8381. * @static
  8382. * @memberOf _
  8383. * @since 3.0.0
  8384. * @category Array
  8385. * @param {Array} array The array to modify.
  8386. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8387. * @returns {Array} Returns the new array of removed elements.
  8388. * @example
  8389. *
  8390. * var array = ['a', 'b', 'c', 'd'];
  8391. * var pulled = _.pullAt(array, [1, 3]);
  8392. *
  8393. * console.log(array);
  8394. * // => ['a', 'c']
  8395. *
  8396. * console.log(pulled);
  8397. * // => ['b', 'd']
  8398. */
  8399. var pullAt = flatRest(function(array, indexes) {
  8400. var length = array == null ? 0 : array.length,
  8401. result = baseAt(array, indexes);
  8402. basePullAt(array, arrayMap(indexes, function(index) {
  8403. return isIndex(index, length) ? +index : index;
  8404. }).sort(compareAscending));
  8405. return result;
  8406. });
  8407. /**
  8408. * Removes all elements from `array` that `predicate` returns truthy for
  8409. * and returns an array of the removed elements. The predicate is invoked
  8410. * with three arguments: (value, index, array).
  8411. *
  8412. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8413. * to pull elements from an array by value.
  8414. *
  8415. * @static
  8416. * @memberOf _
  8417. * @since 2.0.0
  8418. * @category Array
  8419. * @param {Array} array The array to modify.
  8420. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8421. * @returns {Array} Returns the new array of removed elements.
  8422. * @example
  8423. *
  8424. * var array = [1, 2, 3, 4];
  8425. * var evens = _.remove(array, function(n) {
  8426. * return n % 2 == 0;
  8427. * });
  8428. *
  8429. * console.log(array);
  8430. * // => [1, 3]
  8431. *
  8432. * console.log(evens);
  8433. * // => [2, 4]
  8434. */
  8435. function remove(array, predicate) {
  8436. var result = [];
  8437. if (!(array && array.length)) {
  8438. return result;
  8439. }
  8440. var index = -1,
  8441. indexes = [],
  8442. length = array.length;
  8443. predicate = getIteratee(predicate, 3);
  8444. while (++index < length) {
  8445. var value = array[index];
  8446. if (predicate(value, index, array)) {
  8447. result.push(value);
  8448. indexes.push(index);
  8449. }
  8450. }
  8451. basePullAt(array, indexes);
  8452. return result;
  8453. }
  8454. /**
  8455. * Reverses `array` so that the first element becomes the last, the second
  8456. * element becomes the second to last, and so on.
  8457. *
  8458. * **Note:** This method mutates `array` and is based on
  8459. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8460. *
  8461. * @static
  8462. * @memberOf _
  8463. * @since 4.0.0
  8464. * @category Array
  8465. * @param {Array} array The array to modify.
  8466. * @returns {Array} Returns `array`.
  8467. * @example
  8468. *
  8469. * var array = [1, 2, 3];
  8470. *
  8471. * _.reverse(array);
  8472. * // => [3, 2, 1]
  8473. *
  8474. * console.log(array);
  8475. * // => [3, 2, 1]
  8476. */
  8477. function reverse(array) {
  8478. return array == null ? array : nativeReverse.call(array);
  8479. }
  8480. /**
  8481. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8482. *
  8483. * **Note:** This method is used instead of
  8484. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8485. * returned.
  8486. *
  8487. * @static
  8488. * @memberOf _
  8489. * @since 3.0.0
  8490. * @category Array
  8491. * @param {Array} array The array to slice.
  8492. * @param {number} [start=0] The start position.
  8493. * @param {number} [end=array.length] The end position.
  8494. * @returns {Array} Returns the slice of `array`.
  8495. */
  8496. function slice(array, start, end) {
  8497. var length = array == null ? 0 : array.length;
  8498. if (!length) {
  8499. return [];
  8500. }
  8501. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8502. start = 0;
  8503. end = length;
  8504. }
  8505. else {
  8506. start = start == null ? 0 : toInteger(start);
  8507. end = end === undefined ? length : toInteger(end);
  8508. }
  8509. return baseSlice(array, start, end);
  8510. }
  8511. /**
  8512. * Uses a binary search to determine the lowest index at which `value`
  8513. * should be inserted into `array` in order to maintain its sort order.
  8514. *
  8515. * @static
  8516. * @memberOf _
  8517. * @since 0.1.0
  8518. * @category Array
  8519. * @param {Array} array The sorted array to inspect.
  8520. * @param {*} value The value to evaluate.
  8521. * @returns {number} Returns the index at which `value` should be inserted
  8522. * into `array`.
  8523. * @example
  8524. *
  8525. * _.sortedIndex([30, 50], 40);
  8526. * // => 1
  8527. */
  8528. function sortedIndex(array, value) {
  8529. return baseSortedIndex(array, value);
  8530. }
  8531. /**
  8532. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8533. * which is invoked for `value` and each element of `array` to compute their
  8534. * sort ranking. The iteratee is invoked with one argument: (value).
  8535. *
  8536. * @static
  8537. * @memberOf _
  8538. * @since 4.0.0
  8539. * @category Array
  8540. * @param {Array} array The sorted array to inspect.
  8541. * @param {*} value The value to evaluate.
  8542. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8543. * @returns {number} Returns the index at which `value` should be inserted
  8544. * into `array`.
  8545. * @example
  8546. *
  8547. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8548. *
  8549. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8550. * // => 0
  8551. *
  8552. * // The `_.property` iteratee shorthand.
  8553. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8554. * // => 0
  8555. */
  8556. function sortedIndexBy(array, value, iteratee) {
  8557. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8558. }
  8559. /**
  8560. * This method is like `_.indexOf` except that it performs a binary
  8561. * search on a sorted `array`.
  8562. *
  8563. * @static
  8564. * @memberOf _
  8565. * @since 4.0.0
  8566. * @category Array
  8567. * @param {Array} array The array to inspect.
  8568. * @param {*} value The value to search for.
  8569. * @returns {number} Returns the index of the matched value, else `-1`.
  8570. * @example
  8571. *
  8572. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8573. * // => 1
  8574. */
  8575. function sortedIndexOf(array, value) {
  8576. var length = array == null ? 0 : array.length;
  8577. if (length) {
  8578. var index = baseSortedIndex(array, value);
  8579. if (index < length && eq(array[index], value)) {
  8580. return index;
  8581. }
  8582. }
  8583. return -1;
  8584. }
  8585. /**
  8586. * This method is like `_.sortedIndex` except that it returns the highest
  8587. * index at which `value` should be inserted into `array` in order to
  8588. * maintain its sort order.
  8589. *
  8590. * @static
  8591. * @memberOf _
  8592. * @since 3.0.0
  8593. * @category Array
  8594. * @param {Array} array The sorted array to inspect.
  8595. * @param {*} value The value to evaluate.
  8596. * @returns {number} Returns the index at which `value` should be inserted
  8597. * into `array`.
  8598. * @example
  8599. *
  8600. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8601. * // => 4
  8602. */
  8603. function sortedLastIndex(array, value) {
  8604. return baseSortedIndex(array, value, true);
  8605. }
  8606. /**
  8607. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8608. * which is invoked for `value` and each element of `array` to compute their
  8609. * sort ranking. The iteratee is invoked with one argument: (value).
  8610. *
  8611. * @static
  8612. * @memberOf _
  8613. * @since 4.0.0
  8614. * @category Array
  8615. * @param {Array} array The sorted array to inspect.
  8616. * @param {*} value The value to evaluate.
  8617. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8618. * @returns {number} Returns the index at which `value` should be inserted
  8619. * into `array`.
  8620. * @example
  8621. *
  8622. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8623. *
  8624. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8625. * // => 1
  8626. *
  8627. * // The `_.property` iteratee shorthand.
  8628. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8629. * // => 1
  8630. */
  8631. function sortedLastIndexBy(array, value, iteratee) {
  8632. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8633. }
  8634. /**
  8635. * This method is like `_.lastIndexOf` except that it performs a binary
  8636. * search on a sorted `array`.
  8637. *
  8638. * @static
  8639. * @memberOf _
  8640. * @since 4.0.0
  8641. * @category Array
  8642. * @param {Array} array The array to inspect.
  8643. * @param {*} value The value to search for.
  8644. * @returns {number} Returns the index of the matched value, else `-1`.
  8645. * @example
  8646. *
  8647. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8648. * // => 3
  8649. */
  8650. function sortedLastIndexOf(array, value) {
  8651. var length = array == null ? 0 : array.length;
  8652. if (length) {
  8653. var index = baseSortedIndex(array, value, true) - 1;
  8654. if (eq(array[index], value)) {
  8655. return index;
  8656. }
  8657. }
  8658. return -1;
  8659. }
  8660. /**
  8661. * This method is like `_.uniq` except that it's designed and optimized
  8662. * for sorted arrays.
  8663. *
  8664. * @static
  8665. * @memberOf _
  8666. * @since 4.0.0
  8667. * @category Array
  8668. * @param {Array} array The array to inspect.
  8669. * @returns {Array} Returns the new duplicate free array.
  8670. * @example
  8671. *
  8672. * _.sortedUniq([1, 1, 2]);
  8673. * // => [1, 2]
  8674. */
  8675. function sortedUniq(array) {
  8676. return (array && array.length)
  8677. ? baseSortedUniq(array)
  8678. : [];
  8679. }
  8680. /**
  8681. * This method is like `_.uniqBy` except that it's designed and optimized
  8682. * for sorted arrays.
  8683. *
  8684. * @static
  8685. * @memberOf _
  8686. * @since 4.0.0
  8687. * @category Array
  8688. * @param {Array} array The array to inspect.
  8689. * @param {Function} [iteratee] The iteratee invoked per element.
  8690. * @returns {Array} Returns the new duplicate free array.
  8691. * @example
  8692. *
  8693. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8694. * // => [1.1, 2.3]
  8695. */
  8696. function sortedUniqBy(array, iteratee) {
  8697. return (array && array.length)
  8698. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8699. : [];
  8700. }
  8701. /**
  8702. * Gets all but the first element of `array`.
  8703. *
  8704. * @static
  8705. * @memberOf _
  8706. * @since 4.0.0
  8707. * @category Array
  8708. * @param {Array} array The array to query.
  8709. * @returns {Array} Returns the slice of `array`.
  8710. * @example
  8711. *
  8712. * _.tail([1, 2, 3]);
  8713. * // => [2, 3]
  8714. */
  8715. function tail(array) {
  8716. var length = array == null ? 0 : array.length;
  8717. return length ? baseSlice(array, 1, length) : [];
  8718. }
  8719. /**
  8720. * Creates a slice of `array` with `n` elements taken from the beginning.
  8721. *
  8722. * @static
  8723. * @memberOf _
  8724. * @since 0.1.0
  8725. * @category Array
  8726. * @param {Array} array The array to query.
  8727. * @param {number} [n=1] The number of elements to take.
  8728. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8729. * @returns {Array} Returns the slice of `array`.
  8730. * @example
  8731. *
  8732. * _.take([1, 2, 3]);
  8733. * // => [1]
  8734. *
  8735. * _.take([1, 2, 3], 2);
  8736. * // => [1, 2]
  8737. *
  8738. * _.take([1, 2, 3], 5);
  8739. * // => [1, 2, 3]
  8740. *
  8741. * _.take([1, 2, 3], 0);
  8742. * // => []
  8743. */
  8744. function take(array, n, guard) {
  8745. if (!(array && array.length)) {
  8746. return [];
  8747. }
  8748. n = (guard || n === undefined) ? 1 : toInteger(n);
  8749. return baseSlice(array, 0, n < 0 ? 0 : n);
  8750. }
  8751. /**
  8752. * Creates a slice of `array` with `n` elements taken from the end.
  8753. *
  8754. * @static
  8755. * @memberOf _
  8756. * @since 3.0.0
  8757. * @category Array
  8758. * @param {Array} array The array to query.
  8759. * @param {number} [n=1] The number of elements to take.
  8760. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8761. * @returns {Array} Returns the slice of `array`.
  8762. * @example
  8763. *
  8764. * _.takeRight([1, 2, 3]);
  8765. * // => [3]
  8766. *
  8767. * _.takeRight([1, 2, 3], 2);
  8768. * // => [2, 3]
  8769. *
  8770. * _.takeRight([1, 2, 3], 5);
  8771. * // => [1, 2, 3]
  8772. *
  8773. * _.takeRight([1, 2, 3], 0);
  8774. * // => []
  8775. */
  8776. function takeRight(array, n, guard) {
  8777. var length = array == null ? 0 : array.length;
  8778. if (!length) {
  8779. return [];
  8780. }
  8781. n = (guard || n === undefined) ? 1 : toInteger(n);
  8782. n = length - n;
  8783. return baseSlice(array, n < 0 ? 0 : n, length);
  8784. }
  8785. /**
  8786. * Creates a slice of `array` with elements taken from the end. Elements are
  8787. * taken until `predicate` returns falsey. The predicate is invoked with
  8788. * three arguments: (value, index, array).
  8789. *
  8790. * @static
  8791. * @memberOf _
  8792. * @since 3.0.0
  8793. * @category Array
  8794. * @param {Array} array The array to query.
  8795. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8796. * @returns {Array} Returns the slice of `array`.
  8797. * @example
  8798. *
  8799. * var users = [
  8800. * { 'user': 'barney', 'active': true },
  8801. * { 'user': 'fred', 'active': false },
  8802. * { 'user': 'pebbles', 'active': false }
  8803. * ];
  8804. *
  8805. * _.takeRightWhile(users, function(o) { return !o.active; });
  8806. * // => objects for ['fred', 'pebbles']
  8807. *
  8808. * // The `_.matches` iteratee shorthand.
  8809. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8810. * // => objects for ['pebbles']
  8811. *
  8812. * // The `_.matchesProperty` iteratee shorthand.
  8813. * _.takeRightWhile(users, ['active', false]);
  8814. * // => objects for ['fred', 'pebbles']
  8815. *
  8816. * // The `_.property` iteratee shorthand.
  8817. * _.takeRightWhile(users, 'active');
  8818. * // => []
  8819. */
  8820. function takeRightWhile(array, predicate) {
  8821. return (array && array.length)
  8822. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8823. : [];
  8824. }
  8825. /**
  8826. * Creates a slice of `array` with elements taken from the beginning. Elements
  8827. * are taken until `predicate` returns falsey. The predicate is invoked with
  8828. * three arguments: (value, index, array).
  8829. *
  8830. * @static
  8831. * @memberOf _
  8832. * @since 3.0.0
  8833. * @category Array
  8834. * @param {Array} array The array to query.
  8835. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8836. * @returns {Array} Returns the slice of `array`.
  8837. * @example
  8838. *
  8839. * var users = [
  8840. * { 'user': 'barney', 'active': false },
  8841. * { 'user': 'fred', 'active': false },
  8842. * { 'user': 'pebbles', 'active': true }
  8843. * ];
  8844. *
  8845. * _.takeWhile(users, function(o) { return !o.active; });
  8846. * // => objects for ['barney', 'fred']
  8847. *
  8848. * // The `_.matches` iteratee shorthand.
  8849. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8850. * // => objects for ['barney']
  8851. *
  8852. * // The `_.matchesProperty` iteratee shorthand.
  8853. * _.takeWhile(users, ['active', false]);
  8854. * // => objects for ['barney', 'fred']
  8855. *
  8856. * // The `_.property` iteratee shorthand.
  8857. * _.takeWhile(users, 'active');
  8858. * // => []
  8859. */
  8860. function takeWhile(array, predicate) {
  8861. return (array && array.length)
  8862. ? baseWhile(array, getIteratee(predicate, 3))
  8863. : [];
  8864. }
  8865. /**
  8866. * Creates an array of unique values, in order, from all given arrays using
  8867. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8868. * for equality comparisons.
  8869. *
  8870. * @static
  8871. * @memberOf _
  8872. * @since 0.1.0
  8873. * @category Array
  8874. * @param {...Array} [arrays] The arrays to inspect.
  8875. * @returns {Array} Returns the new array of combined values.
  8876. * @example
  8877. *
  8878. * _.union([2], [1, 2]);
  8879. * // => [2, 1]
  8880. */
  8881. var union = baseRest(function(arrays) {
  8882. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8883. });
  8884. /**
  8885. * This method is like `_.union` except that it accepts `iteratee` which is
  8886. * invoked for each element of each `arrays` to generate the criterion by
  8887. * which uniqueness is computed. Result values are chosen from the first
  8888. * array in which the value occurs. The iteratee is invoked with one argument:
  8889. * (value).
  8890. *
  8891. * @static
  8892. * @memberOf _
  8893. * @since 4.0.0
  8894. * @category Array
  8895. * @param {...Array} [arrays] The arrays to inspect.
  8896. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8897. * @returns {Array} Returns the new array of combined values.
  8898. * @example
  8899. *
  8900. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8901. * // => [2.1, 1.2]
  8902. *
  8903. * // The `_.property` iteratee shorthand.
  8904. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8905. * // => [{ 'x': 1 }, { 'x': 2 }]
  8906. */
  8907. var unionBy = baseRest(function(arrays) {
  8908. var iteratee = last(arrays);
  8909. if (isArrayLikeObject(iteratee)) {
  8910. iteratee = undefined;
  8911. }
  8912. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8913. });
  8914. /**
  8915. * This method is like `_.union` except that it accepts `comparator` which
  8916. * is invoked to compare elements of `arrays`. Result values are chosen from
  8917. * the first array in which the value occurs. The comparator is invoked
  8918. * with two arguments: (arrVal, othVal).
  8919. *
  8920. * @static
  8921. * @memberOf _
  8922. * @since 4.0.0
  8923. * @category Array
  8924. * @param {...Array} [arrays] The arrays to inspect.
  8925. * @param {Function} [comparator] The comparator invoked per element.
  8926. * @returns {Array} Returns the new array of combined values.
  8927. * @example
  8928. *
  8929. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8930. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8931. *
  8932. * _.unionWith(objects, others, _.isEqual);
  8933. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8934. */
  8935. var unionWith = baseRest(function(arrays) {
  8936. var comparator = last(arrays);
  8937. comparator = typeof comparator == 'function' ? comparator : undefined;
  8938. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8939. });
  8940. /**
  8941. * Creates a duplicate-free version of an array, using
  8942. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8943. * for equality comparisons, in which only the first occurrence of each element
  8944. * is kept. The order of result values is determined by the order they occur
  8945. * in the array.
  8946. *
  8947. * @static
  8948. * @memberOf _
  8949. * @since 0.1.0
  8950. * @category Array
  8951. * @param {Array} array The array to inspect.
  8952. * @returns {Array} Returns the new duplicate free array.
  8953. * @example
  8954. *
  8955. * _.uniq([2, 1, 2]);
  8956. * // => [2, 1]
  8957. */
  8958. function uniq(array) {
  8959. return (array && array.length) ? baseUniq(array) : [];
  8960. }
  8961. /**
  8962. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8963. * invoked for each element in `array` to generate the criterion by which
  8964. * uniqueness is computed. The order of result values is determined by the
  8965. * order they occur in the array. The iteratee is invoked with one argument:
  8966. * (value).
  8967. *
  8968. * @static
  8969. * @memberOf _
  8970. * @since 4.0.0
  8971. * @category Array
  8972. * @param {Array} array The array to inspect.
  8973. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8974. * @returns {Array} Returns the new duplicate free array.
  8975. * @example
  8976. *
  8977. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8978. * // => [2.1, 1.2]
  8979. *
  8980. * // The `_.property` iteratee shorthand.
  8981. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8982. * // => [{ 'x': 1 }, { 'x': 2 }]
  8983. */
  8984. function uniqBy(array, iteratee) {
  8985. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8986. }
  8987. /**
  8988. * This method is like `_.uniq` except that it accepts `comparator` which
  8989. * is invoked to compare elements of `array`. The order of result values is
  8990. * determined by the order they occur in the array.The comparator is invoked
  8991. * with two arguments: (arrVal, othVal).
  8992. *
  8993. * @static
  8994. * @memberOf _
  8995. * @since 4.0.0
  8996. * @category Array
  8997. * @param {Array} array The array to inspect.
  8998. * @param {Function} [comparator] The comparator invoked per element.
  8999. * @returns {Array} Returns the new duplicate free array.
  9000. * @example
  9001. *
  9002. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9003. *
  9004. * _.uniqWith(objects, _.isEqual);
  9005. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9006. */
  9007. function uniqWith(array, comparator) {
  9008. comparator = typeof comparator == 'function' ? comparator : undefined;
  9009. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9010. }
  9011. /**
  9012. * This method is like `_.zip` except that it accepts an array of grouped
  9013. * elements and creates an array regrouping the elements to their pre-zip
  9014. * configuration.
  9015. *
  9016. * @static
  9017. * @memberOf _
  9018. * @since 1.2.0
  9019. * @category Array
  9020. * @param {Array} array The array of grouped elements to process.
  9021. * @returns {Array} Returns the new array of regrouped elements.
  9022. * @example
  9023. *
  9024. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9025. * // => [['a', 1, true], ['b', 2, false]]
  9026. *
  9027. * _.unzip(zipped);
  9028. * // => [['a', 'b'], [1, 2], [true, false]]
  9029. */
  9030. function unzip(array) {
  9031. if (!(array && array.length)) {
  9032. return [];
  9033. }
  9034. var length = 0;
  9035. array = arrayFilter(array, function(group) {
  9036. if (isArrayLikeObject(group)) {
  9037. length = nativeMax(group.length, length);
  9038. return true;
  9039. }
  9040. });
  9041. return baseTimes(length, function(index) {
  9042. return arrayMap(array, baseProperty(index));
  9043. });
  9044. }
  9045. /**
  9046. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9047. * how regrouped values should be combined. The iteratee is invoked with the
  9048. * elements of each group: (...group).
  9049. *
  9050. * @static
  9051. * @memberOf _
  9052. * @since 3.8.0
  9053. * @category Array
  9054. * @param {Array} array The array of grouped elements to process.
  9055. * @param {Function} [iteratee=_.identity] The function to combine
  9056. * regrouped values.
  9057. * @returns {Array} Returns the new array of regrouped elements.
  9058. * @example
  9059. *
  9060. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9061. * // => [[1, 10, 100], [2, 20, 200]]
  9062. *
  9063. * _.unzipWith(zipped, _.add);
  9064. * // => [3, 30, 300]
  9065. */
  9066. function unzipWith(array, iteratee) {
  9067. if (!(array && array.length)) {
  9068. return [];
  9069. }
  9070. var result = unzip(array);
  9071. if (iteratee == null) {
  9072. return result;
  9073. }
  9074. return arrayMap(result, function(group) {
  9075. return apply(iteratee, undefined, group);
  9076. });
  9077. }
  9078. /**
  9079. * Creates an array excluding all given values using
  9080. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9081. * for equality comparisons.
  9082. *
  9083. * **Note:** Unlike `_.pull`, this method returns a new array.
  9084. *
  9085. * @static
  9086. * @memberOf _
  9087. * @since 0.1.0
  9088. * @category Array
  9089. * @param {Array} array The array to inspect.
  9090. * @param {...*} [values] The values to exclude.
  9091. * @returns {Array} Returns the new array of filtered values.
  9092. * @see _.difference, _.xor
  9093. * @example
  9094. *
  9095. * _.without([2, 1, 2, 3], 1, 2);
  9096. * // => [3]
  9097. */
  9098. var without = baseRest(function(array, values) {
  9099. return isArrayLikeObject(array)
  9100. ? baseDifference(array, values)
  9101. : [];
  9102. });
  9103. /**
  9104. * Creates an array of unique values that is the
  9105. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9106. * of the given arrays. The order of result values is determined by the order
  9107. * they occur in the arrays.
  9108. *
  9109. * @static
  9110. * @memberOf _
  9111. * @since 2.4.0
  9112. * @category Array
  9113. * @param {...Array} [arrays] The arrays to inspect.
  9114. * @returns {Array} Returns the new array of filtered values.
  9115. * @see _.difference, _.without
  9116. * @example
  9117. *
  9118. * _.xor([2, 1], [2, 3]);
  9119. * // => [1, 3]
  9120. */
  9121. var xor = baseRest(function(arrays) {
  9122. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9123. });
  9124. /**
  9125. * This method is like `_.xor` except that it accepts `iteratee` which is
  9126. * invoked for each element of each `arrays` to generate the criterion by
  9127. * which by which they're compared. The order of result values is determined
  9128. * by the order they occur in the arrays. The iteratee is invoked with one
  9129. * argument: (value).
  9130. *
  9131. * @static
  9132. * @memberOf _
  9133. * @since 4.0.0
  9134. * @category Array
  9135. * @param {...Array} [arrays] The arrays to inspect.
  9136. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9137. * @returns {Array} Returns the new array of filtered values.
  9138. * @example
  9139. *
  9140. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9141. * // => [1.2, 3.4]
  9142. *
  9143. * // The `_.property` iteratee shorthand.
  9144. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9145. * // => [{ 'x': 2 }]
  9146. */
  9147. var xorBy = baseRest(function(arrays) {
  9148. var iteratee = last(arrays);
  9149. if (isArrayLikeObject(iteratee)) {
  9150. iteratee = undefined;
  9151. }
  9152. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9153. });
  9154. /**
  9155. * This method is like `_.xor` except that it accepts `comparator` which is
  9156. * invoked to compare elements of `arrays`. The order of result values is
  9157. * determined by the order they occur in the arrays. The comparator is invoked
  9158. * with two arguments: (arrVal, othVal).
  9159. *
  9160. * @static
  9161. * @memberOf _
  9162. * @since 4.0.0
  9163. * @category Array
  9164. * @param {...Array} [arrays] The arrays to inspect.
  9165. * @param {Function} [comparator] The comparator invoked per element.
  9166. * @returns {Array} Returns the new array of filtered values.
  9167. * @example
  9168. *
  9169. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9170. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9171. *
  9172. * _.xorWith(objects, others, _.isEqual);
  9173. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9174. */
  9175. var xorWith = baseRest(function(arrays) {
  9176. var comparator = last(arrays);
  9177. comparator = typeof comparator == 'function' ? comparator : undefined;
  9178. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9179. });
  9180. /**
  9181. * Creates an array of grouped elements, the first of which contains the
  9182. * first elements of the given arrays, the second of which contains the
  9183. * second elements of the given arrays, and so on.
  9184. *
  9185. * @static
  9186. * @memberOf _
  9187. * @since 0.1.0
  9188. * @category Array
  9189. * @param {...Array} [arrays] The arrays to process.
  9190. * @returns {Array} Returns the new array of grouped elements.
  9191. * @example
  9192. *
  9193. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9194. * // => [['a', 1, true], ['b', 2, false]]
  9195. */
  9196. var zip = baseRest(unzip);
  9197. /**
  9198. * This method is like `_.fromPairs` except that it accepts two arrays,
  9199. * one of property identifiers and one of corresponding values.
  9200. *
  9201. * @static
  9202. * @memberOf _
  9203. * @since 0.4.0
  9204. * @category Array
  9205. * @param {Array} [props=[]] The property identifiers.
  9206. * @param {Array} [values=[]] The property values.
  9207. * @returns {Object} Returns the new object.
  9208. * @example
  9209. *
  9210. * _.zipObject(['a', 'b'], [1, 2]);
  9211. * // => { 'a': 1, 'b': 2 }
  9212. */
  9213. function zipObject(props, values) {
  9214. return baseZipObject(props || [], values || [], assignValue);
  9215. }
  9216. /**
  9217. * This method is like `_.zipObject` except that it supports property paths.
  9218. *
  9219. * @static
  9220. * @memberOf _
  9221. * @since 4.1.0
  9222. * @category Array
  9223. * @param {Array} [props=[]] The property identifiers.
  9224. * @param {Array} [values=[]] The property values.
  9225. * @returns {Object} Returns the new object.
  9226. * @example
  9227. *
  9228. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9229. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9230. */
  9231. function zipObjectDeep(props, values) {
  9232. return baseZipObject(props || [], values || [], baseSet);
  9233. }
  9234. /**
  9235. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9236. * how grouped values should be combined. The iteratee is invoked with the
  9237. * elements of each group: (...group).
  9238. *
  9239. * @static
  9240. * @memberOf _
  9241. * @since 3.8.0
  9242. * @category Array
  9243. * @param {...Array} [arrays] The arrays to process.
  9244. * @param {Function} [iteratee=_.identity] The function to combine
  9245. * grouped values.
  9246. * @returns {Array} Returns the new array of grouped elements.
  9247. * @example
  9248. *
  9249. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9250. * return a + b + c;
  9251. * });
  9252. * // => [111, 222]
  9253. */
  9254. var zipWith = baseRest(function(arrays) {
  9255. var length = arrays.length,
  9256. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9257. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9258. return unzipWith(arrays, iteratee);
  9259. });
  9260. /*------------------------------------------------------------------------*/
  9261. /**
  9262. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9263. * chain sequences enabled. The result of such sequences must be unwrapped
  9264. * with `_#value`.
  9265. *
  9266. * @static
  9267. * @memberOf _
  9268. * @since 1.3.0
  9269. * @category Seq
  9270. * @param {*} value The value to wrap.
  9271. * @returns {Object} Returns the new `lodash` wrapper instance.
  9272. * @example
  9273. *
  9274. * var users = [
  9275. * { 'user': 'barney', 'age': 36 },
  9276. * { 'user': 'fred', 'age': 40 },
  9277. * { 'user': 'pebbles', 'age': 1 }
  9278. * ];
  9279. *
  9280. * var youngest = _
  9281. * .chain(users)
  9282. * .sortBy('age')
  9283. * .map(function(o) {
  9284. * return o.user + ' is ' + o.age;
  9285. * })
  9286. * .head()
  9287. * .value();
  9288. * // => 'pebbles is 1'
  9289. */
  9290. function chain(value) {
  9291. var result = lodash(value);
  9292. result.__chain__ = true;
  9293. return result;
  9294. }
  9295. /**
  9296. * This method invokes `interceptor` and returns `value`. The interceptor
  9297. * is invoked with one argument; (value). The purpose of this method is to
  9298. * "tap into" a method chain sequence in order to modify intermediate results.
  9299. *
  9300. * @static
  9301. * @memberOf _
  9302. * @since 0.1.0
  9303. * @category Seq
  9304. * @param {*} value The value to provide to `interceptor`.
  9305. * @param {Function} interceptor The function to invoke.
  9306. * @returns {*} Returns `value`.
  9307. * @example
  9308. *
  9309. * _([1, 2, 3])
  9310. * .tap(function(array) {
  9311. * // Mutate input array.
  9312. * array.pop();
  9313. * })
  9314. * .reverse()
  9315. * .value();
  9316. * // => [2, 1]
  9317. */
  9318. function tap(value, interceptor) {
  9319. interceptor(value);
  9320. return value;
  9321. }
  9322. /**
  9323. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9324. * The purpose of this method is to "pass thru" values replacing intermediate
  9325. * results in a method chain sequence.
  9326. *
  9327. * @static
  9328. * @memberOf _
  9329. * @since 3.0.0
  9330. * @category Seq
  9331. * @param {*} value The value to provide to `interceptor`.
  9332. * @param {Function} interceptor The function to invoke.
  9333. * @returns {*} Returns the result of `interceptor`.
  9334. * @example
  9335. *
  9336. * _(' abc ')
  9337. * .chain()
  9338. * .trim()
  9339. * .thru(function(value) {
  9340. * return [value];
  9341. * })
  9342. * .value();
  9343. * // => ['abc']
  9344. */
  9345. function thru(value, interceptor) {
  9346. return interceptor(value);
  9347. }
  9348. /**
  9349. * This method is the wrapper version of `_.at`.
  9350. *
  9351. * @name at
  9352. * @memberOf _
  9353. * @since 1.0.0
  9354. * @category Seq
  9355. * @param {...(string|string[])} [paths] The property paths to pick.
  9356. * @returns {Object} Returns the new `lodash` wrapper instance.
  9357. * @example
  9358. *
  9359. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9360. *
  9361. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9362. * // => [3, 4]
  9363. */
  9364. var wrapperAt = flatRest(function(paths) {
  9365. var length = paths.length,
  9366. start = length ? paths[0] : 0,
  9367. value = this.__wrapped__,
  9368. interceptor = function(object) { return baseAt(object, paths); };
  9369. if (length > 1 || this.__actions__.length ||
  9370. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9371. return this.thru(interceptor);
  9372. }
  9373. value = value.slice(start, +start + (length ? 1 : 0));
  9374. value.__actions__.push({
  9375. 'func': thru,
  9376. 'args': [interceptor],
  9377. 'thisArg': undefined
  9378. });
  9379. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9380. if (length && !array.length) {
  9381. array.push(undefined);
  9382. }
  9383. return array;
  9384. });
  9385. });
  9386. /**
  9387. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9388. *
  9389. * @name chain
  9390. * @memberOf _
  9391. * @since 0.1.0
  9392. * @category Seq
  9393. * @returns {Object} Returns the new `lodash` wrapper instance.
  9394. * @example
  9395. *
  9396. * var users = [
  9397. * { 'user': 'barney', 'age': 36 },
  9398. * { 'user': 'fred', 'age': 40 }
  9399. * ];
  9400. *
  9401. * // A sequence without explicit chaining.
  9402. * _(users).head();
  9403. * // => { 'user': 'barney', 'age': 36 }
  9404. *
  9405. * // A sequence with explicit chaining.
  9406. * _(users)
  9407. * .chain()
  9408. * .head()
  9409. * .pick('user')
  9410. * .value();
  9411. * // => { 'user': 'barney' }
  9412. */
  9413. function wrapperChain() {
  9414. return chain(this);
  9415. }
  9416. /**
  9417. * Executes the chain sequence and returns the wrapped result.
  9418. *
  9419. * @name commit
  9420. * @memberOf _
  9421. * @since 3.2.0
  9422. * @category Seq
  9423. * @returns {Object} Returns the new `lodash` wrapper instance.
  9424. * @example
  9425. *
  9426. * var array = [1, 2];
  9427. * var wrapped = _(array).push(3);
  9428. *
  9429. * console.log(array);
  9430. * // => [1, 2]
  9431. *
  9432. * wrapped = wrapped.commit();
  9433. * console.log(array);
  9434. * // => [1, 2, 3]
  9435. *
  9436. * wrapped.last();
  9437. * // => 3
  9438. *
  9439. * console.log(array);
  9440. * // => [1, 2, 3]
  9441. */
  9442. function wrapperCommit() {
  9443. return new LodashWrapper(this.value(), this.__chain__);
  9444. }
  9445. /**
  9446. * Gets the next value on a wrapped object following the
  9447. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9448. *
  9449. * @name next
  9450. * @memberOf _
  9451. * @since 4.0.0
  9452. * @category Seq
  9453. * @returns {Object} Returns the next iterator value.
  9454. * @example
  9455. *
  9456. * var wrapped = _([1, 2]);
  9457. *
  9458. * wrapped.next();
  9459. * // => { 'done': false, 'value': 1 }
  9460. *
  9461. * wrapped.next();
  9462. * // => { 'done': false, 'value': 2 }
  9463. *
  9464. * wrapped.next();
  9465. * // => { 'done': true, 'value': undefined }
  9466. */
  9467. function wrapperNext() {
  9468. if (this.__values__ === undefined) {
  9469. this.__values__ = toArray(this.value());
  9470. }
  9471. var done = this.__index__ >= this.__values__.length,
  9472. value = done ? undefined : this.__values__[this.__index__++];
  9473. return { 'done': done, 'value': value };
  9474. }
  9475. /**
  9476. * Enables the wrapper to be iterable.
  9477. *
  9478. * @name Symbol.iterator
  9479. * @memberOf _
  9480. * @since 4.0.0
  9481. * @category Seq
  9482. * @returns {Object} Returns the wrapper object.
  9483. * @example
  9484. *
  9485. * var wrapped = _([1, 2]);
  9486. *
  9487. * wrapped[Symbol.iterator]() === wrapped;
  9488. * // => true
  9489. *
  9490. * Array.from(wrapped);
  9491. * // => [1, 2]
  9492. */
  9493. function wrapperToIterator() {
  9494. return this;
  9495. }
  9496. /**
  9497. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9498. *
  9499. * @name plant
  9500. * @memberOf _
  9501. * @since 3.2.0
  9502. * @category Seq
  9503. * @param {*} value The value to plant.
  9504. * @returns {Object} Returns the new `lodash` wrapper instance.
  9505. * @example
  9506. *
  9507. * function square(n) {
  9508. * return n * n;
  9509. * }
  9510. *
  9511. * var wrapped = _([1, 2]).map(square);
  9512. * var other = wrapped.plant([3, 4]);
  9513. *
  9514. * other.value();
  9515. * // => [9, 16]
  9516. *
  9517. * wrapped.value();
  9518. * // => [1, 4]
  9519. */
  9520. function wrapperPlant(value) {
  9521. var result,
  9522. parent = this;
  9523. while (parent instanceof baseLodash) {
  9524. var clone = wrapperClone(parent);
  9525. clone.__index__ = 0;
  9526. clone.__values__ = undefined;
  9527. if (result) {
  9528. previous.__wrapped__ = clone;
  9529. } else {
  9530. result = clone;
  9531. }
  9532. var previous = clone;
  9533. parent = parent.__wrapped__;
  9534. }
  9535. previous.__wrapped__ = value;
  9536. return result;
  9537. }
  9538. /**
  9539. * This method is the wrapper version of `_.reverse`.
  9540. *
  9541. * **Note:** This method mutates the wrapped array.
  9542. *
  9543. * @name reverse
  9544. * @memberOf _
  9545. * @since 0.1.0
  9546. * @category Seq
  9547. * @returns {Object} Returns the new `lodash` wrapper instance.
  9548. * @example
  9549. *
  9550. * var array = [1, 2, 3];
  9551. *
  9552. * _(array).reverse().value()
  9553. * // => [3, 2, 1]
  9554. *
  9555. * console.log(array);
  9556. * // => [3, 2, 1]
  9557. */
  9558. function wrapperReverse() {
  9559. var value = this.__wrapped__;
  9560. if (value instanceof LazyWrapper) {
  9561. var wrapped = value;
  9562. if (this.__actions__.length) {
  9563. wrapped = new LazyWrapper(this);
  9564. }
  9565. wrapped = wrapped.reverse();
  9566. wrapped.__actions__.push({
  9567. 'func': thru,
  9568. 'args': [reverse],
  9569. 'thisArg': undefined
  9570. });
  9571. return new LodashWrapper(wrapped, this.__chain__);
  9572. }
  9573. return this.thru(reverse);
  9574. }
  9575. /**
  9576. * Executes the chain sequence to resolve the unwrapped value.
  9577. *
  9578. * @name value
  9579. * @memberOf _
  9580. * @since 0.1.0
  9581. * @alias toJSON, valueOf
  9582. * @category Seq
  9583. * @returns {*} Returns the resolved unwrapped value.
  9584. * @example
  9585. *
  9586. * _([1, 2, 3]).value();
  9587. * // => [1, 2, 3]
  9588. */
  9589. function wrapperValue() {
  9590. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9591. }
  9592. /*------------------------------------------------------------------------*/
  9593. /**
  9594. * Creates an object composed of keys generated from the results of running
  9595. * each element of `collection` thru `iteratee`. The corresponding value of
  9596. * each key is the number of times the key was returned by `iteratee`. The
  9597. * iteratee is invoked with one argument: (value).
  9598. *
  9599. * @static
  9600. * @memberOf _
  9601. * @since 0.5.0
  9602. * @category Collection
  9603. * @param {Array|Object} collection The collection to iterate over.
  9604. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9605. * @returns {Object} Returns the composed aggregate object.
  9606. * @example
  9607. *
  9608. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9609. * // => { '4': 1, '6': 2 }
  9610. *
  9611. * // The `_.property` iteratee shorthand.
  9612. * _.countBy(['one', 'two', 'three'], 'length');
  9613. * // => { '3': 2, '5': 1 }
  9614. */
  9615. var countBy = createAggregator(function(result, value, key) {
  9616. if (hasOwnProperty.call(result, key)) {
  9617. ++result[key];
  9618. } else {
  9619. baseAssignValue(result, key, 1);
  9620. }
  9621. });
  9622. /**
  9623. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9624. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9625. * invoked with three arguments: (value, index|key, collection).
  9626. *
  9627. * **Note:** This method returns `true` for
  9628. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9629. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9630. * elements of empty collections.
  9631. *
  9632. * @static
  9633. * @memberOf _
  9634. * @since 0.1.0
  9635. * @category Collection
  9636. * @param {Array|Object} collection The collection to iterate over.
  9637. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9638. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9639. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9640. * else `false`.
  9641. * @example
  9642. *
  9643. * _.every([true, 1, null, 'yes'], Boolean);
  9644. * // => false
  9645. *
  9646. * var users = [
  9647. * { 'user': 'barney', 'age': 36, 'active': false },
  9648. * { 'user': 'fred', 'age': 40, 'active': false }
  9649. * ];
  9650. *
  9651. * // The `_.matches` iteratee shorthand.
  9652. * _.every(users, { 'user': 'barney', 'active': false });
  9653. * // => false
  9654. *
  9655. * // The `_.matchesProperty` iteratee shorthand.
  9656. * _.every(users, ['active', false]);
  9657. * // => true
  9658. *
  9659. * // The `_.property` iteratee shorthand.
  9660. * _.every(users, 'active');
  9661. * // => false
  9662. */
  9663. function every(collection, predicate, guard) {
  9664. var func = isArray(collection) ? arrayEvery : baseEvery;
  9665. if (guard && isIterateeCall(collection, predicate, guard)) {
  9666. predicate = undefined;
  9667. }
  9668. return func(collection, getIteratee(predicate, 3));
  9669. }
  9670. /**
  9671. * Iterates over elements of `collection`, returning an array of all elements
  9672. * `predicate` returns truthy for. The predicate is invoked with three
  9673. * arguments: (value, index|key, collection).
  9674. *
  9675. * **Note:** Unlike `_.remove`, this method returns a new array.
  9676. *
  9677. * @static
  9678. * @memberOf _
  9679. * @since 0.1.0
  9680. * @category Collection
  9681. * @param {Array|Object} collection The collection to iterate over.
  9682. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9683. * @returns {Array} Returns the new filtered array.
  9684. * @see _.reject
  9685. * @example
  9686. *
  9687. * var users = [
  9688. * { 'user': 'barney', 'age': 36, 'active': true },
  9689. * { 'user': 'fred', 'age': 40, 'active': false }
  9690. * ];
  9691. *
  9692. * _.filter(users, function(o) { return !o.active; });
  9693. * // => objects for ['fred']
  9694. *
  9695. * // The `_.matches` iteratee shorthand.
  9696. * _.filter(users, { 'age': 36, 'active': true });
  9697. * // => objects for ['barney']
  9698. *
  9699. * // The `_.matchesProperty` iteratee shorthand.
  9700. * _.filter(users, ['active', false]);
  9701. * // => objects for ['fred']
  9702. *
  9703. * // The `_.property` iteratee shorthand.
  9704. * _.filter(users, 'active');
  9705. * // => objects for ['barney']
  9706. *
  9707. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9708. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9709. * // => objects for ['fred', 'barney']
  9710. */
  9711. function filter(collection, predicate) {
  9712. var func = isArray(collection) ? arrayFilter : baseFilter;
  9713. return func(collection, getIteratee(predicate, 3));
  9714. }
  9715. /**
  9716. * Iterates over elements of `collection`, returning the first element
  9717. * `predicate` returns truthy for. The predicate is invoked with three
  9718. * arguments: (value, index|key, collection).
  9719. *
  9720. * @static
  9721. * @memberOf _
  9722. * @since 0.1.0
  9723. * @category Collection
  9724. * @param {Array|Object} collection The collection to inspect.
  9725. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9726. * @param {number} [fromIndex=0] The index to search from.
  9727. * @returns {*} Returns the matched element, else `undefined`.
  9728. * @example
  9729. *
  9730. * var users = [
  9731. * { 'user': 'barney', 'age': 36, 'active': true },
  9732. * { 'user': 'fred', 'age': 40, 'active': false },
  9733. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9734. * ];
  9735. *
  9736. * _.find(users, function(o) { return o.age < 40; });
  9737. * // => object for 'barney'
  9738. *
  9739. * // The `_.matches` iteratee shorthand.
  9740. * _.find(users, { 'age': 1, 'active': true });
  9741. * // => object for 'pebbles'
  9742. *
  9743. * // The `_.matchesProperty` iteratee shorthand.
  9744. * _.find(users, ['active', false]);
  9745. * // => object for 'fred'
  9746. *
  9747. * // The `_.property` iteratee shorthand.
  9748. * _.find(users, 'active');
  9749. * // => object for 'barney'
  9750. */
  9751. var find = createFind(findIndex);
  9752. /**
  9753. * This method is like `_.find` except that it iterates over elements of
  9754. * `collection` from right to left.
  9755. *
  9756. * @static
  9757. * @memberOf _
  9758. * @since 2.0.0
  9759. * @category Collection
  9760. * @param {Array|Object} collection The collection to inspect.
  9761. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9762. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9763. * @returns {*} Returns the matched element, else `undefined`.
  9764. * @example
  9765. *
  9766. * _.findLast([1, 2, 3, 4], function(n) {
  9767. * return n % 2 == 1;
  9768. * });
  9769. * // => 3
  9770. */
  9771. var findLast = createFind(findLastIndex);
  9772. /**
  9773. * Creates a flattened array of values by running each element in `collection`
  9774. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9775. * with three arguments: (value, index|key, collection).
  9776. *
  9777. * @static
  9778. * @memberOf _
  9779. * @since 4.0.0
  9780. * @category Collection
  9781. * @param {Array|Object} collection The collection to iterate over.
  9782. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9783. * @returns {Array} Returns the new flattened array.
  9784. * @example
  9785. *
  9786. * function duplicate(n) {
  9787. * return [n, n];
  9788. * }
  9789. *
  9790. * _.flatMap([1, 2], duplicate);
  9791. * // => [1, 1, 2, 2]
  9792. */
  9793. function flatMap(collection, iteratee) {
  9794. return baseFlatten(map(collection, iteratee), 1);
  9795. }
  9796. /**
  9797. * This method is like `_.flatMap` except that it recursively flattens the
  9798. * mapped results.
  9799. *
  9800. * @static
  9801. * @memberOf _
  9802. * @since 4.7.0
  9803. * @category Collection
  9804. * @param {Array|Object} collection The collection to iterate over.
  9805. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9806. * @returns {Array} Returns the new flattened array.
  9807. * @example
  9808. *
  9809. * function duplicate(n) {
  9810. * return [[[n, n]]];
  9811. * }
  9812. *
  9813. * _.flatMapDeep([1, 2], duplicate);
  9814. * // => [1, 1, 2, 2]
  9815. */
  9816. function flatMapDeep(collection, iteratee) {
  9817. return baseFlatten(map(collection, iteratee), INFINITY);
  9818. }
  9819. /**
  9820. * This method is like `_.flatMap` except that it recursively flattens the
  9821. * mapped results up to `depth` times.
  9822. *
  9823. * @static
  9824. * @memberOf _
  9825. * @since 4.7.0
  9826. * @category Collection
  9827. * @param {Array|Object} collection The collection to iterate over.
  9828. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9829. * @param {number} [depth=1] The maximum recursion depth.
  9830. * @returns {Array} Returns the new flattened array.
  9831. * @example
  9832. *
  9833. * function duplicate(n) {
  9834. * return [[[n, n]]];
  9835. * }
  9836. *
  9837. * _.flatMapDepth([1, 2], duplicate, 2);
  9838. * // => [[1, 1], [2, 2]]
  9839. */
  9840. function flatMapDepth(collection, iteratee, depth) {
  9841. depth = depth === undefined ? 1 : toInteger(depth);
  9842. return baseFlatten(map(collection, iteratee), depth);
  9843. }
  9844. /**
  9845. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9846. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9847. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9848. *
  9849. * **Note:** As with other "Collections" methods, objects with a "length"
  9850. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9851. * or `_.forOwn` for object iteration.
  9852. *
  9853. * @static
  9854. * @memberOf _
  9855. * @since 0.1.0
  9856. * @alias each
  9857. * @category Collection
  9858. * @param {Array|Object} collection The collection to iterate over.
  9859. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9860. * @returns {Array|Object} Returns `collection`.
  9861. * @see _.forEachRight
  9862. * @example
  9863. *
  9864. * _.forEach([1, 2], function(value) {
  9865. * console.log(value);
  9866. * });
  9867. * // => Logs `1` then `2`.
  9868. *
  9869. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9870. * console.log(key);
  9871. * });
  9872. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9873. */
  9874. function forEach(collection, iteratee) {
  9875. var func = isArray(collection) ? arrayEach : baseEach;
  9876. return func(collection, getIteratee(iteratee, 3));
  9877. }
  9878. /**
  9879. * This method is like `_.forEach` except that it iterates over elements of
  9880. * `collection` from right to left.
  9881. *
  9882. * @static
  9883. * @memberOf _
  9884. * @since 2.0.0
  9885. * @alias eachRight
  9886. * @category Collection
  9887. * @param {Array|Object} collection The collection to iterate over.
  9888. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9889. * @returns {Array|Object} Returns `collection`.
  9890. * @see _.forEach
  9891. * @example
  9892. *
  9893. * _.forEachRight([1, 2], function(value) {
  9894. * console.log(value);
  9895. * });
  9896. * // => Logs `2` then `1`.
  9897. */
  9898. function forEachRight(collection, iteratee) {
  9899. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9900. return func(collection, getIteratee(iteratee, 3));
  9901. }
  9902. /**
  9903. * Creates an object composed of keys generated from the results of running
  9904. * each element of `collection` thru `iteratee`. The order of grouped values
  9905. * is determined by the order they occur in `collection`. The corresponding
  9906. * value of each key is an array of elements responsible for generating the
  9907. * key. The iteratee is invoked with one argument: (value).
  9908. *
  9909. * @static
  9910. * @memberOf _
  9911. * @since 0.1.0
  9912. * @category Collection
  9913. * @param {Array|Object} collection The collection to iterate over.
  9914. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9915. * @returns {Object} Returns the composed aggregate object.
  9916. * @example
  9917. *
  9918. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9919. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9920. *
  9921. * // The `_.property` iteratee shorthand.
  9922. * _.groupBy(['one', 'two', 'three'], 'length');
  9923. * // => { '3': ['one', 'two'], '5': ['three'] }
  9924. */
  9925. var groupBy = createAggregator(function(result, value, key) {
  9926. if (hasOwnProperty.call(result, key)) {
  9927. result[key].push(value);
  9928. } else {
  9929. baseAssignValue(result, key, [value]);
  9930. }
  9931. });
  9932. /**
  9933. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9934. * checked for a substring of `value`, otherwise
  9935. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9936. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9937. * the offset from the end of `collection`.
  9938. *
  9939. * @static
  9940. * @memberOf _
  9941. * @since 0.1.0
  9942. * @category Collection
  9943. * @param {Array|Object|string} collection The collection to inspect.
  9944. * @param {*} value The value to search for.
  9945. * @param {number} [fromIndex=0] The index to search from.
  9946. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9947. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9948. * @example
  9949. *
  9950. * _.includes([1, 2, 3], 1);
  9951. * // => true
  9952. *
  9953. * _.includes([1, 2, 3], 1, 2);
  9954. * // => false
  9955. *
  9956. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9957. * // => true
  9958. *
  9959. * _.includes('abcd', 'bc');
  9960. * // => true
  9961. */
  9962. function includes(collection, value, fromIndex, guard) {
  9963. collection = isArrayLike(collection) ? collection : values(collection);
  9964. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9965. var length = collection.length;
  9966. if (fromIndex < 0) {
  9967. fromIndex = nativeMax(length + fromIndex, 0);
  9968. }
  9969. return isString(collection)
  9970. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9971. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9972. }
  9973. /**
  9974. * Invokes the method at `path` of each element in `collection`, returning
  9975. * an array of the results of each invoked method. Any additional arguments
  9976. * are provided to each invoked method. If `path` is a function, it's invoked
  9977. * for, and `this` bound to, each element in `collection`.
  9978. *
  9979. * @static
  9980. * @memberOf _
  9981. * @since 4.0.0
  9982. * @category Collection
  9983. * @param {Array|Object} collection The collection to iterate over.
  9984. * @param {Array|Function|string} path The path of the method to invoke or
  9985. * the function invoked per iteration.
  9986. * @param {...*} [args] The arguments to invoke each method with.
  9987. * @returns {Array} Returns the array of results.
  9988. * @example
  9989. *
  9990. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9991. * // => [[1, 5, 7], [1, 2, 3]]
  9992. *
  9993. * _.invokeMap([123, 456], String.prototype.split, '');
  9994. * // => [['1', '2', '3'], ['4', '5', '6']]
  9995. */
  9996. var invokeMap = baseRest(function(collection, path, args) {
  9997. var index = -1,
  9998. isFunc = typeof path == 'function',
  9999. result = isArrayLike(collection) ? Array(collection.length) : [];
  10000. baseEach(collection, function(value) {
  10001. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10002. });
  10003. return result;
  10004. });
  10005. /**
  10006. * Creates an object composed of keys generated from the results of running
  10007. * each element of `collection` thru `iteratee`. The corresponding value of
  10008. * each key is the last element responsible for generating the key. The
  10009. * iteratee is invoked with one argument: (value).
  10010. *
  10011. * @static
  10012. * @memberOf _
  10013. * @since 4.0.0
  10014. * @category Collection
  10015. * @param {Array|Object} collection The collection to iterate over.
  10016. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10017. * @returns {Object} Returns the composed aggregate object.
  10018. * @example
  10019. *
  10020. * var array = [
  10021. * { 'dir': 'left', 'code': 97 },
  10022. * { 'dir': 'right', 'code': 100 }
  10023. * ];
  10024. *
  10025. * _.keyBy(array, function(o) {
  10026. * return String.fromCharCode(o.code);
  10027. * });
  10028. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10029. *
  10030. * _.keyBy(array, 'dir');
  10031. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10032. */
  10033. var keyBy = createAggregator(function(result, value, key) {
  10034. baseAssignValue(result, key, value);
  10035. });
  10036. /**
  10037. * Creates an array of values by running each element in `collection` thru
  10038. * `iteratee`. The iteratee is invoked with three arguments:
  10039. * (value, index|key, collection).
  10040. *
  10041. * Many lodash methods are guarded to work as iteratees for methods like
  10042. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10043. *
  10044. * The guarded methods are:
  10045. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10046. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10047. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10048. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10049. *
  10050. * @static
  10051. * @memberOf _
  10052. * @since 0.1.0
  10053. * @category Collection
  10054. * @param {Array|Object} collection The collection to iterate over.
  10055. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10056. * @returns {Array} Returns the new mapped array.
  10057. * @example
  10058. *
  10059. * function square(n) {
  10060. * return n * n;
  10061. * }
  10062. *
  10063. * _.map([4, 8], square);
  10064. * // => [16, 64]
  10065. *
  10066. * _.map({ 'a': 4, 'b': 8 }, square);
  10067. * // => [16, 64] (iteration order is not guaranteed)
  10068. *
  10069. * var users = [
  10070. * { 'user': 'barney' },
  10071. * { 'user': 'fred' }
  10072. * ];
  10073. *
  10074. * // The `_.property` iteratee shorthand.
  10075. * _.map(users, 'user');
  10076. * // => ['barney', 'fred']
  10077. */
  10078. function map(collection, iteratee) {
  10079. var func = isArray(collection) ? arrayMap : baseMap;
  10080. return func(collection, getIteratee(iteratee, 3));
  10081. }
  10082. /**
  10083. * This method is like `_.sortBy` except that it allows specifying the sort
  10084. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10085. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10086. * descending or "asc" for ascending sort order of corresponding values.
  10087. *
  10088. * @static
  10089. * @memberOf _
  10090. * @since 4.0.0
  10091. * @category Collection
  10092. * @param {Array|Object} collection The collection to iterate over.
  10093. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10094. * The iteratees to sort by.
  10095. * @param {string[]} [orders] The sort orders of `iteratees`.
  10096. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10097. * @returns {Array} Returns the new sorted array.
  10098. * @example
  10099. *
  10100. * var users = [
  10101. * { 'user': 'fred', 'age': 48 },
  10102. * { 'user': 'barney', 'age': 34 },
  10103. * { 'user': 'fred', 'age': 40 },
  10104. * { 'user': 'barney', 'age': 36 }
  10105. * ];
  10106. *
  10107. * // Sort by `user` in ascending order and by `age` in descending order.
  10108. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10109. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10110. */
  10111. function orderBy(collection, iteratees, orders, guard) {
  10112. if (collection == null) {
  10113. return [];
  10114. }
  10115. if (!isArray(iteratees)) {
  10116. iteratees = iteratees == null ? [] : [iteratees];
  10117. }
  10118. orders = guard ? undefined : orders;
  10119. if (!isArray(orders)) {
  10120. orders = orders == null ? [] : [orders];
  10121. }
  10122. return baseOrderBy(collection, iteratees, orders);
  10123. }
  10124. /**
  10125. * Creates an array of elements split into two groups, the first of which
  10126. * contains elements `predicate` returns truthy for, the second of which
  10127. * contains elements `predicate` returns falsey for. The predicate is
  10128. * invoked with one argument: (value).
  10129. *
  10130. * @static
  10131. * @memberOf _
  10132. * @since 3.0.0
  10133. * @category Collection
  10134. * @param {Array|Object} collection The collection to iterate over.
  10135. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10136. * @returns {Array} Returns the array of grouped elements.
  10137. * @example
  10138. *
  10139. * var users = [
  10140. * { 'user': 'barney', 'age': 36, 'active': false },
  10141. * { 'user': 'fred', 'age': 40, 'active': true },
  10142. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10143. * ];
  10144. *
  10145. * _.partition(users, function(o) { return o.active; });
  10146. * // => objects for [['fred'], ['barney', 'pebbles']]
  10147. *
  10148. * // The `_.matches` iteratee shorthand.
  10149. * _.partition(users, { 'age': 1, 'active': false });
  10150. * // => objects for [['pebbles'], ['barney', 'fred']]
  10151. *
  10152. * // The `_.matchesProperty` iteratee shorthand.
  10153. * _.partition(users, ['active', false]);
  10154. * // => objects for [['barney', 'pebbles'], ['fred']]
  10155. *
  10156. * // The `_.property` iteratee shorthand.
  10157. * _.partition(users, 'active');
  10158. * // => objects for [['fred'], ['barney', 'pebbles']]
  10159. */
  10160. var partition = createAggregator(function(result, value, key) {
  10161. result[key ? 0 : 1].push(value);
  10162. }, function() { return [[], []]; });
  10163. /**
  10164. * Reduces `collection` to a value which is the accumulated result of running
  10165. * each element in `collection` thru `iteratee`, where each successive
  10166. * invocation is supplied the return value of the previous. If `accumulator`
  10167. * is not given, the first element of `collection` is used as the initial
  10168. * value. The iteratee is invoked with four arguments:
  10169. * (accumulator, value, index|key, collection).
  10170. *
  10171. * Many lodash methods are guarded to work as iteratees for methods like
  10172. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10173. *
  10174. * The guarded methods are:
  10175. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10176. * and `sortBy`
  10177. *
  10178. * @static
  10179. * @memberOf _
  10180. * @since 0.1.0
  10181. * @category Collection
  10182. * @param {Array|Object} collection The collection to iterate over.
  10183. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10184. * @param {*} [accumulator] The initial value.
  10185. * @returns {*} Returns the accumulated value.
  10186. * @see _.reduceRight
  10187. * @example
  10188. *
  10189. * _.reduce([1, 2], function(sum, n) {
  10190. * return sum + n;
  10191. * }, 0);
  10192. * // => 3
  10193. *
  10194. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10195. * (result[value] || (result[value] = [])).push(key);
  10196. * return result;
  10197. * }, {});
  10198. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10199. */
  10200. function reduce(collection, iteratee, accumulator) {
  10201. var func = isArray(collection) ? arrayReduce : baseReduce,
  10202. initAccum = arguments.length < 3;
  10203. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10204. }
  10205. /**
  10206. * This method is like `_.reduce` except that it iterates over elements of
  10207. * `collection` from right to left.
  10208. *
  10209. * @static
  10210. * @memberOf _
  10211. * @since 0.1.0
  10212. * @category Collection
  10213. * @param {Array|Object} collection The collection to iterate over.
  10214. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10215. * @param {*} [accumulator] The initial value.
  10216. * @returns {*} Returns the accumulated value.
  10217. * @see _.reduce
  10218. * @example
  10219. *
  10220. * var array = [[0, 1], [2, 3], [4, 5]];
  10221. *
  10222. * _.reduceRight(array, function(flattened, other) {
  10223. * return flattened.concat(other);
  10224. * }, []);
  10225. * // => [4, 5, 2, 3, 0, 1]
  10226. */
  10227. function reduceRight(collection, iteratee, accumulator) {
  10228. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10229. initAccum = arguments.length < 3;
  10230. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10231. }
  10232. /**
  10233. * The opposite of `_.filter`; this method returns the elements of `collection`
  10234. * that `predicate` does **not** return truthy for.
  10235. *
  10236. * @static
  10237. * @memberOf _
  10238. * @since 0.1.0
  10239. * @category Collection
  10240. * @param {Array|Object} collection The collection to iterate over.
  10241. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10242. * @returns {Array} Returns the new filtered array.
  10243. * @see _.filter
  10244. * @example
  10245. *
  10246. * var users = [
  10247. * { 'user': 'barney', 'age': 36, 'active': false },
  10248. * { 'user': 'fred', 'age': 40, 'active': true }
  10249. * ];
  10250. *
  10251. * _.reject(users, function(o) { return !o.active; });
  10252. * // => objects for ['fred']
  10253. *
  10254. * // The `_.matches` iteratee shorthand.
  10255. * _.reject(users, { 'age': 40, 'active': true });
  10256. * // => objects for ['barney']
  10257. *
  10258. * // The `_.matchesProperty` iteratee shorthand.
  10259. * _.reject(users, ['active', false]);
  10260. * // => objects for ['fred']
  10261. *
  10262. * // The `_.property` iteratee shorthand.
  10263. * _.reject(users, 'active');
  10264. * // => objects for ['barney']
  10265. */
  10266. function reject(collection, predicate) {
  10267. var func = isArray(collection) ? arrayFilter : baseFilter;
  10268. return func(collection, negate(getIteratee(predicate, 3)));
  10269. }
  10270. /**
  10271. * Gets a random element from `collection`.
  10272. *
  10273. * @static
  10274. * @memberOf _
  10275. * @since 2.0.0
  10276. * @category Collection
  10277. * @param {Array|Object} collection The collection to sample.
  10278. * @returns {*} Returns the random element.
  10279. * @example
  10280. *
  10281. * _.sample([1, 2, 3, 4]);
  10282. * // => 2
  10283. */
  10284. function sample(collection) {
  10285. var func = isArray(collection) ? arraySample : baseSample;
  10286. return func(collection);
  10287. }
  10288. /**
  10289. * Gets `n` random elements at unique keys from `collection` up to the
  10290. * size of `collection`.
  10291. *
  10292. * @static
  10293. * @memberOf _
  10294. * @since 4.0.0
  10295. * @category Collection
  10296. * @param {Array|Object} collection The collection to sample.
  10297. * @param {number} [n=1] The number of elements to sample.
  10298. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10299. * @returns {Array} Returns the random elements.
  10300. * @example
  10301. *
  10302. * _.sampleSize([1, 2, 3], 2);
  10303. * // => [3, 1]
  10304. *
  10305. * _.sampleSize([1, 2, 3], 4);
  10306. * // => [2, 3, 1]
  10307. */
  10308. function sampleSize(collection, n, guard) {
  10309. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10310. n = 1;
  10311. } else {
  10312. n = toInteger(n);
  10313. }
  10314. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10315. return func(collection, n);
  10316. }
  10317. /**
  10318. * Creates an array of shuffled values, using a version of the
  10319. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10320. *
  10321. * @static
  10322. * @memberOf _
  10323. * @since 0.1.0
  10324. * @category Collection
  10325. * @param {Array|Object} collection The collection to shuffle.
  10326. * @returns {Array} Returns the new shuffled array.
  10327. * @example
  10328. *
  10329. * _.shuffle([1, 2, 3, 4]);
  10330. * // => [4, 1, 3, 2]
  10331. */
  10332. function shuffle(collection) {
  10333. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10334. return func(collection);
  10335. }
  10336. /**
  10337. * Gets the size of `collection` by returning its length for array-like
  10338. * values or the number of own enumerable string keyed properties for objects.
  10339. *
  10340. * @static
  10341. * @memberOf _
  10342. * @since 0.1.0
  10343. * @category Collection
  10344. * @param {Array|Object|string} collection The collection to inspect.
  10345. * @returns {number} Returns the collection size.
  10346. * @example
  10347. *
  10348. * _.size([1, 2, 3]);
  10349. * // => 3
  10350. *
  10351. * _.size({ 'a': 1, 'b': 2 });
  10352. * // => 2
  10353. *
  10354. * _.size('pebbles');
  10355. * // => 7
  10356. */
  10357. function size(collection) {
  10358. if (collection == null) {
  10359. return 0;
  10360. }
  10361. if (isArrayLike(collection)) {
  10362. return isString(collection) ? stringSize(collection) : collection.length;
  10363. }
  10364. var tag = getTag(collection);
  10365. if (tag == mapTag || tag == setTag) {
  10366. return collection.size;
  10367. }
  10368. return baseKeys(collection).length;
  10369. }
  10370. /**
  10371. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10372. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10373. * invoked with three arguments: (value, index|key, collection).
  10374. *
  10375. * @static
  10376. * @memberOf _
  10377. * @since 0.1.0
  10378. * @category Collection
  10379. * @param {Array|Object} collection The collection to iterate over.
  10380. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10381. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10382. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10383. * else `false`.
  10384. * @example
  10385. *
  10386. * _.some([null, 0, 'yes', false], Boolean);
  10387. * // => true
  10388. *
  10389. * var users = [
  10390. * { 'user': 'barney', 'active': true },
  10391. * { 'user': 'fred', 'active': false }
  10392. * ];
  10393. *
  10394. * // The `_.matches` iteratee shorthand.
  10395. * _.some(users, { 'user': 'barney', 'active': false });
  10396. * // => false
  10397. *
  10398. * // The `_.matchesProperty` iteratee shorthand.
  10399. * _.some(users, ['active', false]);
  10400. * // => true
  10401. *
  10402. * // The `_.property` iteratee shorthand.
  10403. * _.some(users, 'active');
  10404. * // => true
  10405. */
  10406. function some(collection, predicate, guard) {
  10407. var func = isArray(collection) ? arraySome : baseSome;
  10408. if (guard && isIterateeCall(collection, predicate, guard)) {
  10409. predicate = undefined;
  10410. }
  10411. return func(collection, getIteratee(predicate, 3));
  10412. }
  10413. /**
  10414. * Creates an array of elements, sorted in ascending order by the results of
  10415. * running each element in a collection thru each iteratee. This method
  10416. * performs a stable sort, that is, it preserves the original sort order of
  10417. * equal elements. The iteratees are invoked with one argument: (value).
  10418. *
  10419. * @static
  10420. * @memberOf _
  10421. * @since 0.1.0
  10422. * @category Collection
  10423. * @param {Array|Object} collection The collection to iterate over.
  10424. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10425. * The iteratees to sort by.
  10426. * @returns {Array} Returns the new sorted array.
  10427. * @example
  10428. *
  10429. * var users = [
  10430. * { 'user': 'fred', 'age': 48 },
  10431. * { 'user': 'barney', 'age': 36 },
  10432. * { 'user': 'fred', 'age': 30 },
  10433. * { 'user': 'barney', 'age': 34 }
  10434. * ];
  10435. *
  10436. * _.sortBy(users, [function(o) { return o.user; }]);
  10437. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10438. *
  10439. * _.sortBy(users, ['user', 'age']);
  10440. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10441. */
  10442. var sortBy = baseRest(function(collection, iteratees) {
  10443. if (collection == null) {
  10444. return [];
  10445. }
  10446. var length = iteratees.length;
  10447. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10448. iteratees = [];
  10449. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10450. iteratees = [iteratees[0]];
  10451. }
  10452. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10453. });
  10454. /*------------------------------------------------------------------------*/
  10455. /**
  10456. * Gets the timestamp of the number of milliseconds that have elapsed since
  10457. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10458. *
  10459. * @static
  10460. * @memberOf _
  10461. * @since 2.4.0
  10462. * @category Date
  10463. * @returns {number} Returns the timestamp.
  10464. * @example
  10465. *
  10466. * _.defer(function(stamp) {
  10467. * console.log(_.now() - stamp);
  10468. * }, _.now());
  10469. * // => Logs the number of milliseconds it took for the deferred invocation.
  10470. */
  10471. var now = ctxNow || function() {
  10472. return root.Date.now();
  10473. };
  10474. /*------------------------------------------------------------------------*/
  10475. /**
  10476. * The opposite of `_.before`; this method creates a function that invokes
  10477. * `func` once it's called `n` or more times.
  10478. *
  10479. * @static
  10480. * @memberOf _
  10481. * @since 0.1.0
  10482. * @category Function
  10483. * @param {number} n The number of calls before `func` is invoked.
  10484. * @param {Function} func The function to restrict.
  10485. * @returns {Function} Returns the new restricted function.
  10486. * @example
  10487. *
  10488. * var saves = ['profile', 'settings'];
  10489. *
  10490. * var done = _.after(saves.length, function() {
  10491. * console.log('done saving!');
  10492. * });
  10493. *
  10494. * _.forEach(saves, function(type) {
  10495. * asyncSave({ 'type': type, 'complete': done });
  10496. * });
  10497. * // => Logs 'done saving!' after the two async saves have completed.
  10498. */
  10499. function after(n, func) {
  10500. if (typeof func != 'function') {
  10501. throw new TypeError(FUNC_ERROR_TEXT);
  10502. }
  10503. n = toInteger(n);
  10504. return function() {
  10505. if (--n < 1) {
  10506. return func.apply(this, arguments);
  10507. }
  10508. };
  10509. }
  10510. /**
  10511. * Creates a function that invokes `func`, with up to `n` arguments,
  10512. * ignoring any additional arguments.
  10513. *
  10514. * @static
  10515. * @memberOf _
  10516. * @since 3.0.0
  10517. * @category Function
  10518. * @param {Function} func The function to cap arguments for.
  10519. * @param {number} [n=func.length] The arity cap.
  10520. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10521. * @returns {Function} Returns the new capped function.
  10522. * @example
  10523. *
  10524. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10525. * // => [6, 8, 10]
  10526. */
  10527. function ary(func, n, guard) {
  10528. n = guard ? undefined : n;
  10529. n = (func && n == null) ? func.length : n;
  10530. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10531. }
  10532. /**
  10533. * Creates a function that invokes `func`, with the `this` binding and arguments
  10534. * of the created function, while it's called less than `n` times. Subsequent
  10535. * calls to the created function return the result of the last `func` invocation.
  10536. *
  10537. * @static
  10538. * @memberOf _
  10539. * @since 3.0.0
  10540. * @category Function
  10541. * @param {number} n The number of calls at which `func` is no longer invoked.
  10542. * @param {Function} func The function to restrict.
  10543. * @returns {Function} Returns the new restricted function.
  10544. * @example
  10545. *
  10546. * jQuery(element).on('click', _.before(5, addContactToList));
  10547. * // => Allows adding up to 4 contacts to the list.
  10548. */
  10549. function before(n, func) {
  10550. var result;
  10551. if (typeof func != 'function') {
  10552. throw new TypeError(FUNC_ERROR_TEXT);
  10553. }
  10554. n = toInteger(n);
  10555. return function() {
  10556. if (--n > 0) {
  10557. result = func.apply(this, arguments);
  10558. }
  10559. if (n <= 1) {
  10560. func = undefined;
  10561. }
  10562. return result;
  10563. };
  10564. }
  10565. /**
  10566. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10567. * and `partials` prepended to the arguments it receives.
  10568. *
  10569. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10570. * may be used as a placeholder for partially applied arguments.
  10571. *
  10572. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10573. * property of bound functions.
  10574. *
  10575. * @static
  10576. * @memberOf _
  10577. * @since 0.1.0
  10578. * @category Function
  10579. * @param {Function} func The function to bind.
  10580. * @param {*} thisArg The `this` binding of `func`.
  10581. * @param {...*} [partials] The arguments to be partially applied.
  10582. * @returns {Function} Returns the new bound function.
  10583. * @example
  10584. *
  10585. * function greet(greeting, punctuation) {
  10586. * return greeting + ' ' + this.user + punctuation;
  10587. * }
  10588. *
  10589. * var object = { 'user': 'fred' };
  10590. *
  10591. * var bound = _.bind(greet, object, 'hi');
  10592. * bound('!');
  10593. * // => 'hi fred!'
  10594. *
  10595. * // Bound with placeholders.
  10596. * var bound = _.bind(greet, object, _, '!');
  10597. * bound('hi');
  10598. * // => 'hi fred!'
  10599. */
  10600. var bind = baseRest(function(func, thisArg, partials) {
  10601. var bitmask = WRAP_BIND_FLAG;
  10602. if (partials.length) {
  10603. var holders = replaceHolders(partials, getHolder(bind));
  10604. bitmask |= WRAP_PARTIAL_FLAG;
  10605. }
  10606. return createWrap(func, bitmask, thisArg, partials, holders);
  10607. });
  10608. /**
  10609. * Creates a function that invokes the method at `object[key]` with `partials`
  10610. * prepended to the arguments it receives.
  10611. *
  10612. * This method differs from `_.bind` by allowing bound functions to reference
  10613. * methods that may be redefined or don't yet exist. See
  10614. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10615. * for more details.
  10616. *
  10617. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10618. * builds, may be used as a placeholder for partially applied arguments.
  10619. *
  10620. * @static
  10621. * @memberOf _
  10622. * @since 0.10.0
  10623. * @category Function
  10624. * @param {Object} object The object to invoke the method on.
  10625. * @param {string} key The key of the method.
  10626. * @param {...*} [partials] The arguments to be partially applied.
  10627. * @returns {Function} Returns the new bound function.
  10628. * @example
  10629. *
  10630. * var object = {
  10631. * 'user': 'fred',
  10632. * 'greet': function(greeting, punctuation) {
  10633. * return greeting + ' ' + this.user + punctuation;
  10634. * }
  10635. * };
  10636. *
  10637. * var bound = _.bindKey(object, 'greet', 'hi');
  10638. * bound('!');
  10639. * // => 'hi fred!'
  10640. *
  10641. * object.greet = function(greeting, punctuation) {
  10642. * return greeting + 'ya ' + this.user + punctuation;
  10643. * };
  10644. *
  10645. * bound('!');
  10646. * // => 'hiya fred!'
  10647. *
  10648. * // Bound with placeholders.
  10649. * var bound = _.bindKey(object, 'greet', _, '!');
  10650. * bound('hi');
  10651. * // => 'hiya fred!'
  10652. */
  10653. var bindKey = baseRest(function(object, key, partials) {
  10654. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10655. if (partials.length) {
  10656. var holders = replaceHolders(partials, getHolder(bindKey));
  10657. bitmask |= WRAP_PARTIAL_FLAG;
  10658. }
  10659. return createWrap(key, bitmask, object, partials, holders);
  10660. });
  10661. /**
  10662. * Creates a function that accepts arguments of `func` and either invokes
  10663. * `func` returning its result, if at least `arity` number of arguments have
  10664. * been provided, or returns a function that accepts the remaining `func`
  10665. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10666. * is not sufficient.
  10667. *
  10668. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10669. * may be used as a placeholder for provided arguments.
  10670. *
  10671. * **Note:** This method doesn't set the "length" property of curried functions.
  10672. *
  10673. * @static
  10674. * @memberOf _
  10675. * @since 2.0.0
  10676. * @category Function
  10677. * @param {Function} func The function to curry.
  10678. * @param {number} [arity=func.length] The arity of `func`.
  10679. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10680. * @returns {Function} Returns the new curried function.
  10681. * @example
  10682. *
  10683. * var abc = function(a, b, c) {
  10684. * return [a, b, c];
  10685. * };
  10686. *
  10687. * var curried = _.curry(abc);
  10688. *
  10689. * curried(1)(2)(3);
  10690. * // => [1, 2, 3]
  10691. *
  10692. * curried(1, 2)(3);
  10693. * // => [1, 2, 3]
  10694. *
  10695. * curried(1, 2, 3);
  10696. * // => [1, 2, 3]
  10697. *
  10698. * // Curried with placeholders.
  10699. * curried(1)(_, 3)(2);
  10700. * // => [1, 2, 3]
  10701. */
  10702. function curry(func, arity, guard) {
  10703. arity = guard ? undefined : arity;
  10704. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10705. result.placeholder = curry.placeholder;
  10706. return result;
  10707. }
  10708. /**
  10709. * This method is like `_.curry` except that arguments are applied to `func`
  10710. * in the manner of `_.partialRight` instead of `_.partial`.
  10711. *
  10712. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10713. * builds, may be used as a placeholder for provided arguments.
  10714. *
  10715. * **Note:** This method doesn't set the "length" property of curried functions.
  10716. *
  10717. * @static
  10718. * @memberOf _
  10719. * @since 3.0.0
  10720. * @category Function
  10721. * @param {Function} func The function to curry.
  10722. * @param {number} [arity=func.length] The arity of `func`.
  10723. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10724. * @returns {Function} Returns the new curried function.
  10725. * @example
  10726. *
  10727. * var abc = function(a, b, c) {
  10728. * return [a, b, c];
  10729. * };
  10730. *
  10731. * var curried = _.curryRight(abc);
  10732. *
  10733. * curried(3)(2)(1);
  10734. * // => [1, 2, 3]
  10735. *
  10736. * curried(2, 3)(1);
  10737. * // => [1, 2, 3]
  10738. *
  10739. * curried(1, 2, 3);
  10740. * // => [1, 2, 3]
  10741. *
  10742. * // Curried with placeholders.
  10743. * curried(3)(1, _)(2);
  10744. * // => [1, 2, 3]
  10745. */
  10746. function curryRight(func, arity, guard) {
  10747. arity = guard ? undefined : arity;
  10748. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10749. result.placeholder = curryRight.placeholder;
  10750. return result;
  10751. }
  10752. /**
  10753. * Creates a debounced function that delays invoking `func` until after `wait`
  10754. * milliseconds have elapsed since the last time the debounced function was
  10755. * invoked. The debounced function comes with a `cancel` method to cancel
  10756. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10757. * Provide `options` to indicate whether `func` should be invoked on the
  10758. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10759. * with the last arguments provided to the debounced function. Subsequent
  10760. * calls to the debounced function return the result of the last `func`
  10761. * invocation.
  10762. *
  10763. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10764. * invoked on the trailing edge of the timeout only if the debounced function
  10765. * is invoked more than once during the `wait` timeout.
  10766. *
  10767. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10768. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10769. *
  10770. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10771. * for details over the differences between `_.debounce` and `_.throttle`.
  10772. *
  10773. * @static
  10774. * @memberOf _
  10775. * @since 0.1.0
  10776. * @category Function
  10777. * @param {Function} func The function to debounce.
  10778. * @param {number} [wait=0] The number of milliseconds to delay.
  10779. * @param {Object} [options={}] The options object.
  10780. * @param {boolean} [options.leading=false]
  10781. * Specify invoking on the leading edge of the timeout.
  10782. * @param {number} [options.maxWait]
  10783. * The maximum time `func` is allowed to be delayed before it's invoked.
  10784. * @param {boolean} [options.trailing=true]
  10785. * Specify invoking on the trailing edge of the timeout.
  10786. * @returns {Function} Returns the new debounced function.
  10787. * @example
  10788. *
  10789. * // Avoid costly calculations while the window size is in flux.
  10790. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10791. *
  10792. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10793. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10794. * 'leading': true,
  10795. * 'trailing': false
  10796. * }));
  10797. *
  10798. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10799. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10800. * var source = new EventSource('/stream');
  10801. * jQuery(source).on('message', debounced);
  10802. *
  10803. * // Cancel the trailing debounced invocation.
  10804. * jQuery(window).on('popstate', debounced.cancel);
  10805. */
  10806. function debounce(func, wait, options) {
  10807. var lastArgs,
  10808. lastThis,
  10809. maxWait,
  10810. result,
  10811. timerId,
  10812. lastCallTime,
  10813. lastInvokeTime = 0,
  10814. leading = false,
  10815. maxing = false,
  10816. trailing = true;
  10817. if (typeof func != 'function') {
  10818. throw new TypeError(FUNC_ERROR_TEXT);
  10819. }
  10820. wait = toNumber(wait) || 0;
  10821. if (isObject(options)) {
  10822. leading = !!options.leading;
  10823. maxing = 'maxWait' in options;
  10824. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10825. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10826. }
  10827. function invokeFunc(time) {
  10828. var args = lastArgs,
  10829. thisArg = lastThis;
  10830. lastArgs = lastThis = undefined;
  10831. lastInvokeTime = time;
  10832. result = func.apply(thisArg, args);
  10833. return result;
  10834. }
  10835. function leadingEdge(time) {
  10836. // Reset any `maxWait` timer.
  10837. lastInvokeTime = time;
  10838. // Start the timer for the trailing edge.
  10839. timerId = setTimeout(timerExpired, wait);
  10840. // Invoke the leading edge.
  10841. return leading ? invokeFunc(time) : result;
  10842. }
  10843. function remainingWait(time) {
  10844. var timeSinceLastCall = time - lastCallTime,
  10845. timeSinceLastInvoke = time - lastInvokeTime,
  10846. timeWaiting = wait - timeSinceLastCall;
  10847. return maxing
  10848. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10849. : timeWaiting;
  10850. }
  10851. function shouldInvoke(time) {
  10852. var timeSinceLastCall = time - lastCallTime,
  10853. timeSinceLastInvoke = time - lastInvokeTime;
  10854. // Either this is the first call, activity has stopped and we're at the
  10855. // trailing edge, the system time has gone backwards and we're treating
  10856. // it as the trailing edge, or we've hit the `maxWait` limit.
  10857. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10858. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10859. }
  10860. function timerExpired() {
  10861. var time = now();
  10862. if (shouldInvoke(time)) {
  10863. return trailingEdge(time);
  10864. }
  10865. // Restart the timer.
  10866. timerId = setTimeout(timerExpired, remainingWait(time));
  10867. }
  10868. function trailingEdge(time) {
  10869. timerId = undefined;
  10870. // Only invoke if we have `lastArgs` which means `func` has been
  10871. // debounced at least once.
  10872. if (trailing && lastArgs) {
  10873. return invokeFunc(time);
  10874. }
  10875. lastArgs = lastThis = undefined;
  10876. return result;
  10877. }
  10878. function cancel() {
  10879. if (timerId !== undefined) {
  10880. clearTimeout(timerId);
  10881. }
  10882. lastInvokeTime = 0;
  10883. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10884. }
  10885. function flush() {
  10886. return timerId === undefined ? result : trailingEdge(now());
  10887. }
  10888. function debounced() {
  10889. var time = now(),
  10890. isInvoking = shouldInvoke(time);
  10891. lastArgs = arguments;
  10892. lastThis = this;
  10893. lastCallTime = time;
  10894. if (isInvoking) {
  10895. if (timerId === undefined) {
  10896. return leadingEdge(lastCallTime);
  10897. }
  10898. if (maxing) {
  10899. // Handle invocations in a tight loop.
  10900. clearTimeout(timerId);
  10901. timerId = setTimeout(timerExpired, wait);
  10902. return invokeFunc(lastCallTime);
  10903. }
  10904. }
  10905. if (timerId === undefined) {
  10906. timerId = setTimeout(timerExpired, wait);
  10907. }
  10908. return result;
  10909. }
  10910. debounced.cancel = cancel;
  10911. debounced.flush = flush;
  10912. return debounced;
  10913. }
  10914. /**
  10915. * Defers invoking the `func` until the current call stack has cleared. Any
  10916. * additional arguments are provided to `func` when it's invoked.
  10917. *
  10918. * @static
  10919. * @memberOf _
  10920. * @since 0.1.0
  10921. * @category Function
  10922. * @param {Function} func The function to defer.
  10923. * @param {...*} [args] The arguments to invoke `func` with.
  10924. * @returns {number} Returns the timer id.
  10925. * @example
  10926. *
  10927. * _.defer(function(text) {
  10928. * console.log(text);
  10929. * }, 'deferred');
  10930. * // => Logs 'deferred' after one millisecond.
  10931. */
  10932. var defer = baseRest(function(func, args) {
  10933. return baseDelay(func, 1, args);
  10934. });
  10935. /**
  10936. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10937. * provided to `func` when it's invoked.
  10938. *
  10939. * @static
  10940. * @memberOf _
  10941. * @since 0.1.0
  10942. * @category Function
  10943. * @param {Function} func The function to delay.
  10944. * @param {number} wait The number of milliseconds to delay invocation.
  10945. * @param {...*} [args] The arguments to invoke `func` with.
  10946. * @returns {number} Returns the timer id.
  10947. * @example
  10948. *
  10949. * _.delay(function(text) {
  10950. * console.log(text);
  10951. * }, 1000, 'later');
  10952. * // => Logs 'later' after one second.
  10953. */
  10954. var delay = baseRest(function(func, wait, args) {
  10955. return baseDelay(func, toNumber(wait) || 0, args);
  10956. });
  10957. /**
  10958. * Creates a function that invokes `func` with arguments reversed.
  10959. *
  10960. * @static
  10961. * @memberOf _
  10962. * @since 4.0.0
  10963. * @category Function
  10964. * @param {Function} func The function to flip arguments for.
  10965. * @returns {Function} Returns the new flipped function.
  10966. * @example
  10967. *
  10968. * var flipped = _.flip(function() {
  10969. * return _.toArray(arguments);
  10970. * });
  10971. *
  10972. * flipped('a', 'b', 'c', 'd');
  10973. * // => ['d', 'c', 'b', 'a']
  10974. */
  10975. function flip(func) {
  10976. return createWrap(func, WRAP_FLIP_FLAG);
  10977. }
  10978. /**
  10979. * Creates a function that memoizes the result of `func`. If `resolver` is
  10980. * provided, it determines the cache key for storing the result based on the
  10981. * arguments provided to the memoized function. By default, the first argument
  10982. * provided to the memoized function is used as the map cache key. The `func`
  10983. * is invoked with the `this` binding of the memoized function.
  10984. *
  10985. * **Note:** The cache is exposed as the `cache` property on the memoized
  10986. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10987. * constructor with one whose instances implement the
  10988. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10989. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10990. *
  10991. * @static
  10992. * @memberOf _
  10993. * @since 0.1.0
  10994. * @category Function
  10995. * @param {Function} func The function to have its output memoized.
  10996. * @param {Function} [resolver] The function to resolve the cache key.
  10997. * @returns {Function} Returns the new memoized function.
  10998. * @example
  10999. *
  11000. * var object = { 'a': 1, 'b': 2 };
  11001. * var other = { 'c': 3, 'd': 4 };
  11002. *
  11003. * var values = _.memoize(_.values);
  11004. * values(object);
  11005. * // => [1, 2]
  11006. *
  11007. * values(other);
  11008. * // => [3, 4]
  11009. *
  11010. * object.a = 2;
  11011. * values(object);
  11012. * // => [1, 2]
  11013. *
  11014. * // Modify the result cache.
  11015. * values.cache.set(object, ['a', 'b']);
  11016. * values(object);
  11017. * // => ['a', 'b']
  11018. *
  11019. * // Replace `_.memoize.Cache`.
  11020. * _.memoize.Cache = WeakMap;
  11021. */
  11022. function memoize(func, resolver) {
  11023. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11024. throw new TypeError(FUNC_ERROR_TEXT);
  11025. }
  11026. var memoized = function() {
  11027. var args = arguments,
  11028. key = resolver ? resolver.apply(this, args) : args[0],
  11029. cache = memoized.cache;
  11030. if (cache.has(key)) {
  11031. return cache.get(key);
  11032. }
  11033. var result = func.apply(this, args);
  11034. memoized.cache = cache.set(key, result) || cache;
  11035. return result;
  11036. };
  11037. memoized.cache = new (memoize.Cache || MapCache);
  11038. return memoized;
  11039. }
  11040. // Expose `MapCache`.
  11041. memoize.Cache = MapCache;
  11042. /**
  11043. * Creates a function that negates the result of the predicate `func`. The
  11044. * `func` predicate is invoked with the `this` binding and arguments of the
  11045. * created function.
  11046. *
  11047. * @static
  11048. * @memberOf _
  11049. * @since 3.0.0
  11050. * @category Function
  11051. * @param {Function} predicate The predicate to negate.
  11052. * @returns {Function} Returns the new negated function.
  11053. * @example
  11054. *
  11055. * function isEven(n) {
  11056. * return n % 2 == 0;
  11057. * }
  11058. *
  11059. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11060. * // => [1, 3, 5]
  11061. */
  11062. function negate(predicate) {
  11063. if (typeof predicate != 'function') {
  11064. throw new TypeError(FUNC_ERROR_TEXT);
  11065. }
  11066. return function() {
  11067. var args = arguments;
  11068. switch (args.length) {
  11069. case 0: return !predicate.call(this);
  11070. case 1: return !predicate.call(this, args[0]);
  11071. case 2: return !predicate.call(this, args[0], args[1]);
  11072. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11073. }
  11074. return !predicate.apply(this, args);
  11075. };
  11076. }
  11077. /**
  11078. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11079. * to the function return the value of the first invocation. The `func` is
  11080. * invoked with the `this` binding and arguments of the created function.
  11081. *
  11082. * @static
  11083. * @memberOf _
  11084. * @since 0.1.0
  11085. * @category Function
  11086. * @param {Function} func The function to restrict.
  11087. * @returns {Function} Returns the new restricted function.
  11088. * @example
  11089. *
  11090. * var initialize = _.once(createApplication);
  11091. * initialize();
  11092. * initialize();
  11093. * // => `createApplication` is invoked once
  11094. */
  11095. function once(func) {
  11096. return before(2, func);
  11097. }
  11098. /**
  11099. * Creates a function that invokes `func` with its arguments transformed.
  11100. *
  11101. * @static
  11102. * @since 4.0.0
  11103. * @memberOf _
  11104. * @category Function
  11105. * @param {Function} func The function to wrap.
  11106. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11107. * The argument transforms.
  11108. * @returns {Function} Returns the new function.
  11109. * @example
  11110. *
  11111. * function doubled(n) {
  11112. * return n * 2;
  11113. * }
  11114. *
  11115. * function square(n) {
  11116. * return n * n;
  11117. * }
  11118. *
  11119. * var func = _.overArgs(function(x, y) {
  11120. * return [x, y];
  11121. * }, [square, doubled]);
  11122. *
  11123. * func(9, 3);
  11124. * // => [81, 6]
  11125. *
  11126. * func(10, 5);
  11127. * // => [100, 10]
  11128. */
  11129. var overArgs = castRest(function(func, transforms) {
  11130. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11131. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11132. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11133. var funcsLength = transforms.length;
  11134. return baseRest(function(args) {
  11135. var index = -1,
  11136. length = nativeMin(args.length, funcsLength);
  11137. while (++index < length) {
  11138. args[index] = transforms[index].call(this, args[index]);
  11139. }
  11140. return apply(func, this, args);
  11141. });
  11142. });
  11143. /**
  11144. * Creates a function that invokes `func` with `partials` prepended to the
  11145. * arguments it receives. This method is like `_.bind` except it does **not**
  11146. * alter the `this` binding.
  11147. *
  11148. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11149. * builds, may be used as a placeholder for partially applied arguments.
  11150. *
  11151. * **Note:** This method doesn't set the "length" property of partially
  11152. * applied functions.
  11153. *
  11154. * @static
  11155. * @memberOf _
  11156. * @since 0.2.0
  11157. * @category Function
  11158. * @param {Function} func The function to partially apply arguments to.
  11159. * @param {...*} [partials] The arguments to be partially applied.
  11160. * @returns {Function} Returns the new partially applied function.
  11161. * @example
  11162. *
  11163. * function greet(greeting, name) {
  11164. * return greeting + ' ' + name;
  11165. * }
  11166. *
  11167. * var sayHelloTo = _.partial(greet, 'hello');
  11168. * sayHelloTo('fred');
  11169. * // => 'hello fred'
  11170. *
  11171. * // Partially applied with placeholders.
  11172. * var greetFred = _.partial(greet, _, 'fred');
  11173. * greetFred('hi');
  11174. * // => 'hi fred'
  11175. */
  11176. var partial = baseRest(function(func, partials) {
  11177. var holders = replaceHolders(partials, getHolder(partial));
  11178. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11179. });
  11180. /**
  11181. * This method is like `_.partial` except that partially applied arguments
  11182. * are appended to the arguments it receives.
  11183. *
  11184. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11185. * builds, may be used as a placeholder for partially applied arguments.
  11186. *
  11187. * **Note:** This method doesn't set the "length" property of partially
  11188. * applied functions.
  11189. *
  11190. * @static
  11191. * @memberOf _
  11192. * @since 1.0.0
  11193. * @category Function
  11194. * @param {Function} func The function to partially apply arguments to.
  11195. * @param {...*} [partials] The arguments to be partially applied.
  11196. * @returns {Function} Returns the new partially applied function.
  11197. * @example
  11198. *
  11199. * function greet(greeting, name) {
  11200. * return greeting + ' ' + name;
  11201. * }
  11202. *
  11203. * var greetFred = _.partialRight(greet, 'fred');
  11204. * greetFred('hi');
  11205. * // => 'hi fred'
  11206. *
  11207. * // Partially applied with placeholders.
  11208. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11209. * sayHelloTo('fred');
  11210. * // => 'hello fred'
  11211. */
  11212. var partialRight = baseRest(function(func, partials) {
  11213. var holders = replaceHolders(partials, getHolder(partialRight));
  11214. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11215. });
  11216. /**
  11217. * Creates a function that invokes `func` with arguments arranged according
  11218. * to the specified `indexes` where the argument value at the first index is
  11219. * provided as the first argument, the argument value at the second index is
  11220. * provided as the second argument, and so on.
  11221. *
  11222. * @static
  11223. * @memberOf _
  11224. * @since 3.0.0
  11225. * @category Function
  11226. * @param {Function} func The function to rearrange arguments for.
  11227. * @param {...(number|number[])} indexes The arranged argument indexes.
  11228. * @returns {Function} Returns the new function.
  11229. * @example
  11230. *
  11231. * var rearged = _.rearg(function(a, b, c) {
  11232. * return [a, b, c];
  11233. * }, [2, 0, 1]);
  11234. *
  11235. * rearged('b', 'c', 'a')
  11236. * // => ['a', 'b', 'c']
  11237. */
  11238. var rearg = flatRest(function(func, indexes) {
  11239. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11240. });
  11241. /**
  11242. * Creates a function that invokes `func` with the `this` binding of the
  11243. * created function and arguments from `start` and beyond provided as
  11244. * an array.
  11245. *
  11246. * **Note:** This method is based on the
  11247. * [rest parameter](https://mdn.io/rest_parameters).
  11248. *
  11249. * @static
  11250. * @memberOf _
  11251. * @since 4.0.0
  11252. * @category Function
  11253. * @param {Function} func The function to apply a rest parameter to.
  11254. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11255. * @returns {Function} Returns the new function.
  11256. * @example
  11257. *
  11258. * var say = _.rest(function(what, names) {
  11259. * return what + ' ' + _.initial(names).join(', ') +
  11260. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11261. * });
  11262. *
  11263. * say('hello', 'fred', 'barney', 'pebbles');
  11264. * // => 'hello fred, barney, & pebbles'
  11265. */
  11266. function rest(func, start) {
  11267. if (typeof func != 'function') {
  11268. throw new TypeError(FUNC_ERROR_TEXT);
  11269. }
  11270. start = start === undefined ? start : toInteger(start);
  11271. return baseRest(func, start);
  11272. }
  11273. /**
  11274. * Creates a function that invokes `func` with the `this` binding of the
  11275. * create function and an array of arguments much like
  11276. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11277. *
  11278. * **Note:** This method is based on the
  11279. * [spread operator](https://mdn.io/spread_operator).
  11280. *
  11281. * @static
  11282. * @memberOf _
  11283. * @since 3.2.0
  11284. * @category Function
  11285. * @param {Function} func The function to spread arguments over.
  11286. * @param {number} [start=0] The start position of the spread.
  11287. * @returns {Function} Returns the new function.
  11288. * @example
  11289. *
  11290. * var say = _.spread(function(who, what) {
  11291. * return who + ' says ' + what;
  11292. * });
  11293. *
  11294. * say(['fred', 'hello']);
  11295. * // => 'fred says hello'
  11296. *
  11297. * var numbers = Promise.all([
  11298. * Promise.resolve(40),
  11299. * Promise.resolve(36)
  11300. * ]);
  11301. *
  11302. * numbers.then(_.spread(function(x, y) {
  11303. * return x + y;
  11304. * }));
  11305. * // => a Promise of 76
  11306. */
  11307. function spread(func, start) {
  11308. if (typeof func != 'function') {
  11309. throw new TypeError(FUNC_ERROR_TEXT);
  11310. }
  11311. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11312. return baseRest(function(args) {
  11313. var array = args[start],
  11314. otherArgs = castSlice(args, 0, start);
  11315. if (array) {
  11316. arrayPush(otherArgs, array);
  11317. }
  11318. return apply(func, this, otherArgs);
  11319. });
  11320. }
  11321. /**
  11322. * Creates a throttled function that only invokes `func` at most once per
  11323. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11324. * method to cancel delayed `func` invocations and a `flush` method to
  11325. * immediately invoke them. Provide `options` to indicate whether `func`
  11326. * should be invoked on the leading and/or trailing edge of the `wait`
  11327. * timeout. The `func` is invoked with the last arguments provided to the
  11328. * throttled function. Subsequent calls to the throttled function return the
  11329. * result of the last `func` invocation.
  11330. *
  11331. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11332. * invoked on the trailing edge of the timeout only if the throttled function
  11333. * is invoked more than once during the `wait` timeout.
  11334. *
  11335. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11336. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11337. *
  11338. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11339. * for details over the differences between `_.throttle` and `_.debounce`.
  11340. *
  11341. * @static
  11342. * @memberOf _
  11343. * @since 0.1.0
  11344. * @category Function
  11345. * @param {Function} func The function to throttle.
  11346. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11347. * @param {Object} [options={}] The options object.
  11348. * @param {boolean} [options.leading=true]
  11349. * Specify invoking on the leading edge of the timeout.
  11350. * @param {boolean} [options.trailing=true]
  11351. * Specify invoking on the trailing edge of the timeout.
  11352. * @returns {Function} Returns the new throttled function.
  11353. * @example
  11354. *
  11355. * // Avoid excessively updating the position while scrolling.
  11356. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11357. *
  11358. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11359. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11360. * jQuery(element).on('click', throttled);
  11361. *
  11362. * // Cancel the trailing throttled invocation.
  11363. * jQuery(window).on('popstate', throttled.cancel);
  11364. */
  11365. function throttle(func, wait, options) {
  11366. var leading = true,
  11367. trailing = true;
  11368. if (typeof func != 'function') {
  11369. throw new TypeError(FUNC_ERROR_TEXT);
  11370. }
  11371. if (isObject(options)) {
  11372. leading = 'leading' in options ? !!options.leading : leading;
  11373. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11374. }
  11375. return debounce(func, wait, {
  11376. 'leading': leading,
  11377. 'maxWait': wait,
  11378. 'trailing': trailing
  11379. });
  11380. }
  11381. /**
  11382. * Creates a function that accepts up to one argument, ignoring any
  11383. * additional arguments.
  11384. *
  11385. * @static
  11386. * @memberOf _
  11387. * @since 4.0.0
  11388. * @category Function
  11389. * @param {Function} func The function to cap arguments for.
  11390. * @returns {Function} Returns the new capped function.
  11391. * @example
  11392. *
  11393. * _.map(['6', '8', '10'], _.unary(parseInt));
  11394. * // => [6, 8, 10]
  11395. */
  11396. function unary(func) {
  11397. return ary(func, 1);
  11398. }
  11399. /**
  11400. * Creates a function that provides `value` to `wrapper` as its first
  11401. * argument. Any additional arguments provided to the function are appended
  11402. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11403. * binding of the created function.
  11404. *
  11405. * @static
  11406. * @memberOf _
  11407. * @since 0.1.0
  11408. * @category Function
  11409. * @param {*} value The value to wrap.
  11410. * @param {Function} [wrapper=identity] The wrapper function.
  11411. * @returns {Function} Returns the new function.
  11412. * @example
  11413. *
  11414. * var p = _.wrap(_.escape, function(func, text) {
  11415. * return '<p>' + func(text) + '</p>';
  11416. * });
  11417. *
  11418. * p('fred, barney, & pebbles');
  11419. * // => '<p>fred, barney, &amp; pebbles</p>'
  11420. */
  11421. function wrap(value, wrapper) {
  11422. return partial(castFunction(wrapper), value);
  11423. }
  11424. /*------------------------------------------------------------------------*/
  11425. /**
  11426. * Casts `value` as an array if it's not one.
  11427. *
  11428. * @static
  11429. * @memberOf _
  11430. * @since 4.4.0
  11431. * @category Lang
  11432. * @param {*} value The value to inspect.
  11433. * @returns {Array} Returns the cast array.
  11434. * @example
  11435. *
  11436. * _.castArray(1);
  11437. * // => [1]
  11438. *
  11439. * _.castArray({ 'a': 1 });
  11440. * // => [{ 'a': 1 }]
  11441. *
  11442. * _.castArray('abc');
  11443. * // => ['abc']
  11444. *
  11445. * _.castArray(null);
  11446. * // => [null]
  11447. *
  11448. * _.castArray(undefined);
  11449. * // => [undefined]
  11450. *
  11451. * _.castArray();
  11452. * // => []
  11453. *
  11454. * var array = [1, 2, 3];
  11455. * console.log(_.castArray(array) === array);
  11456. * // => true
  11457. */
  11458. function castArray() {
  11459. if (!arguments.length) {
  11460. return [];
  11461. }
  11462. var value = arguments[0];
  11463. return isArray(value) ? value : [value];
  11464. }
  11465. /**
  11466. * Creates a shallow clone of `value`.
  11467. *
  11468. * **Note:** This method is loosely based on the
  11469. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11470. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11471. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11472. * arrays. The own enumerable properties of `arguments` objects are cloned
  11473. * as plain objects. An empty object is returned for uncloneable values such
  11474. * as error objects, functions, DOM nodes, and WeakMaps.
  11475. *
  11476. * @static
  11477. * @memberOf _
  11478. * @since 0.1.0
  11479. * @category Lang
  11480. * @param {*} value The value to clone.
  11481. * @returns {*} Returns the cloned value.
  11482. * @see _.cloneDeep
  11483. * @example
  11484. *
  11485. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11486. *
  11487. * var shallow = _.clone(objects);
  11488. * console.log(shallow[0] === objects[0]);
  11489. * // => true
  11490. */
  11491. function clone(value) {
  11492. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11493. }
  11494. /**
  11495. * This method is like `_.clone` except that it accepts `customizer` which
  11496. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11497. * cloning is handled by the method instead. The `customizer` is invoked with
  11498. * up to four arguments; (value [, index|key, object, stack]).
  11499. *
  11500. * @static
  11501. * @memberOf _
  11502. * @since 4.0.0
  11503. * @category Lang
  11504. * @param {*} value The value to clone.
  11505. * @param {Function} [customizer] The function to customize cloning.
  11506. * @returns {*} Returns the cloned value.
  11507. * @see _.cloneDeepWith
  11508. * @example
  11509. *
  11510. * function customizer(value) {
  11511. * if (_.isElement(value)) {
  11512. * return value.cloneNode(false);
  11513. * }
  11514. * }
  11515. *
  11516. * var el = _.cloneWith(document.body, customizer);
  11517. *
  11518. * console.log(el === document.body);
  11519. * // => false
  11520. * console.log(el.nodeName);
  11521. * // => 'BODY'
  11522. * console.log(el.childNodes.length);
  11523. * // => 0
  11524. */
  11525. function cloneWith(value, customizer) {
  11526. customizer = typeof customizer == 'function' ? customizer : undefined;
  11527. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11528. }
  11529. /**
  11530. * This method is like `_.clone` except that it recursively clones `value`.
  11531. *
  11532. * @static
  11533. * @memberOf _
  11534. * @since 1.0.0
  11535. * @category Lang
  11536. * @param {*} value The value to recursively clone.
  11537. * @returns {*} Returns the deep cloned value.
  11538. * @see _.clone
  11539. * @example
  11540. *
  11541. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11542. *
  11543. * var deep = _.cloneDeep(objects);
  11544. * console.log(deep[0] === objects[0]);
  11545. * // => false
  11546. */
  11547. function cloneDeep(value) {
  11548. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11549. }
  11550. /**
  11551. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11552. *
  11553. * @static
  11554. * @memberOf _
  11555. * @since 4.0.0
  11556. * @category Lang
  11557. * @param {*} value The value to recursively clone.
  11558. * @param {Function} [customizer] The function to customize cloning.
  11559. * @returns {*} Returns the deep cloned value.
  11560. * @see _.cloneWith
  11561. * @example
  11562. *
  11563. * function customizer(value) {
  11564. * if (_.isElement(value)) {
  11565. * return value.cloneNode(true);
  11566. * }
  11567. * }
  11568. *
  11569. * var el = _.cloneDeepWith(document.body, customizer);
  11570. *
  11571. * console.log(el === document.body);
  11572. * // => false
  11573. * console.log(el.nodeName);
  11574. * // => 'BODY'
  11575. * console.log(el.childNodes.length);
  11576. * // => 20
  11577. */
  11578. function cloneDeepWith(value, customizer) {
  11579. customizer = typeof customizer == 'function' ? customizer : undefined;
  11580. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11581. }
  11582. /**
  11583. * Checks if `object` conforms to `source` by invoking the predicate
  11584. * properties of `source` with the corresponding property values of `object`.
  11585. *
  11586. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11587. * partially applied.
  11588. *
  11589. * @static
  11590. * @memberOf _
  11591. * @since 4.14.0
  11592. * @category Lang
  11593. * @param {Object} object The object to inspect.
  11594. * @param {Object} source The object of property predicates to conform to.
  11595. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11596. * @example
  11597. *
  11598. * var object = { 'a': 1, 'b': 2 };
  11599. *
  11600. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11601. * // => true
  11602. *
  11603. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11604. * // => false
  11605. */
  11606. function conformsTo(object, source) {
  11607. return source == null || baseConformsTo(object, source, keys(source));
  11608. }
  11609. /**
  11610. * Performs a
  11611. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11612. * comparison between two values to determine if they are equivalent.
  11613. *
  11614. * @static
  11615. * @memberOf _
  11616. * @since 4.0.0
  11617. * @category Lang
  11618. * @param {*} value The value to compare.
  11619. * @param {*} other The other value to compare.
  11620. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11621. * @example
  11622. *
  11623. * var object = { 'a': 1 };
  11624. * var other = { 'a': 1 };
  11625. *
  11626. * _.eq(object, object);
  11627. * // => true
  11628. *
  11629. * _.eq(object, other);
  11630. * // => false
  11631. *
  11632. * _.eq('a', 'a');
  11633. * // => true
  11634. *
  11635. * _.eq('a', Object('a'));
  11636. * // => false
  11637. *
  11638. * _.eq(NaN, NaN);
  11639. * // => true
  11640. */
  11641. function eq(value, other) {
  11642. return value === other || (value !== value && other !== other);
  11643. }
  11644. /**
  11645. * Checks if `value` is greater than `other`.
  11646. *
  11647. * @static
  11648. * @memberOf _
  11649. * @since 3.9.0
  11650. * @category Lang
  11651. * @param {*} value The value to compare.
  11652. * @param {*} other The other value to compare.
  11653. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11654. * else `false`.
  11655. * @see _.lt
  11656. * @example
  11657. *
  11658. * _.gt(3, 1);
  11659. * // => true
  11660. *
  11661. * _.gt(3, 3);
  11662. * // => false
  11663. *
  11664. * _.gt(1, 3);
  11665. * // => false
  11666. */
  11667. var gt = createRelationalOperation(baseGt);
  11668. /**
  11669. * Checks if `value` is greater than or equal to `other`.
  11670. *
  11671. * @static
  11672. * @memberOf _
  11673. * @since 3.9.0
  11674. * @category Lang
  11675. * @param {*} value The value to compare.
  11676. * @param {*} other The other value to compare.
  11677. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11678. * `other`, else `false`.
  11679. * @see _.lte
  11680. * @example
  11681. *
  11682. * _.gte(3, 1);
  11683. * // => true
  11684. *
  11685. * _.gte(3, 3);
  11686. * // => true
  11687. *
  11688. * _.gte(1, 3);
  11689. * // => false
  11690. */
  11691. var gte = createRelationalOperation(function(value, other) {
  11692. return value >= other;
  11693. });
  11694. /**
  11695. * Checks if `value` is likely an `arguments` object.
  11696. *
  11697. * @static
  11698. * @memberOf _
  11699. * @since 0.1.0
  11700. * @category Lang
  11701. * @param {*} value The value to check.
  11702. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11703. * else `false`.
  11704. * @example
  11705. *
  11706. * _.isArguments(function() { return arguments; }());
  11707. * // => true
  11708. *
  11709. * _.isArguments([1, 2, 3]);
  11710. * // => false
  11711. */
  11712. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11713. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11714. !propertyIsEnumerable.call(value, 'callee');
  11715. };
  11716. /**
  11717. * Checks if `value` is classified as an `Array` object.
  11718. *
  11719. * @static
  11720. * @memberOf _
  11721. * @since 0.1.0
  11722. * @category Lang
  11723. * @param {*} value The value to check.
  11724. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11725. * @example
  11726. *
  11727. * _.isArray([1, 2, 3]);
  11728. * // => true
  11729. *
  11730. * _.isArray(document.body.children);
  11731. * // => false
  11732. *
  11733. * _.isArray('abc');
  11734. * // => false
  11735. *
  11736. * _.isArray(_.noop);
  11737. * // => false
  11738. */
  11739. var isArray = Array.isArray;
  11740. /**
  11741. * Checks if `value` is classified as an `ArrayBuffer` object.
  11742. *
  11743. * @static
  11744. * @memberOf _
  11745. * @since 4.3.0
  11746. * @category Lang
  11747. * @param {*} value The value to check.
  11748. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11749. * @example
  11750. *
  11751. * _.isArrayBuffer(new ArrayBuffer(2));
  11752. * // => true
  11753. *
  11754. * _.isArrayBuffer(new Array(2));
  11755. * // => false
  11756. */
  11757. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11758. /**
  11759. * Checks if `value` is array-like. A value is considered array-like if it's
  11760. * not a function and has a `value.length` that's an integer greater than or
  11761. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11762. *
  11763. * @static
  11764. * @memberOf _
  11765. * @since 4.0.0
  11766. * @category Lang
  11767. * @param {*} value The value to check.
  11768. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11769. * @example
  11770. *
  11771. * _.isArrayLike([1, 2, 3]);
  11772. * // => true
  11773. *
  11774. * _.isArrayLike(document.body.children);
  11775. * // => true
  11776. *
  11777. * _.isArrayLike('abc');
  11778. * // => true
  11779. *
  11780. * _.isArrayLike(_.noop);
  11781. * // => false
  11782. */
  11783. function isArrayLike(value) {
  11784. return value != null && isLength(value.length) && !isFunction(value);
  11785. }
  11786. /**
  11787. * This method is like `_.isArrayLike` except that it also checks if `value`
  11788. * is an object.
  11789. *
  11790. * @static
  11791. * @memberOf _
  11792. * @since 4.0.0
  11793. * @category Lang
  11794. * @param {*} value The value to check.
  11795. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11796. * else `false`.
  11797. * @example
  11798. *
  11799. * _.isArrayLikeObject([1, 2, 3]);
  11800. * // => true
  11801. *
  11802. * _.isArrayLikeObject(document.body.children);
  11803. * // => true
  11804. *
  11805. * _.isArrayLikeObject('abc');
  11806. * // => false
  11807. *
  11808. * _.isArrayLikeObject(_.noop);
  11809. * // => false
  11810. */
  11811. function isArrayLikeObject(value) {
  11812. return isObjectLike(value) && isArrayLike(value);
  11813. }
  11814. /**
  11815. * Checks if `value` is classified as a boolean primitive or object.
  11816. *
  11817. * @static
  11818. * @memberOf _
  11819. * @since 0.1.0
  11820. * @category Lang
  11821. * @param {*} value The value to check.
  11822. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11823. * @example
  11824. *
  11825. * _.isBoolean(false);
  11826. * // => true
  11827. *
  11828. * _.isBoolean(null);
  11829. * // => false
  11830. */
  11831. function isBoolean(value) {
  11832. return value === true || value === false ||
  11833. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11834. }
  11835. /**
  11836. * Checks if `value` is a buffer.
  11837. *
  11838. * @static
  11839. * @memberOf _
  11840. * @since 4.3.0
  11841. * @category Lang
  11842. * @param {*} value The value to check.
  11843. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11844. * @example
  11845. *
  11846. * _.isBuffer(new Buffer(2));
  11847. * // => true
  11848. *
  11849. * _.isBuffer(new Uint8Array(2));
  11850. * // => false
  11851. */
  11852. var isBuffer = nativeIsBuffer || stubFalse;
  11853. /**
  11854. * Checks if `value` is classified as a `Date` object.
  11855. *
  11856. * @static
  11857. * @memberOf _
  11858. * @since 0.1.0
  11859. * @category Lang
  11860. * @param {*} value The value to check.
  11861. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11862. * @example
  11863. *
  11864. * _.isDate(new Date);
  11865. * // => true
  11866. *
  11867. * _.isDate('Mon April 23 2012');
  11868. * // => false
  11869. */
  11870. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11871. /**
  11872. * Checks if `value` is likely a DOM element.
  11873. *
  11874. * @static
  11875. * @memberOf _
  11876. * @since 0.1.0
  11877. * @category Lang
  11878. * @param {*} value The value to check.
  11879. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11880. * @example
  11881. *
  11882. * _.isElement(document.body);
  11883. * // => true
  11884. *
  11885. * _.isElement('<body>');
  11886. * // => false
  11887. */
  11888. function isElement(value) {
  11889. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11890. }
  11891. /**
  11892. * Checks if `value` is an empty object, collection, map, or set.
  11893. *
  11894. * Objects are considered empty if they have no own enumerable string keyed
  11895. * properties.
  11896. *
  11897. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11898. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11899. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11900. *
  11901. * @static
  11902. * @memberOf _
  11903. * @since 0.1.0
  11904. * @category Lang
  11905. * @param {*} value The value to check.
  11906. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11907. * @example
  11908. *
  11909. * _.isEmpty(null);
  11910. * // => true
  11911. *
  11912. * _.isEmpty(true);
  11913. * // => true
  11914. *
  11915. * _.isEmpty(1);
  11916. * // => true
  11917. *
  11918. * _.isEmpty([1, 2, 3]);
  11919. * // => false
  11920. *
  11921. * _.isEmpty({ 'a': 1 });
  11922. * // => false
  11923. */
  11924. function isEmpty(value) {
  11925. if (value == null) {
  11926. return true;
  11927. }
  11928. if (isArrayLike(value) &&
  11929. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11930. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11931. return !value.length;
  11932. }
  11933. var tag = getTag(value);
  11934. if (tag == mapTag || tag == setTag) {
  11935. return !value.size;
  11936. }
  11937. if (isPrototype(value)) {
  11938. return !baseKeys(value).length;
  11939. }
  11940. for (var key in value) {
  11941. if (hasOwnProperty.call(value, key)) {
  11942. return false;
  11943. }
  11944. }
  11945. return true;
  11946. }
  11947. /**
  11948. * Performs a deep comparison between two values to determine if they are
  11949. * equivalent.
  11950. *
  11951. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11952. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11953. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11954. * by their own, not inherited, enumerable properties. Functions and DOM
  11955. * nodes are compared by strict equality, i.e. `===`.
  11956. *
  11957. * @static
  11958. * @memberOf _
  11959. * @since 0.1.0
  11960. * @category Lang
  11961. * @param {*} value The value to compare.
  11962. * @param {*} other The other value to compare.
  11963. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11964. * @example
  11965. *
  11966. * var object = { 'a': 1 };
  11967. * var other = { 'a': 1 };
  11968. *
  11969. * _.isEqual(object, other);
  11970. * // => true
  11971. *
  11972. * object === other;
  11973. * // => false
  11974. */
  11975. function isEqual(value, other) {
  11976. return baseIsEqual(value, other);
  11977. }
  11978. /**
  11979. * This method is like `_.isEqual` except that it accepts `customizer` which
  11980. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11981. * are handled by the method instead. The `customizer` is invoked with up to
  11982. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11983. *
  11984. * @static
  11985. * @memberOf _
  11986. * @since 4.0.0
  11987. * @category Lang
  11988. * @param {*} value The value to compare.
  11989. * @param {*} other The other value to compare.
  11990. * @param {Function} [customizer] The function to customize comparisons.
  11991. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11992. * @example
  11993. *
  11994. * function isGreeting(value) {
  11995. * return /^h(?:i|ello)$/.test(value);
  11996. * }
  11997. *
  11998. * function customizer(objValue, othValue) {
  11999. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12000. * return true;
  12001. * }
  12002. * }
  12003. *
  12004. * var array = ['hello', 'goodbye'];
  12005. * var other = ['hi', 'goodbye'];
  12006. *
  12007. * _.isEqualWith(array, other, customizer);
  12008. * // => true
  12009. */
  12010. function isEqualWith(value, other, customizer) {
  12011. customizer = typeof customizer == 'function' ? customizer : undefined;
  12012. var result = customizer ? customizer(value, other) : undefined;
  12013. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12014. }
  12015. /**
  12016. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12017. * `SyntaxError`, `TypeError`, or `URIError` object.
  12018. *
  12019. * @static
  12020. * @memberOf _
  12021. * @since 3.0.0
  12022. * @category Lang
  12023. * @param {*} value The value to check.
  12024. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12025. * @example
  12026. *
  12027. * _.isError(new Error);
  12028. * // => true
  12029. *
  12030. * _.isError(Error);
  12031. * // => false
  12032. */
  12033. function isError(value) {
  12034. if (!isObjectLike(value)) {
  12035. return false;
  12036. }
  12037. var tag = baseGetTag(value);
  12038. return tag == errorTag || tag == domExcTag ||
  12039. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12040. }
  12041. /**
  12042. * Checks if `value` is a finite primitive number.
  12043. *
  12044. * **Note:** This method is based on
  12045. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12046. *
  12047. * @static
  12048. * @memberOf _
  12049. * @since 0.1.0
  12050. * @category Lang
  12051. * @param {*} value The value to check.
  12052. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12053. * @example
  12054. *
  12055. * _.isFinite(3);
  12056. * // => true
  12057. *
  12058. * _.isFinite(Number.MIN_VALUE);
  12059. * // => true
  12060. *
  12061. * _.isFinite(Infinity);
  12062. * // => false
  12063. *
  12064. * _.isFinite('3');
  12065. * // => false
  12066. */
  12067. function isFinite(value) {
  12068. return typeof value == 'number' && nativeIsFinite(value);
  12069. }
  12070. /**
  12071. * Checks if `value` is classified as a `Function` object.
  12072. *
  12073. * @static
  12074. * @memberOf _
  12075. * @since 0.1.0
  12076. * @category Lang
  12077. * @param {*} value The value to check.
  12078. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12079. * @example
  12080. *
  12081. * _.isFunction(_);
  12082. * // => true
  12083. *
  12084. * _.isFunction(/abc/);
  12085. * // => false
  12086. */
  12087. function isFunction(value) {
  12088. if (!isObject(value)) {
  12089. return false;
  12090. }
  12091. // The use of `Object#toString` avoids issues with the `typeof` operator
  12092. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12093. var tag = baseGetTag(value);
  12094. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12095. }
  12096. /**
  12097. * Checks if `value` is an integer.
  12098. *
  12099. * **Note:** This method is based on
  12100. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12101. *
  12102. * @static
  12103. * @memberOf _
  12104. * @since 4.0.0
  12105. * @category Lang
  12106. * @param {*} value The value to check.
  12107. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12108. * @example
  12109. *
  12110. * _.isInteger(3);
  12111. * // => true
  12112. *
  12113. * _.isInteger(Number.MIN_VALUE);
  12114. * // => false
  12115. *
  12116. * _.isInteger(Infinity);
  12117. * // => false
  12118. *
  12119. * _.isInteger('3');
  12120. * // => false
  12121. */
  12122. function isInteger(value) {
  12123. return typeof value == 'number' && value == toInteger(value);
  12124. }
  12125. /**
  12126. * Checks if `value` is a valid array-like length.
  12127. *
  12128. * **Note:** This method is loosely based on
  12129. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12130. *
  12131. * @static
  12132. * @memberOf _
  12133. * @since 4.0.0
  12134. * @category Lang
  12135. * @param {*} value The value to check.
  12136. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12137. * @example
  12138. *
  12139. * _.isLength(3);
  12140. * // => true
  12141. *
  12142. * _.isLength(Number.MIN_VALUE);
  12143. * // => false
  12144. *
  12145. * _.isLength(Infinity);
  12146. * // => false
  12147. *
  12148. * _.isLength('3');
  12149. * // => false
  12150. */
  12151. function isLength(value) {
  12152. return typeof value == 'number' &&
  12153. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12154. }
  12155. /**
  12156. * Checks if `value` is the
  12157. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12158. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12159. *
  12160. * @static
  12161. * @memberOf _
  12162. * @since 0.1.0
  12163. * @category Lang
  12164. * @param {*} value The value to check.
  12165. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12166. * @example
  12167. *
  12168. * _.isObject({});
  12169. * // => true
  12170. *
  12171. * _.isObject([1, 2, 3]);
  12172. * // => true
  12173. *
  12174. * _.isObject(_.noop);
  12175. * // => true
  12176. *
  12177. * _.isObject(null);
  12178. * // => false
  12179. */
  12180. function isObject(value) {
  12181. var type = typeof value;
  12182. return value != null && (type == 'object' || type == 'function');
  12183. }
  12184. /**
  12185. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12186. * and has a `typeof` result of "object".
  12187. *
  12188. * @static
  12189. * @memberOf _
  12190. * @since 4.0.0
  12191. * @category Lang
  12192. * @param {*} value The value to check.
  12193. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12194. * @example
  12195. *
  12196. * _.isObjectLike({});
  12197. * // => true
  12198. *
  12199. * _.isObjectLike([1, 2, 3]);
  12200. * // => true
  12201. *
  12202. * _.isObjectLike(_.noop);
  12203. * // => false
  12204. *
  12205. * _.isObjectLike(null);
  12206. * // => false
  12207. */
  12208. function isObjectLike(value) {
  12209. return value != null && typeof value == 'object';
  12210. }
  12211. /**
  12212. * Checks if `value` is classified as a `Map` object.
  12213. *
  12214. * @static
  12215. * @memberOf _
  12216. * @since 4.3.0
  12217. * @category Lang
  12218. * @param {*} value The value to check.
  12219. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12220. * @example
  12221. *
  12222. * _.isMap(new Map);
  12223. * // => true
  12224. *
  12225. * _.isMap(new WeakMap);
  12226. * // => false
  12227. */
  12228. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12229. /**
  12230. * Performs a partial deep comparison between `object` and `source` to
  12231. * determine if `object` contains equivalent property values.
  12232. *
  12233. * **Note:** This method is equivalent to `_.matches` when `source` is
  12234. * partially applied.
  12235. *
  12236. * Partial comparisons will match empty array and empty object `source`
  12237. * values against any array or object value, respectively. See `_.isEqual`
  12238. * for a list of supported value comparisons.
  12239. *
  12240. * @static
  12241. * @memberOf _
  12242. * @since 3.0.0
  12243. * @category Lang
  12244. * @param {Object} object The object to inspect.
  12245. * @param {Object} source The object of property values to match.
  12246. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12247. * @example
  12248. *
  12249. * var object = { 'a': 1, 'b': 2 };
  12250. *
  12251. * _.isMatch(object, { 'b': 2 });
  12252. * // => true
  12253. *
  12254. * _.isMatch(object, { 'b': 1 });
  12255. * // => false
  12256. */
  12257. function isMatch(object, source) {
  12258. return object === source || baseIsMatch(object, source, getMatchData(source));
  12259. }
  12260. /**
  12261. * This method is like `_.isMatch` except that it accepts `customizer` which
  12262. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12263. * are handled by the method instead. The `customizer` is invoked with five
  12264. * arguments: (objValue, srcValue, index|key, object, source).
  12265. *
  12266. * @static
  12267. * @memberOf _
  12268. * @since 4.0.0
  12269. * @category Lang
  12270. * @param {Object} object The object to inspect.
  12271. * @param {Object} source The object of property values to match.
  12272. * @param {Function} [customizer] The function to customize comparisons.
  12273. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12274. * @example
  12275. *
  12276. * function isGreeting(value) {
  12277. * return /^h(?:i|ello)$/.test(value);
  12278. * }
  12279. *
  12280. * function customizer(objValue, srcValue) {
  12281. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12282. * return true;
  12283. * }
  12284. * }
  12285. *
  12286. * var object = { 'greeting': 'hello' };
  12287. * var source = { 'greeting': 'hi' };
  12288. *
  12289. * _.isMatchWith(object, source, customizer);
  12290. * // => true
  12291. */
  12292. function isMatchWith(object, source, customizer) {
  12293. customizer = typeof customizer == 'function' ? customizer : undefined;
  12294. return baseIsMatch(object, source, getMatchData(source), customizer);
  12295. }
  12296. /**
  12297. * Checks if `value` is `NaN`.
  12298. *
  12299. * **Note:** This method is based on
  12300. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12301. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12302. * `undefined` and other non-number values.
  12303. *
  12304. * @static
  12305. * @memberOf _
  12306. * @since 0.1.0
  12307. * @category Lang
  12308. * @param {*} value The value to check.
  12309. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12310. * @example
  12311. *
  12312. * _.isNaN(NaN);
  12313. * // => true
  12314. *
  12315. * _.isNaN(new Number(NaN));
  12316. * // => true
  12317. *
  12318. * isNaN(undefined);
  12319. * // => true
  12320. *
  12321. * _.isNaN(undefined);
  12322. * // => false
  12323. */
  12324. function isNaN(value) {
  12325. // An `NaN` primitive is the only value that is not equal to itself.
  12326. // Perform the `toStringTag` check first to avoid errors with some
  12327. // ActiveX objects in IE.
  12328. return isNumber(value) && value != +value;
  12329. }
  12330. /**
  12331. * Checks if `value` is a pristine native function.
  12332. *
  12333. * **Note:** This method can't reliably detect native functions in the presence
  12334. * of the core-js package because core-js circumvents this kind of detection.
  12335. * Despite multiple requests, the core-js maintainer has made it clear: any
  12336. * attempt to fix the detection will be obstructed. As a result, we're left
  12337. * with little choice but to throw an error. Unfortunately, this also affects
  12338. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12339. * which rely on core-js.
  12340. *
  12341. * @static
  12342. * @memberOf _
  12343. * @since 3.0.0
  12344. * @category Lang
  12345. * @param {*} value The value to check.
  12346. * @returns {boolean} Returns `true` if `value` is a native function,
  12347. * else `false`.
  12348. * @example
  12349. *
  12350. * _.isNative(Array.prototype.push);
  12351. * // => true
  12352. *
  12353. * _.isNative(_);
  12354. * // => false
  12355. */
  12356. function isNative(value) {
  12357. if (isMaskable(value)) {
  12358. throw new Error(CORE_ERROR_TEXT);
  12359. }
  12360. return baseIsNative(value);
  12361. }
  12362. /**
  12363. * Checks if `value` is `null`.
  12364. *
  12365. * @static
  12366. * @memberOf _
  12367. * @since 0.1.0
  12368. * @category Lang
  12369. * @param {*} value The value to check.
  12370. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12371. * @example
  12372. *
  12373. * _.isNull(null);
  12374. * // => true
  12375. *
  12376. * _.isNull(void 0);
  12377. * // => false
  12378. */
  12379. function isNull(value) {
  12380. return value === null;
  12381. }
  12382. /**
  12383. * Checks if `value` is `null` or `undefined`.
  12384. *
  12385. * @static
  12386. * @memberOf _
  12387. * @since 4.0.0
  12388. * @category Lang
  12389. * @param {*} value The value to check.
  12390. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12391. * @example
  12392. *
  12393. * _.isNil(null);
  12394. * // => true
  12395. *
  12396. * _.isNil(void 0);
  12397. * // => true
  12398. *
  12399. * _.isNil(NaN);
  12400. * // => false
  12401. */
  12402. function isNil(value) {
  12403. return value == null;
  12404. }
  12405. /**
  12406. * Checks if `value` is classified as a `Number` primitive or object.
  12407. *
  12408. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12409. * classified as numbers, use the `_.isFinite` method.
  12410. *
  12411. * @static
  12412. * @memberOf _
  12413. * @since 0.1.0
  12414. * @category Lang
  12415. * @param {*} value The value to check.
  12416. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12417. * @example
  12418. *
  12419. * _.isNumber(3);
  12420. * // => true
  12421. *
  12422. * _.isNumber(Number.MIN_VALUE);
  12423. * // => true
  12424. *
  12425. * _.isNumber(Infinity);
  12426. * // => true
  12427. *
  12428. * _.isNumber('3');
  12429. * // => false
  12430. */
  12431. function isNumber(value) {
  12432. return typeof value == 'number' ||
  12433. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12434. }
  12435. /**
  12436. * Checks if `value` is a plain object, that is, an object created by the
  12437. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12438. *
  12439. * @static
  12440. * @memberOf _
  12441. * @since 0.8.0
  12442. * @category Lang
  12443. * @param {*} value The value to check.
  12444. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12445. * @example
  12446. *
  12447. * function Foo() {
  12448. * this.a = 1;
  12449. * }
  12450. *
  12451. * _.isPlainObject(new Foo);
  12452. * // => false
  12453. *
  12454. * _.isPlainObject([1, 2, 3]);
  12455. * // => false
  12456. *
  12457. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12458. * // => true
  12459. *
  12460. * _.isPlainObject(Object.create(null));
  12461. * // => true
  12462. */
  12463. function isPlainObject(value) {
  12464. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12465. return false;
  12466. }
  12467. var proto = getPrototype(value);
  12468. if (proto === null) {
  12469. return true;
  12470. }
  12471. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12472. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12473. funcToString.call(Ctor) == objectCtorString;
  12474. }
  12475. /**
  12476. * Checks if `value` is classified as a `RegExp` object.
  12477. *
  12478. * @static
  12479. * @memberOf _
  12480. * @since 0.1.0
  12481. * @category Lang
  12482. * @param {*} value The value to check.
  12483. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12484. * @example
  12485. *
  12486. * _.isRegExp(/abc/);
  12487. * // => true
  12488. *
  12489. * _.isRegExp('/abc/');
  12490. * // => false
  12491. */
  12492. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12493. /**
  12494. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12495. * double precision number which isn't the result of a rounded unsafe integer.
  12496. *
  12497. * **Note:** This method is based on
  12498. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12499. *
  12500. * @static
  12501. * @memberOf _
  12502. * @since 4.0.0
  12503. * @category Lang
  12504. * @param {*} value The value to check.
  12505. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12506. * @example
  12507. *
  12508. * _.isSafeInteger(3);
  12509. * // => true
  12510. *
  12511. * _.isSafeInteger(Number.MIN_VALUE);
  12512. * // => false
  12513. *
  12514. * _.isSafeInteger(Infinity);
  12515. * // => false
  12516. *
  12517. * _.isSafeInteger('3');
  12518. * // => false
  12519. */
  12520. function isSafeInteger(value) {
  12521. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12522. }
  12523. /**
  12524. * Checks if `value` is classified as a `Set` object.
  12525. *
  12526. * @static
  12527. * @memberOf _
  12528. * @since 4.3.0
  12529. * @category Lang
  12530. * @param {*} value The value to check.
  12531. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12532. * @example
  12533. *
  12534. * _.isSet(new Set);
  12535. * // => true
  12536. *
  12537. * _.isSet(new WeakSet);
  12538. * // => false
  12539. */
  12540. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12541. /**
  12542. * Checks if `value` is classified as a `String` primitive or object.
  12543. *
  12544. * @static
  12545. * @since 0.1.0
  12546. * @memberOf _
  12547. * @category Lang
  12548. * @param {*} value The value to check.
  12549. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12550. * @example
  12551. *
  12552. * _.isString('abc');
  12553. * // => true
  12554. *
  12555. * _.isString(1);
  12556. * // => false
  12557. */
  12558. function isString(value) {
  12559. return typeof value == 'string' ||
  12560. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12561. }
  12562. /**
  12563. * Checks if `value` is classified as a `Symbol` primitive or object.
  12564. *
  12565. * @static
  12566. * @memberOf _
  12567. * @since 4.0.0
  12568. * @category Lang
  12569. * @param {*} value The value to check.
  12570. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12571. * @example
  12572. *
  12573. * _.isSymbol(Symbol.iterator);
  12574. * // => true
  12575. *
  12576. * _.isSymbol('abc');
  12577. * // => false
  12578. */
  12579. function isSymbol(value) {
  12580. return typeof value == 'symbol' ||
  12581. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12582. }
  12583. /**
  12584. * Checks if `value` is classified as a typed array.
  12585. *
  12586. * @static
  12587. * @memberOf _
  12588. * @since 3.0.0
  12589. * @category Lang
  12590. * @param {*} value The value to check.
  12591. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12592. * @example
  12593. *
  12594. * _.isTypedArray(new Uint8Array);
  12595. * // => true
  12596. *
  12597. * _.isTypedArray([]);
  12598. * // => false
  12599. */
  12600. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12601. /**
  12602. * Checks if `value` is `undefined`.
  12603. *
  12604. * @static
  12605. * @since 0.1.0
  12606. * @memberOf _
  12607. * @category Lang
  12608. * @param {*} value The value to check.
  12609. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12610. * @example
  12611. *
  12612. * _.isUndefined(void 0);
  12613. * // => true
  12614. *
  12615. * _.isUndefined(null);
  12616. * // => false
  12617. */
  12618. function isUndefined(value) {
  12619. return value === undefined;
  12620. }
  12621. /**
  12622. * Checks if `value` is classified as a `WeakMap` object.
  12623. *
  12624. * @static
  12625. * @memberOf _
  12626. * @since 4.3.0
  12627. * @category Lang
  12628. * @param {*} value The value to check.
  12629. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12630. * @example
  12631. *
  12632. * _.isWeakMap(new WeakMap);
  12633. * // => true
  12634. *
  12635. * _.isWeakMap(new Map);
  12636. * // => false
  12637. */
  12638. function isWeakMap(value) {
  12639. return isObjectLike(value) && getTag(value) == weakMapTag;
  12640. }
  12641. /**
  12642. * Checks if `value` is classified as a `WeakSet` object.
  12643. *
  12644. * @static
  12645. * @memberOf _
  12646. * @since 4.3.0
  12647. * @category Lang
  12648. * @param {*} value The value to check.
  12649. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12650. * @example
  12651. *
  12652. * _.isWeakSet(new WeakSet);
  12653. * // => true
  12654. *
  12655. * _.isWeakSet(new Set);
  12656. * // => false
  12657. */
  12658. function isWeakSet(value) {
  12659. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12660. }
  12661. /**
  12662. * Checks if `value` is less than `other`.
  12663. *
  12664. * @static
  12665. * @memberOf _
  12666. * @since 3.9.0
  12667. * @category Lang
  12668. * @param {*} value The value to compare.
  12669. * @param {*} other The other value to compare.
  12670. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12671. * else `false`.
  12672. * @see _.gt
  12673. * @example
  12674. *
  12675. * _.lt(1, 3);
  12676. * // => true
  12677. *
  12678. * _.lt(3, 3);
  12679. * // => false
  12680. *
  12681. * _.lt(3, 1);
  12682. * // => false
  12683. */
  12684. var lt = createRelationalOperation(baseLt);
  12685. /**
  12686. * Checks if `value` is less than or equal to `other`.
  12687. *
  12688. * @static
  12689. * @memberOf _
  12690. * @since 3.9.0
  12691. * @category Lang
  12692. * @param {*} value The value to compare.
  12693. * @param {*} other The other value to compare.
  12694. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12695. * `other`, else `false`.
  12696. * @see _.gte
  12697. * @example
  12698. *
  12699. * _.lte(1, 3);
  12700. * // => true
  12701. *
  12702. * _.lte(3, 3);
  12703. * // => true
  12704. *
  12705. * _.lte(3, 1);
  12706. * // => false
  12707. */
  12708. var lte = createRelationalOperation(function(value, other) {
  12709. return value <= other;
  12710. });
  12711. /**
  12712. * Converts `value` to an array.
  12713. *
  12714. * @static
  12715. * @since 0.1.0
  12716. * @memberOf _
  12717. * @category Lang
  12718. * @param {*} value The value to convert.
  12719. * @returns {Array} Returns the converted array.
  12720. * @example
  12721. *
  12722. * _.toArray({ 'a': 1, 'b': 2 });
  12723. * // => [1, 2]
  12724. *
  12725. * _.toArray('abc');
  12726. * // => ['a', 'b', 'c']
  12727. *
  12728. * _.toArray(1);
  12729. * // => []
  12730. *
  12731. * _.toArray(null);
  12732. * // => []
  12733. */
  12734. function toArray(value) {
  12735. if (!value) {
  12736. return [];
  12737. }
  12738. if (isArrayLike(value)) {
  12739. return isString(value) ? stringToArray(value) : copyArray(value);
  12740. }
  12741. if (symIterator && value[symIterator]) {
  12742. return iteratorToArray(value[symIterator]());
  12743. }
  12744. var tag = getTag(value),
  12745. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12746. return func(value);
  12747. }
  12748. /**
  12749. * Converts `value` to a finite number.
  12750. *
  12751. * @static
  12752. * @memberOf _
  12753. * @since 4.12.0
  12754. * @category Lang
  12755. * @param {*} value The value to convert.
  12756. * @returns {number} Returns the converted number.
  12757. * @example
  12758. *
  12759. * _.toFinite(3.2);
  12760. * // => 3.2
  12761. *
  12762. * _.toFinite(Number.MIN_VALUE);
  12763. * // => 5e-324
  12764. *
  12765. * _.toFinite(Infinity);
  12766. * // => 1.7976931348623157e+308
  12767. *
  12768. * _.toFinite('3.2');
  12769. * // => 3.2
  12770. */
  12771. function toFinite(value) {
  12772. if (!value) {
  12773. return value === 0 ? value : 0;
  12774. }
  12775. value = toNumber(value);
  12776. if (value === INFINITY || value === -INFINITY) {
  12777. var sign = (value < 0 ? -1 : 1);
  12778. return sign * MAX_INTEGER;
  12779. }
  12780. return value === value ? value : 0;
  12781. }
  12782. /**
  12783. * Converts `value` to an integer.
  12784. *
  12785. * **Note:** This method is loosely based on
  12786. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12787. *
  12788. * @static
  12789. * @memberOf _
  12790. * @since 4.0.0
  12791. * @category Lang
  12792. * @param {*} value The value to convert.
  12793. * @returns {number} Returns the converted integer.
  12794. * @example
  12795. *
  12796. * _.toInteger(3.2);
  12797. * // => 3
  12798. *
  12799. * _.toInteger(Number.MIN_VALUE);
  12800. * // => 0
  12801. *
  12802. * _.toInteger(Infinity);
  12803. * // => 1.7976931348623157e+308
  12804. *
  12805. * _.toInteger('3.2');
  12806. * // => 3
  12807. */
  12808. function toInteger(value) {
  12809. var result = toFinite(value),
  12810. remainder = result % 1;
  12811. return result === result ? (remainder ? result - remainder : result) : 0;
  12812. }
  12813. /**
  12814. * Converts `value` to an integer suitable for use as the length of an
  12815. * array-like object.
  12816. *
  12817. * **Note:** This method is based on
  12818. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12819. *
  12820. * @static
  12821. * @memberOf _
  12822. * @since 4.0.0
  12823. * @category Lang
  12824. * @param {*} value The value to convert.
  12825. * @returns {number} Returns the converted integer.
  12826. * @example
  12827. *
  12828. * _.toLength(3.2);
  12829. * // => 3
  12830. *
  12831. * _.toLength(Number.MIN_VALUE);
  12832. * // => 0
  12833. *
  12834. * _.toLength(Infinity);
  12835. * // => 4294967295
  12836. *
  12837. * _.toLength('3.2');
  12838. * // => 3
  12839. */
  12840. function toLength(value) {
  12841. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12842. }
  12843. /**
  12844. * Converts `value` to a number.
  12845. *
  12846. * @static
  12847. * @memberOf _
  12848. * @since 4.0.0
  12849. * @category Lang
  12850. * @param {*} value The value to process.
  12851. * @returns {number} Returns the number.
  12852. * @example
  12853. *
  12854. * _.toNumber(3.2);
  12855. * // => 3.2
  12856. *
  12857. * _.toNumber(Number.MIN_VALUE);
  12858. * // => 5e-324
  12859. *
  12860. * _.toNumber(Infinity);
  12861. * // => Infinity
  12862. *
  12863. * _.toNumber('3.2');
  12864. * // => 3.2
  12865. */
  12866. function toNumber(value) {
  12867. if (typeof value == 'number') {
  12868. return value;
  12869. }
  12870. if (isSymbol(value)) {
  12871. return NAN;
  12872. }
  12873. if (isObject(value)) {
  12874. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12875. value = isObject(other) ? (other + '') : other;
  12876. }
  12877. if (typeof value != 'string') {
  12878. return value === 0 ? value : +value;
  12879. }
  12880. value = baseTrim(value);
  12881. var isBinary = reIsBinary.test(value);
  12882. return (isBinary || reIsOctal.test(value))
  12883. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12884. : (reIsBadHex.test(value) ? NAN : +value);
  12885. }
  12886. /**
  12887. * Converts `value` to a plain object flattening inherited enumerable string
  12888. * keyed properties of `value` to own properties of the plain object.
  12889. *
  12890. * @static
  12891. * @memberOf _
  12892. * @since 3.0.0
  12893. * @category Lang
  12894. * @param {*} value The value to convert.
  12895. * @returns {Object} Returns the converted plain object.
  12896. * @example
  12897. *
  12898. * function Foo() {
  12899. * this.b = 2;
  12900. * }
  12901. *
  12902. * Foo.prototype.c = 3;
  12903. *
  12904. * _.assign({ 'a': 1 }, new Foo);
  12905. * // => { 'a': 1, 'b': 2 }
  12906. *
  12907. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12908. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12909. */
  12910. function toPlainObject(value) {
  12911. return copyObject(value, keysIn(value));
  12912. }
  12913. /**
  12914. * Converts `value` to a safe integer. A safe integer can be compared and
  12915. * represented correctly.
  12916. *
  12917. * @static
  12918. * @memberOf _
  12919. * @since 4.0.0
  12920. * @category Lang
  12921. * @param {*} value The value to convert.
  12922. * @returns {number} Returns the converted integer.
  12923. * @example
  12924. *
  12925. * _.toSafeInteger(3.2);
  12926. * // => 3
  12927. *
  12928. * _.toSafeInteger(Number.MIN_VALUE);
  12929. * // => 0
  12930. *
  12931. * _.toSafeInteger(Infinity);
  12932. * // => 9007199254740991
  12933. *
  12934. * _.toSafeInteger('3.2');
  12935. * // => 3
  12936. */
  12937. function toSafeInteger(value) {
  12938. return value
  12939. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12940. : (value === 0 ? value : 0);
  12941. }
  12942. /**
  12943. * Converts `value` to a string. An empty string is returned for `null`
  12944. * and `undefined` values. The sign of `-0` is preserved.
  12945. *
  12946. * @static
  12947. * @memberOf _
  12948. * @since 4.0.0
  12949. * @category Lang
  12950. * @param {*} value The value to convert.
  12951. * @returns {string} Returns the converted string.
  12952. * @example
  12953. *
  12954. * _.toString(null);
  12955. * // => ''
  12956. *
  12957. * _.toString(-0);
  12958. * // => '-0'
  12959. *
  12960. * _.toString([1, 2, 3]);
  12961. * // => '1,2,3'
  12962. */
  12963. function toString(value) {
  12964. return value == null ? '' : baseToString(value);
  12965. }
  12966. /*------------------------------------------------------------------------*/
  12967. /**
  12968. * Assigns own enumerable string keyed properties of source objects to the
  12969. * destination object. Source objects are applied from left to right.
  12970. * Subsequent sources overwrite property assignments of previous sources.
  12971. *
  12972. * **Note:** This method mutates `object` and is loosely based on
  12973. * [`Object.assign`](https://mdn.io/Object/assign).
  12974. *
  12975. * @static
  12976. * @memberOf _
  12977. * @since 0.10.0
  12978. * @category Object
  12979. * @param {Object} object The destination object.
  12980. * @param {...Object} [sources] The source objects.
  12981. * @returns {Object} Returns `object`.
  12982. * @see _.assignIn
  12983. * @example
  12984. *
  12985. * function Foo() {
  12986. * this.a = 1;
  12987. * }
  12988. *
  12989. * function Bar() {
  12990. * this.c = 3;
  12991. * }
  12992. *
  12993. * Foo.prototype.b = 2;
  12994. * Bar.prototype.d = 4;
  12995. *
  12996. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12997. * // => { 'a': 1, 'c': 3 }
  12998. */
  12999. var assign = createAssigner(function(object, source) {
  13000. if (isPrototype(source) || isArrayLike(source)) {
  13001. copyObject(source, keys(source), object);
  13002. return;
  13003. }
  13004. for (var key in source) {
  13005. if (hasOwnProperty.call(source, key)) {
  13006. assignValue(object, key, source[key]);
  13007. }
  13008. }
  13009. });
  13010. /**
  13011. * This method is like `_.assign` except that it iterates over own and
  13012. * inherited source properties.
  13013. *
  13014. * **Note:** This method mutates `object`.
  13015. *
  13016. * @static
  13017. * @memberOf _
  13018. * @since 4.0.0
  13019. * @alias extend
  13020. * @category Object
  13021. * @param {Object} object The destination object.
  13022. * @param {...Object} [sources] The source objects.
  13023. * @returns {Object} Returns `object`.
  13024. * @see _.assign
  13025. * @example
  13026. *
  13027. * function Foo() {
  13028. * this.a = 1;
  13029. * }
  13030. *
  13031. * function Bar() {
  13032. * this.c = 3;
  13033. * }
  13034. *
  13035. * Foo.prototype.b = 2;
  13036. * Bar.prototype.d = 4;
  13037. *
  13038. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13039. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13040. */
  13041. var assignIn = createAssigner(function(object, source) {
  13042. copyObject(source, keysIn(source), object);
  13043. });
  13044. /**
  13045. * This method is like `_.assignIn` except that it accepts `customizer`
  13046. * which is invoked to produce the assigned values. If `customizer` returns
  13047. * `undefined`, assignment is handled by the method instead. The `customizer`
  13048. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13049. *
  13050. * **Note:** This method mutates `object`.
  13051. *
  13052. * @static
  13053. * @memberOf _
  13054. * @since 4.0.0
  13055. * @alias extendWith
  13056. * @category Object
  13057. * @param {Object} object The destination object.
  13058. * @param {...Object} sources The source objects.
  13059. * @param {Function} [customizer] The function to customize assigned values.
  13060. * @returns {Object} Returns `object`.
  13061. * @see _.assignWith
  13062. * @example
  13063. *
  13064. * function customizer(objValue, srcValue) {
  13065. * return _.isUndefined(objValue) ? srcValue : objValue;
  13066. * }
  13067. *
  13068. * var defaults = _.partialRight(_.assignInWith, customizer);
  13069. *
  13070. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13071. * // => { 'a': 1, 'b': 2 }
  13072. */
  13073. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13074. copyObject(source, keysIn(source), object, customizer);
  13075. });
  13076. /**
  13077. * This method is like `_.assign` except that it accepts `customizer`
  13078. * which is invoked to produce the assigned values. If `customizer` returns
  13079. * `undefined`, assignment is handled by the method instead. The `customizer`
  13080. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13081. *
  13082. * **Note:** This method mutates `object`.
  13083. *
  13084. * @static
  13085. * @memberOf _
  13086. * @since 4.0.0
  13087. * @category Object
  13088. * @param {Object} object The destination object.
  13089. * @param {...Object} sources The source objects.
  13090. * @param {Function} [customizer] The function to customize assigned values.
  13091. * @returns {Object} Returns `object`.
  13092. * @see _.assignInWith
  13093. * @example
  13094. *
  13095. * function customizer(objValue, srcValue) {
  13096. * return _.isUndefined(objValue) ? srcValue : objValue;
  13097. * }
  13098. *
  13099. * var defaults = _.partialRight(_.assignWith, customizer);
  13100. *
  13101. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13102. * // => { 'a': 1, 'b': 2 }
  13103. */
  13104. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13105. copyObject(source, keys(source), object, customizer);
  13106. });
  13107. /**
  13108. * Creates an array of values corresponding to `paths` of `object`.
  13109. *
  13110. * @static
  13111. * @memberOf _
  13112. * @since 1.0.0
  13113. * @category Object
  13114. * @param {Object} object The object to iterate over.
  13115. * @param {...(string|string[])} [paths] The property paths to pick.
  13116. * @returns {Array} Returns the picked values.
  13117. * @example
  13118. *
  13119. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13120. *
  13121. * _.at(object, ['a[0].b.c', 'a[1]']);
  13122. * // => [3, 4]
  13123. */
  13124. var at = flatRest(baseAt);
  13125. /**
  13126. * Creates an object that inherits from the `prototype` object. If a
  13127. * `properties` object is given, its own enumerable string keyed properties
  13128. * are assigned to the created object.
  13129. *
  13130. * @static
  13131. * @memberOf _
  13132. * @since 2.3.0
  13133. * @category Object
  13134. * @param {Object} prototype The object to inherit from.
  13135. * @param {Object} [properties] The properties to assign to the object.
  13136. * @returns {Object} Returns the new object.
  13137. * @example
  13138. *
  13139. * function Shape() {
  13140. * this.x = 0;
  13141. * this.y = 0;
  13142. * }
  13143. *
  13144. * function Circle() {
  13145. * Shape.call(this);
  13146. * }
  13147. *
  13148. * Circle.prototype = _.create(Shape.prototype, {
  13149. * 'constructor': Circle
  13150. * });
  13151. *
  13152. * var circle = new Circle;
  13153. * circle instanceof Circle;
  13154. * // => true
  13155. *
  13156. * circle instanceof Shape;
  13157. * // => true
  13158. */
  13159. function create(prototype, properties) {
  13160. var result = baseCreate(prototype);
  13161. return properties == null ? result : baseAssign(result, properties);
  13162. }
  13163. /**
  13164. * Assigns own and inherited enumerable string keyed properties of source
  13165. * objects to the destination object for all destination properties that
  13166. * resolve to `undefined`. Source objects are applied from left to right.
  13167. * Once a property is set, additional values of the same property are ignored.
  13168. *
  13169. * **Note:** This method mutates `object`.
  13170. *
  13171. * @static
  13172. * @since 0.1.0
  13173. * @memberOf _
  13174. * @category Object
  13175. * @param {Object} object The destination object.
  13176. * @param {...Object} [sources] The source objects.
  13177. * @returns {Object} Returns `object`.
  13178. * @see _.defaultsDeep
  13179. * @example
  13180. *
  13181. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13182. * // => { 'a': 1, 'b': 2 }
  13183. */
  13184. var defaults = baseRest(function(object, sources) {
  13185. object = Object(object);
  13186. var index = -1;
  13187. var length = sources.length;
  13188. var guard = length > 2 ? sources[2] : undefined;
  13189. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13190. length = 1;
  13191. }
  13192. while (++index < length) {
  13193. var source = sources[index];
  13194. var props = keysIn(source);
  13195. var propsIndex = -1;
  13196. var propsLength = props.length;
  13197. while (++propsIndex < propsLength) {
  13198. var key = props[propsIndex];
  13199. var value = object[key];
  13200. if (value === undefined ||
  13201. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13202. object[key] = source[key];
  13203. }
  13204. }
  13205. }
  13206. return object;
  13207. });
  13208. /**
  13209. * This method is like `_.defaults` except that it recursively assigns
  13210. * default properties.
  13211. *
  13212. * **Note:** This method mutates `object`.
  13213. *
  13214. * @static
  13215. * @memberOf _
  13216. * @since 3.10.0
  13217. * @category Object
  13218. * @param {Object} object The destination object.
  13219. * @param {...Object} [sources] The source objects.
  13220. * @returns {Object} Returns `object`.
  13221. * @see _.defaults
  13222. * @example
  13223. *
  13224. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13225. * // => { 'a': { 'b': 2, 'c': 3 } }
  13226. */
  13227. var defaultsDeep = baseRest(function(args) {
  13228. args.push(undefined, customDefaultsMerge);
  13229. return apply(mergeWith, undefined, args);
  13230. });
  13231. /**
  13232. * This method is like `_.find` except that it returns the key of the first
  13233. * element `predicate` returns truthy for instead of the element itself.
  13234. *
  13235. * @static
  13236. * @memberOf _
  13237. * @since 1.1.0
  13238. * @category Object
  13239. * @param {Object} object The object to inspect.
  13240. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13241. * @returns {string|undefined} Returns the key of the matched element,
  13242. * else `undefined`.
  13243. * @example
  13244. *
  13245. * var users = {
  13246. * 'barney': { 'age': 36, 'active': true },
  13247. * 'fred': { 'age': 40, 'active': false },
  13248. * 'pebbles': { 'age': 1, 'active': true }
  13249. * };
  13250. *
  13251. * _.findKey(users, function(o) { return o.age < 40; });
  13252. * // => 'barney' (iteration order is not guaranteed)
  13253. *
  13254. * // The `_.matches` iteratee shorthand.
  13255. * _.findKey(users, { 'age': 1, 'active': true });
  13256. * // => 'pebbles'
  13257. *
  13258. * // The `_.matchesProperty` iteratee shorthand.
  13259. * _.findKey(users, ['active', false]);
  13260. * // => 'fred'
  13261. *
  13262. * // The `_.property` iteratee shorthand.
  13263. * _.findKey(users, 'active');
  13264. * // => 'barney'
  13265. */
  13266. function findKey(object, predicate) {
  13267. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13268. }
  13269. /**
  13270. * This method is like `_.findKey` except that it iterates over elements of
  13271. * a collection in the opposite order.
  13272. *
  13273. * @static
  13274. * @memberOf _
  13275. * @since 2.0.0
  13276. * @category Object
  13277. * @param {Object} object The object to inspect.
  13278. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13279. * @returns {string|undefined} Returns the key of the matched element,
  13280. * else `undefined`.
  13281. * @example
  13282. *
  13283. * var users = {
  13284. * 'barney': { 'age': 36, 'active': true },
  13285. * 'fred': { 'age': 40, 'active': false },
  13286. * 'pebbles': { 'age': 1, 'active': true }
  13287. * };
  13288. *
  13289. * _.findLastKey(users, function(o) { return o.age < 40; });
  13290. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13291. *
  13292. * // The `_.matches` iteratee shorthand.
  13293. * _.findLastKey(users, { 'age': 36, 'active': true });
  13294. * // => 'barney'
  13295. *
  13296. * // The `_.matchesProperty` iteratee shorthand.
  13297. * _.findLastKey(users, ['active', false]);
  13298. * // => 'fred'
  13299. *
  13300. * // The `_.property` iteratee shorthand.
  13301. * _.findLastKey(users, 'active');
  13302. * // => 'pebbles'
  13303. */
  13304. function findLastKey(object, predicate) {
  13305. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13306. }
  13307. /**
  13308. * Iterates over own and inherited enumerable string keyed properties of an
  13309. * object and invokes `iteratee` for each property. The iteratee is invoked
  13310. * with three arguments: (value, key, object). Iteratee functions may exit
  13311. * iteration early by explicitly returning `false`.
  13312. *
  13313. * @static
  13314. * @memberOf _
  13315. * @since 0.3.0
  13316. * @category Object
  13317. * @param {Object} object The object to iterate over.
  13318. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13319. * @returns {Object} Returns `object`.
  13320. * @see _.forInRight
  13321. * @example
  13322. *
  13323. * function Foo() {
  13324. * this.a = 1;
  13325. * this.b = 2;
  13326. * }
  13327. *
  13328. * Foo.prototype.c = 3;
  13329. *
  13330. * _.forIn(new Foo, function(value, key) {
  13331. * console.log(key);
  13332. * });
  13333. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13334. */
  13335. function forIn(object, iteratee) {
  13336. return object == null
  13337. ? object
  13338. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13339. }
  13340. /**
  13341. * This method is like `_.forIn` except that it iterates over properties of
  13342. * `object` in the opposite order.
  13343. *
  13344. * @static
  13345. * @memberOf _
  13346. * @since 2.0.0
  13347. * @category Object
  13348. * @param {Object} object The object to iterate over.
  13349. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13350. * @returns {Object} Returns `object`.
  13351. * @see _.forIn
  13352. * @example
  13353. *
  13354. * function Foo() {
  13355. * this.a = 1;
  13356. * this.b = 2;
  13357. * }
  13358. *
  13359. * Foo.prototype.c = 3;
  13360. *
  13361. * _.forInRight(new Foo, function(value, key) {
  13362. * console.log(key);
  13363. * });
  13364. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13365. */
  13366. function forInRight(object, iteratee) {
  13367. return object == null
  13368. ? object
  13369. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13370. }
  13371. /**
  13372. * Iterates over own enumerable string keyed properties of an object and
  13373. * invokes `iteratee` for each property. The iteratee is invoked with three
  13374. * arguments: (value, key, object). Iteratee functions may exit iteration
  13375. * early by explicitly returning `false`.
  13376. *
  13377. * @static
  13378. * @memberOf _
  13379. * @since 0.3.0
  13380. * @category Object
  13381. * @param {Object} object The object to iterate over.
  13382. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13383. * @returns {Object} Returns `object`.
  13384. * @see _.forOwnRight
  13385. * @example
  13386. *
  13387. * function Foo() {
  13388. * this.a = 1;
  13389. * this.b = 2;
  13390. * }
  13391. *
  13392. * Foo.prototype.c = 3;
  13393. *
  13394. * _.forOwn(new Foo, function(value, key) {
  13395. * console.log(key);
  13396. * });
  13397. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13398. */
  13399. function forOwn(object, iteratee) {
  13400. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13401. }
  13402. /**
  13403. * This method is like `_.forOwn` except that it iterates over properties of
  13404. * `object` in the opposite order.
  13405. *
  13406. * @static
  13407. * @memberOf _
  13408. * @since 2.0.0
  13409. * @category Object
  13410. * @param {Object} object The object to iterate over.
  13411. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13412. * @returns {Object} Returns `object`.
  13413. * @see _.forOwn
  13414. * @example
  13415. *
  13416. * function Foo() {
  13417. * this.a = 1;
  13418. * this.b = 2;
  13419. * }
  13420. *
  13421. * Foo.prototype.c = 3;
  13422. *
  13423. * _.forOwnRight(new Foo, function(value, key) {
  13424. * console.log(key);
  13425. * });
  13426. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13427. */
  13428. function forOwnRight(object, iteratee) {
  13429. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13430. }
  13431. /**
  13432. * Creates an array of function property names from own enumerable properties
  13433. * of `object`.
  13434. *
  13435. * @static
  13436. * @since 0.1.0
  13437. * @memberOf _
  13438. * @category Object
  13439. * @param {Object} object The object to inspect.
  13440. * @returns {Array} Returns the function names.
  13441. * @see _.functionsIn
  13442. * @example
  13443. *
  13444. * function Foo() {
  13445. * this.a = _.constant('a');
  13446. * this.b = _.constant('b');
  13447. * }
  13448. *
  13449. * Foo.prototype.c = _.constant('c');
  13450. *
  13451. * _.functions(new Foo);
  13452. * // => ['a', 'b']
  13453. */
  13454. function functions(object) {
  13455. return object == null ? [] : baseFunctions(object, keys(object));
  13456. }
  13457. /**
  13458. * Creates an array of function property names from own and inherited
  13459. * enumerable properties of `object`.
  13460. *
  13461. * @static
  13462. * @memberOf _
  13463. * @since 4.0.0
  13464. * @category Object
  13465. * @param {Object} object The object to inspect.
  13466. * @returns {Array} Returns the function names.
  13467. * @see _.functions
  13468. * @example
  13469. *
  13470. * function Foo() {
  13471. * this.a = _.constant('a');
  13472. * this.b = _.constant('b');
  13473. * }
  13474. *
  13475. * Foo.prototype.c = _.constant('c');
  13476. *
  13477. * _.functionsIn(new Foo);
  13478. * // => ['a', 'b', 'c']
  13479. */
  13480. function functionsIn(object) {
  13481. return object == null ? [] : baseFunctions(object, keysIn(object));
  13482. }
  13483. /**
  13484. * Gets the value at `path` of `object`. If the resolved value is
  13485. * `undefined`, the `defaultValue` is returned in its place.
  13486. *
  13487. * @static
  13488. * @memberOf _
  13489. * @since 3.7.0
  13490. * @category Object
  13491. * @param {Object} object The object to query.
  13492. * @param {Array|string} path The path of the property to get.
  13493. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13494. * @returns {*} Returns the resolved value.
  13495. * @example
  13496. *
  13497. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13498. *
  13499. * _.get(object, 'a[0].b.c');
  13500. * // => 3
  13501. *
  13502. * _.get(object, ['a', '0', 'b', 'c']);
  13503. * // => 3
  13504. *
  13505. * _.get(object, 'a.b.c', 'default');
  13506. * // => 'default'
  13507. */
  13508. function get(object, path, defaultValue) {
  13509. var result = object == null ? undefined : baseGet(object, path);
  13510. return result === undefined ? defaultValue : result;
  13511. }
  13512. /**
  13513. * Checks if `path` is a direct property of `object`.
  13514. *
  13515. * @static
  13516. * @since 0.1.0
  13517. * @memberOf _
  13518. * @category Object
  13519. * @param {Object} object The object to query.
  13520. * @param {Array|string} path The path to check.
  13521. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13522. * @example
  13523. *
  13524. * var object = { 'a': { 'b': 2 } };
  13525. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13526. *
  13527. * _.has(object, 'a');
  13528. * // => true
  13529. *
  13530. * _.has(object, 'a.b');
  13531. * // => true
  13532. *
  13533. * _.has(object, ['a', 'b']);
  13534. * // => true
  13535. *
  13536. * _.has(other, 'a');
  13537. * // => false
  13538. */
  13539. function has(object, path) {
  13540. return object != null && hasPath(object, path, baseHas);
  13541. }
  13542. /**
  13543. * Checks if `path` is a direct or inherited property of `object`.
  13544. *
  13545. * @static
  13546. * @memberOf _
  13547. * @since 4.0.0
  13548. * @category Object
  13549. * @param {Object} object The object to query.
  13550. * @param {Array|string} path The path to check.
  13551. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13552. * @example
  13553. *
  13554. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13555. *
  13556. * _.hasIn(object, 'a');
  13557. * // => true
  13558. *
  13559. * _.hasIn(object, 'a.b');
  13560. * // => true
  13561. *
  13562. * _.hasIn(object, ['a', 'b']);
  13563. * // => true
  13564. *
  13565. * _.hasIn(object, 'b');
  13566. * // => false
  13567. */
  13568. function hasIn(object, path) {
  13569. return object != null && hasPath(object, path, baseHasIn);
  13570. }
  13571. /**
  13572. * Creates an object composed of the inverted keys and values of `object`.
  13573. * If `object` contains duplicate values, subsequent values overwrite
  13574. * property assignments of previous values.
  13575. *
  13576. * @static
  13577. * @memberOf _
  13578. * @since 0.7.0
  13579. * @category Object
  13580. * @param {Object} object The object to invert.
  13581. * @returns {Object} Returns the new inverted object.
  13582. * @example
  13583. *
  13584. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13585. *
  13586. * _.invert(object);
  13587. * // => { '1': 'c', '2': 'b' }
  13588. */
  13589. var invert = createInverter(function(result, value, key) {
  13590. if (value != null &&
  13591. typeof value.toString != 'function') {
  13592. value = nativeObjectToString.call(value);
  13593. }
  13594. result[value] = key;
  13595. }, constant(identity));
  13596. /**
  13597. * This method is like `_.invert` except that the inverted object is generated
  13598. * from the results of running each element of `object` thru `iteratee`. The
  13599. * corresponding inverted value of each inverted key is an array of keys
  13600. * responsible for generating the inverted value. The iteratee is invoked
  13601. * with one argument: (value).
  13602. *
  13603. * @static
  13604. * @memberOf _
  13605. * @since 4.1.0
  13606. * @category Object
  13607. * @param {Object} object The object to invert.
  13608. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13609. * @returns {Object} Returns the new inverted object.
  13610. * @example
  13611. *
  13612. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13613. *
  13614. * _.invertBy(object);
  13615. * // => { '1': ['a', 'c'], '2': ['b'] }
  13616. *
  13617. * _.invertBy(object, function(value) {
  13618. * return 'group' + value;
  13619. * });
  13620. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13621. */
  13622. var invertBy = createInverter(function(result, value, key) {
  13623. if (value != null &&
  13624. typeof value.toString != 'function') {
  13625. value = nativeObjectToString.call(value);
  13626. }
  13627. if (hasOwnProperty.call(result, value)) {
  13628. result[value].push(key);
  13629. } else {
  13630. result[value] = [key];
  13631. }
  13632. }, getIteratee);
  13633. /**
  13634. * Invokes the method at `path` of `object`.
  13635. *
  13636. * @static
  13637. * @memberOf _
  13638. * @since 4.0.0
  13639. * @category Object
  13640. * @param {Object} object The object to query.
  13641. * @param {Array|string} path The path of the method to invoke.
  13642. * @param {...*} [args] The arguments to invoke the method with.
  13643. * @returns {*} Returns the result of the invoked method.
  13644. * @example
  13645. *
  13646. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13647. *
  13648. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13649. * // => [2, 3]
  13650. */
  13651. var invoke = baseRest(baseInvoke);
  13652. /**
  13653. * Creates an array of the own enumerable property names of `object`.
  13654. *
  13655. * **Note:** Non-object values are coerced to objects. See the
  13656. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13657. * for more details.
  13658. *
  13659. * @static
  13660. * @since 0.1.0
  13661. * @memberOf _
  13662. * @category Object
  13663. * @param {Object} object The object to query.
  13664. * @returns {Array} Returns the array of property names.
  13665. * @example
  13666. *
  13667. * function Foo() {
  13668. * this.a = 1;
  13669. * this.b = 2;
  13670. * }
  13671. *
  13672. * Foo.prototype.c = 3;
  13673. *
  13674. * _.keys(new Foo);
  13675. * // => ['a', 'b'] (iteration order is not guaranteed)
  13676. *
  13677. * _.keys('hi');
  13678. * // => ['0', '1']
  13679. */
  13680. function keys(object) {
  13681. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13682. }
  13683. /**
  13684. * Creates an array of the own and inherited enumerable property names of `object`.
  13685. *
  13686. * **Note:** Non-object values are coerced to objects.
  13687. *
  13688. * @static
  13689. * @memberOf _
  13690. * @since 3.0.0
  13691. * @category Object
  13692. * @param {Object} object The object to query.
  13693. * @returns {Array} Returns the array of property names.
  13694. * @example
  13695. *
  13696. * function Foo() {
  13697. * this.a = 1;
  13698. * this.b = 2;
  13699. * }
  13700. *
  13701. * Foo.prototype.c = 3;
  13702. *
  13703. * _.keysIn(new Foo);
  13704. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13705. */
  13706. function keysIn(object) {
  13707. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13708. }
  13709. /**
  13710. * The opposite of `_.mapValues`; this method creates an object with the
  13711. * same values as `object` and keys generated by running each own enumerable
  13712. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13713. * with three arguments: (value, key, object).
  13714. *
  13715. * @static
  13716. * @memberOf _
  13717. * @since 3.8.0
  13718. * @category Object
  13719. * @param {Object} object The object to iterate over.
  13720. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13721. * @returns {Object} Returns the new mapped object.
  13722. * @see _.mapValues
  13723. * @example
  13724. *
  13725. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13726. * return key + value;
  13727. * });
  13728. * // => { 'a1': 1, 'b2': 2 }
  13729. */
  13730. function mapKeys(object, iteratee) {
  13731. var result = {};
  13732. iteratee = getIteratee(iteratee, 3);
  13733. baseForOwn(object, function(value, key, object) {
  13734. baseAssignValue(result, iteratee(value, key, object), value);
  13735. });
  13736. return result;
  13737. }
  13738. /**
  13739. * Creates an object with the same keys as `object` and values generated
  13740. * by running each own enumerable string keyed property of `object` thru
  13741. * `iteratee`. The iteratee is invoked with three arguments:
  13742. * (value, key, object).
  13743. *
  13744. * @static
  13745. * @memberOf _
  13746. * @since 2.4.0
  13747. * @category Object
  13748. * @param {Object} object The object to iterate over.
  13749. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13750. * @returns {Object} Returns the new mapped object.
  13751. * @see _.mapKeys
  13752. * @example
  13753. *
  13754. * var users = {
  13755. * 'fred': { 'user': 'fred', 'age': 40 },
  13756. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13757. * };
  13758. *
  13759. * _.mapValues(users, function(o) { return o.age; });
  13760. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13761. *
  13762. * // The `_.property` iteratee shorthand.
  13763. * _.mapValues(users, 'age');
  13764. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13765. */
  13766. function mapValues(object, iteratee) {
  13767. var result = {};
  13768. iteratee = getIteratee(iteratee, 3);
  13769. baseForOwn(object, function(value, key, object) {
  13770. baseAssignValue(result, key, iteratee(value, key, object));
  13771. });
  13772. return result;
  13773. }
  13774. /**
  13775. * This method is like `_.assign` except that it recursively merges own and
  13776. * inherited enumerable string keyed properties of source objects into the
  13777. * destination object. Source properties that resolve to `undefined` are
  13778. * skipped if a destination value exists. Array and plain object properties
  13779. * are merged recursively. Other objects and value types are overridden by
  13780. * assignment. Source objects are applied from left to right. Subsequent
  13781. * sources overwrite property assignments of previous sources.
  13782. *
  13783. * **Note:** This method mutates `object`.
  13784. *
  13785. * @static
  13786. * @memberOf _
  13787. * @since 0.5.0
  13788. * @category Object
  13789. * @param {Object} object The destination object.
  13790. * @param {...Object} [sources] The source objects.
  13791. * @returns {Object} Returns `object`.
  13792. * @example
  13793. *
  13794. * var object = {
  13795. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13796. * };
  13797. *
  13798. * var other = {
  13799. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13800. * };
  13801. *
  13802. * _.merge(object, other);
  13803. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13804. */
  13805. var merge = createAssigner(function(object, source, srcIndex) {
  13806. baseMerge(object, source, srcIndex);
  13807. });
  13808. /**
  13809. * This method is like `_.merge` except that it accepts `customizer` which
  13810. * is invoked to produce the merged values of the destination and source
  13811. * properties. If `customizer` returns `undefined`, merging is handled by the
  13812. * method instead. The `customizer` is invoked with six arguments:
  13813. * (objValue, srcValue, key, object, source, stack).
  13814. *
  13815. * **Note:** This method mutates `object`.
  13816. *
  13817. * @static
  13818. * @memberOf _
  13819. * @since 4.0.0
  13820. * @category Object
  13821. * @param {Object} object The destination object.
  13822. * @param {...Object} sources The source objects.
  13823. * @param {Function} customizer The function to customize assigned values.
  13824. * @returns {Object} Returns `object`.
  13825. * @example
  13826. *
  13827. * function customizer(objValue, srcValue) {
  13828. * if (_.isArray(objValue)) {
  13829. * return objValue.concat(srcValue);
  13830. * }
  13831. * }
  13832. *
  13833. * var object = { 'a': [1], 'b': [2] };
  13834. * var other = { 'a': [3], 'b': [4] };
  13835. *
  13836. * _.mergeWith(object, other, customizer);
  13837. * // => { 'a': [1, 3], 'b': [2, 4] }
  13838. */
  13839. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13840. baseMerge(object, source, srcIndex, customizer);
  13841. });
  13842. /**
  13843. * The opposite of `_.pick`; this method creates an object composed of the
  13844. * own and inherited enumerable property paths of `object` that are not omitted.
  13845. *
  13846. * **Note:** This method is considerably slower than `_.pick`.
  13847. *
  13848. * @static
  13849. * @since 0.1.0
  13850. * @memberOf _
  13851. * @category Object
  13852. * @param {Object} object The source object.
  13853. * @param {...(string|string[])} [paths] The property paths to omit.
  13854. * @returns {Object} Returns the new object.
  13855. * @example
  13856. *
  13857. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13858. *
  13859. * _.omit(object, ['a', 'c']);
  13860. * // => { 'b': '2' }
  13861. */
  13862. var omit = flatRest(function(object, paths) {
  13863. var result = {};
  13864. if (object == null) {
  13865. return result;
  13866. }
  13867. var isDeep = false;
  13868. paths = arrayMap(paths, function(path) {
  13869. path = castPath(path, object);
  13870. isDeep || (isDeep = path.length > 1);
  13871. return path;
  13872. });
  13873. copyObject(object, getAllKeysIn(object), result);
  13874. if (isDeep) {
  13875. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13876. }
  13877. var length = paths.length;
  13878. while (length--) {
  13879. baseUnset(result, paths[length]);
  13880. }
  13881. return result;
  13882. });
  13883. /**
  13884. * The opposite of `_.pickBy`; this method creates an object composed of
  13885. * the own and inherited enumerable string keyed properties of `object` that
  13886. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13887. * arguments: (value, key).
  13888. *
  13889. * @static
  13890. * @memberOf _
  13891. * @since 4.0.0
  13892. * @category Object
  13893. * @param {Object} object The source object.
  13894. * @param {Function} [predicate=_.identity] The function invoked per property.
  13895. * @returns {Object} Returns the new object.
  13896. * @example
  13897. *
  13898. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13899. *
  13900. * _.omitBy(object, _.isNumber);
  13901. * // => { 'b': '2' }
  13902. */
  13903. function omitBy(object, predicate) {
  13904. return pickBy(object, negate(getIteratee(predicate)));
  13905. }
  13906. /**
  13907. * Creates an object composed of the picked `object` properties.
  13908. *
  13909. * @static
  13910. * @since 0.1.0
  13911. * @memberOf _
  13912. * @category Object
  13913. * @param {Object} object The source object.
  13914. * @param {...(string|string[])} [paths] The property paths to pick.
  13915. * @returns {Object} Returns the new object.
  13916. * @example
  13917. *
  13918. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13919. *
  13920. * _.pick(object, ['a', 'c']);
  13921. * // => { 'a': 1, 'c': 3 }
  13922. */
  13923. var pick = flatRest(function(object, paths) {
  13924. return object == null ? {} : basePick(object, paths);
  13925. });
  13926. /**
  13927. * Creates an object composed of the `object` properties `predicate` returns
  13928. * truthy for. The predicate is invoked with two arguments: (value, key).
  13929. *
  13930. * @static
  13931. * @memberOf _
  13932. * @since 4.0.0
  13933. * @category Object
  13934. * @param {Object} object The source object.
  13935. * @param {Function} [predicate=_.identity] The function invoked per property.
  13936. * @returns {Object} Returns the new object.
  13937. * @example
  13938. *
  13939. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13940. *
  13941. * _.pickBy(object, _.isNumber);
  13942. * // => { 'a': 1, 'c': 3 }
  13943. */
  13944. function pickBy(object, predicate) {
  13945. if (object == null) {
  13946. return {};
  13947. }
  13948. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13949. return [prop];
  13950. });
  13951. predicate = getIteratee(predicate);
  13952. return basePickBy(object, props, function(value, path) {
  13953. return predicate(value, path[0]);
  13954. });
  13955. }
  13956. /**
  13957. * This method is like `_.get` except that if the resolved value is a
  13958. * function it's invoked with the `this` binding of its parent object and
  13959. * its result is returned.
  13960. *
  13961. * @static
  13962. * @since 0.1.0
  13963. * @memberOf _
  13964. * @category Object
  13965. * @param {Object} object The object to query.
  13966. * @param {Array|string} path The path of the property to resolve.
  13967. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13968. * @returns {*} Returns the resolved value.
  13969. * @example
  13970. *
  13971. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13972. *
  13973. * _.result(object, 'a[0].b.c1');
  13974. * // => 3
  13975. *
  13976. * _.result(object, 'a[0].b.c2');
  13977. * // => 4
  13978. *
  13979. * _.result(object, 'a[0].b.c3', 'default');
  13980. * // => 'default'
  13981. *
  13982. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13983. * // => 'default'
  13984. */
  13985. function result(object, path, defaultValue) {
  13986. path = castPath(path, object);
  13987. var index = -1,
  13988. length = path.length;
  13989. // Ensure the loop is entered when path is empty.
  13990. if (!length) {
  13991. length = 1;
  13992. object = undefined;
  13993. }
  13994. while (++index < length) {
  13995. var value = object == null ? undefined : object[toKey(path[index])];
  13996. if (value === undefined) {
  13997. index = length;
  13998. value = defaultValue;
  13999. }
  14000. object = isFunction(value) ? value.call(object) : value;
  14001. }
  14002. return object;
  14003. }
  14004. /**
  14005. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14006. * it's created. Arrays are created for missing index properties while objects
  14007. * are created for all other missing properties. Use `_.setWith` to customize
  14008. * `path` creation.
  14009. *
  14010. * **Note:** This method mutates `object`.
  14011. *
  14012. * @static
  14013. * @memberOf _
  14014. * @since 3.7.0
  14015. * @category Object
  14016. * @param {Object} object The object to modify.
  14017. * @param {Array|string} path The path of the property to set.
  14018. * @param {*} value The value to set.
  14019. * @returns {Object} Returns `object`.
  14020. * @example
  14021. *
  14022. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14023. *
  14024. * _.set(object, 'a[0].b.c', 4);
  14025. * console.log(object.a[0].b.c);
  14026. * // => 4
  14027. *
  14028. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14029. * console.log(object.x[0].y.z);
  14030. * // => 5
  14031. */
  14032. function set(object, path, value) {
  14033. return object == null ? object : baseSet(object, path, value);
  14034. }
  14035. /**
  14036. * This method is like `_.set` except that it accepts `customizer` which is
  14037. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14038. * path creation is handled by the method instead. The `customizer` is invoked
  14039. * with three arguments: (nsValue, key, nsObject).
  14040. *
  14041. * **Note:** This method mutates `object`.
  14042. *
  14043. * @static
  14044. * @memberOf _
  14045. * @since 4.0.0
  14046. * @category Object
  14047. * @param {Object} object The object to modify.
  14048. * @param {Array|string} path The path of the property to set.
  14049. * @param {*} value The value to set.
  14050. * @param {Function} [customizer] The function to customize assigned values.
  14051. * @returns {Object} Returns `object`.
  14052. * @example
  14053. *
  14054. * var object = {};
  14055. *
  14056. * _.setWith(object, '[0][1]', 'a', Object);
  14057. * // => { '0': { '1': 'a' } }
  14058. */
  14059. function setWith(object, path, value, customizer) {
  14060. customizer = typeof customizer == 'function' ? customizer : undefined;
  14061. return object == null ? object : baseSet(object, path, value, customizer);
  14062. }
  14063. /**
  14064. * Creates an array of own enumerable string keyed-value pairs for `object`
  14065. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14066. * entries are returned.
  14067. *
  14068. * @static
  14069. * @memberOf _
  14070. * @since 4.0.0
  14071. * @alias entries
  14072. * @category Object
  14073. * @param {Object} object The object to query.
  14074. * @returns {Array} Returns the key-value pairs.
  14075. * @example
  14076. *
  14077. * function Foo() {
  14078. * this.a = 1;
  14079. * this.b = 2;
  14080. * }
  14081. *
  14082. * Foo.prototype.c = 3;
  14083. *
  14084. * _.toPairs(new Foo);
  14085. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14086. */
  14087. var toPairs = createToPairs(keys);
  14088. /**
  14089. * Creates an array of own and inherited enumerable string keyed-value pairs
  14090. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14091. * or set, its entries are returned.
  14092. *
  14093. * @static
  14094. * @memberOf _
  14095. * @since 4.0.0
  14096. * @alias entriesIn
  14097. * @category Object
  14098. * @param {Object} object The object to query.
  14099. * @returns {Array} Returns the key-value pairs.
  14100. * @example
  14101. *
  14102. * function Foo() {
  14103. * this.a = 1;
  14104. * this.b = 2;
  14105. * }
  14106. *
  14107. * Foo.prototype.c = 3;
  14108. *
  14109. * _.toPairsIn(new Foo);
  14110. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14111. */
  14112. var toPairsIn = createToPairs(keysIn);
  14113. /**
  14114. * An alternative to `_.reduce`; this method transforms `object` to a new
  14115. * `accumulator` object which is the result of running each of its own
  14116. * enumerable string keyed properties thru `iteratee`, with each invocation
  14117. * potentially mutating the `accumulator` object. If `accumulator` is not
  14118. * provided, a new object with the same `[[Prototype]]` will be used. The
  14119. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14120. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14121. *
  14122. * @static
  14123. * @memberOf _
  14124. * @since 1.3.0
  14125. * @category Object
  14126. * @param {Object} object The object to iterate over.
  14127. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14128. * @param {*} [accumulator] The custom accumulator value.
  14129. * @returns {*} Returns the accumulated value.
  14130. * @example
  14131. *
  14132. * _.transform([2, 3, 4], function(result, n) {
  14133. * result.push(n *= n);
  14134. * return n % 2 == 0;
  14135. * }, []);
  14136. * // => [4, 9]
  14137. *
  14138. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14139. * (result[value] || (result[value] = [])).push(key);
  14140. * }, {});
  14141. * // => { '1': ['a', 'c'], '2': ['b'] }
  14142. */
  14143. function transform(object, iteratee, accumulator) {
  14144. var isArr = isArray(object),
  14145. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14146. iteratee = getIteratee(iteratee, 4);
  14147. if (accumulator == null) {
  14148. var Ctor = object && object.constructor;
  14149. if (isArrLike) {
  14150. accumulator = isArr ? new Ctor : [];
  14151. }
  14152. else if (isObject(object)) {
  14153. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14154. }
  14155. else {
  14156. accumulator = {};
  14157. }
  14158. }
  14159. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14160. return iteratee(accumulator, value, index, object);
  14161. });
  14162. return accumulator;
  14163. }
  14164. /**
  14165. * Removes the property at `path` of `object`.
  14166. *
  14167. * **Note:** This method mutates `object`.
  14168. *
  14169. * @static
  14170. * @memberOf _
  14171. * @since 4.0.0
  14172. * @category Object
  14173. * @param {Object} object The object to modify.
  14174. * @param {Array|string} path The path of the property to unset.
  14175. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14176. * @example
  14177. *
  14178. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14179. * _.unset(object, 'a[0].b.c');
  14180. * // => true
  14181. *
  14182. * console.log(object);
  14183. * // => { 'a': [{ 'b': {} }] };
  14184. *
  14185. * _.unset(object, ['a', '0', 'b', 'c']);
  14186. * // => true
  14187. *
  14188. * console.log(object);
  14189. * // => { 'a': [{ 'b': {} }] };
  14190. */
  14191. function unset(object, path) {
  14192. return object == null ? true : baseUnset(object, path);
  14193. }
  14194. /**
  14195. * This method is like `_.set` except that accepts `updater` to produce the
  14196. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14197. * is invoked with one argument: (value).
  14198. *
  14199. * **Note:** This method mutates `object`.
  14200. *
  14201. * @static
  14202. * @memberOf _
  14203. * @since 4.6.0
  14204. * @category Object
  14205. * @param {Object} object The object to modify.
  14206. * @param {Array|string} path The path of the property to set.
  14207. * @param {Function} updater The function to produce the updated value.
  14208. * @returns {Object} Returns `object`.
  14209. * @example
  14210. *
  14211. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14212. *
  14213. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14214. * console.log(object.a[0].b.c);
  14215. * // => 9
  14216. *
  14217. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14218. * console.log(object.x[0].y.z);
  14219. * // => 0
  14220. */
  14221. function update(object, path, updater) {
  14222. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14223. }
  14224. /**
  14225. * This method is like `_.update` except that it accepts `customizer` which is
  14226. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14227. * path creation is handled by the method instead. The `customizer` is invoked
  14228. * with three arguments: (nsValue, key, nsObject).
  14229. *
  14230. * **Note:** This method mutates `object`.
  14231. *
  14232. * @static
  14233. * @memberOf _
  14234. * @since 4.6.0
  14235. * @category Object
  14236. * @param {Object} object The object to modify.
  14237. * @param {Array|string} path The path of the property to set.
  14238. * @param {Function} updater The function to produce the updated value.
  14239. * @param {Function} [customizer] The function to customize assigned values.
  14240. * @returns {Object} Returns `object`.
  14241. * @example
  14242. *
  14243. * var object = {};
  14244. *
  14245. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14246. * // => { '0': { '1': 'a' } }
  14247. */
  14248. function updateWith(object, path, updater, customizer) {
  14249. customizer = typeof customizer == 'function' ? customizer : undefined;
  14250. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14251. }
  14252. /**
  14253. * Creates an array of the own enumerable string keyed property values of `object`.
  14254. *
  14255. * **Note:** Non-object values are coerced to objects.
  14256. *
  14257. * @static
  14258. * @since 0.1.0
  14259. * @memberOf _
  14260. * @category Object
  14261. * @param {Object} object The object to query.
  14262. * @returns {Array} Returns the array of property values.
  14263. * @example
  14264. *
  14265. * function Foo() {
  14266. * this.a = 1;
  14267. * this.b = 2;
  14268. * }
  14269. *
  14270. * Foo.prototype.c = 3;
  14271. *
  14272. * _.values(new Foo);
  14273. * // => [1, 2] (iteration order is not guaranteed)
  14274. *
  14275. * _.values('hi');
  14276. * // => ['h', 'i']
  14277. */
  14278. function values(object) {
  14279. return object == null ? [] : baseValues(object, keys(object));
  14280. }
  14281. /**
  14282. * Creates an array of the own and inherited enumerable string keyed property
  14283. * values of `object`.
  14284. *
  14285. * **Note:** Non-object values are coerced to objects.
  14286. *
  14287. * @static
  14288. * @memberOf _
  14289. * @since 3.0.0
  14290. * @category Object
  14291. * @param {Object} object The object to query.
  14292. * @returns {Array} Returns the array of property values.
  14293. * @example
  14294. *
  14295. * function Foo() {
  14296. * this.a = 1;
  14297. * this.b = 2;
  14298. * }
  14299. *
  14300. * Foo.prototype.c = 3;
  14301. *
  14302. * _.valuesIn(new Foo);
  14303. * // => [1, 2, 3] (iteration order is not guaranteed)
  14304. */
  14305. function valuesIn(object) {
  14306. return object == null ? [] : baseValues(object, keysIn(object));
  14307. }
  14308. /*------------------------------------------------------------------------*/
  14309. /**
  14310. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14311. *
  14312. * @static
  14313. * @memberOf _
  14314. * @since 4.0.0
  14315. * @category Number
  14316. * @param {number} number The number to clamp.
  14317. * @param {number} [lower] The lower bound.
  14318. * @param {number} upper The upper bound.
  14319. * @returns {number} Returns the clamped number.
  14320. * @example
  14321. *
  14322. * _.clamp(-10, -5, 5);
  14323. * // => -5
  14324. *
  14325. * _.clamp(10, -5, 5);
  14326. * // => 5
  14327. */
  14328. function clamp(number, lower, upper) {
  14329. if (upper === undefined) {
  14330. upper = lower;
  14331. lower = undefined;
  14332. }
  14333. if (upper !== undefined) {
  14334. upper = toNumber(upper);
  14335. upper = upper === upper ? upper : 0;
  14336. }
  14337. if (lower !== undefined) {
  14338. lower = toNumber(lower);
  14339. lower = lower === lower ? lower : 0;
  14340. }
  14341. return baseClamp(toNumber(number), lower, upper);
  14342. }
  14343. /**
  14344. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14345. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14346. * If `start` is greater than `end` the params are swapped to support
  14347. * negative ranges.
  14348. *
  14349. * @static
  14350. * @memberOf _
  14351. * @since 3.3.0
  14352. * @category Number
  14353. * @param {number} number The number to check.
  14354. * @param {number} [start=0] The start of the range.
  14355. * @param {number} end The end of the range.
  14356. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14357. * @see _.range, _.rangeRight
  14358. * @example
  14359. *
  14360. * _.inRange(3, 2, 4);
  14361. * // => true
  14362. *
  14363. * _.inRange(4, 8);
  14364. * // => true
  14365. *
  14366. * _.inRange(4, 2);
  14367. * // => false
  14368. *
  14369. * _.inRange(2, 2);
  14370. * // => false
  14371. *
  14372. * _.inRange(1.2, 2);
  14373. * // => true
  14374. *
  14375. * _.inRange(5.2, 4);
  14376. * // => false
  14377. *
  14378. * _.inRange(-3, -2, -6);
  14379. * // => true
  14380. */
  14381. function inRange(number, start, end) {
  14382. start = toFinite(start);
  14383. if (end === undefined) {
  14384. end = start;
  14385. start = 0;
  14386. } else {
  14387. end = toFinite(end);
  14388. }
  14389. number = toNumber(number);
  14390. return baseInRange(number, start, end);
  14391. }
  14392. /**
  14393. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14394. * If only one argument is provided a number between `0` and the given number
  14395. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14396. * floats, a floating-point number is returned instead of an integer.
  14397. *
  14398. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14399. * floating-point values which can produce unexpected results.
  14400. *
  14401. * @static
  14402. * @memberOf _
  14403. * @since 0.7.0
  14404. * @category Number
  14405. * @param {number} [lower=0] The lower bound.
  14406. * @param {number} [upper=1] The upper bound.
  14407. * @param {boolean} [floating] Specify returning a floating-point number.
  14408. * @returns {number} Returns the random number.
  14409. * @example
  14410. *
  14411. * _.random(0, 5);
  14412. * // => an integer between 0 and 5
  14413. *
  14414. * _.random(5);
  14415. * // => also an integer between 0 and 5
  14416. *
  14417. * _.random(5, true);
  14418. * // => a floating-point number between 0 and 5
  14419. *
  14420. * _.random(1.2, 5.2);
  14421. * // => a floating-point number between 1.2 and 5.2
  14422. */
  14423. function random(lower, upper, floating) {
  14424. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14425. upper = floating = undefined;
  14426. }
  14427. if (floating === undefined) {
  14428. if (typeof upper == 'boolean') {
  14429. floating = upper;
  14430. upper = undefined;
  14431. }
  14432. else if (typeof lower == 'boolean') {
  14433. floating = lower;
  14434. lower = undefined;
  14435. }
  14436. }
  14437. if (lower === undefined && upper === undefined) {
  14438. lower = 0;
  14439. upper = 1;
  14440. }
  14441. else {
  14442. lower = toFinite(lower);
  14443. if (upper === undefined) {
  14444. upper = lower;
  14445. lower = 0;
  14446. } else {
  14447. upper = toFinite(upper);
  14448. }
  14449. }
  14450. if (lower > upper) {
  14451. var temp = lower;
  14452. lower = upper;
  14453. upper = temp;
  14454. }
  14455. if (floating || lower % 1 || upper % 1) {
  14456. var rand = nativeRandom();
  14457. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14458. }
  14459. return baseRandom(lower, upper);
  14460. }
  14461. /*------------------------------------------------------------------------*/
  14462. /**
  14463. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14464. *
  14465. * @static
  14466. * @memberOf _
  14467. * @since 3.0.0
  14468. * @category String
  14469. * @param {string} [string=''] The string to convert.
  14470. * @returns {string} Returns the camel cased string.
  14471. * @example
  14472. *
  14473. * _.camelCase('Foo Bar');
  14474. * // => 'fooBar'
  14475. *
  14476. * _.camelCase('--foo-bar--');
  14477. * // => 'fooBar'
  14478. *
  14479. * _.camelCase('__FOO_BAR__');
  14480. * // => 'fooBar'
  14481. */
  14482. var camelCase = createCompounder(function(result, word, index) {
  14483. word = word.toLowerCase();
  14484. return result + (index ? capitalize(word) : word);
  14485. });
  14486. /**
  14487. * Converts the first character of `string` to upper case and the remaining
  14488. * to lower case.
  14489. *
  14490. * @static
  14491. * @memberOf _
  14492. * @since 3.0.0
  14493. * @category String
  14494. * @param {string} [string=''] The string to capitalize.
  14495. * @returns {string} Returns the capitalized string.
  14496. * @example
  14497. *
  14498. * _.capitalize('FRED');
  14499. * // => 'Fred'
  14500. */
  14501. function capitalize(string) {
  14502. return upperFirst(toString(string).toLowerCase());
  14503. }
  14504. /**
  14505. * Deburrs `string` by converting
  14506. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14507. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14508. * letters to basic Latin letters and removing
  14509. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14510. *
  14511. * @static
  14512. * @memberOf _
  14513. * @since 3.0.0
  14514. * @category String
  14515. * @param {string} [string=''] The string to deburr.
  14516. * @returns {string} Returns the deburred string.
  14517. * @example
  14518. *
  14519. * _.deburr('déjà vu');
  14520. * // => 'deja vu'
  14521. */
  14522. function deburr(string) {
  14523. string = toString(string);
  14524. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14525. }
  14526. /**
  14527. * Checks if `string` ends with the given target string.
  14528. *
  14529. * @static
  14530. * @memberOf _
  14531. * @since 3.0.0
  14532. * @category String
  14533. * @param {string} [string=''] The string to inspect.
  14534. * @param {string} [target] The string to search for.
  14535. * @param {number} [position=string.length] The position to search up to.
  14536. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14537. * else `false`.
  14538. * @example
  14539. *
  14540. * _.endsWith('abc', 'c');
  14541. * // => true
  14542. *
  14543. * _.endsWith('abc', 'b');
  14544. * // => false
  14545. *
  14546. * _.endsWith('abc', 'b', 2);
  14547. * // => true
  14548. */
  14549. function endsWith(string, target, position) {
  14550. string = toString(string);
  14551. target = baseToString(target);
  14552. var length = string.length;
  14553. position = position === undefined
  14554. ? length
  14555. : baseClamp(toInteger(position), 0, length);
  14556. var end = position;
  14557. position -= target.length;
  14558. return position >= 0 && string.slice(position, end) == target;
  14559. }
  14560. /**
  14561. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14562. * corresponding HTML entities.
  14563. *
  14564. * **Note:** No other characters are escaped. To escape additional
  14565. * characters use a third-party library like [_he_](https://mths.be/he).
  14566. *
  14567. * Though the ">" character is escaped for symmetry, characters like
  14568. * ">" and "/" don't need escaping in HTML and have no special meaning
  14569. * unless they're part of a tag or unquoted attribute value. See
  14570. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14571. * (under "semi-related fun fact") for more details.
  14572. *
  14573. * When working with HTML you should always
  14574. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14575. * XSS vectors.
  14576. *
  14577. * @static
  14578. * @since 0.1.0
  14579. * @memberOf _
  14580. * @category String
  14581. * @param {string} [string=''] The string to escape.
  14582. * @returns {string} Returns the escaped string.
  14583. * @example
  14584. *
  14585. * _.escape('fred, barney, & pebbles');
  14586. * // => 'fred, barney, &amp; pebbles'
  14587. */
  14588. function escape(string) {
  14589. string = toString(string);
  14590. return (string && reHasUnescapedHtml.test(string))
  14591. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14592. : string;
  14593. }
  14594. /**
  14595. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14596. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14597. *
  14598. * @static
  14599. * @memberOf _
  14600. * @since 3.0.0
  14601. * @category String
  14602. * @param {string} [string=''] The string to escape.
  14603. * @returns {string} Returns the escaped string.
  14604. * @example
  14605. *
  14606. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14607. * // => '\[lodash\]\(https://lodash\.com/\)'
  14608. */
  14609. function escapeRegExp(string) {
  14610. string = toString(string);
  14611. return (string && reHasRegExpChar.test(string))
  14612. ? string.replace(reRegExpChar, '\\$&')
  14613. : string;
  14614. }
  14615. /**
  14616. * Converts `string` to
  14617. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14618. *
  14619. * @static
  14620. * @memberOf _
  14621. * @since 3.0.0
  14622. * @category String
  14623. * @param {string} [string=''] The string to convert.
  14624. * @returns {string} Returns the kebab cased string.
  14625. * @example
  14626. *
  14627. * _.kebabCase('Foo Bar');
  14628. * // => 'foo-bar'
  14629. *
  14630. * _.kebabCase('fooBar');
  14631. * // => 'foo-bar'
  14632. *
  14633. * _.kebabCase('__FOO_BAR__');
  14634. * // => 'foo-bar'
  14635. */
  14636. var kebabCase = createCompounder(function(result, word, index) {
  14637. return result + (index ? '-' : '') + word.toLowerCase();
  14638. });
  14639. /**
  14640. * Converts `string`, as space separated words, to lower case.
  14641. *
  14642. * @static
  14643. * @memberOf _
  14644. * @since 4.0.0
  14645. * @category String
  14646. * @param {string} [string=''] The string to convert.
  14647. * @returns {string} Returns the lower cased string.
  14648. * @example
  14649. *
  14650. * _.lowerCase('--Foo-Bar--');
  14651. * // => 'foo bar'
  14652. *
  14653. * _.lowerCase('fooBar');
  14654. * // => 'foo bar'
  14655. *
  14656. * _.lowerCase('__FOO_BAR__');
  14657. * // => 'foo bar'
  14658. */
  14659. var lowerCase = createCompounder(function(result, word, index) {
  14660. return result + (index ? ' ' : '') + word.toLowerCase();
  14661. });
  14662. /**
  14663. * Converts the first character of `string` to lower case.
  14664. *
  14665. * @static
  14666. * @memberOf _
  14667. * @since 4.0.0
  14668. * @category String
  14669. * @param {string} [string=''] The string to convert.
  14670. * @returns {string} Returns the converted string.
  14671. * @example
  14672. *
  14673. * _.lowerFirst('Fred');
  14674. * // => 'fred'
  14675. *
  14676. * _.lowerFirst('FRED');
  14677. * // => 'fRED'
  14678. */
  14679. var lowerFirst = createCaseFirst('toLowerCase');
  14680. /**
  14681. * Pads `string` on the left and right sides if it's shorter than `length`.
  14682. * Padding characters are truncated if they can't be evenly divided by `length`.
  14683. *
  14684. * @static
  14685. * @memberOf _
  14686. * @since 3.0.0
  14687. * @category String
  14688. * @param {string} [string=''] The string to pad.
  14689. * @param {number} [length=0] The padding length.
  14690. * @param {string} [chars=' '] The string used as padding.
  14691. * @returns {string} Returns the padded string.
  14692. * @example
  14693. *
  14694. * _.pad('abc', 8);
  14695. * // => ' abc '
  14696. *
  14697. * _.pad('abc', 8, '_-');
  14698. * // => '_-abc_-_'
  14699. *
  14700. * _.pad('abc', 3);
  14701. * // => 'abc'
  14702. */
  14703. function pad(string, length, chars) {
  14704. string = toString(string);
  14705. length = toInteger(length);
  14706. var strLength = length ? stringSize(string) : 0;
  14707. if (!length || strLength >= length) {
  14708. return string;
  14709. }
  14710. var mid = (length - strLength) / 2;
  14711. return (
  14712. createPadding(nativeFloor(mid), chars) +
  14713. string +
  14714. createPadding(nativeCeil(mid), chars)
  14715. );
  14716. }
  14717. /**
  14718. * Pads `string` on the right side if it's shorter than `length`. Padding
  14719. * characters are truncated if they exceed `length`.
  14720. *
  14721. * @static
  14722. * @memberOf _
  14723. * @since 4.0.0
  14724. * @category String
  14725. * @param {string} [string=''] The string to pad.
  14726. * @param {number} [length=0] The padding length.
  14727. * @param {string} [chars=' '] The string used as padding.
  14728. * @returns {string} Returns the padded string.
  14729. * @example
  14730. *
  14731. * _.padEnd('abc', 6);
  14732. * // => 'abc '
  14733. *
  14734. * _.padEnd('abc', 6, '_-');
  14735. * // => 'abc_-_'
  14736. *
  14737. * _.padEnd('abc', 3);
  14738. * // => 'abc'
  14739. */
  14740. function padEnd(string, length, chars) {
  14741. string = toString(string);
  14742. length = toInteger(length);
  14743. var strLength = length ? stringSize(string) : 0;
  14744. return (length && strLength < length)
  14745. ? (string + createPadding(length - strLength, chars))
  14746. : string;
  14747. }
  14748. /**
  14749. * Pads `string` on the left side if it's shorter than `length`. Padding
  14750. * characters are truncated if they exceed `length`.
  14751. *
  14752. * @static
  14753. * @memberOf _
  14754. * @since 4.0.0
  14755. * @category String
  14756. * @param {string} [string=''] The string to pad.
  14757. * @param {number} [length=0] The padding length.
  14758. * @param {string} [chars=' '] The string used as padding.
  14759. * @returns {string} Returns the padded string.
  14760. * @example
  14761. *
  14762. * _.padStart('abc', 6);
  14763. * // => ' abc'
  14764. *
  14765. * _.padStart('abc', 6, '_-');
  14766. * // => '_-_abc'
  14767. *
  14768. * _.padStart('abc', 3);
  14769. * // => 'abc'
  14770. */
  14771. function padStart(string, length, chars) {
  14772. string = toString(string);
  14773. length = toInteger(length);
  14774. var strLength = length ? stringSize(string) : 0;
  14775. return (length && strLength < length)
  14776. ? (createPadding(length - strLength, chars) + string)
  14777. : string;
  14778. }
  14779. /**
  14780. * Converts `string` to an integer of the specified radix. If `radix` is
  14781. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14782. * hexadecimal, in which case a `radix` of `16` is used.
  14783. *
  14784. * **Note:** This method aligns with the
  14785. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14786. *
  14787. * @static
  14788. * @memberOf _
  14789. * @since 1.1.0
  14790. * @category String
  14791. * @param {string} string The string to convert.
  14792. * @param {number} [radix=10] The radix to interpret `value` by.
  14793. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14794. * @returns {number} Returns the converted integer.
  14795. * @example
  14796. *
  14797. * _.parseInt('08');
  14798. * // => 8
  14799. *
  14800. * _.map(['6', '08', '10'], _.parseInt);
  14801. * // => [6, 8, 10]
  14802. */
  14803. function parseInt(string, radix, guard) {
  14804. if (guard || radix == null) {
  14805. radix = 0;
  14806. } else if (radix) {
  14807. radix = +radix;
  14808. }
  14809. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14810. }
  14811. /**
  14812. * Repeats the given string `n` times.
  14813. *
  14814. * @static
  14815. * @memberOf _
  14816. * @since 3.0.0
  14817. * @category String
  14818. * @param {string} [string=''] The string to repeat.
  14819. * @param {number} [n=1] The number of times to repeat the string.
  14820. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14821. * @returns {string} Returns the repeated string.
  14822. * @example
  14823. *
  14824. * _.repeat('*', 3);
  14825. * // => '***'
  14826. *
  14827. * _.repeat('abc', 2);
  14828. * // => 'abcabc'
  14829. *
  14830. * _.repeat('abc', 0);
  14831. * // => ''
  14832. */
  14833. function repeat(string, n, guard) {
  14834. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14835. n = 1;
  14836. } else {
  14837. n = toInteger(n);
  14838. }
  14839. return baseRepeat(toString(string), n);
  14840. }
  14841. /**
  14842. * Replaces matches for `pattern` in `string` with `replacement`.
  14843. *
  14844. * **Note:** This method is based on
  14845. * [`String#replace`](https://mdn.io/String/replace).
  14846. *
  14847. * @static
  14848. * @memberOf _
  14849. * @since 4.0.0
  14850. * @category String
  14851. * @param {string} [string=''] The string to modify.
  14852. * @param {RegExp|string} pattern The pattern to replace.
  14853. * @param {Function|string} replacement The match replacement.
  14854. * @returns {string} Returns the modified string.
  14855. * @example
  14856. *
  14857. * _.replace('Hi Fred', 'Fred', 'Barney');
  14858. * // => 'Hi Barney'
  14859. */
  14860. function replace() {
  14861. var args = arguments,
  14862. string = toString(args[0]);
  14863. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14864. }
  14865. /**
  14866. * Converts `string` to
  14867. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14868. *
  14869. * @static
  14870. * @memberOf _
  14871. * @since 3.0.0
  14872. * @category String
  14873. * @param {string} [string=''] The string to convert.
  14874. * @returns {string} Returns the snake cased string.
  14875. * @example
  14876. *
  14877. * _.snakeCase('Foo Bar');
  14878. * // => 'foo_bar'
  14879. *
  14880. * _.snakeCase('fooBar');
  14881. * // => 'foo_bar'
  14882. *
  14883. * _.snakeCase('--FOO-BAR--');
  14884. * // => 'foo_bar'
  14885. */
  14886. var snakeCase = createCompounder(function(result, word, index) {
  14887. return result + (index ? '_' : '') + word.toLowerCase();
  14888. });
  14889. /**
  14890. * Splits `string` by `separator`.
  14891. *
  14892. * **Note:** This method is based on
  14893. * [`String#split`](https://mdn.io/String/split).
  14894. *
  14895. * @static
  14896. * @memberOf _
  14897. * @since 4.0.0
  14898. * @category String
  14899. * @param {string} [string=''] The string to split.
  14900. * @param {RegExp|string} separator The separator pattern to split by.
  14901. * @param {number} [limit] The length to truncate results to.
  14902. * @returns {Array} Returns the string segments.
  14903. * @example
  14904. *
  14905. * _.split('a-b-c', '-', 2);
  14906. * // => ['a', 'b']
  14907. */
  14908. function split(string, separator, limit) {
  14909. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14910. separator = limit = undefined;
  14911. }
  14912. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14913. if (!limit) {
  14914. return [];
  14915. }
  14916. string = toString(string);
  14917. if (string && (
  14918. typeof separator == 'string' ||
  14919. (separator != null && !isRegExp(separator))
  14920. )) {
  14921. separator = baseToString(separator);
  14922. if (!separator && hasUnicode(string)) {
  14923. return castSlice(stringToArray(string), 0, limit);
  14924. }
  14925. }
  14926. return string.split(separator, limit);
  14927. }
  14928. /**
  14929. * Converts `string` to
  14930. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14931. *
  14932. * @static
  14933. * @memberOf _
  14934. * @since 3.1.0
  14935. * @category String
  14936. * @param {string} [string=''] The string to convert.
  14937. * @returns {string} Returns the start cased string.
  14938. * @example
  14939. *
  14940. * _.startCase('--foo-bar--');
  14941. * // => 'Foo Bar'
  14942. *
  14943. * _.startCase('fooBar');
  14944. * // => 'Foo Bar'
  14945. *
  14946. * _.startCase('__FOO_BAR__');
  14947. * // => 'FOO BAR'
  14948. */
  14949. var startCase = createCompounder(function(result, word, index) {
  14950. return result + (index ? ' ' : '') + upperFirst(word);
  14951. });
  14952. /**
  14953. * Checks if `string` starts with the given target string.
  14954. *
  14955. * @static
  14956. * @memberOf _
  14957. * @since 3.0.0
  14958. * @category String
  14959. * @param {string} [string=''] The string to inspect.
  14960. * @param {string} [target] The string to search for.
  14961. * @param {number} [position=0] The position to search from.
  14962. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14963. * else `false`.
  14964. * @example
  14965. *
  14966. * _.startsWith('abc', 'a');
  14967. * // => true
  14968. *
  14969. * _.startsWith('abc', 'b');
  14970. * // => false
  14971. *
  14972. * _.startsWith('abc', 'b', 1);
  14973. * // => true
  14974. */
  14975. function startsWith(string, target, position) {
  14976. string = toString(string);
  14977. position = position == null
  14978. ? 0
  14979. : baseClamp(toInteger(position), 0, string.length);
  14980. target = baseToString(target);
  14981. return string.slice(position, position + target.length) == target;
  14982. }
  14983. /**
  14984. * Creates a compiled template function that can interpolate data properties
  14985. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14986. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14987. * properties may be accessed as free variables in the template. If a setting
  14988. * object is given, it takes precedence over `_.templateSettings` values.
  14989. *
  14990. * **Note:** In the development build `_.template` utilizes
  14991. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14992. * for easier debugging.
  14993. *
  14994. * For more information on precompiling templates see
  14995. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14996. *
  14997. * For more information on Chrome extension sandboxes see
  14998. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14999. *
  15000. * @static
  15001. * @since 0.1.0
  15002. * @memberOf _
  15003. * @category String
  15004. * @param {string} [string=''] The template string.
  15005. * @param {Object} [options={}] The options object.
  15006. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15007. * The HTML "escape" delimiter.
  15008. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15009. * The "evaluate" delimiter.
  15010. * @param {Object} [options.imports=_.templateSettings.imports]
  15011. * An object to import into the template as free variables.
  15012. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15013. * The "interpolate" delimiter.
  15014. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15015. * The sourceURL of the compiled template.
  15016. * @param {string} [options.variable='obj']
  15017. * The data object variable name.
  15018. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15019. * @returns {Function} Returns the compiled template function.
  15020. * @example
  15021. *
  15022. * // Use the "interpolate" delimiter to create a compiled template.
  15023. * var compiled = _.template('hello <%= user %>!');
  15024. * compiled({ 'user': 'fred' });
  15025. * // => 'hello fred!'
  15026. *
  15027. * // Use the HTML "escape" delimiter to escape data property values.
  15028. * var compiled = _.template('<b><%- value %></b>');
  15029. * compiled({ 'value': '<script>' });
  15030. * // => '<b>&lt;script&gt;</b>'
  15031. *
  15032. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15033. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15034. * compiled({ 'users': ['fred', 'barney'] });
  15035. * // => '<li>fred</li><li>barney</li>'
  15036. *
  15037. * // Use the internal `print` function in "evaluate" delimiters.
  15038. * var compiled = _.template('<% print("hello " + user); %>!');
  15039. * compiled({ 'user': 'barney' });
  15040. * // => 'hello barney!'
  15041. *
  15042. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15043. * // Disable support by replacing the "interpolate" delimiter.
  15044. * var compiled = _.template('hello ${ user }!');
  15045. * compiled({ 'user': 'pebbles' });
  15046. * // => 'hello pebbles!'
  15047. *
  15048. * // Use backslashes to treat delimiters as plain text.
  15049. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15050. * compiled({ 'value': 'ignored' });
  15051. * // => '<%- value %>'
  15052. *
  15053. * // Use the `imports` option to import `jQuery` as `jq`.
  15054. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15055. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15056. * compiled({ 'users': ['fred', 'barney'] });
  15057. * // => '<li>fred</li><li>barney</li>'
  15058. *
  15059. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15060. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15061. * compiled(data);
  15062. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15063. *
  15064. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15065. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15066. * compiled.source;
  15067. * // => function(data) {
  15068. * // var __t, __p = '';
  15069. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15070. * // return __p;
  15071. * // }
  15072. *
  15073. * // Use custom template delimiters.
  15074. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15075. * var compiled = _.template('hello {{ user }}!');
  15076. * compiled({ 'user': 'mustache' });
  15077. * // => 'hello mustache!'
  15078. *
  15079. * // Use the `source` property to inline compiled templates for meaningful
  15080. * // line numbers in error messages and stack traces.
  15081. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15082. * var JST = {\
  15083. * "main": ' + _.template(mainText).source + '\
  15084. * };\
  15085. * ');
  15086. */
  15087. function template(string, options, guard) {
  15088. // Based on John Resig's `tmpl` implementation
  15089. // (http://ejohn.org/blog/javascript-micro-templating/)
  15090. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15091. var settings = lodash.templateSettings;
  15092. if (guard && isIterateeCall(string, options, guard)) {
  15093. options = undefined;
  15094. }
  15095. string = toString(string);
  15096. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15097. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15098. importsKeys = keys(imports),
  15099. importsValues = baseValues(imports, importsKeys);
  15100. var isEscaping,
  15101. isEvaluating,
  15102. index = 0,
  15103. interpolate = options.interpolate || reNoMatch,
  15104. source = "__p += '";
  15105. // Compile the regexp to match each delimiter.
  15106. var reDelimiters = RegExp(
  15107. (options.escape || reNoMatch).source + '|' +
  15108. interpolate.source + '|' +
  15109. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15110. (options.evaluate || reNoMatch).source + '|$'
  15111. , 'g');
  15112. // Use a sourceURL for easier debugging.
  15113. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15114. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15115. // and escape the comment, thus injecting code that gets evaled.
  15116. var sourceURL = '//# sourceURL=' +
  15117. (hasOwnProperty.call(options, 'sourceURL')
  15118. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15119. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15120. ) + '\n';
  15121. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15122. interpolateValue || (interpolateValue = esTemplateValue);
  15123. // Escape characters that can't be included in string literals.
  15124. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15125. // Replace delimiters with snippets.
  15126. if (escapeValue) {
  15127. isEscaping = true;
  15128. source += "' +\n__e(" + escapeValue + ") +\n'";
  15129. }
  15130. if (evaluateValue) {
  15131. isEvaluating = true;
  15132. source += "';\n" + evaluateValue + ";\n__p += '";
  15133. }
  15134. if (interpolateValue) {
  15135. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15136. }
  15137. index = offset + match.length;
  15138. // The JS engine embedded in Adobe products needs `match` returned in
  15139. // order to produce the correct `offset` value.
  15140. return match;
  15141. });
  15142. source += "';\n";
  15143. // If `variable` is not specified wrap a with-statement around the generated
  15144. // code to add the data object to the top of the scope chain.
  15145. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15146. if (!variable) {
  15147. source = 'with (obj) {\n' + source + '\n}\n';
  15148. }
  15149. // Throw an error if a forbidden character was found in `variable`, to prevent
  15150. // potential command injection attacks.
  15151. else if (reForbiddenIdentifierChars.test(variable)) {
  15152. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15153. }
  15154. // Cleanup code by stripping empty strings.
  15155. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15156. .replace(reEmptyStringMiddle, '$1')
  15157. .replace(reEmptyStringTrailing, '$1;');
  15158. // Frame code as the function body.
  15159. source = 'function(' + (variable || 'obj') + ') {\n' +
  15160. (variable
  15161. ? ''
  15162. : 'obj || (obj = {});\n'
  15163. ) +
  15164. "var __t, __p = ''" +
  15165. (isEscaping
  15166. ? ', __e = _.escape'
  15167. : ''
  15168. ) +
  15169. (isEvaluating
  15170. ? ', __j = Array.prototype.join;\n' +
  15171. "function print() { __p += __j.call(arguments, '') }\n"
  15172. : ';\n'
  15173. ) +
  15174. source +
  15175. 'return __p\n}';
  15176. var result = attempt(function() {
  15177. return Function(importsKeys, sourceURL + 'return ' + source)
  15178. .apply(undefined, importsValues);
  15179. });
  15180. // Provide the compiled function's source by its `toString` method or
  15181. // the `source` property as a convenience for inlining compiled templates.
  15182. result.source = source;
  15183. if (isError(result)) {
  15184. throw result;
  15185. }
  15186. return result;
  15187. }
  15188. /**
  15189. * Converts `string`, as a whole, to lower case just like
  15190. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15191. *
  15192. * @static
  15193. * @memberOf _
  15194. * @since 4.0.0
  15195. * @category String
  15196. * @param {string} [string=''] The string to convert.
  15197. * @returns {string} Returns the lower cased string.
  15198. * @example
  15199. *
  15200. * _.toLower('--Foo-Bar--');
  15201. * // => '--foo-bar--'
  15202. *
  15203. * _.toLower('fooBar');
  15204. * // => 'foobar'
  15205. *
  15206. * _.toLower('__FOO_BAR__');
  15207. * // => '__foo_bar__'
  15208. */
  15209. function toLower(value) {
  15210. return toString(value).toLowerCase();
  15211. }
  15212. /**
  15213. * Converts `string`, as a whole, to upper case just like
  15214. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15215. *
  15216. * @static
  15217. * @memberOf _
  15218. * @since 4.0.0
  15219. * @category String
  15220. * @param {string} [string=''] The string to convert.
  15221. * @returns {string} Returns the upper cased string.
  15222. * @example
  15223. *
  15224. * _.toUpper('--foo-bar--');
  15225. * // => '--FOO-BAR--'
  15226. *
  15227. * _.toUpper('fooBar');
  15228. * // => 'FOOBAR'
  15229. *
  15230. * _.toUpper('__foo_bar__');
  15231. * // => '__FOO_BAR__'
  15232. */
  15233. function toUpper(value) {
  15234. return toString(value).toUpperCase();
  15235. }
  15236. /**
  15237. * Removes leading and trailing whitespace or specified characters from `string`.
  15238. *
  15239. * @static
  15240. * @memberOf _
  15241. * @since 3.0.0
  15242. * @category String
  15243. * @param {string} [string=''] The string to trim.
  15244. * @param {string} [chars=whitespace] The characters to trim.
  15245. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15246. * @returns {string} Returns the trimmed string.
  15247. * @example
  15248. *
  15249. * _.trim(' abc ');
  15250. * // => 'abc'
  15251. *
  15252. * _.trim('-_-abc-_-', '_-');
  15253. * // => 'abc'
  15254. *
  15255. * _.map([' foo ', ' bar '], _.trim);
  15256. * // => ['foo', 'bar']
  15257. */
  15258. function trim(string, chars, guard) {
  15259. string = toString(string);
  15260. if (string && (guard || chars === undefined)) {
  15261. return baseTrim(string);
  15262. }
  15263. if (!string || !(chars = baseToString(chars))) {
  15264. return string;
  15265. }
  15266. var strSymbols = stringToArray(string),
  15267. chrSymbols = stringToArray(chars),
  15268. start = charsStartIndex(strSymbols, chrSymbols),
  15269. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15270. return castSlice(strSymbols, start, end).join('');
  15271. }
  15272. /**
  15273. * Removes trailing whitespace or specified characters from `string`.
  15274. *
  15275. * @static
  15276. * @memberOf _
  15277. * @since 4.0.0
  15278. * @category String
  15279. * @param {string} [string=''] The string to trim.
  15280. * @param {string} [chars=whitespace] The characters to trim.
  15281. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15282. * @returns {string} Returns the trimmed string.
  15283. * @example
  15284. *
  15285. * _.trimEnd(' abc ');
  15286. * // => ' abc'
  15287. *
  15288. * _.trimEnd('-_-abc-_-', '_-');
  15289. * // => '-_-abc'
  15290. */
  15291. function trimEnd(string, chars, guard) {
  15292. string = toString(string);
  15293. if (string && (guard || chars === undefined)) {
  15294. return string.slice(0, trimmedEndIndex(string) + 1);
  15295. }
  15296. if (!string || !(chars = baseToString(chars))) {
  15297. return string;
  15298. }
  15299. var strSymbols = stringToArray(string),
  15300. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15301. return castSlice(strSymbols, 0, end).join('');
  15302. }
  15303. /**
  15304. * Removes leading whitespace or specified characters from `string`.
  15305. *
  15306. * @static
  15307. * @memberOf _
  15308. * @since 4.0.0
  15309. * @category String
  15310. * @param {string} [string=''] The string to trim.
  15311. * @param {string} [chars=whitespace] The characters to trim.
  15312. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15313. * @returns {string} Returns the trimmed string.
  15314. * @example
  15315. *
  15316. * _.trimStart(' abc ');
  15317. * // => 'abc '
  15318. *
  15319. * _.trimStart('-_-abc-_-', '_-');
  15320. * // => 'abc-_-'
  15321. */
  15322. function trimStart(string, chars, guard) {
  15323. string = toString(string);
  15324. if (string && (guard || chars === undefined)) {
  15325. return string.replace(reTrimStart, '');
  15326. }
  15327. if (!string || !(chars = baseToString(chars))) {
  15328. return string;
  15329. }
  15330. var strSymbols = stringToArray(string),
  15331. start = charsStartIndex(strSymbols, stringToArray(chars));
  15332. return castSlice(strSymbols, start).join('');
  15333. }
  15334. /**
  15335. * Truncates `string` if it's longer than the given maximum string length.
  15336. * The last characters of the truncated string are replaced with the omission
  15337. * string which defaults to "...".
  15338. *
  15339. * @static
  15340. * @memberOf _
  15341. * @since 4.0.0
  15342. * @category String
  15343. * @param {string} [string=''] The string to truncate.
  15344. * @param {Object} [options={}] The options object.
  15345. * @param {number} [options.length=30] The maximum string length.
  15346. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15347. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15348. * @returns {string} Returns the truncated string.
  15349. * @example
  15350. *
  15351. * _.truncate('hi-diddly-ho there, neighborino');
  15352. * // => 'hi-diddly-ho there, neighbo...'
  15353. *
  15354. * _.truncate('hi-diddly-ho there, neighborino', {
  15355. * 'length': 24,
  15356. * 'separator': ' '
  15357. * });
  15358. * // => 'hi-diddly-ho there,...'
  15359. *
  15360. * _.truncate('hi-diddly-ho there, neighborino', {
  15361. * 'length': 24,
  15362. * 'separator': /,? +/
  15363. * });
  15364. * // => 'hi-diddly-ho there...'
  15365. *
  15366. * _.truncate('hi-diddly-ho there, neighborino', {
  15367. * 'omission': ' [...]'
  15368. * });
  15369. * // => 'hi-diddly-ho there, neig [...]'
  15370. */
  15371. function truncate(string, options) {
  15372. var length = DEFAULT_TRUNC_LENGTH,
  15373. omission = DEFAULT_TRUNC_OMISSION;
  15374. if (isObject(options)) {
  15375. var separator = 'separator' in options ? options.separator : separator;
  15376. length = 'length' in options ? toInteger(options.length) : length;
  15377. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15378. }
  15379. string = toString(string);
  15380. var strLength = string.length;
  15381. if (hasUnicode(string)) {
  15382. var strSymbols = stringToArray(string);
  15383. strLength = strSymbols.length;
  15384. }
  15385. if (length >= strLength) {
  15386. return string;
  15387. }
  15388. var end = length - stringSize(omission);
  15389. if (end < 1) {
  15390. return omission;
  15391. }
  15392. var result = strSymbols
  15393. ? castSlice(strSymbols, 0, end).join('')
  15394. : string.slice(0, end);
  15395. if (separator === undefined) {
  15396. return result + omission;
  15397. }
  15398. if (strSymbols) {
  15399. end += (result.length - end);
  15400. }
  15401. if (isRegExp(separator)) {
  15402. if (string.slice(end).search(separator)) {
  15403. var match,
  15404. substring = result;
  15405. if (!separator.global) {
  15406. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15407. }
  15408. separator.lastIndex = 0;
  15409. while ((match = separator.exec(substring))) {
  15410. var newEnd = match.index;
  15411. }
  15412. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15413. }
  15414. } else if (string.indexOf(baseToString(separator), end) != end) {
  15415. var index = result.lastIndexOf(separator);
  15416. if (index > -1) {
  15417. result = result.slice(0, index);
  15418. }
  15419. }
  15420. return result + omission;
  15421. }
  15422. /**
  15423. * The inverse of `_.escape`; this method converts the HTML entities
  15424. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15425. * their corresponding characters.
  15426. *
  15427. * **Note:** No other HTML entities are unescaped. To unescape additional
  15428. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15429. *
  15430. * @static
  15431. * @memberOf _
  15432. * @since 0.6.0
  15433. * @category String
  15434. * @param {string} [string=''] The string to unescape.
  15435. * @returns {string} Returns the unescaped string.
  15436. * @example
  15437. *
  15438. * _.unescape('fred, barney, &amp; pebbles');
  15439. * // => 'fred, barney, & pebbles'
  15440. */
  15441. function unescape(string) {
  15442. string = toString(string);
  15443. return (string && reHasEscapedHtml.test(string))
  15444. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15445. : string;
  15446. }
  15447. /**
  15448. * Converts `string`, as space separated words, to upper case.
  15449. *
  15450. * @static
  15451. * @memberOf _
  15452. * @since 4.0.0
  15453. * @category String
  15454. * @param {string} [string=''] The string to convert.
  15455. * @returns {string} Returns the upper cased string.
  15456. * @example
  15457. *
  15458. * _.upperCase('--foo-bar');
  15459. * // => 'FOO BAR'
  15460. *
  15461. * _.upperCase('fooBar');
  15462. * // => 'FOO BAR'
  15463. *
  15464. * _.upperCase('__foo_bar__');
  15465. * // => 'FOO BAR'
  15466. */
  15467. var upperCase = createCompounder(function(result, word, index) {
  15468. return result + (index ? ' ' : '') + word.toUpperCase();
  15469. });
  15470. /**
  15471. * Converts the first character of `string` to upper case.
  15472. *
  15473. * @static
  15474. * @memberOf _
  15475. * @since 4.0.0
  15476. * @category String
  15477. * @param {string} [string=''] The string to convert.
  15478. * @returns {string} Returns the converted string.
  15479. * @example
  15480. *
  15481. * _.upperFirst('fred');
  15482. * // => 'Fred'
  15483. *
  15484. * _.upperFirst('FRED');
  15485. * // => 'FRED'
  15486. */
  15487. var upperFirst = createCaseFirst('toUpperCase');
  15488. /**
  15489. * Splits `string` into an array of its words.
  15490. *
  15491. * @static
  15492. * @memberOf _
  15493. * @since 3.0.0
  15494. * @category String
  15495. * @param {string} [string=''] The string to inspect.
  15496. * @param {RegExp|string} [pattern] The pattern to match words.
  15497. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15498. * @returns {Array} Returns the words of `string`.
  15499. * @example
  15500. *
  15501. * _.words('fred, barney, & pebbles');
  15502. * // => ['fred', 'barney', 'pebbles']
  15503. *
  15504. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15505. * // => ['fred', 'barney', '&', 'pebbles']
  15506. */
  15507. function words(string, pattern, guard) {
  15508. string = toString(string);
  15509. pattern = guard ? undefined : pattern;
  15510. if (pattern === undefined) {
  15511. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15512. }
  15513. return string.match(pattern) || [];
  15514. }
  15515. /*------------------------------------------------------------------------*/
  15516. /**
  15517. * Attempts to invoke `func`, returning either the result or the caught error
  15518. * object. Any additional arguments are provided to `func` when it's invoked.
  15519. *
  15520. * @static
  15521. * @memberOf _
  15522. * @since 3.0.0
  15523. * @category Util
  15524. * @param {Function} func The function to attempt.
  15525. * @param {...*} [args] The arguments to invoke `func` with.
  15526. * @returns {*} Returns the `func` result or error object.
  15527. * @example
  15528. *
  15529. * // Avoid throwing errors for invalid selectors.
  15530. * var elements = _.attempt(function(selector) {
  15531. * return document.querySelectorAll(selector);
  15532. * }, '>_>');
  15533. *
  15534. * if (_.isError(elements)) {
  15535. * elements = [];
  15536. * }
  15537. */
  15538. var attempt = baseRest(function(func, args) {
  15539. try {
  15540. return apply(func, undefined, args);
  15541. } catch (e) {
  15542. return isError(e) ? e : new Error(e);
  15543. }
  15544. });
  15545. /**
  15546. * Binds methods of an object to the object itself, overwriting the existing
  15547. * method.
  15548. *
  15549. * **Note:** This method doesn't set the "length" property of bound functions.
  15550. *
  15551. * @static
  15552. * @since 0.1.0
  15553. * @memberOf _
  15554. * @category Util
  15555. * @param {Object} object The object to bind and assign the bound methods to.
  15556. * @param {...(string|string[])} methodNames The object method names to bind.
  15557. * @returns {Object} Returns `object`.
  15558. * @example
  15559. *
  15560. * var view = {
  15561. * 'label': 'docs',
  15562. * 'click': function() {
  15563. * console.log('clicked ' + this.label);
  15564. * }
  15565. * };
  15566. *
  15567. * _.bindAll(view, ['click']);
  15568. * jQuery(element).on('click', view.click);
  15569. * // => Logs 'clicked docs' when clicked.
  15570. */
  15571. var bindAll = flatRest(function(object, methodNames) {
  15572. arrayEach(methodNames, function(key) {
  15573. key = toKey(key);
  15574. baseAssignValue(object, key, bind(object[key], object));
  15575. });
  15576. return object;
  15577. });
  15578. /**
  15579. * Creates a function that iterates over `pairs` and invokes the corresponding
  15580. * function of the first predicate to return truthy. The predicate-function
  15581. * pairs are invoked with the `this` binding and arguments of the created
  15582. * function.
  15583. *
  15584. * @static
  15585. * @memberOf _
  15586. * @since 4.0.0
  15587. * @category Util
  15588. * @param {Array} pairs The predicate-function pairs.
  15589. * @returns {Function} Returns the new composite function.
  15590. * @example
  15591. *
  15592. * var func = _.cond([
  15593. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15594. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15595. * [_.stubTrue, _.constant('no match')]
  15596. * ]);
  15597. *
  15598. * func({ 'a': 1, 'b': 2 });
  15599. * // => 'matches A'
  15600. *
  15601. * func({ 'a': 0, 'b': 1 });
  15602. * // => 'matches B'
  15603. *
  15604. * func({ 'a': '1', 'b': '2' });
  15605. * // => 'no match'
  15606. */
  15607. function cond(pairs) {
  15608. var length = pairs == null ? 0 : pairs.length,
  15609. toIteratee = getIteratee();
  15610. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15611. if (typeof pair[1] != 'function') {
  15612. throw new TypeError(FUNC_ERROR_TEXT);
  15613. }
  15614. return [toIteratee(pair[0]), pair[1]];
  15615. });
  15616. return baseRest(function(args) {
  15617. var index = -1;
  15618. while (++index < length) {
  15619. var pair = pairs[index];
  15620. if (apply(pair[0], this, args)) {
  15621. return apply(pair[1], this, args);
  15622. }
  15623. }
  15624. });
  15625. }
  15626. /**
  15627. * Creates a function that invokes the predicate properties of `source` with
  15628. * the corresponding property values of a given object, returning `true` if
  15629. * all predicates return truthy, else `false`.
  15630. *
  15631. * **Note:** The created function is equivalent to `_.conformsTo` with
  15632. * `source` partially applied.
  15633. *
  15634. * @static
  15635. * @memberOf _
  15636. * @since 4.0.0
  15637. * @category Util
  15638. * @param {Object} source The object of property predicates to conform to.
  15639. * @returns {Function} Returns the new spec function.
  15640. * @example
  15641. *
  15642. * var objects = [
  15643. * { 'a': 2, 'b': 1 },
  15644. * { 'a': 1, 'b': 2 }
  15645. * ];
  15646. *
  15647. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15648. * // => [{ 'a': 1, 'b': 2 }]
  15649. */
  15650. function conforms(source) {
  15651. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15652. }
  15653. /**
  15654. * Creates a function that returns `value`.
  15655. *
  15656. * @static
  15657. * @memberOf _
  15658. * @since 2.4.0
  15659. * @category Util
  15660. * @param {*} value The value to return from the new function.
  15661. * @returns {Function} Returns the new constant function.
  15662. * @example
  15663. *
  15664. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15665. *
  15666. * console.log(objects);
  15667. * // => [{ 'a': 1 }, { 'a': 1 }]
  15668. *
  15669. * console.log(objects[0] === objects[1]);
  15670. * // => true
  15671. */
  15672. function constant(value) {
  15673. return function() {
  15674. return value;
  15675. };
  15676. }
  15677. /**
  15678. * Checks `value` to determine whether a default value should be returned in
  15679. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15680. * or `undefined`.
  15681. *
  15682. * @static
  15683. * @memberOf _
  15684. * @since 4.14.0
  15685. * @category Util
  15686. * @param {*} value The value to check.
  15687. * @param {*} defaultValue The default value.
  15688. * @returns {*} Returns the resolved value.
  15689. * @example
  15690. *
  15691. * _.defaultTo(1, 10);
  15692. * // => 1
  15693. *
  15694. * _.defaultTo(undefined, 10);
  15695. * // => 10
  15696. */
  15697. function defaultTo(value, defaultValue) {
  15698. return (value == null || value !== value) ? defaultValue : value;
  15699. }
  15700. /**
  15701. * Creates a function that returns the result of invoking the given functions
  15702. * with the `this` binding of the created function, where each successive
  15703. * invocation is supplied the return value of the previous.
  15704. *
  15705. * @static
  15706. * @memberOf _
  15707. * @since 3.0.0
  15708. * @category Util
  15709. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15710. * @returns {Function} Returns the new composite function.
  15711. * @see _.flowRight
  15712. * @example
  15713. *
  15714. * function square(n) {
  15715. * return n * n;
  15716. * }
  15717. *
  15718. * var addSquare = _.flow([_.add, square]);
  15719. * addSquare(1, 2);
  15720. * // => 9
  15721. */
  15722. var flow = createFlow();
  15723. /**
  15724. * This method is like `_.flow` except that it creates a function that
  15725. * invokes the given functions from right to left.
  15726. *
  15727. * @static
  15728. * @since 3.0.0
  15729. * @memberOf _
  15730. * @category Util
  15731. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15732. * @returns {Function} Returns the new composite function.
  15733. * @see _.flow
  15734. * @example
  15735. *
  15736. * function square(n) {
  15737. * return n * n;
  15738. * }
  15739. *
  15740. * var addSquare = _.flowRight([square, _.add]);
  15741. * addSquare(1, 2);
  15742. * // => 9
  15743. */
  15744. var flowRight = createFlow(true);
  15745. /**
  15746. * This method returns the first argument it receives.
  15747. *
  15748. * @static
  15749. * @since 0.1.0
  15750. * @memberOf _
  15751. * @category Util
  15752. * @param {*} value Any value.
  15753. * @returns {*} Returns `value`.
  15754. * @example
  15755. *
  15756. * var object = { 'a': 1 };
  15757. *
  15758. * console.log(_.identity(object) === object);
  15759. * // => true
  15760. */
  15761. function identity(value) {
  15762. return value;
  15763. }
  15764. /**
  15765. * Creates a function that invokes `func` with the arguments of the created
  15766. * function. If `func` is a property name, the created function returns the
  15767. * property value for a given element. If `func` is an array or object, the
  15768. * created function returns `true` for elements that contain the equivalent
  15769. * source properties, otherwise it returns `false`.
  15770. *
  15771. * @static
  15772. * @since 4.0.0
  15773. * @memberOf _
  15774. * @category Util
  15775. * @param {*} [func=_.identity] The value to convert to a callback.
  15776. * @returns {Function} Returns the callback.
  15777. * @example
  15778. *
  15779. * var users = [
  15780. * { 'user': 'barney', 'age': 36, 'active': true },
  15781. * { 'user': 'fred', 'age': 40, 'active': false }
  15782. * ];
  15783. *
  15784. * // The `_.matches` iteratee shorthand.
  15785. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15786. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15787. *
  15788. * // The `_.matchesProperty` iteratee shorthand.
  15789. * _.filter(users, _.iteratee(['user', 'fred']));
  15790. * // => [{ 'user': 'fred', 'age': 40 }]
  15791. *
  15792. * // The `_.property` iteratee shorthand.
  15793. * _.map(users, _.iteratee('user'));
  15794. * // => ['barney', 'fred']
  15795. *
  15796. * // Create custom iteratee shorthands.
  15797. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15798. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15799. * return func.test(string);
  15800. * };
  15801. * });
  15802. *
  15803. * _.filter(['abc', 'def'], /ef/);
  15804. * // => ['def']
  15805. */
  15806. function iteratee(func) {
  15807. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15808. }
  15809. /**
  15810. * Creates a function that performs a partial deep comparison between a given
  15811. * object and `source`, returning `true` if the given object has equivalent
  15812. * property values, else `false`.
  15813. *
  15814. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15815. * partially applied.
  15816. *
  15817. * Partial comparisons will match empty array and empty object `source`
  15818. * values against any array or object value, respectively. See `_.isEqual`
  15819. * for a list of supported value comparisons.
  15820. *
  15821. * **Note:** Multiple values can be checked by combining several matchers
  15822. * using `_.overSome`
  15823. *
  15824. * @static
  15825. * @memberOf _
  15826. * @since 3.0.0
  15827. * @category Util
  15828. * @param {Object} source The object of property values to match.
  15829. * @returns {Function} Returns the new spec function.
  15830. * @example
  15831. *
  15832. * var objects = [
  15833. * { 'a': 1, 'b': 2, 'c': 3 },
  15834. * { 'a': 4, 'b': 5, 'c': 6 }
  15835. * ];
  15836. *
  15837. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15838. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15839. *
  15840. * // Checking for several possible values
  15841. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15842. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15843. */
  15844. function matches(source) {
  15845. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15846. }
  15847. /**
  15848. * Creates a function that performs a partial deep comparison between the
  15849. * value at `path` of a given object to `srcValue`, returning `true` if the
  15850. * object value is equivalent, else `false`.
  15851. *
  15852. * **Note:** Partial comparisons will match empty array and empty object
  15853. * `srcValue` values against any array or object value, respectively. See
  15854. * `_.isEqual` for a list of supported value comparisons.
  15855. *
  15856. * **Note:** Multiple values can be checked by combining several matchers
  15857. * using `_.overSome`
  15858. *
  15859. * @static
  15860. * @memberOf _
  15861. * @since 3.2.0
  15862. * @category Util
  15863. * @param {Array|string} path The path of the property to get.
  15864. * @param {*} srcValue The value to match.
  15865. * @returns {Function} Returns the new spec function.
  15866. * @example
  15867. *
  15868. * var objects = [
  15869. * { 'a': 1, 'b': 2, 'c': 3 },
  15870. * { 'a': 4, 'b': 5, 'c': 6 }
  15871. * ];
  15872. *
  15873. * _.find(objects, _.matchesProperty('a', 4));
  15874. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15875. *
  15876. * // Checking for several possible values
  15877. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15878. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15879. */
  15880. function matchesProperty(path, srcValue) {
  15881. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15882. }
  15883. /**
  15884. * Creates a function that invokes the method at `path` of a given object.
  15885. * Any additional arguments are provided to the invoked method.
  15886. *
  15887. * @static
  15888. * @memberOf _
  15889. * @since 3.7.0
  15890. * @category Util
  15891. * @param {Array|string} path The path of the method to invoke.
  15892. * @param {...*} [args] The arguments to invoke the method with.
  15893. * @returns {Function} Returns the new invoker function.
  15894. * @example
  15895. *
  15896. * var objects = [
  15897. * { 'a': { 'b': _.constant(2) } },
  15898. * { 'a': { 'b': _.constant(1) } }
  15899. * ];
  15900. *
  15901. * _.map(objects, _.method('a.b'));
  15902. * // => [2, 1]
  15903. *
  15904. * _.map(objects, _.method(['a', 'b']));
  15905. * // => [2, 1]
  15906. */
  15907. var method = baseRest(function(path, args) {
  15908. return function(object) {
  15909. return baseInvoke(object, path, args);
  15910. };
  15911. });
  15912. /**
  15913. * The opposite of `_.method`; this method creates a function that invokes
  15914. * the method at a given path of `object`. Any additional arguments are
  15915. * provided to the invoked method.
  15916. *
  15917. * @static
  15918. * @memberOf _
  15919. * @since 3.7.0
  15920. * @category Util
  15921. * @param {Object} object The object to query.
  15922. * @param {...*} [args] The arguments to invoke the method with.
  15923. * @returns {Function} Returns the new invoker function.
  15924. * @example
  15925. *
  15926. * var array = _.times(3, _.constant),
  15927. * object = { 'a': array, 'b': array, 'c': array };
  15928. *
  15929. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15930. * // => [2, 0]
  15931. *
  15932. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15933. * // => [2, 0]
  15934. */
  15935. var methodOf = baseRest(function(object, args) {
  15936. return function(path) {
  15937. return baseInvoke(object, path, args);
  15938. };
  15939. });
  15940. /**
  15941. * Adds all own enumerable string keyed function properties of a source
  15942. * object to the destination object. If `object` is a function, then methods
  15943. * are added to its prototype as well.
  15944. *
  15945. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15946. * avoid conflicts caused by modifying the original.
  15947. *
  15948. * @static
  15949. * @since 0.1.0
  15950. * @memberOf _
  15951. * @category Util
  15952. * @param {Function|Object} [object=lodash] The destination object.
  15953. * @param {Object} source The object of functions to add.
  15954. * @param {Object} [options={}] The options object.
  15955. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15956. * @returns {Function|Object} Returns `object`.
  15957. * @example
  15958. *
  15959. * function vowels(string) {
  15960. * return _.filter(string, function(v) {
  15961. * return /[aeiou]/i.test(v);
  15962. * });
  15963. * }
  15964. *
  15965. * _.mixin({ 'vowels': vowels });
  15966. * _.vowels('fred');
  15967. * // => ['e']
  15968. *
  15969. * _('fred').vowels().value();
  15970. * // => ['e']
  15971. *
  15972. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15973. * _('fred').vowels();
  15974. * // => ['e']
  15975. */
  15976. function mixin(object, source, options) {
  15977. var props = keys(source),
  15978. methodNames = baseFunctions(source, props);
  15979. if (options == null &&
  15980. !(isObject(source) && (methodNames.length || !props.length))) {
  15981. options = source;
  15982. source = object;
  15983. object = this;
  15984. methodNames = baseFunctions(source, keys(source));
  15985. }
  15986. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15987. isFunc = isFunction(object);
  15988. arrayEach(methodNames, function(methodName) {
  15989. var func = source[methodName];
  15990. object[methodName] = func;
  15991. if (isFunc) {
  15992. object.prototype[methodName] = function() {
  15993. var chainAll = this.__chain__;
  15994. if (chain || chainAll) {
  15995. var result = object(this.__wrapped__),
  15996. actions = result.__actions__ = copyArray(this.__actions__);
  15997. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15998. result.__chain__ = chainAll;
  15999. return result;
  16000. }
  16001. return func.apply(object, arrayPush([this.value()], arguments));
  16002. };
  16003. }
  16004. });
  16005. return object;
  16006. }
  16007. /**
  16008. * Reverts the `_` variable to its previous value and returns a reference to
  16009. * the `lodash` function.
  16010. *
  16011. * @static
  16012. * @since 0.1.0
  16013. * @memberOf _
  16014. * @category Util
  16015. * @returns {Function} Returns the `lodash` function.
  16016. * @example
  16017. *
  16018. * var lodash = _.noConflict();
  16019. */
  16020. function noConflict() {
  16021. if (root._ === this) {
  16022. root._ = oldDash;
  16023. }
  16024. return this;
  16025. }
  16026. /**
  16027. * This method returns `undefined`.
  16028. *
  16029. * @static
  16030. * @memberOf _
  16031. * @since 2.3.0
  16032. * @category Util
  16033. * @example
  16034. *
  16035. * _.times(2, _.noop);
  16036. * // => [undefined, undefined]
  16037. */
  16038. function noop() {
  16039. // No operation performed.
  16040. }
  16041. /**
  16042. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16043. * the nth argument from the end is returned.
  16044. *
  16045. * @static
  16046. * @memberOf _
  16047. * @since 4.0.0
  16048. * @category Util
  16049. * @param {number} [n=0] The index of the argument to return.
  16050. * @returns {Function} Returns the new pass-thru function.
  16051. * @example
  16052. *
  16053. * var func = _.nthArg(1);
  16054. * func('a', 'b', 'c', 'd');
  16055. * // => 'b'
  16056. *
  16057. * var func = _.nthArg(-2);
  16058. * func('a', 'b', 'c', 'd');
  16059. * // => 'c'
  16060. */
  16061. function nthArg(n) {
  16062. n = toInteger(n);
  16063. return baseRest(function(args) {
  16064. return baseNth(args, n);
  16065. });
  16066. }
  16067. /**
  16068. * Creates a function that invokes `iteratees` with the arguments it receives
  16069. * and returns their results.
  16070. *
  16071. * @static
  16072. * @memberOf _
  16073. * @since 4.0.0
  16074. * @category Util
  16075. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16076. * The iteratees to invoke.
  16077. * @returns {Function} Returns the new function.
  16078. * @example
  16079. *
  16080. * var func = _.over([Math.max, Math.min]);
  16081. *
  16082. * func(1, 2, 3, 4);
  16083. * // => [4, 1]
  16084. */
  16085. var over = createOver(arrayMap);
  16086. /**
  16087. * Creates a function that checks if **all** of the `predicates` return
  16088. * truthy when invoked with the arguments it receives.
  16089. *
  16090. * Following shorthands are possible for providing predicates.
  16091. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16092. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16093. *
  16094. * @static
  16095. * @memberOf _
  16096. * @since 4.0.0
  16097. * @category Util
  16098. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16099. * The predicates to check.
  16100. * @returns {Function} Returns the new function.
  16101. * @example
  16102. *
  16103. * var func = _.overEvery([Boolean, isFinite]);
  16104. *
  16105. * func('1');
  16106. * // => true
  16107. *
  16108. * func(null);
  16109. * // => false
  16110. *
  16111. * func(NaN);
  16112. * // => false
  16113. */
  16114. var overEvery = createOver(arrayEvery);
  16115. /**
  16116. * Creates a function that checks if **any** of the `predicates` return
  16117. * truthy when invoked with the arguments it receives.
  16118. *
  16119. * Following shorthands are possible for providing predicates.
  16120. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16121. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16122. *
  16123. * @static
  16124. * @memberOf _
  16125. * @since 4.0.0
  16126. * @category Util
  16127. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16128. * The predicates to check.
  16129. * @returns {Function} Returns the new function.
  16130. * @example
  16131. *
  16132. * var func = _.overSome([Boolean, isFinite]);
  16133. *
  16134. * func('1');
  16135. * // => true
  16136. *
  16137. * func(null);
  16138. * // => true
  16139. *
  16140. * func(NaN);
  16141. * // => false
  16142. *
  16143. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16144. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16145. */
  16146. var overSome = createOver(arraySome);
  16147. /**
  16148. * Creates a function that returns the value at `path` of a given object.
  16149. *
  16150. * @static
  16151. * @memberOf _
  16152. * @since 2.4.0
  16153. * @category Util
  16154. * @param {Array|string} path The path of the property to get.
  16155. * @returns {Function} Returns the new accessor function.
  16156. * @example
  16157. *
  16158. * var objects = [
  16159. * { 'a': { 'b': 2 } },
  16160. * { 'a': { 'b': 1 } }
  16161. * ];
  16162. *
  16163. * _.map(objects, _.property('a.b'));
  16164. * // => [2, 1]
  16165. *
  16166. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16167. * // => [1, 2]
  16168. */
  16169. function property(path) {
  16170. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16171. }
  16172. /**
  16173. * The opposite of `_.property`; this method creates a function that returns
  16174. * the value at a given path of `object`.
  16175. *
  16176. * @static
  16177. * @memberOf _
  16178. * @since 3.0.0
  16179. * @category Util
  16180. * @param {Object} object The object to query.
  16181. * @returns {Function} Returns the new accessor function.
  16182. * @example
  16183. *
  16184. * var array = [0, 1, 2],
  16185. * object = { 'a': array, 'b': array, 'c': array };
  16186. *
  16187. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16188. * // => [2, 0]
  16189. *
  16190. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16191. * // => [2, 0]
  16192. */
  16193. function propertyOf(object) {
  16194. return function(path) {
  16195. return object == null ? undefined : baseGet(object, path);
  16196. };
  16197. }
  16198. /**
  16199. * Creates an array of numbers (positive and/or negative) progressing from
  16200. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16201. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16202. * it's set to `start` with `start` then set to `0`.
  16203. *
  16204. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16205. * floating-point values which can produce unexpected results.
  16206. *
  16207. * @static
  16208. * @since 0.1.0
  16209. * @memberOf _
  16210. * @category Util
  16211. * @param {number} [start=0] The start of the range.
  16212. * @param {number} end The end of the range.
  16213. * @param {number} [step=1] The value to increment or decrement by.
  16214. * @returns {Array} Returns the range of numbers.
  16215. * @see _.inRange, _.rangeRight
  16216. * @example
  16217. *
  16218. * _.range(4);
  16219. * // => [0, 1, 2, 3]
  16220. *
  16221. * _.range(-4);
  16222. * // => [0, -1, -2, -3]
  16223. *
  16224. * _.range(1, 5);
  16225. * // => [1, 2, 3, 4]
  16226. *
  16227. * _.range(0, 20, 5);
  16228. * // => [0, 5, 10, 15]
  16229. *
  16230. * _.range(0, -4, -1);
  16231. * // => [0, -1, -2, -3]
  16232. *
  16233. * _.range(1, 4, 0);
  16234. * // => [1, 1, 1]
  16235. *
  16236. * _.range(0);
  16237. * // => []
  16238. */
  16239. var range = createRange();
  16240. /**
  16241. * This method is like `_.range` except that it populates values in
  16242. * descending order.
  16243. *
  16244. * @static
  16245. * @memberOf _
  16246. * @since 4.0.0
  16247. * @category Util
  16248. * @param {number} [start=0] The start of the range.
  16249. * @param {number} end The end of the range.
  16250. * @param {number} [step=1] The value to increment or decrement by.
  16251. * @returns {Array} Returns the range of numbers.
  16252. * @see _.inRange, _.range
  16253. * @example
  16254. *
  16255. * _.rangeRight(4);
  16256. * // => [3, 2, 1, 0]
  16257. *
  16258. * _.rangeRight(-4);
  16259. * // => [-3, -2, -1, 0]
  16260. *
  16261. * _.rangeRight(1, 5);
  16262. * // => [4, 3, 2, 1]
  16263. *
  16264. * _.rangeRight(0, 20, 5);
  16265. * // => [15, 10, 5, 0]
  16266. *
  16267. * _.rangeRight(0, -4, -1);
  16268. * // => [-3, -2, -1, 0]
  16269. *
  16270. * _.rangeRight(1, 4, 0);
  16271. * // => [1, 1, 1]
  16272. *
  16273. * _.rangeRight(0);
  16274. * // => []
  16275. */
  16276. var rangeRight = createRange(true);
  16277. /**
  16278. * This method returns a new empty array.
  16279. *
  16280. * @static
  16281. * @memberOf _
  16282. * @since 4.13.0
  16283. * @category Util
  16284. * @returns {Array} Returns the new empty array.
  16285. * @example
  16286. *
  16287. * var arrays = _.times(2, _.stubArray);
  16288. *
  16289. * console.log(arrays);
  16290. * // => [[], []]
  16291. *
  16292. * console.log(arrays[0] === arrays[1]);
  16293. * // => false
  16294. */
  16295. function stubArray() {
  16296. return [];
  16297. }
  16298. /**
  16299. * This method returns `false`.
  16300. *
  16301. * @static
  16302. * @memberOf _
  16303. * @since 4.13.0
  16304. * @category Util
  16305. * @returns {boolean} Returns `false`.
  16306. * @example
  16307. *
  16308. * _.times(2, _.stubFalse);
  16309. * // => [false, false]
  16310. */
  16311. function stubFalse() {
  16312. return false;
  16313. }
  16314. /**
  16315. * This method returns a new empty object.
  16316. *
  16317. * @static
  16318. * @memberOf _
  16319. * @since 4.13.0
  16320. * @category Util
  16321. * @returns {Object} Returns the new empty object.
  16322. * @example
  16323. *
  16324. * var objects = _.times(2, _.stubObject);
  16325. *
  16326. * console.log(objects);
  16327. * // => [{}, {}]
  16328. *
  16329. * console.log(objects[0] === objects[1]);
  16330. * // => false
  16331. */
  16332. function stubObject() {
  16333. return {};
  16334. }
  16335. /**
  16336. * This method returns an empty string.
  16337. *
  16338. * @static
  16339. * @memberOf _
  16340. * @since 4.13.0
  16341. * @category Util
  16342. * @returns {string} Returns the empty string.
  16343. * @example
  16344. *
  16345. * _.times(2, _.stubString);
  16346. * // => ['', '']
  16347. */
  16348. function stubString() {
  16349. return '';
  16350. }
  16351. /**
  16352. * This method returns `true`.
  16353. *
  16354. * @static
  16355. * @memberOf _
  16356. * @since 4.13.0
  16357. * @category Util
  16358. * @returns {boolean} Returns `true`.
  16359. * @example
  16360. *
  16361. * _.times(2, _.stubTrue);
  16362. * // => [true, true]
  16363. */
  16364. function stubTrue() {
  16365. return true;
  16366. }
  16367. /**
  16368. * Invokes the iteratee `n` times, returning an array of the results of
  16369. * each invocation. The iteratee is invoked with one argument; (index).
  16370. *
  16371. * @static
  16372. * @since 0.1.0
  16373. * @memberOf _
  16374. * @category Util
  16375. * @param {number} n The number of times to invoke `iteratee`.
  16376. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16377. * @returns {Array} Returns the array of results.
  16378. * @example
  16379. *
  16380. * _.times(3, String);
  16381. * // => ['0', '1', '2']
  16382. *
  16383. * _.times(4, _.constant(0));
  16384. * // => [0, 0, 0, 0]
  16385. */
  16386. function times(n, iteratee) {
  16387. n = toInteger(n);
  16388. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16389. return [];
  16390. }
  16391. var index = MAX_ARRAY_LENGTH,
  16392. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16393. iteratee = getIteratee(iteratee);
  16394. n -= MAX_ARRAY_LENGTH;
  16395. var result = baseTimes(length, iteratee);
  16396. while (++index < n) {
  16397. iteratee(index);
  16398. }
  16399. return result;
  16400. }
  16401. /**
  16402. * Converts `value` to a property path array.
  16403. *
  16404. * @static
  16405. * @memberOf _
  16406. * @since 4.0.0
  16407. * @category Util
  16408. * @param {*} value The value to convert.
  16409. * @returns {Array} Returns the new property path array.
  16410. * @example
  16411. *
  16412. * _.toPath('a.b.c');
  16413. * // => ['a', 'b', 'c']
  16414. *
  16415. * _.toPath('a[0].b.c');
  16416. * // => ['a', '0', 'b', 'c']
  16417. */
  16418. function toPath(value) {
  16419. if (isArray(value)) {
  16420. return arrayMap(value, toKey);
  16421. }
  16422. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16423. }
  16424. /**
  16425. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16426. *
  16427. * @static
  16428. * @since 0.1.0
  16429. * @memberOf _
  16430. * @category Util
  16431. * @param {string} [prefix=''] The value to prefix the ID with.
  16432. * @returns {string} Returns the unique ID.
  16433. * @example
  16434. *
  16435. * _.uniqueId('contact_');
  16436. * // => 'contact_104'
  16437. *
  16438. * _.uniqueId();
  16439. * // => '105'
  16440. */
  16441. function uniqueId(prefix) {
  16442. var id = ++idCounter;
  16443. return toString(prefix) + id;
  16444. }
  16445. /*------------------------------------------------------------------------*/
  16446. /**
  16447. * Adds two numbers.
  16448. *
  16449. * @static
  16450. * @memberOf _
  16451. * @since 3.4.0
  16452. * @category Math
  16453. * @param {number} augend The first number in an addition.
  16454. * @param {number} addend The second number in an addition.
  16455. * @returns {number} Returns the total.
  16456. * @example
  16457. *
  16458. * _.add(6, 4);
  16459. * // => 10
  16460. */
  16461. var add = createMathOperation(function(augend, addend) {
  16462. return augend + addend;
  16463. }, 0);
  16464. /**
  16465. * Computes `number` rounded up to `precision`.
  16466. *
  16467. * @static
  16468. * @memberOf _
  16469. * @since 3.10.0
  16470. * @category Math
  16471. * @param {number} number The number to round up.
  16472. * @param {number} [precision=0] The precision to round up to.
  16473. * @returns {number} Returns the rounded up number.
  16474. * @example
  16475. *
  16476. * _.ceil(4.006);
  16477. * // => 5
  16478. *
  16479. * _.ceil(6.004, 2);
  16480. * // => 6.01
  16481. *
  16482. * _.ceil(6040, -2);
  16483. * // => 6100
  16484. */
  16485. var ceil = createRound('ceil');
  16486. /**
  16487. * Divide two numbers.
  16488. *
  16489. * @static
  16490. * @memberOf _
  16491. * @since 4.7.0
  16492. * @category Math
  16493. * @param {number} dividend The first number in a division.
  16494. * @param {number} divisor The second number in a division.
  16495. * @returns {number} Returns the quotient.
  16496. * @example
  16497. *
  16498. * _.divide(6, 4);
  16499. * // => 1.5
  16500. */
  16501. var divide = createMathOperation(function(dividend, divisor) {
  16502. return dividend / divisor;
  16503. }, 1);
  16504. /**
  16505. * Computes `number` rounded down to `precision`.
  16506. *
  16507. * @static
  16508. * @memberOf _
  16509. * @since 3.10.0
  16510. * @category Math
  16511. * @param {number} number The number to round down.
  16512. * @param {number} [precision=0] The precision to round down to.
  16513. * @returns {number} Returns the rounded down number.
  16514. * @example
  16515. *
  16516. * _.floor(4.006);
  16517. * // => 4
  16518. *
  16519. * _.floor(0.046, 2);
  16520. * // => 0.04
  16521. *
  16522. * _.floor(4060, -2);
  16523. * // => 4000
  16524. */
  16525. var floor = createRound('floor');
  16526. /**
  16527. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16528. * `undefined` is returned.
  16529. *
  16530. * @static
  16531. * @since 0.1.0
  16532. * @memberOf _
  16533. * @category Math
  16534. * @param {Array} array The array to iterate over.
  16535. * @returns {*} Returns the maximum value.
  16536. * @example
  16537. *
  16538. * _.max([4, 2, 8, 6]);
  16539. * // => 8
  16540. *
  16541. * _.max([]);
  16542. * // => undefined
  16543. */
  16544. function max(array) {
  16545. return (array && array.length)
  16546. ? baseExtremum(array, identity, baseGt)
  16547. : undefined;
  16548. }
  16549. /**
  16550. * This method is like `_.max` except that it accepts `iteratee` which is
  16551. * invoked for each element in `array` to generate the criterion by which
  16552. * the value is ranked. The iteratee is invoked with one argument: (value).
  16553. *
  16554. * @static
  16555. * @memberOf _
  16556. * @since 4.0.0
  16557. * @category Math
  16558. * @param {Array} array The array to iterate over.
  16559. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16560. * @returns {*} Returns the maximum value.
  16561. * @example
  16562. *
  16563. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16564. *
  16565. * _.maxBy(objects, function(o) { return o.n; });
  16566. * // => { 'n': 2 }
  16567. *
  16568. * // The `_.property` iteratee shorthand.
  16569. * _.maxBy(objects, 'n');
  16570. * // => { 'n': 2 }
  16571. */
  16572. function maxBy(array, iteratee) {
  16573. return (array && array.length)
  16574. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16575. : undefined;
  16576. }
  16577. /**
  16578. * Computes the mean of the values in `array`.
  16579. *
  16580. * @static
  16581. * @memberOf _
  16582. * @since 4.0.0
  16583. * @category Math
  16584. * @param {Array} array The array to iterate over.
  16585. * @returns {number} Returns the mean.
  16586. * @example
  16587. *
  16588. * _.mean([4, 2, 8, 6]);
  16589. * // => 5
  16590. */
  16591. function mean(array) {
  16592. return baseMean(array, identity);
  16593. }
  16594. /**
  16595. * This method is like `_.mean` except that it accepts `iteratee` which is
  16596. * invoked for each element in `array` to generate the value to be averaged.
  16597. * The iteratee is invoked with one argument: (value).
  16598. *
  16599. * @static
  16600. * @memberOf _
  16601. * @since 4.7.0
  16602. * @category Math
  16603. * @param {Array} array The array to iterate over.
  16604. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16605. * @returns {number} Returns the mean.
  16606. * @example
  16607. *
  16608. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16609. *
  16610. * _.meanBy(objects, function(o) { return o.n; });
  16611. * // => 5
  16612. *
  16613. * // The `_.property` iteratee shorthand.
  16614. * _.meanBy(objects, 'n');
  16615. * // => 5
  16616. */
  16617. function meanBy(array, iteratee) {
  16618. return baseMean(array, getIteratee(iteratee, 2));
  16619. }
  16620. /**
  16621. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16622. * `undefined` is returned.
  16623. *
  16624. * @static
  16625. * @since 0.1.0
  16626. * @memberOf _
  16627. * @category Math
  16628. * @param {Array} array The array to iterate over.
  16629. * @returns {*} Returns the minimum value.
  16630. * @example
  16631. *
  16632. * _.min([4, 2, 8, 6]);
  16633. * // => 2
  16634. *
  16635. * _.min([]);
  16636. * // => undefined
  16637. */
  16638. function min(array) {
  16639. return (array && array.length)
  16640. ? baseExtremum(array, identity, baseLt)
  16641. : undefined;
  16642. }
  16643. /**
  16644. * This method is like `_.min` except that it accepts `iteratee` which is
  16645. * invoked for each element in `array` to generate the criterion by which
  16646. * the value is ranked. The iteratee is invoked with one argument: (value).
  16647. *
  16648. * @static
  16649. * @memberOf _
  16650. * @since 4.0.0
  16651. * @category Math
  16652. * @param {Array} array The array to iterate over.
  16653. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16654. * @returns {*} Returns the minimum value.
  16655. * @example
  16656. *
  16657. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16658. *
  16659. * _.minBy(objects, function(o) { return o.n; });
  16660. * // => { 'n': 1 }
  16661. *
  16662. * // The `_.property` iteratee shorthand.
  16663. * _.minBy(objects, 'n');
  16664. * // => { 'n': 1 }
  16665. */
  16666. function minBy(array, iteratee) {
  16667. return (array && array.length)
  16668. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16669. : undefined;
  16670. }
  16671. /**
  16672. * Multiply two numbers.
  16673. *
  16674. * @static
  16675. * @memberOf _
  16676. * @since 4.7.0
  16677. * @category Math
  16678. * @param {number} multiplier The first number in a multiplication.
  16679. * @param {number} multiplicand The second number in a multiplication.
  16680. * @returns {number} Returns the product.
  16681. * @example
  16682. *
  16683. * _.multiply(6, 4);
  16684. * // => 24
  16685. */
  16686. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16687. return multiplier * multiplicand;
  16688. }, 1);
  16689. /**
  16690. * Computes `number` rounded to `precision`.
  16691. *
  16692. * @static
  16693. * @memberOf _
  16694. * @since 3.10.0
  16695. * @category Math
  16696. * @param {number} number The number to round.
  16697. * @param {number} [precision=0] The precision to round to.
  16698. * @returns {number} Returns the rounded number.
  16699. * @example
  16700. *
  16701. * _.round(4.006);
  16702. * // => 4
  16703. *
  16704. * _.round(4.006, 2);
  16705. * // => 4.01
  16706. *
  16707. * _.round(4060, -2);
  16708. * // => 4100
  16709. */
  16710. var round = createRound('round');
  16711. /**
  16712. * Subtract two numbers.
  16713. *
  16714. * @static
  16715. * @memberOf _
  16716. * @since 4.0.0
  16717. * @category Math
  16718. * @param {number} minuend The first number in a subtraction.
  16719. * @param {number} subtrahend The second number in a subtraction.
  16720. * @returns {number} Returns the difference.
  16721. * @example
  16722. *
  16723. * _.subtract(6, 4);
  16724. * // => 2
  16725. */
  16726. var subtract = createMathOperation(function(minuend, subtrahend) {
  16727. return minuend - subtrahend;
  16728. }, 0);
  16729. /**
  16730. * Computes the sum of the values in `array`.
  16731. *
  16732. * @static
  16733. * @memberOf _
  16734. * @since 3.4.0
  16735. * @category Math
  16736. * @param {Array} array The array to iterate over.
  16737. * @returns {number} Returns the sum.
  16738. * @example
  16739. *
  16740. * _.sum([4, 2, 8, 6]);
  16741. * // => 20
  16742. */
  16743. function sum(array) {
  16744. return (array && array.length)
  16745. ? baseSum(array, identity)
  16746. : 0;
  16747. }
  16748. /**
  16749. * This method is like `_.sum` except that it accepts `iteratee` which is
  16750. * invoked for each element in `array` to generate the value to be summed.
  16751. * The iteratee is invoked with one argument: (value).
  16752. *
  16753. * @static
  16754. * @memberOf _
  16755. * @since 4.0.0
  16756. * @category Math
  16757. * @param {Array} array The array to iterate over.
  16758. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16759. * @returns {number} Returns the sum.
  16760. * @example
  16761. *
  16762. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16763. *
  16764. * _.sumBy(objects, function(o) { return o.n; });
  16765. * // => 20
  16766. *
  16767. * // The `_.property` iteratee shorthand.
  16768. * _.sumBy(objects, 'n');
  16769. * // => 20
  16770. */
  16771. function sumBy(array, iteratee) {
  16772. return (array && array.length)
  16773. ? baseSum(array, getIteratee(iteratee, 2))
  16774. : 0;
  16775. }
  16776. /*------------------------------------------------------------------------*/
  16777. // Add methods that return wrapped values in chain sequences.
  16778. lodash.after = after;
  16779. lodash.ary = ary;
  16780. lodash.assign = assign;
  16781. lodash.assignIn = assignIn;
  16782. lodash.assignInWith = assignInWith;
  16783. lodash.assignWith = assignWith;
  16784. lodash.at = at;
  16785. lodash.before = before;
  16786. lodash.bind = bind;
  16787. lodash.bindAll = bindAll;
  16788. lodash.bindKey = bindKey;
  16789. lodash.castArray = castArray;
  16790. lodash.chain = chain;
  16791. lodash.chunk = chunk;
  16792. lodash.compact = compact;
  16793. lodash.concat = concat;
  16794. lodash.cond = cond;
  16795. lodash.conforms = conforms;
  16796. lodash.constant = constant;
  16797. lodash.countBy = countBy;
  16798. lodash.create = create;
  16799. lodash.curry = curry;
  16800. lodash.curryRight = curryRight;
  16801. lodash.debounce = debounce;
  16802. lodash.defaults = defaults;
  16803. lodash.defaultsDeep = defaultsDeep;
  16804. lodash.defer = defer;
  16805. lodash.delay = delay;
  16806. lodash.difference = difference;
  16807. lodash.differenceBy = differenceBy;
  16808. lodash.differenceWith = differenceWith;
  16809. lodash.drop = drop;
  16810. lodash.dropRight = dropRight;
  16811. lodash.dropRightWhile = dropRightWhile;
  16812. lodash.dropWhile = dropWhile;
  16813. lodash.fill = fill;
  16814. lodash.filter = filter;
  16815. lodash.flatMap = flatMap;
  16816. lodash.flatMapDeep = flatMapDeep;
  16817. lodash.flatMapDepth = flatMapDepth;
  16818. lodash.flatten = flatten;
  16819. lodash.flattenDeep = flattenDeep;
  16820. lodash.flattenDepth = flattenDepth;
  16821. lodash.flip = flip;
  16822. lodash.flow = flow;
  16823. lodash.flowRight = flowRight;
  16824. lodash.fromPairs = fromPairs;
  16825. lodash.functions = functions;
  16826. lodash.functionsIn = functionsIn;
  16827. lodash.groupBy = groupBy;
  16828. lodash.initial = initial;
  16829. lodash.intersection = intersection;
  16830. lodash.intersectionBy = intersectionBy;
  16831. lodash.intersectionWith = intersectionWith;
  16832. lodash.invert = invert;
  16833. lodash.invertBy = invertBy;
  16834. lodash.invokeMap = invokeMap;
  16835. lodash.iteratee = iteratee;
  16836. lodash.keyBy = keyBy;
  16837. lodash.keys = keys;
  16838. lodash.keysIn = keysIn;
  16839. lodash.map = map;
  16840. lodash.mapKeys = mapKeys;
  16841. lodash.mapValues = mapValues;
  16842. lodash.matches = matches;
  16843. lodash.matchesProperty = matchesProperty;
  16844. lodash.memoize = memoize;
  16845. lodash.merge = merge;
  16846. lodash.mergeWith = mergeWith;
  16847. lodash.method = method;
  16848. lodash.methodOf = methodOf;
  16849. lodash.mixin = mixin;
  16850. lodash.negate = negate;
  16851. lodash.nthArg = nthArg;
  16852. lodash.omit = omit;
  16853. lodash.omitBy = omitBy;
  16854. lodash.once = once;
  16855. lodash.orderBy = orderBy;
  16856. lodash.over = over;
  16857. lodash.overArgs = overArgs;
  16858. lodash.overEvery = overEvery;
  16859. lodash.overSome = overSome;
  16860. lodash.partial = partial;
  16861. lodash.partialRight = partialRight;
  16862. lodash.partition = partition;
  16863. lodash.pick = pick;
  16864. lodash.pickBy = pickBy;
  16865. lodash.property = property;
  16866. lodash.propertyOf = propertyOf;
  16867. lodash.pull = pull;
  16868. lodash.pullAll = pullAll;
  16869. lodash.pullAllBy = pullAllBy;
  16870. lodash.pullAllWith = pullAllWith;
  16871. lodash.pullAt = pullAt;
  16872. lodash.range = range;
  16873. lodash.rangeRight = rangeRight;
  16874. lodash.rearg = rearg;
  16875. lodash.reject = reject;
  16876. lodash.remove = remove;
  16877. lodash.rest = rest;
  16878. lodash.reverse = reverse;
  16879. lodash.sampleSize = sampleSize;
  16880. lodash.set = set;
  16881. lodash.setWith = setWith;
  16882. lodash.shuffle = shuffle;
  16883. lodash.slice = slice;
  16884. lodash.sortBy = sortBy;
  16885. lodash.sortedUniq = sortedUniq;
  16886. lodash.sortedUniqBy = sortedUniqBy;
  16887. lodash.split = split;
  16888. lodash.spread = spread;
  16889. lodash.tail = tail;
  16890. lodash.take = take;
  16891. lodash.takeRight = takeRight;
  16892. lodash.takeRightWhile = takeRightWhile;
  16893. lodash.takeWhile = takeWhile;
  16894. lodash.tap = tap;
  16895. lodash.throttle = throttle;
  16896. lodash.thru = thru;
  16897. lodash.toArray = toArray;
  16898. lodash.toPairs = toPairs;
  16899. lodash.toPairsIn = toPairsIn;
  16900. lodash.toPath = toPath;
  16901. lodash.toPlainObject = toPlainObject;
  16902. lodash.transform = transform;
  16903. lodash.unary = unary;
  16904. lodash.union = union;
  16905. lodash.unionBy = unionBy;
  16906. lodash.unionWith = unionWith;
  16907. lodash.uniq = uniq;
  16908. lodash.uniqBy = uniqBy;
  16909. lodash.uniqWith = uniqWith;
  16910. lodash.unset = unset;
  16911. lodash.unzip = unzip;
  16912. lodash.unzipWith = unzipWith;
  16913. lodash.update = update;
  16914. lodash.updateWith = updateWith;
  16915. lodash.values = values;
  16916. lodash.valuesIn = valuesIn;
  16917. lodash.without = without;
  16918. lodash.words = words;
  16919. lodash.wrap = wrap;
  16920. lodash.xor = xor;
  16921. lodash.xorBy = xorBy;
  16922. lodash.xorWith = xorWith;
  16923. lodash.zip = zip;
  16924. lodash.zipObject = zipObject;
  16925. lodash.zipObjectDeep = zipObjectDeep;
  16926. lodash.zipWith = zipWith;
  16927. // Add aliases.
  16928. lodash.entries = toPairs;
  16929. lodash.entriesIn = toPairsIn;
  16930. lodash.extend = assignIn;
  16931. lodash.extendWith = assignInWith;
  16932. // Add methods to `lodash.prototype`.
  16933. mixin(lodash, lodash);
  16934. /*------------------------------------------------------------------------*/
  16935. // Add methods that return unwrapped values in chain sequences.
  16936. lodash.add = add;
  16937. lodash.attempt = attempt;
  16938. lodash.camelCase = camelCase;
  16939. lodash.capitalize = capitalize;
  16940. lodash.ceil = ceil;
  16941. lodash.clamp = clamp;
  16942. lodash.clone = clone;
  16943. lodash.cloneDeep = cloneDeep;
  16944. lodash.cloneDeepWith = cloneDeepWith;
  16945. lodash.cloneWith = cloneWith;
  16946. lodash.conformsTo = conformsTo;
  16947. lodash.deburr = deburr;
  16948. lodash.defaultTo = defaultTo;
  16949. lodash.divide = divide;
  16950. lodash.endsWith = endsWith;
  16951. lodash.eq = eq;
  16952. lodash.escape = escape;
  16953. lodash.escapeRegExp = escapeRegExp;
  16954. lodash.every = every;
  16955. lodash.find = find;
  16956. lodash.findIndex = findIndex;
  16957. lodash.findKey = findKey;
  16958. lodash.findLast = findLast;
  16959. lodash.findLastIndex = findLastIndex;
  16960. lodash.findLastKey = findLastKey;
  16961. lodash.floor = floor;
  16962. lodash.forEach = forEach;
  16963. lodash.forEachRight = forEachRight;
  16964. lodash.forIn = forIn;
  16965. lodash.forInRight = forInRight;
  16966. lodash.forOwn = forOwn;
  16967. lodash.forOwnRight = forOwnRight;
  16968. lodash.get = get;
  16969. lodash.gt = gt;
  16970. lodash.gte = gte;
  16971. lodash.has = has;
  16972. lodash.hasIn = hasIn;
  16973. lodash.head = head;
  16974. lodash.identity = identity;
  16975. lodash.includes = includes;
  16976. lodash.indexOf = indexOf;
  16977. lodash.inRange = inRange;
  16978. lodash.invoke = invoke;
  16979. lodash.isArguments = isArguments;
  16980. lodash.isArray = isArray;
  16981. lodash.isArrayBuffer = isArrayBuffer;
  16982. lodash.isArrayLike = isArrayLike;
  16983. lodash.isArrayLikeObject = isArrayLikeObject;
  16984. lodash.isBoolean = isBoolean;
  16985. lodash.isBuffer = isBuffer;
  16986. lodash.isDate = isDate;
  16987. lodash.isElement = isElement;
  16988. lodash.isEmpty = isEmpty;
  16989. lodash.isEqual = isEqual;
  16990. lodash.isEqualWith = isEqualWith;
  16991. lodash.isError = isError;
  16992. lodash.isFinite = isFinite;
  16993. lodash.isFunction = isFunction;
  16994. lodash.isInteger = isInteger;
  16995. lodash.isLength = isLength;
  16996. lodash.isMap = isMap;
  16997. lodash.isMatch = isMatch;
  16998. lodash.isMatchWith = isMatchWith;
  16999. lodash.isNaN = isNaN;
  17000. lodash.isNative = isNative;
  17001. lodash.isNil = isNil;
  17002. lodash.isNull = isNull;
  17003. lodash.isNumber = isNumber;
  17004. lodash.isObject = isObject;
  17005. lodash.isObjectLike = isObjectLike;
  17006. lodash.isPlainObject = isPlainObject;
  17007. lodash.isRegExp = isRegExp;
  17008. lodash.isSafeInteger = isSafeInteger;
  17009. lodash.isSet = isSet;
  17010. lodash.isString = isString;
  17011. lodash.isSymbol = isSymbol;
  17012. lodash.isTypedArray = isTypedArray;
  17013. lodash.isUndefined = isUndefined;
  17014. lodash.isWeakMap = isWeakMap;
  17015. lodash.isWeakSet = isWeakSet;
  17016. lodash.join = join;
  17017. lodash.kebabCase = kebabCase;
  17018. lodash.last = last;
  17019. lodash.lastIndexOf = lastIndexOf;
  17020. lodash.lowerCase = lowerCase;
  17021. lodash.lowerFirst = lowerFirst;
  17022. lodash.lt = lt;
  17023. lodash.lte = lte;
  17024. lodash.max = max;
  17025. lodash.maxBy = maxBy;
  17026. lodash.mean = mean;
  17027. lodash.meanBy = meanBy;
  17028. lodash.min = min;
  17029. lodash.minBy = minBy;
  17030. lodash.stubArray = stubArray;
  17031. lodash.stubFalse = stubFalse;
  17032. lodash.stubObject = stubObject;
  17033. lodash.stubString = stubString;
  17034. lodash.stubTrue = stubTrue;
  17035. lodash.multiply = multiply;
  17036. lodash.nth = nth;
  17037. lodash.noConflict = noConflict;
  17038. lodash.noop = noop;
  17039. lodash.now = now;
  17040. lodash.pad = pad;
  17041. lodash.padEnd = padEnd;
  17042. lodash.padStart = padStart;
  17043. lodash.parseInt = parseInt;
  17044. lodash.random = random;
  17045. lodash.reduce = reduce;
  17046. lodash.reduceRight = reduceRight;
  17047. lodash.repeat = repeat;
  17048. lodash.replace = replace;
  17049. lodash.result = result;
  17050. lodash.round = round;
  17051. lodash.runInContext = runInContext;
  17052. lodash.sample = sample;
  17053. lodash.size = size;
  17054. lodash.snakeCase = snakeCase;
  17055. lodash.some = some;
  17056. lodash.sortedIndex = sortedIndex;
  17057. lodash.sortedIndexBy = sortedIndexBy;
  17058. lodash.sortedIndexOf = sortedIndexOf;
  17059. lodash.sortedLastIndex = sortedLastIndex;
  17060. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17061. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17062. lodash.startCase = startCase;
  17063. lodash.startsWith = startsWith;
  17064. lodash.subtract = subtract;
  17065. lodash.sum = sum;
  17066. lodash.sumBy = sumBy;
  17067. lodash.template = template;
  17068. lodash.times = times;
  17069. lodash.toFinite = toFinite;
  17070. lodash.toInteger = toInteger;
  17071. lodash.toLength = toLength;
  17072. lodash.toLower = toLower;
  17073. lodash.toNumber = toNumber;
  17074. lodash.toSafeInteger = toSafeInteger;
  17075. lodash.toString = toString;
  17076. lodash.toUpper = toUpper;
  17077. lodash.trim = trim;
  17078. lodash.trimEnd = trimEnd;
  17079. lodash.trimStart = trimStart;
  17080. lodash.truncate = truncate;
  17081. lodash.unescape = unescape;
  17082. lodash.uniqueId = uniqueId;
  17083. lodash.upperCase = upperCase;
  17084. lodash.upperFirst = upperFirst;
  17085. // Add aliases.
  17086. lodash.each = forEach;
  17087. lodash.eachRight = forEachRight;
  17088. lodash.first = head;
  17089. mixin(lodash, (function() {
  17090. var source = {};
  17091. baseForOwn(lodash, function(func, methodName) {
  17092. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17093. source[methodName] = func;
  17094. }
  17095. });
  17096. return source;
  17097. }()), { 'chain': false });
  17098. /*------------------------------------------------------------------------*/
  17099. /**
  17100. * The semantic version number.
  17101. *
  17102. * @static
  17103. * @memberOf _
  17104. * @type {string}
  17105. */
  17106. lodash.VERSION = VERSION;
  17107. // Assign default placeholders.
  17108. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17109. lodash[methodName].placeholder = lodash;
  17110. });
  17111. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17112. arrayEach(['drop', 'take'], function(methodName, index) {
  17113. LazyWrapper.prototype[methodName] = function(n) {
  17114. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17115. var result = (this.__filtered__ && !index)
  17116. ? new LazyWrapper(this)
  17117. : this.clone();
  17118. if (result.__filtered__) {
  17119. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17120. } else {
  17121. result.__views__.push({
  17122. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17123. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17124. });
  17125. }
  17126. return result;
  17127. };
  17128. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17129. return this.reverse()[methodName](n).reverse();
  17130. };
  17131. });
  17132. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17133. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17134. var type = index + 1,
  17135. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17136. LazyWrapper.prototype[methodName] = function(iteratee) {
  17137. var result = this.clone();
  17138. result.__iteratees__.push({
  17139. 'iteratee': getIteratee(iteratee, 3),
  17140. 'type': type
  17141. });
  17142. result.__filtered__ = result.__filtered__ || isFilter;
  17143. return result;
  17144. };
  17145. });
  17146. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17147. arrayEach(['head', 'last'], function(methodName, index) {
  17148. var takeName = 'take' + (index ? 'Right' : '');
  17149. LazyWrapper.prototype[methodName] = function() {
  17150. return this[takeName](1).value()[0];
  17151. };
  17152. });
  17153. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17154. arrayEach(['initial', 'tail'], function(methodName, index) {
  17155. var dropName = 'drop' + (index ? '' : 'Right');
  17156. LazyWrapper.prototype[methodName] = function() {
  17157. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17158. };
  17159. });
  17160. LazyWrapper.prototype.compact = function() {
  17161. return this.filter(identity);
  17162. };
  17163. LazyWrapper.prototype.find = function(predicate) {
  17164. return this.filter(predicate).head();
  17165. };
  17166. LazyWrapper.prototype.findLast = function(predicate) {
  17167. return this.reverse().find(predicate);
  17168. };
  17169. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17170. if (typeof path == 'function') {
  17171. return new LazyWrapper(this);
  17172. }
  17173. return this.map(function(value) {
  17174. return baseInvoke(value, path, args);
  17175. });
  17176. });
  17177. LazyWrapper.prototype.reject = function(predicate) {
  17178. return this.filter(negate(getIteratee(predicate)));
  17179. };
  17180. LazyWrapper.prototype.slice = function(start, end) {
  17181. start = toInteger(start);
  17182. var result = this;
  17183. if (result.__filtered__ && (start > 0 || end < 0)) {
  17184. return new LazyWrapper(result);
  17185. }
  17186. if (start < 0) {
  17187. result = result.takeRight(-start);
  17188. } else if (start) {
  17189. result = result.drop(start);
  17190. }
  17191. if (end !== undefined) {
  17192. end = toInteger(end);
  17193. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17194. }
  17195. return result;
  17196. };
  17197. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17198. return this.reverse().takeWhile(predicate).reverse();
  17199. };
  17200. LazyWrapper.prototype.toArray = function() {
  17201. return this.take(MAX_ARRAY_LENGTH);
  17202. };
  17203. // Add `LazyWrapper` methods to `lodash.prototype`.
  17204. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17205. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17206. isTaker = /^(?:head|last)$/.test(methodName),
  17207. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17208. retUnwrapped = isTaker || /^find/.test(methodName);
  17209. if (!lodashFunc) {
  17210. return;
  17211. }
  17212. lodash.prototype[methodName] = function() {
  17213. var value = this.__wrapped__,
  17214. args = isTaker ? [1] : arguments,
  17215. isLazy = value instanceof LazyWrapper,
  17216. iteratee = args[0],
  17217. useLazy = isLazy || isArray(value);
  17218. var interceptor = function(value) {
  17219. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17220. return (isTaker && chainAll) ? result[0] : result;
  17221. };
  17222. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17223. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17224. isLazy = useLazy = false;
  17225. }
  17226. var chainAll = this.__chain__,
  17227. isHybrid = !!this.__actions__.length,
  17228. isUnwrapped = retUnwrapped && !chainAll,
  17229. onlyLazy = isLazy && !isHybrid;
  17230. if (!retUnwrapped && useLazy) {
  17231. value = onlyLazy ? value : new LazyWrapper(this);
  17232. var result = func.apply(value, args);
  17233. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17234. return new LodashWrapper(result, chainAll);
  17235. }
  17236. if (isUnwrapped && onlyLazy) {
  17237. return func.apply(this, args);
  17238. }
  17239. result = this.thru(interceptor);
  17240. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17241. };
  17242. });
  17243. // Add `Array` methods to `lodash.prototype`.
  17244. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17245. var func = arrayProto[methodName],
  17246. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17247. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17248. lodash.prototype[methodName] = function() {
  17249. var args = arguments;
  17250. if (retUnwrapped && !this.__chain__) {
  17251. var value = this.value();
  17252. return func.apply(isArray(value) ? value : [], args);
  17253. }
  17254. return this[chainName](function(value) {
  17255. return func.apply(isArray(value) ? value : [], args);
  17256. });
  17257. };
  17258. });
  17259. // Map minified method names to their real names.
  17260. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17261. var lodashFunc = lodash[methodName];
  17262. if (lodashFunc) {
  17263. var key = lodashFunc.name + '';
  17264. if (!hasOwnProperty.call(realNames, key)) {
  17265. realNames[key] = [];
  17266. }
  17267. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17268. }
  17269. });
  17270. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17271. 'name': 'wrapper',
  17272. 'func': undefined
  17273. }];
  17274. // Add methods to `LazyWrapper`.
  17275. LazyWrapper.prototype.clone = lazyClone;
  17276. LazyWrapper.prototype.reverse = lazyReverse;
  17277. LazyWrapper.prototype.value = lazyValue;
  17278. // Add chain sequence methods to the `lodash` wrapper.
  17279. lodash.prototype.at = wrapperAt;
  17280. lodash.prototype.chain = wrapperChain;
  17281. lodash.prototype.commit = wrapperCommit;
  17282. lodash.prototype.next = wrapperNext;
  17283. lodash.prototype.plant = wrapperPlant;
  17284. lodash.prototype.reverse = wrapperReverse;
  17285. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17286. // Add lazy aliases.
  17287. lodash.prototype.first = lodash.prototype.head;
  17288. if (symIterator) {
  17289. lodash.prototype[symIterator] = wrapperToIterator;
  17290. }
  17291. return lodash;
  17292. });
  17293. /*--------------------------------------------------------------------------*/
  17294. // Export lodash.
  17295. var _ = runInContext();
  17296. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17297. if (true) {
  17298. // Expose Lodash on the global object to prevent errors when Lodash is
  17299. // loaded by a script tag in the presence of an AMD loader.
  17300. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17301. // Use `_.noConflict` to remove Lodash from the global object.
  17302. root._ = _;
  17303. // Define as an anonymous module so, through path mapping, it can be
  17304. // referenced as the "underscore" module.
  17305. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17306. return _;
  17307. }).call(exports, __webpack_require__, exports, module),
  17308. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17309. }
  17310. // Check for `exports` after `define` in case a build optimizer adds it.
  17311. else {}
  17312. }.call(this));
  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. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17317. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17318. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17319. "use strict";
  17320. __webpack_require__.r(__webpack_exports__);
  17321. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17322. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17323. /* harmony export */ });
  17324. /* 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");
  17325. /* 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__);
  17326. /* 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");
  17327. var options = {};
  17328. options.insert = "head";
  17329. options.singleton = false;
  17330. 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);
  17331. /* 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 || {});
  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. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17336. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17338. "use strict";
  17339. __webpack_require__.r(__webpack_exports__);
  17340. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17341. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17342. /* harmony export */ });
  17343. /* 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");
  17344. /* 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__);
  17345. /* 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");
  17346. var options = {};
  17347. options.insert = "head";
  17348. options.singleton = false;
  17349. 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);
  17350. /* 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 || {});
  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. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17355. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17356. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17357. "use strict";
  17358. __webpack_require__.r(__webpack_exports__);
  17359. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17360. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17361. /* harmony export */ });
  17362. /* 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");
  17363. /* 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__);
  17364. /* 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");
  17365. var options = {};
  17366. options.insert = "head";
  17367. options.singleton = false;
  17368. 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);
  17369. /* 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 || {});
  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. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17374. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17375. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17376. "use strict";
  17377. __webpack_require__.r(__webpack_exports__);
  17378. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17379. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17380. /* harmony export */ });
  17381. /* harmony import */ var _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");
  17382. /* 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__);
  17383. /* 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");
  17384. var options = {};
  17385. options.insert = "head";
  17386. options.singleton = false;
  17387. 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);
  17388. /* 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 || {});
  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. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17393. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17394. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17395. "use strict";
  17396. __webpack_require__.r(__webpack_exports__);
  17397. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17398. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17399. /* harmony export */ });
  17400. /* harmony import */ var _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");
  17401. /* 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__);
  17402. /* 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");
  17403. var options = {};
  17404. options.insert = "head";
  17405. options.singleton = false;
  17406. 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);
  17407. /* 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 || {});
  17408. /***/ }),
  17409. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17410. /*!******************************************************!*\
  17411. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17412. \******************************************************/
  17413. /***/ ((__unused_webpack_module, exports) => {
  17414. "use strict";
  17415. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17416. // runtime helper for setting properties on components
  17417. // in a tree-shakable way
  17418. exports["default"] = (sfc, props) => {
  17419. const target = sfc.__vccOpts || sfc;
  17420. for (const [key, val] of props) {
  17421. target[key] = val;
  17422. }
  17423. return target;
  17424. };
  17425. /***/ }),
  17426. /***/ "./resources/js/components/AppButtonLink.vue":
  17427. /*!***************************************************!*\
  17428. !*** ./resources/js/components/AppButtonLink.vue ***!
  17429. \***************************************************/
  17430. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17431. "use strict";
  17432. __webpack_require__.r(__webpack_exports__);
  17433. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17434. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17435. /* harmony export */ });
  17436. /* 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");
  17437. /* 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");
  17438. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17439. ;
  17440. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17441. /* hot reload */
  17442. if (false) {}
  17443. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17444. /***/ }),
  17445. /***/ "./resources/js/components/AppFooter.vue":
  17446. /*!***********************************************!*\
  17447. !*** ./resources/js/components/AppFooter.vue ***!
  17448. \***********************************************/
  17449. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17450. "use strict";
  17451. __webpack_require__.r(__webpack_exports__);
  17452. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17453. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17454. /* harmony export */ });
  17455. /* 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");
  17456. /* 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");
  17457. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17458. const script = {}
  17459. ;
  17460. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17461. /* hot reload */
  17462. if (false) {}
  17463. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17464. /***/ }),
  17465. /***/ "./resources/js/components/AppMessage.vue":
  17466. /*!************************************************!*\
  17467. !*** ./resources/js/components/AppMessage.vue ***!
  17468. \************************************************/
  17469. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17470. "use strict";
  17471. __webpack_require__.r(__webpack_exports__);
  17472. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17473. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17474. /* harmony export */ });
  17475. /* 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");
  17476. /* 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");
  17477. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17478. ;
  17479. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17480. /* hot reload */
  17481. if (false) {}
  17482. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17483. /***/ }),
  17484. /***/ "./resources/js/components/AppPagination.vue":
  17485. /*!***************************************************!*\
  17486. !*** ./resources/js/components/AppPagination.vue ***!
  17487. \***************************************************/
  17488. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17489. "use strict";
  17490. __webpack_require__.r(__webpack_exports__);
  17491. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17492. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17493. /* harmony export */ });
  17494. /* 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");
  17495. /* 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");
  17496. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17497. ;
  17498. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17499. /* hot reload */
  17500. if (false) {}
  17501. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17502. /***/ }),
  17503. /***/ "./resources/js/components/AppSidebar.vue":
  17504. /*!************************************************!*\
  17505. !*** ./resources/js/components/AppSidebar.vue ***!
  17506. \************************************************/
  17507. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17508. "use strict";
  17509. __webpack_require__.r(__webpack_exports__);
  17510. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17511. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17512. /* harmony export */ });
  17513. /* 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");
  17514. /* 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");
  17515. /* 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");
  17516. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17517. ;
  17518. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17519. /* hot reload */
  17520. if (false) {}
  17521. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17522. /***/ }),
  17523. /***/ "./resources/js/components/AppSubSidebar.vue":
  17524. /*!***************************************************!*\
  17525. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17526. \***************************************************/
  17527. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17528. "use strict";
  17529. __webpack_require__.r(__webpack_exports__);
  17530. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17531. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17532. /* harmony export */ });
  17533. /* 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");
  17534. /* 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");
  17535. /* 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");
  17536. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17537. ;
  17538. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17539. /* hot reload */
  17540. if (false) {}
  17541. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17542. /***/ }),
  17543. /***/ "./resources/js/components/AppTopBar.vue":
  17544. /*!***********************************************!*\
  17545. !*** ./resources/js/components/AppTopBar.vue ***!
  17546. \***********************************************/
  17547. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17548. "use strict";
  17549. __webpack_require__.r(__webpack_exports__);
  17550. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17551. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17552. /* harmony export */ });
  17553. /* 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");
  17554. /* 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");
  17555. /* 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");
  17556. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17557. ;
  17558. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17559. /* hot reload */
  17560. if (false) {}
  17561. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17562. /***/ }),
  17563. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17564. /*!**************************************************!*\
  17565. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17566. \**************************************************/
  17567. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17568. "use strict";
  17569. __webpack_require__.r(__webpack_exports__);
  17570. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17571. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17572. /* harmony export */ });
  17573. /* 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");
  17574. /* 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");
  17575. /* 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");
  17576. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17577. ;
  17578. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17579. /* hot reload */
  17580. if (false) {}
  17581. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17582. /***/ }),
  17583. /***/ "./resources/js/pages/Customers/Index.vue":
  17584. /*!************************************************!*\
  17585. !*** ./resources/js/pages/Customers/Index.vue ***!
  17586. \************************************************/
  17587. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17588. "use strict";
  17589. __webpack_require__.r(__webpack_exports__);
  17590. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17591. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17592. /* harmony export */ });
  17593. /* harmony import */ var _Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=2f43e3ff */ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17594. /* 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/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17595. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17596. ;
  17597. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Customers/Index.vue"]])
  17598. /* hot reload */
  17599. if (false) {}
  17600. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17601. /***/ }),
  17602. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17603. /*!**************************************************************************************!*\
  17604. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17605. \**************************************************************************************/
  17606. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17607. "use strict";
  17608. __webpack_require__.r(__webpack_exports__);
  17609. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17610. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17611. /* harmony export */ });
  17612. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17613. /***/ }),
  17614. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17615. /*!***********************************************************************************!*\
  17616. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17617. \***********************************************************************************/
  17618. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17619. "use strict";
  17620. __webpack_require__.r(__webpack_exports__);
  17621. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17622. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17623. /* harmony export */ });
  17624. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17625. /***/ }),
  17626. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17627. /*!**************************************************************************************!*\
  17628. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17629. \**************************************************************************************/
  17630. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17631. "use strict";
  17632. __webpack_require__.r(__webpack_exports__);
  17633. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17634. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17635. /* harmony export */ });
  17636. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17637. /***/ }),
  17638. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17639. /*!***********************************************************************************!*\
  17640. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17641. \***********************************************************************************/
  17642. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17643. "use strict";
  17644. __webpack_require__.r(__webpack_exports__);
  17645. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17646. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17647. /* harmony export */ });
  17648. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17649. /***/ }),
  17650. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17651. /*!**************************************************************************************!*\
  17652. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17653. \**************************************************************************************/
  17654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17655. "use strict";
  17656. __webpack_require__.r(__webpack_exports__);
  17657. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17658. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17659. /* harmony export */ });
  17660. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17661. /***/ }),
  17662. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17663. /*!**********************************************************************************!*\
  17664. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17665. \**********************************************************************************/
  17666. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17667. "use strict";
  17668. __webpack_require__.r(__webpack_exports__);
  17669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17670. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17671. /* harmony export */ });
  17672. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17673. /***/ }),
  17674. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17675. /*!*************************************************************************************!*\
  17676. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17677. \*************************************************************************************/
  17678. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17679. "use strict";
  17680. __webpack_require__.r(__webpack_exports__);
  17681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17682. /* harmony export */ "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"])
  17683. /* harmony export */ });
  17684. /* 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");
  17685. /***/ }),
  17686. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  17687. /*!***********************************************************************************!*\
  17688. !*** ./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17689. \***********************************************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* harmony export */ "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"])
  17695. /* harmony export */ });
  17696. /* 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/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17699. /*!*********************************************************************************!*\
  17700. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17701. \*********************************************************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17707. /* harmony export */ });
  17708. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17709. /***/ }),
  17710. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17711. /*!*****************************************************************************************!*\
  17712. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17713. \*****************************************************************************************/
  17714. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17715. "use strict";
  17716. __webpack_require__.r(__webpack_exports__);
  17717. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17718. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17719. /* harmony export */ });
  17720. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17721. /***/ }),
  17722. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17723. /*!******************************************************************************!*\
  17724. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17725. \******************************************************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17731. /* harmony export */ });
  17732. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17733. /***/ }),
  17734. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17735. /*!*********************************************************************************!*\
  17736. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17737. \*********************************************************************************/
  17738. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17739. "use strict";
  17740. __webpack_require__.r(__webpack_exports__);
  17741. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17742. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17743. /* harmony export */ });
  17744. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17747. /*!******************************************************************************************!*\
  17748. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17749. \******************************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17754. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17755. /* harmony export */ });
  17756. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17757. /***/ }),
  17758. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17759. /*!*********************************************************************************************!*\
  17760. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17761. \*********************************************************************************************/
  17762. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17763. "use strict";
  17764. __webpack_require__.r(__webpack_exports__);
  17765. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17766. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17767. /* harmony export */ });
  17768. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17769. /***/ }),
  17770. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17771. /*!*****************************************************************************************!*\
  17772. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17773. \*****************************************************************************************/
  17774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17778. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17779. /* harmony export */ });
  17780. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17781. /***/ }),
  17782. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17783. /*!********************************************************************************************!*\
  17784. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17785. \********************************************************************************************/
  17786. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17787. "use strict";
  17788. __webpack_require__.r(__webpack_exports__);
  17789. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17790. /* 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)
  17791. /* harmony export */ });
  17792. /* 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");
  17793. /***/ }),
  17794. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  17795. /*!******************************************************************************!*\
  17796. !*** ./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  17797. \******************************************************************************/
  17798. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17799. "use strict";
  17800. __webpack_require__.r(__webpack_exports__);
  17801. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17802. /* 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_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render)
  17803. /* harmony export */ });
  17804. /* 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_2f43e3ff__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=2f43e3ff */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17805. /***/ }),
  17806. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17807. /*!********************************************************************************************************!*\
  17808. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17809. \********************************************************************************************************/
  17810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17811. "use strict";
  17812. __webpack_require__.r(__webpack_exports__);
  17813. /* 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");
  17814. /***/ }),
  17815. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17816. /*!*********************************************************************************************************!*\
  17817. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17818. \*********************************************************************************************************/
  17819. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17820. "use strict";
  17821. __webpack_require__.r(__webpack_exports__);
  17822. /* 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");
  17823. /***/ }),
  17824. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17825. /*!************************************************************************************************************!*\
  17826. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17827. \************************************************************************************************************/
  17828. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17829. "use strict";
  17830. __webpack_require__.r(__webpack_exports__);
  17831. /* 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");
  17832. /***/ }),
  17833. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17834. /*!********************************************************************************************************!*\
  17835. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17836. \********************************************************************************************************/
  17837. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17838. "use strict";
  17839. __webpack_require__.r(__webpack_exports__);
  17840. /* 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");
  17841. /***/ }),
  17842. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17843. /*!***********************************************************************************************************!*\
  17844. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17845. \***********************************************************************************************************/
  17846. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17847. "use strict";
  17848. __webpack_require__.r(__webpack_exports__);
  17849. /* 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");
  17850. /***/ })
  17851. }]);