resources_js_pages_Customers_Index_vue.js 696KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405
  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: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  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. !*** ./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 ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  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. !*** ./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 ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  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/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./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/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./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":
  325. /*!***************************************************************************************************************************************************************************************************************!*\
  326. !*** ./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 ***!
  327. \***************************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  335. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  336. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Customers/config.js");
  337. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  338. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  339. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  340. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  342. __name: 'Index',
  343. props: {
  344. customers: Object,
  345. initialSearch: String
  346. },
  347. setup: function setup(__props, _ref) {
  348. var expose = _ref.expose;
  349. expose();
  350. var deleteConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm)();
  351. var onDelete = function onDelete(data) {
  352. deleteConfirm.require({
  353. message: "Yakin akan menghapus data (".concat(data.name, ") ?"),
  354. header: 'Hapus Pelanggan',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia["delete"](route('customers.destroy', data.id));
  359. },
  360. reject: function reject() {
  361. deleteConfirm.close();
  362. }
  363. });
  364. };
  365. var __returned__ = {
  366. deleteConfirm: deleteConfirm,
  367. onDelete: onDelete,
  368. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  369. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm,
  370. indexTable: _config__WEBPACK_IMPORTED_MODULE_2__.indexTable,
  371. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  372. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  373. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  374. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  375. };
  376. Object.defineProperty(__returned__, '__isScriptSetup', {
  377. enumerable: false,
  378. value: true
  379. });
  380. return __returned__;
  381. }
  382. });
  383. /***/ }),
  384. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  385. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  386. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  387. \***********************************************************************************************************************************************************************************************************************************************************************************/
  388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  389. "use strict";
  390. __webpack_require__.r(__webpack_exports__);
  391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  392. /* harmony export */ "render": () => (/* binding */ render)
  393. /* harmony export */ });
  394. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  395. var _hoisted_1 = {
  396. key: 1,
  397. "class": "p-button-label"
  398. };
  399. var _hoisted_2 = {
  400. key: 1,
  401. "class": "p-button p-component"
  402. };
  403. var _hoisted_3 = {
  404. key: 1,
  405. "class": "p-button-label"
  406. };
  407. function render(_ctx, _cache, $props, $setup, $data, $options) {
  408. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  409. key: 0,
  410. "class": "p-button p-component",
  411. as: "button",
  412. type: "button"
  413. }, {
  414. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  415. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  416. key: 0,
  417. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  418. }, null, 2
  419. /* CLASS */
  420. )) : (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
  421. /* TEXT */
  422. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  423. }),
  424. _: 1
  425. /* STABLE */
  426. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  427. key: 0,
  428. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  429. }, null, 2
  430. /* CLASS */
  431. )) : (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_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  432. /* TEXT */
  433. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  434. }
  435. /***/ }),
  436. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. 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, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (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, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (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, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. 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
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. 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) {
  517. 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", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _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"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppSearch.vue?vue&type=template&id=5b9fdcce":
  543. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  545. \*******************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  555. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  556. modelValue: $setup.search,
  557. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  558. return $setup.search = $event;
  559. })
  560. }, null, 8
  561. /* PROPS */
  562. , ["modelValue"]);
  563. }
  564. /***/ }),
  565. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  566. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  567. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  568. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  570. "use strict";
  571. __webpack_require__.r(__webpack_exports__);
  572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  573. /* harmony export */ "render": () => (/* binding */ render)
  574. /* harmony export */ });
  575. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  576. var _hoisted_1 = {
  577. "class": "layout-footer"
  578. };
  579. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  580. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  581. href: "https://dijitalcode.com",
  582. target: "_blank",
  583. "class": "font-medium ml-2"
  584. }, " DijitalCODE ", -1
  585. /* HOISTED */
  586. );
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  595. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. function render(_ctx, _cache, $props, $setup, $data, $options) {
  604. 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["SubSidebar"], {
  605. "class": "layout-menu",
  606. items: $props.menu,
  607. root: true
  608. }, null, 8
  609. /* PROPS */
  610. , ["items"])]);
  611. }
  612. /***/ }),
  613. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  614. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  615. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  616. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  618. "use strict";
  619. __webpack_require__.r(__webpack_exports__);
  620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  621. /* harmony export */ "render": () => (/* binding */ render)
  622. /* harmony export */ });
  623. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  624. var _withScopeId = function _withScopeId(n) {
  625. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  626. };
  627. var _hoisted_1 = {
  628. key: 0
  629. };
  630. var _hoisted_2 = ["aria-label"];
  631. var _hoisted_3 = ["aria-label"];
  632. function render(_ctx, _cache, $props, $setup, $data, $options) {
  633. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  634. 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) {
  635. 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", {
  636. key: i,
  637. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  638. 'layout-menuitem-category': $props.root
  639. }]),
  640. role: "none"
  641. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  642. key: 0
  643. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  644. "class": "layout-menuitem-root-text",
  645. "aria-label": item.label
  646. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  647. /* TEXT, PROPS */
  648. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  649. items: item.items
  650. }, null, 8
  651. /* PROPS */
  652. , ["items"])], 64
  653. /* STABLE_FRAGMENT */
  654. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  655. key: 1
  656. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  657. key: 0,
  658. role: "menuitem",
  659. href: item.to,
  660. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  661. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  662. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  663. }]),
  664. "aria-label": item.label
  665. }, {
  666. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  667. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  669. }, null, 2
  670. /* CLASS */
  671. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  672. /* TEXT */
  673. )];
  674. }),
  675. _: 2
  676. /* DYNAMIC */
  677. }, 1032
  678. /* PROPS, DYNAMIC_SLOTS */
  679. , ["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", {
  680. key: 1,
  681. href: "#",
  682. role: "menuitem",
  683. "aria-label": item.label
  684. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  686. }, null, 2
  687. /* CLASS */
  688. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  689. /* TEXT */
  690. )], 8
  691. /* PROPS */
  692. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  693. items: item.items
  694. }, null, 8
  695. /* PROPS */
  696. , ["items"])], 64
  697. /* STABLE_FRAGMENT */
  698. ))], 2
  699. /* CLASS */
  700. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  701. /* STABLE_FRAGMENT */
  702. );
  703. }), 256
  704. /* UNKEYED_FRAGMENT */
  705. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  706. }
  707. /***/ }),
  708. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  709. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  710. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  711. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  713. "use strict";
  714. __webpack_require__.r(__webpack_exports__);
  715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  716. /* harmony export */ "render": () => (/* binding */ render)
  717. /* harmony export */ });
  718. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  719. var _withScopeId = function _withScopeId(n) {
  720. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  721. };
  722. var _hoisted_1 = {
  723. "class": "layout-topbar"
  724. };
  725. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  726. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  727. alt: "Brand Logo",
  728. src: "/images/logo.svg",
  729. "class": "md:mr-3"
  730. }, null, -1
  731. /* HOISTED */
  732. );
  733. });
  734. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  735. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  736. /* HOISTED */
  737. );
  738. });
  739. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  740. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  741. "class": "pi pi-bars"
  742. }, null, -1
  743. /* HOISTED */
  744. );
  745. });
  746. var _hoisted_5 = [_hoisted_4];
  747. var _hoisted_6 = {
  748. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  749. };
  750. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  751. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  752. "class": "pi pi-ellipsis-v"
  753. }, null, -1
  754. /* HOISTED */
  755. );
  756. });
  757. var _hoisted_8 = [_hoisted_7];
  758. var _hoisted_9 = {
  759. "class": "layout-topbar-menu hidden lg:flex origin-top"
  760. };
  761. var _hoisted_10 = {
  762. "class": "align-self-center"
  763. };
  764. var _hoisted_11 = {
  765. "class": "hidden lg:inline"
  766. };
  767. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  768. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  769. "class": "pi pi-user"
  770. }, null, -1
  771. /* HOISTED */
  772. );
  773. });
  774. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  775. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  780. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  781. "class": "pi pi-sign-out"
  782. }, null, -1
  783. /* HOISTED */
  784. );
  785. });
  786. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  787. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  788. /* HOISTED */
  789. );
  790. });
  791. function render(_ctx, _cache, $props, $setup, $data, $options) {
  792. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  793. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  794. 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"], {
  795. href: "/",
  796. "class": "layout-topbar-logo"
  797. }, {
  798. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  799. return [_hoisted_2, _hoisted_3];
  800. }),
  801. _: 1
  802. /* STABLE */
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  804. "class": "p-link layout-menu-button layout-topbar-button",
  805. onClick: _cache[0] || (_cache[0] = function ($event) {
  806. return _ctx.$emit('menu-toggle', $event);
  807. })
  808. }, _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, {
  809. selector: '@next',
  810. enterClass: 'hidden',
  811. enterActiveClass: 'scalein',
  812. leaveToClass: 'hidden',
  813. leaveActiveClass: 'fadeout',
  814. hideOnOutsideClick: true
  815. }]]), (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
  816. /* TEXT */
  817. )]), (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"], {
  818. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  819. "class": "p-link layout-topbar-button"
  820. }, {
  821. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [_hoisted_12, _hoisted_13];
  823. }),
  824. _: 1
  825. /* STABLE */
  826. }, 8
  827. /* PROPS */
  828. , ["href"])), [[_directive_tooltip, {
  829. value: 'Ubah Profil',
  830. "class": 'layout-topbar-menu-tooltip'
  831. }, void 0, {
  832. bottom: true
  833. }]])]), (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"], {
  834. href: _ctx.route('logout'),
  835. as: "button",
  836. method: "post",
  837. "class": "p-link layout-topbar-button"
  838. }, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [_hoisted_14, _hoisted_15];
  841. }),
  842. _: 1
  843. /* STABLE */
  844. }, 8
  845. /* PROPS */
  846. , ["href"])), [[_directive_tooltip, {
  847. value: 'Keluar',
  848. "class": 'layout-topbar-menu-tooltip'
  849. }, void 0, {
  850. bottom: true
  851. }]])])])]);
  852. }
  853. /***/ }),
  854. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _withScopeId = function _withScopeId(n) {
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  867. };
  868. var _hoisted_1 = {
  869. "class": "layout-sidebar"
  870. };
  871. var _hoisted_2 = {
  872. "class": "layout-main-container"
  873. };
  874. var _hoisted_3 = {
  875. "class": "layout-main"
  876. };
  877. var _hoisted_4 = {
  878. key: 0,
  879. "class": "layout-mask p-component-overlay"
  880. };
  881. function render(_ctx, _cache, $props, $setup, $data, $options) {
  882. 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"], {
  883. title: $props.title
  884. }, null, 8
  885. /* PROPS */
  886. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  887. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  888. onClick: $setup.onWrapperClick
  889. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  890. onMenuToggle: $setup.onMenuToggle
  891. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  892. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  893. }, null, 8
  894. /* PROPS */
  895. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _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["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  896. name: "layout-mask"
  897. }, {
  898. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  899. 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)];
  900. }),
  901. _: 1
  902. /* STABLE */
  903. })], 2
  904. /* CLASS */
  905. )], 64
  906. /* STABLE_FRAGMENT */
  907. );
  908. }
  909. /***/ }),
  910. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  911. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  912. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  913. \********************************************************************************************************************************************************************************************************************************************************************************/
  914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  915. "use strict";
  916. __webpack_require__.r(__webpack_exports__);
  917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  918. /* harmony export */ "render": () => (/* binding */ render)
  919. /* harmony export */ });
  920. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  921. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pelanggan", -1
  922. /* HOISTED */
  923. );
  924. var _hoisted_2 = {
  925. "class": "grid"
  926. };
  927. var _hoisted_3 = {
  928. "class": "col-12 md:col-8"
  929. };
  930. var _hoisted_4 = {
  931. "class": "flex align-items-center"
  932. };
  933. var _hoisted_5 = {
  934. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  935. };
  936. function render(_ctx, _cache, $props, $setup, $data, $options) {
  937. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  938. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  939. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  940. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  941. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  942. 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)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], {
  943. title: "Daftar Pelanggan"
  944. }, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  947. responsiveLayout: "scroll",
  948. columnResizeMode: "expand",
  949. value: $props.customers.data,
  950. rowHover: true,
  951. stripedRows: true
  952. }, {
  953. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  954. 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)($setup["AppSearch"], {
  955. "class": "w-full md:w-27rem",
  956. placeholder: "cari, contoh: tina, 08xx, 0x",
  957. url: "/customers",
  958. "initial-search": $props.initialSearch
  959. }, null, 8
  960. /* PROPS */
  961. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. label: "Tambah Pelanggan",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('customers.create')
  966. }, null, 8
  967. /* PROPS */
  968. , ["href"])])])];
  969. }),
  970. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  971. 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.indexTable, function (value) {
  972. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  973. field: value.field,
  974. header: value.header,
  975. key: value.field
  976. }, null, 8
  977. /* PROPS */
  978. , ["field", "header"]);
  979. }), 128
  980. /* KEYED_FRAGMENT */
  981. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  982. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  983. var data = _ref.data;
  984. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  985. icon: "pi pi-pencil",
  986. "class": "p-button-icon-only p-button-rounded p-button-text",
  987. href: _ctx.route('customers.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah Pelanggan', void 0, {
  991. bottom: true
  992. }]])];
  993. }),
  994. _: 1
  995. /* STABLE */
  996. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  997. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  998. var data = _ref2.data;
  999. return [!data.isUsed ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Button, {
  1000. key: 0,
  1001. icon: "pi pi-trash",
  1002. "class": "p-button-icon-only p-button-rounded p-button-text",
  1003. onClick: function onClick($event) {
  1004. return $setup.onDelete(data);
  1005. }
  1006. }, null, 8
  1007. /* PROPS */
  1008. , ["onClick"])), [[_directive_tooltip, 'Hapus Pelanggan', void 0, {
  1009. bottom: true
  1010. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1011. }),
  1012. _: 1
  1013. /* STABLE */
  1014. })];
  1015. }),
  1016. _: 1
  1017. /* STABLE */
  1018. }, 8
  1019. /* PROPS */
  1020. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1021. links: $props.customers.links
  1022. }, null, 8
  1023. /* PROPS */
  1024. , ["links"])];
  1025. }),
  1026. _: 1
  1027. /* STABLE */
  1028. })], 64
  1029. /* STABLE_FRAGMENT */
  1030. );
  1031. }
  1032. /***/ }),
  1033. /***/ "./resources/js/pages/Customers/config.js":
  1034. /*!************************************************!*\
  1035. !*** ./resources/js/pages/Customers/config.js ***!
  1036. \************************************************/
  1037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1038. "use strict";
  1039. __webpack_require__.r(__webpack_exports__);
  1040. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1041. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  1042. /* harmony export */ });
  1043. var indexTable = [{
  1044. field: 'name',
  1045. header: 'Nama'
  1046. }, {
  1047. field: 'address',
  1048. header: 'Alamat'
  1049. }, {
  1050. field: 'phone',
  1051. header: 'No HP'
  1052. }, {
  1053. field: 'npwp',
  1054. header: 'NPWP'
  1055. }];
  1056. /***/ }),
  1057. /***/ "./resources/js/utils/menu.js":
  1058. /*!************************************!*\
  1059. !*** ./resources/js/utils/menu.js ***!
  1060. \************************************/
  1061. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1062. "use strict";
  1063. __webpack_require__.r(__webpack_exports__);
  1064. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1065. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1066. /* harmony export */ });
  1067. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1068. // Admin
  1069. 1: [{
  1070. label: 'Home',
  1071. items: [{
  1072. label: 'Dashboard',
  1073. icon: 'pi pi-chart-bar',
  1074. to: '/dashboards',
  1075. component: 'Dashboards/Index'
  1076. }]
  1077. }, {
  1078. label: 'Laporan',
  1079. items: []
  1080. }, {
  1081. label: 'Master',
  1082. items: [{
  1083. label: 'User',
  1084. icon: 'pi pi-user',
  1085. to: '/users',
  1086. component: 'Users/Index'
  1087. }]
  1088. }, {
  1089. label: 'Pengaturan',
  1090. items: [{
  1091. label: 'PPN',
  1092. icon: 'pi pi-percentage',
  1093. to: '/ppn',
  1094. component: 'PPN/Index'
  1095. }]
  1096. }],
  1097. // Supervisor
  1098. 2: [{
  1099. label: 'Home',
  1100. items: [{
  1101. label: 'Dashboard',
  1102. icon: 'pi pi-chart-bar',
  1103. to: '/dashboards',
  1104. component: 'Dashboards/Index'
  1105. }]
  1106. }, {
  1107. label: 'Master',
  1108. items: [{
  1109. label: 'Pelanggan',
  1110. icon: 'pi pi-users',
  1111. to: '/customers',
  1112. component: 'Customers/Index'
  1113. }, {
  1114. label: 'Pembelian',
  1115. icon: 'pi pi-shopping-cart',
  1116. to: '/purchases',
  1117. component: 'Purchases/Index'
  1118. }, {
  1119. label: 'Penjualan',
  1120. icon: 'pi pi-tag',
  1121. to: '/sales',
  1122. component: 'Sales/Index'
  1123. }, {
  1124. label: 'Produk',
  1125. icon: 'pi pi-th-large',
  1126. to: '/products',
  1127. component: 'Products/Index'
  1128. }]
  1129. }],
  1130. // Operator
  1131. 3: [{
  1132. label: 'Home',
  1133. items: [{
  1134. label: 'Dashboard',
  1135. icon: 'pi pi-chart-bar',
  1136. to: '/dashboards',
  1137. component: 'Dashboards/Index'
  1138. }]
  1139. }, {
  1140. label: 'Master',
  1141. items: [{
  1142. label: 'Supplier',
  1143. icon: 'pi pi-shopping-cart',
  1144. to: '/suppliers',
  1145. component: 'Suppliers/Index'
  1146. }, {
  1147. label: 'Stok Barang',
  1148. icon: 'pi pi-box',
  1149. to: '/stock-products',
  1150. component: 'StockProducts/Index'
  1151. }]
  1152. }]
  1153. });
  1154. /***/ }),
  1155. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1156. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1157. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1158. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1159. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1160. "use strict";
  1161. __webpack_require__.r(__webpack_exports__);
  1162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1164. /* harmony export */ });
  1165. /* 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");
  1166. /* 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__);
  1167. // Imports
  1168. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1169. // Module
  1170. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1171. // Exports
  1172. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1173. /***/ }),
  1174. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1175. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1176. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1177. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1178. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1179. "use strict";
  1180. __webpack_require__.r(__webpack_exports__);
  1181. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1182. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1183. /* harmony export */ });
  1184. /* 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");
  1185. /* 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__);
  1186. // Imports
  1187. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1188. // Module
  1189. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\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-b1b23eb4] {\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-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]: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-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1190. // Exports
  1191. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1192. /***/ }),
  1193. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1194. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1195. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1196. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1197. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1198. "use strict";
  1199. __webpack_require__.r(__webpack_exports__);
  1200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1202. /* harmony export */ });
  1203. /* 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");
  1204. /* 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__);
  1205. // Imports
  1206. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1207. // Module
  1208. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\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-0b7edbb0] {\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-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]: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-0b7edbb0] {\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-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]: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-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\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-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\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-0b7edbb0] {\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-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1209. // Exports
  1210. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1211. /***/ }),
  1212. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1213. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1214. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1215. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1216. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1217. "use strict";
  1218. __webpack_require__.r(__webpack_exports__);
  1219. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1220. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1221. /* harmony export */ });
  1222. /* 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");
  1223. /* 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__);
  1224. // Imports
  1225. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1226. // Module
  1227. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\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-1d279fe2] {\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-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\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}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\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-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1228. // Exports
  1229. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1230. /***/ }),
  1231. /***/ "./node_modules/lodash/lodash.js":
  1232. /*!***************************************!*\
  1233. !*** ./node_modules/lodash/lodash.js ***!
  1234. \***************************************/
  1235. /***/ (function(module, exports, __webpack_require__) {
  1236. /* module decorator */ module = __webpack_require__.nmd(module);
  1237. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1238. * @license
  1239. * Lodash <https://lodash.com/>
  1240. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1241. * Released under MIT license <https://lodash.com/license>
  1242. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1243. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1244. */
  1245. ;(function() {
  1246. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1247. var undefined;
  1248. /** Used as the semantic version number. */
  1249. var VERSION = '4.17.21';
  1250. /** Used as the size to enable large array optimizations. */
  1251. var LARGE_ARRAY_SIZE = 200;
  1252. /** Error message constants. */
  1253. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1254. FUNC_ERROR_TEXT = 'Expected a function',
  1255. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1256. /** Used to stand-in for `undefined` hash values. */
  1257. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1258. /** Used as the maximum memoize cache size. */
  1259. var MAX_MEMOIZE_SIZE = 500;
  1260. /** Used as the internal argument placeholder. */
  1261. var PLACEHOLDER = '__lodash_placeholder__';
  1262. /** Used to compose bitmasks for cloning. */
  1263. var CLONE_DEEP_FLAG = 1,
  1264. CLONE_FLAT_FLAG = 2,
  1265. CLONE_SYMBOLS_FLAG = 4;
  1266. /** Used to compose bitmasks for value comparisons. */
  1267. var COMPARE_PARTIAL_FLAG = 1,
  1268. COMPARE_UNORDERED_FLAG = 2;
  1269. /** Used to compose bitmasks for function metadata. */
  1270. var WRAP_BIND_FLAG = 1,
  1271. WRAP_BIND_KEY_FLAG = 2,
  1272. WRAP_CURRY_BOUND_FLAG = 4,
  1273. WRAP_CURRY_FLAG = 8,
  1274. WRAP_CURRY_RIGHT_FLAG = 16,
  1275. WRAP_PARTIAL_FLAG = 32,
  1276. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1277. WRAP_ARY_FLAG = 128,
  1278. WRAP_REARG_FLAG = 256,
  1279. WRAP_FLIP_FLAG = 512;
  1280. /** Used as default options for `_.truncate`. */
  1281. var DEFAULT_TRUNC_LENGTH = 30,
  1282. DEFAULT_TRUNC_OMISSION = '...';
  1283. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1284. var HOT_COUNT = 800,
  1285. HOT_SPAN = 16;
  1286. /** Used to indicate the type of lazy iteratees. */
  1287. var LAZY_FILTER_FLAG = 1,
  1288. LAZY_MAP_FLAG = 2,
  1289. LAZY_WHILE_FLAG = 3;
  1290. /** Used as references for various `Number` constants. */
  1291. var INFINITY = 1 / 0,
  1292. MAX_SAFE_INTEGER = 9007199254740991,
  1293. MAX_INTEGER = 1.7976931348623157e+308,
  1294. NAN = 0 / 0;
  1295. /** Used as references for the maximum length and index of an array. */
  1296. var MAX_ARRAY_LENGTH = 4294967295,
  1297. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1298. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1299. /** Used to associate wrap methods with their bit flags. */
  1300. var wrapFlags = [
  1301. ['ary', WRAP_ARY_FLAG],
  1302. ['bind', WRAP_BIND_FLAG],
  1303. ['bindKey', WRAP_BIND_KEY_FLAG],
  1304. ['curry', WRAP_CURRY_FLAG],
  1305. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1306. ['flip', WRAP_FLIP_FLAG],
  1307. ['partial', WRAP_PARTIAL_FLAG],
  1308. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1309. ['rearg', WRAP_REARG_FLAG]
  1310. ];
  1311. /** `Object#toString` result references. */
  1312. var argsTag = '[object Arguments]',
  1313. arrayTag = '[object Array]',
  1314. asyncTag = '[object AsyncFunction]',
  1315. boolTag = '[object Boolean]',
  1316. dateTag = '[object Date]',
  1317. domExcTag = '[object DOMException]',
  1318. errorTag = '[object Error]',
  1319. funcTag = '[object Function]',
  1320. genTag = '[object GeneratorFunction]',
  1321. mapTag = '[object Map]',
  1322. numberTag = '[object Number]',
  1323. nullTag = '[object Null]',
  1324. objectTag = '[object Object]',
  1325. promiseTag = '[object Promise]',
  1326. proxyTag = '[object Proxy]',
  1327. regexpTag = '[object RegExp]',
  1328. setTag = '[object Set]',
  1329. stringTag = '[object String]',
  1330. symbolTag = '[object Symbol]',
  1331. undefinedTag = '[object Undefined]',
  1332. weakMapTag = '[object WeakMap]',
  1333. weakSetTag = '[object WeakSet]';
  1334. var arrayBufferTag = '[object ArrayBuffer]',
  1335. dataViewTag = '[object DataView]',
  1336. float32Tag = '[object Float32Array]',
  1337. float64Tag = '[object Float64Array]',
  1338. int8Tag = '[object Int8Array]',
  1339. int16Tag = '[object Int16Array]',
  1340. int32Tag = '[object Int32Array]',
  1341. uint8Tag = '[object Uint8Array]',
  1342. uint8ClampedTag = '[object Uint8ClampedArray]',
  1343. uint16Tag = '[object Uint16Array]',
  1344. uint32Tag = '[object Uint32Array]';
  1345. /** Used to match empty string literals in compiled template source. */
  1346. var reEmptyStringLeading = /\b__p \+= '';/g,
  1347. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1348. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1349. /** Used to match HTML entities and HTML characters. */
  1350. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1351. reUnescapedHtml = /[&<>"']/g,
  1352. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1353. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1354. /** Used to match template delimiters. */
  1355. var reEscape = /<%-([\s\S]+?)%>/g,
  1356. reEvaluate = /<%([\s\S]+?)%>/g,
  1357. reInterpolate = /<%=([\s\S]+?)%>/g;
  1358. /** Used to match property names within property paths. */
  1359. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1360. reIsPlainProp = /^\w*$/,
  1361. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1362. /**
  1363. * Used to match `RegExp`
  1364. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1365. */
  1366. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1367. reHasRegExpChar = RegExp(reRegExpChar.source);
  1368. /** Used to match leading whitespace. */
  1369. var reTrimStart = /^\s+/;
  1370. /** Used to match a single whitespace character. */
  1371. var reWhitespace = /\s/;
  1372. /** Used to match wrap detail comments. */
  1373. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1374. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1375. reSplitDetails = /,? & /;
  1376. /** Used to match words composed of alphanumeric characters. */
  1377. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1378. /**
  1379. * Used to validate the `validate` option in `_.template` variable.
  1380. *
  1381. * Forbids characters which could potentially change the meaning of the function argument definition:
  1382. * - "()," (modification of function parameters)
  1383. * - "=" (default value)
  1384. * - "[]{}" (destructuring of function parameters)
  1385. * - "/" (beginning of a comment)
  1386. * - whitespace
  1387. */
  1388. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1389. /** Used to match backslashes in property paths. */
  1390. var reEscapeChar = /\\(\\)?/g;
  1391. /**
  1392. * Used to match
  1393. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1394. */
  1395. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1396. /** Used to match `RegExp` flags from their coerced string values. */
  1397. var reFlags = /\w*$/;
  1398. /** Used to detect bad signed hexadecimal string values. */
  1399. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1400. /** Used to detect binary string values. */
  1401. var reIsBinary = /^0b[01]+$/i;
  1402. /** Used to detect host constructors (Safari). */
  1403. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1404. /** Used to detect octal string values. */
  1405. var reIsOctal = /^0o[0-7]+$/i;
  1406. /** Used to detect unsigned integer values. */
  1407. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1408. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1409. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1410. /** Used to ensure capturing order of template delimiters. */
  1411. var reNoMatch = /($^)/;
  1412. /** Used to match unescaped characters in compiled string literals. */
  1413. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1414. /** Used to compose unicode character classes. */
  1415. var rsAstralRange = '\\ud800-\\udfff',
  1416. rsComboMarksRange = '\\u0300-\\u036f',
  1417. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1418. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1419. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1420. rsDingbatRange = '\\u2700-\\u27bf',
  1421. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1422. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1423. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1424. rsPunctuationRange = '\\u2000-\\u206f',
  1425. 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',
  1426. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1427. rsVarRange = '\\ufe0e\\ufe0f',
  1428. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1429. /** Used to compose unicode capture groups. */
  1430. var rsApos = "['\u2019]",
  1431. rsAstral = '[' + rsAstralRange + ']',
  1432. rsBreak = '[' + rsBreakRange + ']',
  1433. rsCombo = '[' + rsComboRange + ']',
  1434. rsDigits = '\\d+',
  1435. rsDingbat = '[' + rsDingbatRange + ']',
  1436. rsLower = '[' + rsLowerRange + ']',
  1437. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1438. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1439. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1440. rsNonAstral = '[^' + rsAstralRange + ']',
  1441. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1442. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1443. rsUpper = '[' + rsUpperRange + ']',
  1444. rsZWJ = '\\u200d';
  1445. /** Used to compose unicode regexes. */
  1446. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1447. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1448. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1449. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1450. reOptMod = rsModifier + '?',
  1451. rsOptVar = '[' + rsVarRange + ']?',
  1452. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1453. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1454. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1455. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1456. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1457. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1458. /** Used to match apostrophes. */
  1459. var reApos = RegExp(rsApos, 'g');
  1460. /**
  1461. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1462. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1463. */
  1464. var reComboMark = RegExp(rsCombo, 'g');
  1465. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1466. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1467. /** Used to match complex or compound words. */
  1468. var reUnicodeWord = RegExp([
  1469. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1470. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1471. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1472. rsUpper + '+' + rsOptContrUpper,
  1473. rsOrdUpper,
  1474. rsOrdLower,
  1475. rsDigits,
  1476. rsEmoji
  1477. ].join('|'), 'g');
  1478. /** 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/). */
  1479. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1480. /** Used to detect strings that need a more robust regexp to match words. */
  1481. 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 ]/;
  1482. /** Used to assign default `context` object properties. */
  1483. var contextProps = [
  1484. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1485. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1486. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1487. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1488. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1489. ];
  1490. /** Used to make template sourceURLs easier to identify. */
  1491. var templateCounter = -1;
  1492. /** Used to identify `toStringTag` values of typed arrays. */
  1493. var typedArrayTags = {};
  1494. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1495. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1496. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1497. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1498. typedArrayTags[uint32Tag] = true;
  1499. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1500. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1501. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1502. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1503. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1504. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1505. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1506. typedArrayTags[weakMapTag] = false;
  1507. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1508. var cloneableTags = {};
  1509. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1510. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1511. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1512. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1513. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1514. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1515. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1516. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1517. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1518. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1519. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1520. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1521. cloneableTags[weakMapTag] = false;
  1522. /** Used to map Latin Unicode letters to basic Latin letters. */
  1523. var deburredLetters = {
  1524. // Latin-1 Supplement block.
  1525. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1526. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1527. '\xc7': 'C', '\xe7': 'c',
  1528. '\xd0': 'D', '\xf0': 'd',
  1529. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1530. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1531. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1532. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1533. '\xd1': 'N', '\xf1': 'n',
  1534. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1535. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1536. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1537. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1538. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1539. '\xc6': 'Ae', '\xe6': 'ae',
  1540. '\xde': 'Th', '\xfe': 'th',
  1541. '\xdf': 'ss',
  1542. // Latin Extended-A block.
  1543. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1544. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1545. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1546. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1547. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1548. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1549. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1550. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1551. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1552. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1553. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1554. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1555. '\u0134': 'J', '\u0135': 'j',
  1556. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1557. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1558. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1559. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1560. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1561. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1562. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1563. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1564. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1565. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1566. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1567. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1568. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1569. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1570. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1571. '\u0174': 'W', '\u0175': 'w',
  1572. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1573. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1574. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1575. '\u0132': 'IJ', '\u0133': 'ij',
  1576. '\u0152': 'Oe', '\u0153': 'oe',
  1577. '\u0149': "'n", '\u017f': 's'
  1578. };
  1579. /** Used to map characters to HTML entities. */
  1580. var htmlEscapes = {
  1581. '&': '&amp;',
  1582. '<': '&lt;',
  1583. '>': '&gt;',
  1584. '"': '&quot;',
  1585. "'": '&#39;'
  1586. };
  1587. /** Used to map HTML entities to characters. */
  1588. var htmlUnescapes = {
  1589. '&amp;': '&',
  1590. '&lt;': '<',
  1591. '&gt;': '>',
  1592. '&quot;': '"',
  1593. '&#39;': "'"
  1594. };
  1595. /** Used to escape characters for inclusion in compiled string literals. */
  1596. var stringEscapes = {
  1597. '\\': '\\',
  1598. "'": "'",
  1599. '\n': 'n',
  1600. '\r': 'r',
  1601. '\u2028': 'u2028',
  1602. '\u2029': 'u2029'
  1603. };
  1604. /** Built-in method references without a dependency on `root`. */
  1605. var freeParseFloat = parseFloat,
  1606. freeParseInt = parseInt;
  1607. /** Detect free variable `global` from Node.js. */
  1608. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1609. /** Detect free variable `self`. */
  1610. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1611. /** Used as a reference to the global object. */
  1612. var root = freeGlobal || freeSelf || Function('return this')();
  1613. /** Detect free variable `exports`. */
  1614. var freeExports = true && exports && !exports.nodeType && exports;
  1615. /** Detect free variable `module`. */
  1616. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1617. /** Detect the popular CommonJS extension `module.exports`. */
  1618. var moduleExports = freeModule && freeModule.exports === freeExports;
  1619. /** Detect free variable `process` from Node.js. */
  1620. var freeProcess = moduleExports && freeGlobal.process;
  1621. /** Used to access faster Node.js helpers. */
  1622. var nodeUtil = (function() {
  1623. try {
  1624. // Use `util.types` for Node.js 10+.
  1625. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1626. if (types) {
  1627. return types;
  1628. }
  1629. // Legacy `process.binding('util')` for Node.js < 10.
  1630. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1631. } catch (e) {}
  1632. }());
  1633. /* Node.js helper references. */
  1634. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1635. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1636. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1637. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1638. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1639. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1640. /*--------------------------------------------------------------------------*/
  1641. /**
  1642. * A faster alternative to `Function#apply`, this function invokes `func`
  1643. * with the `this` binding of `thisArg` and the arguments of `args`.
  1644. *
  1645. * @private
  1646. * @param {Function} func The function to invoke.
  1647. * @param {*} thisArg The `this` binding of `func`.
  1648. * @param {Array} args The arguments to invoke `func` with.
  1649. * @returns {*} Returns the result of `func`.
  1650. */
  1651. function apply(func, thisArg, args) {
  1652. switch (args.length) {
  1653. case 0: return func.call(thisArg);
  1654. case 1: return func.call(thisArg, args[0]);
  1655. case 2: return func.call(thisArg, args[0], args[1]);
  1656. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1657. }
  1658. return func.apply(thisArg, args);
  1659. }
  1660. /**
  1661. * A specialized version of `baseAggregator` for arrays.
  1662. *
  1663. * @private
  1664. * @param {Array} [array] The array to iterate over.
  1665. * @param {Function} setter The function to set `accumulator` values.
  1666. * @param {Function} iteratee The iteratee to transform keys.
  1667. * @param {Object} accumulator The initial aggregated object.
  1668. * @returns {Function} Returns `accumulator`.
  1669. */
  1670. function arrayAggregator(array, setter, iteratee, accumulator) {
  1671. var index = -1,
  1672. length = array == null ? 0 : array.length;
  1673. while (++index < length) {
  1674. var value = array[index];
  1675. setter(accumulator, value, iteratee(value), array);
  1676. }
  1677. return accumulator;
  1678. }
  1679. /**
  1680. * A specialized version of `_.forEach` for arrays without support for
  1681. * iteratee shorthands.
  1682. *
  1683. * @private
  1684. * @param {Array} [array] The array to iterate over.
  1685. * @param {Function} iteratee The function invoked per iteration.
  1686. * @returns {Array} Returns `array`.
  1687. */
  1688. function arrayEach(array, iteratee) {
  1689. var index = -1,
  1690. length = array == null ? 0 : array.length;
  1691. while (++index < length) {
  1692. if (iteratee(array[index], index, array) === false) {
  1693. break;
  1694. }
  1695. }
  1696. return array;
  1697. }
  1698. /**
  1699. * A specialized version of `_.forEachRight` for arrays without support for
  1700. * iteratee shorthands.
  1701. *
  1702. * @private
  1703. * @param {Array} [array] The array to iterate over.
  1704. * @param {Function} iteratee The function invoked per iteration.
  1705. * @returns {Array} Returns `array`.
  1706. */
  1707. function arrayEachRight(array, iteratee) {
  1708. var length = array == null ? 0 : array.length;
  1709. while (length--) {
  1710. if (iteratee(array[length], length, array) === false) {
  1711. break;
  1712. }
  1713. }
  1714. return array;
  1715. }
  1716. /**
  1717. * A specialized version of `_.every` for arrays without support for
  1718. * iteratee shorthands.
  1719. *
  1720. * @private
  1721. * @param {Array} [array] The array to iterate over.
  1722. * @param {Function} predicate The function invoked per iteration.
  1723. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1724. * else `false`.
  1725. */
  1726. function arrayEvery(array, predicate) {
  1727. var index = -1,
  1728. length = array == null ? 0 : array.length;
  1729. while (++index < length) {
  1730. if (!predicate(array[index], index, array)) {
  1731. return false;
  1732. }
  1733. }
  1734. return true;
  1735. }
  1736. /**
  1737. * A specialized version of `_.filter` for arrays without support for
  1738. * iteratee shorthands.
  1739. *
  1740. * @private
  1741. * @param {Array} [array] The array to iterate over.
  1742. * @param {Function} predicate The function invoked per iteration.
  1743. * @returns {Array} Returns the new filtered array.
  1744. */
  1745. function arrayFilter(array, predicate) {
  1746. var index = -1,
  1747. length = array == null ? 0 : array.length,
  1748. resIndex = 0,
  1749. result = [];
  1750. while (++index < length) {
  1751. var value = array[index];
  1752. if (predicate(value, index, array)) {
  1753. result[resIndex++] = value;
  1754. }
  1755. }
  1756. return result;
  1757. }
  1758. /**
  1759. * A specialized version of `_.includes` for arrays without support for
  1760. * specifying an index to search from.
  1761. *
  1762. * @private
  1763. * @param {Array} [array] The array to inspect.
  1764. * @param {*} target The value to search for.
  1765. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1766. */
  1767. function arrayIncludes(array, value) {
  1768. var length = array == null ? 0 : array.length;
  1769. return !!length && baseIndexOf(array, value, 0) > -1;
  1770. }
  1771. /**
  1772. * This function is like `arrayIncludes` except that it accepts a comparator.
  1773. *
  1774. * @private
  1775. * @param {Array} [array] The array to inspect.
  1776. * @param {*} target The value to search for.
  1777. * @param {Function} comparator The comparator invoked per element.
  1778. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1779. */
  1780. function arrayIncludesWith(array, value, comparator) {
  1781. var index = -1,
  1782. length = array == null ? 0 : array.length;
  1783. while (++index < length) {
  1784. if (comparator(value, array[index])) {
  1785. return true;
  1786. }
  1787. }
  1788. return false;
  1789. }
  1790. /**
  1791. * A specialized version of `_.map` for arrays without support for iteratee
  1792. * shorthands.
  1793. *
  1794. * @private
  1795. * @param {Array} [array] The array to iterate over.
  1796. * @param {Function} iteratee The function invoked per iteration.
  1797. * @returns {Array} Returns the new mapped array.
  1798. */
  1799. function arrayMap(array, iteratee) {
  1800. var index = -1,
  1801. length = array == null ? 0 : array.length,
  1802. result = Array(length);
  1803. while (++index < length) {
  1804. result[index] = iteratee(array[index], index, array);
  1805. }
  1806. return result;
  1807. }
  1808. /**
  1809. * Appends the elements of `values` to `array`.
  1810. *
  1811. * @private
  1812. * @param {Array} array The array to modify.
  1813. * @param {Array} values The values to append.
  1814. * @returns {Array} Returns `array`.
  1815. */
  1816. function arrayPush(array, values) {
  1817. var index = -1,
  1818. length = values.length,
  1819. offset = array.length;
  1820. while (++index < length) {
  1821. array[offset + index] = values[index];
  1822. }
  1823. return array;
  1824. }
  1825. /**
  1826. * A specialized version of `_.reduce` for arrays without support for
  1827. * iteratee shorthands.
  1828. *
  1829. * @private
  1830. * @param {Array} [array] The array to iterate over.
  1831. * @param {Function} iteratee The function invoked per iteration.
  1832. * @param {*} [accumulator] The initial value.
  1833. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1834. * the initial value.
  1835. * @returns {*} Returns the accumulated value.
  1836. */
  1837. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1838. var index = -1,
  1839. length = array == null ? 0 : array.length;
  1840. if (initAccum && length) {
  1841. accumulator = array[++index];
  1842. }
  1843. while (++index < length) {
  1844. accumulator = iteratee(accumulator, array[index], index, array);
  1845. }
  1846. return accumulator;
  1847. }
  1848. /**
  1849. * A specialized version of `_.reduceRight` for arrays without support for
  1850. * iteratee shorthands.
  1851. *
  1852. * @private
  1853. * @param {Array} [array] The array to iterate over.
  1854. * @param {Function} iteratee The function invoked per iteration.
  1855. * @param {*} [accumulator] The initial value.
  1856. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1857. * the initial value.
  1858. * @returns {*} Returns the accumulated value.
  1859. */
  1860. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1861. var length = array == null ? 0 : array.length;
  1862. if (initAccum && length) {
  1863. accumulator = array[--length];
  1864. }
  1865. while (length--) {
  1866. accumulator = iteratee(accumulator, array[length], length, array);
  1867. }
  1868. return accumulator;
  1869. }
  1870. /**
  1871. * A specialized version of `_.some` for arrays without support for iteratee
  1872. * shorthands.
  1873. *
  1874. * @private
  1875. * @param {Array} [array] The array to iterate over.
  1876. * @param {Function} predicate The function invoked per iteration.
  1877. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1878. * else `false`.
  1879. */
  1880. function arraySome(array, predicate) {
  1881. var index = -1,
  1882. length = array == null ? 0 : array.length;
  1883. while (++index < length) {
  1884. if (predicate(array[index], index, array)) {
  1885. return true;
  1886. }
  1887. }
  1888. return false;
  1889. }
  1890. /**
  1891. * Gets the size of an ASCII `string`.
  1892. *
  1893. * @private
  1894. * @param {string} string The string inspect.
  1895. * @returns {number} Returns the string size.
  1896. */
  1897. var asciiSize = baseProperty('length');
  1898. /**
  1899. * Converts an ASCII `string` to an array.
  1900. *
  1901. * @private
  1902. * @param {string} string The string to convert.
  1903. * @returns {Array} Returns the converted array.
  1904. */
  1905. function asciiToArray(string) {
  1906. return string.split('');
  1907. }
  1908. /**
  1909. * Splits an ASCII `string` into an array of its words.
  1910. *
  1911. * @private
  1912. * @param {string} The string to inspect.
  1913. * @returns {Array} Returns the words of `string`.
  1914. */
  1915. function asciiWords(string) {
  1916. return string.match(reAsciiWord) || [];
  1917. }
  1918. /**
  1919. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1920. * without support for iteratee shorthands, which iterates over `collection`
  1921. * using `eachFunc`.
  1922. *
  1923. * @private
  1924. * @param {Array|Object} collection The collection to inspect.
  1925. * @param {Function} predicate The function invoked per iteration.
  1926. * @param {Function} eachFunc The function to iterate over `collection`.
  1927. * @returns {*} Returns the found element or its key, else `undefined`.
  1928. */
  1929. function baseFindKey(collection, predicate, eachFunc) {
  1930. var result;
  1931. eachFunc(collection, function(value, key, collection) {
  1932. if (predicate(value, key, collection)) {
  1933. result = key;
  1934. return false;
  1935. }
  1936. });
  1937. return result;
  1938. }
  1939. /**
  1940. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1941. * support for iteratee shorthands.
  1942. *
  1943. * @private
  1944. * @param {Array} array The array to inspect.
  1945. * @param {Function} predicate The function invoked per iteration.
  1946. * @param {number} fromIndex The index to search from.
  1947. * @param {boolean} [fromRight] Specify iterating from right to left.
  1948. * @returns {number} Returns the index of the matched value, else `-1`.
  1949. */
  1950. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1951. var length = array.length,
  1952. index = fromIndex + (fromRight ? 1 : -1);
  1953. while ((fromRight ? index-- : ++index < length)) {
  1954. if (predicate(array[index], index, array)) {
  1955. return index;
  1956. }
  1957. }
  1958. return -1;
  1959. }
  1960. /**
  1961. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1962. *
  1963. * @private
  1964. * @param {Array} array The array to inspect.
  1965. * @param {*} value The value to search for.
  1966. * @param {number} fromIndex The index to search from.
  1967. * @returns {number} Returns the index of the matched value, else `-1`.
  1968. */
  1969. function baseIndexOf(array, value, fromIndex) {
  1970. return value === value
  1971. ? strictIndexOf(array, value, fromIndex)
  1972. : baseFindIndex(array, baseIsNaN, fromIndex);
  1973. }
  1974. /**
  1975. * This function is like `baseIndexOf` except that it accepts a comparator.
  1976. *
  1977. * @private
  1978. * @param {Array} array The array to inspect.
  1979. * @param {*} value The value to search for.
  1980. * @param {number} fromIndex The index to search from.
  1981. * @param {Function} comparator The comparator invoked per element.
  1982. * @returns {number} Returns the index of the matched value, else `-1`.
  1983. */
  1984. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1985. var index = fromIndex - 1,
  1986. length = array.length;
  1987. while (++index < length) {
  1988. if (comparator(array[index], value)) {
  1989. return index;
  1990. }
  1991. }
  1992. return -1;
  1993. }
  1994. /**
  1995. * The base implementation of `_.isNaN` without support for number objects.
  1996. *
  1997. * @private
  1998. * @param {*} value The value to check.
  1999. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2000. */
  2001. function baseIsNaN(value) {
  2002. return value !== value;
  2003. }
  2004. /**
  2005. * The base implementation of `_.mean` and `_.meanBy` without support for
  2006. * iteratee shorthands.
  2007. *
  2008. * @private
  2009. * @param {Array} array The array to iterate over.
  2010. * @param {Function} iteratee The function invoked per iteration.
  2011. * @returns {number} Returns the mean.
  2012. */
  2013. function baseMean(array, iteratee) {
  2014. var length = array == null ? 0 : array.length;
  2015. return length ? (baseSum(array, iteratee) / length) : NAN;
  2016. }
  2017. /**
  2018. * The base implementation of `_.property` without support for deep paths.
  2019. *
  2020. * @private
  2021. * @param {string} key The key of the property to get.
  2022. * @returns {Function} Returns the new accessor function.
  2023. */
  2024. function baseProperty(key) {
  2025. return function(object) {
  2026. return object == null ? undefined : object[key];
  2027. };
  2028. }
  2029. /**
  2030. * The base implementation of `_.propertyOf` without support for deep paths.
  2031. *
  2032. * @private
  2033. * @param {Object} object The object to query.
  2034. * @returns {Function} Returns the new accessor function.
  2035. */
  2036. function basePropertyOf(object) {
  2037. return function(key) {
  2038. return object == null ? undefined : object[key];
  2039. };
  2040. }
  2041. /**
  2042. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2043. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2044. *
  2045. * @private
  2046. * @param {Array|Object} collection The collection to iterate over.
  2047. * @param {Function} iteratee The function invoked per iteration.
  2048. * @param {*} accumulator The initial value.
  2049. * @param {boolean} initAccum Specify using the first or last element of
  2050. * `collection` as the initial value.
  2051. * @param {Function} eachFunc The function to iterate over `collection`.
  2052. * @returns {*} Returns the accumulated value.
  2053. */
  2054. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2055. eachFunc(collection, function(value, index, collection) {
  2056. accumulator = initAccum
  2057. ? (initAccum = false, value)
  2058. : iteratee(accumulator, value, index, collection);
  2059. });
  2060. return accumulator;
  2061. }
  2062. /**
  2063. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2064. * sort order of `array` and replaces criteria objects with their corresponding
  2065. * values.
  2066. *
  2067. * @private
  2068. * @param {Array} array The array to sort.
  2069. * @param {Function} comparer The function to define sort order.
  2070. * @returns {Array} Returns `array`.
  2071. */
  2072. function baseSortBy(array, comparer) {
  2073. var length = array.length;
  2074. array.sort(comparer);
  2075. while (length--) {
  2076. array[length] = array[length].value;
  2077. }
  2078. return array;
  2079. }
  2080. /**
  2081. * The base implementation of `_.sum` and `_.sumBy` without support for
  2082. * iteratee shorthands.
  2083. *
  2084. * @private
  2085. * @param {Array} array The array to iterate over.
  2086. * @param {Function} iteratee The function invoked per iteration.
  2087. * @returns {number} Returns the sum.
  2088. */
  2089. function baseSum(array, iteratee) {
  2090. var result,
  2091. index = -1,
  2092. length = array.length;
  2093. while (++index < length) {
  2094. var current = iteratee(array[index]);
  2095. if (current !== undefined) {
  2096. result = result === undefined ? current : (result + current);
  2097. }
  2098. }
  2099. return result;
  2100. }
  2101. /**
  2102. * The base implementation of `_.times` without support for iteratee shorthands
  2103. * or max array length checks.
  2104. *
  2105. * @private
  2106. * @param {number} n The number of times to invoke `iteratee`.
  2107. * @param {Function} iteratee The function invoked per iteration.
  2108. * @returns {Array} Returns the array of results.
  2109. */
  2110. function baseTimes(n, iteratee) {
  2111. var index = -1,
  2112. result = Array(n);
  2113. while (++index < n) {
  2114. result[index] = iteratee(index);
  2115. }
  2116. return result;
  2117. }
  2118. /**
  2119. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2120. * of key-value pairs for `object` corresponding to the property names of `props`.
  2121. *
  2122. * @private
  2123. * @param {Object} object The object to query.
  2124. * @param {Array} props The property names to get values for.
  2125. * @returns {Object} Returns the key-value pairs.
  2126. */
  2127. function baseToPairs(object, props) {
  2128. return arrayMap(props, function(key) {
  2129. return [key, object[key]];
  2130. });
  2131. }
  2132. /**
  2133. * The base implementation of `_.trim`.
  2134. *
  2135. * @private
  2136. * @param {string} string The string to trim.
  2137. * @returns {string} Returns the trimmed string.
  2138. */
  2139. function baseTrim(string) {
  2140. return string
  2141. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2142. : string;
  2143. }
  2144. /**
  2145. * The base implementation of `_.unary` without support for storing metadata.
  2146. *
  2147. * @private
  2148. * @param {Function} func The function to cap arguments for.
  2149. * @returns {Function} Returns the new capped function.
  2150. */
  2151. function baseUnary(func) {
  2152. return function(value) {
  2153. return func(value);
  2154. };
  2155. }
  2156. /**
  2157. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2158. * array of `object` property values corresponding to the property names
  2159. * of `props`.
  2160. *
  2161. * @private
  2162. * @param {Object} object The object to query.
  2163. * @param {Array} props The property names to get values for.
  2164. * @returns {Object} Returns the array of property values.
  2165. */
  2166. function baseValues(object, props) {
  2167. return arrayMap(props, function(key) {
  2168. return object[key];
  2169. });
  2170. }
  2171. /**
  2172. * Checks if a `cache` value for `key` exists.
  2173. *
  2174. * @private
  2175. * @param {Object} cache The cache to query.
  2176. * @param {string} key The key of the entry to check.
  2177. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2178. */
  2179. function cacheHas(cache, key) {
  2180. return cache.has(key);
  2181. }
  2182. /**
  2183. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2184. * that is not found in the character symbols.
  2185. *
  2186. * @private
  2187. * @param {Array} strSymbols The string symbols to inspect.
  2188. * @param {Array} chrSymbols The character symbols to find.
  2189. * @returns {number} Returns the index of the first unmatched string symbol.
  2190. */
  2191. function charsStartIndex(strSymbols, chrSymbols) {
  2192. var index = -1,
  2193. length = strSymbols.length;
  2194. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2195. return index;
  2196. }
  2197. /**
  2198. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2199. * that is not found in the character symbols.
  2200. *
  2201. * @private
  2202. * @param {Array} strSymbols The string symbols to inspect.
  2203. * @param {Array} chrSymbols The character symbols to find.
  2204. * @returns {number} Returns the index of the last unmatched string symbol.
  2205. */
  2206. function charsEndIndex(strSymbols, chrSymbols) {
  2207. var index = strSymbols.length;
  2208. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2209. return index;
  2210. }
  2211. /**
  2212. * Gets the number of `placeholder` occurrences in `array`.
  2213. *
  2214. * @private
  2215. * @param {Array} array The array to inspect.
  2216. * @param {*} placeholder The placeholder to search for.
  2217. * @returns {number} Returns the placeholder count.
  2218. */
  2219. function countHolders(array, placeholder) {
  2220. var length = array.length,
  2221. result = 0;
  2222. while (length--) {
  2223. if (array[length] === placeholder) {
  2224. ++result;
  2225. }
  2226. }
  2227. return result;
  2228. }
  2229. /**
  2230. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2231. * letters to basic Latin letters.
  2232. *
  2233. * @private
  2234. * @param {string} letter The matched letter to deburr.
  2235. * @returns {string} Returns the deburred letter.
  2236. */
  2237. var deburrLetter = basePropertyOf(deburredLetters);
  2238. /**
  2239. * Used by `_.escape` to convert characters to HTML entities.
  2240. *
  2241. * @private
  2242. * @param {string} chr The matched character to escape.
  2243. * @returns {string} Returns the escaped character.
  2244. */
  2245. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2246. /**
  2247. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2248. *
  2249. * @private
  2250. * @param {string} chr The matched character to escape.
  2251. * @returns {string} Returns the escaped character.
  2252. */
  2253. function escapeStringChar(chr) {
  2254. return '\\' + stringEscapes[chr];
  2255. }
  2256. /**
  2257. * Gets the value at `key` of `object`.
  2258. *
  2259. * @private
  2260. * @param {Object} [object] The object to query.
  2261. * @param {string} key The key of the property to get.
  2262. * @returns {*} Returns the property value.
  2263. */
  2264. function getValue(object, key) {
  2265. return object == null ? undefined : object[key];
  2266. }
  2267. /**
  2268. * Checks if `string` contains Unicode symbols.
  2269. *
  2270. * @private
  2271. * @param {string} string The string to inspect.
  2272. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2273. */
  2274. function hasUnicode(string) {
  2275. return reHasUnicode.test(string);
  2276. }
  2277. /**
  2278. * Checks if `string` contains a word composed of Unicode symbols.
  2279. *
  2280. * @private
  2281. * @param {string} string The string to inspect.
  2282. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2283. */
  2284. function hasUnicodeWord(string) {
  2285. return reHasUnicodeWord.test(string);
  2286. }
  2287. /**
  2288. * Converts `iterator` to an array.
  2289. *
  2290. * @private
  2291. * @param {Object} iterator The iterator to convert.
  2292. * @returns {Array} Returns the converted array.
  2293. */
  2294. function iteratorToArray(iterator) {
  2295. var data,
  2296. result = [];
  2297. while (!(data = iterator.next()).done) {
  2298. result.push(data.value);
  2299. }
  2300. return result;
  2301. }
  2302. /**
  2303. * Converts `map` to its key-value pairs.
  2304. *
  2305. * @private
  2306. * @param {Object} map The map to convert.
  2307. * @returns {Array} Returns the key-value pairs.
  2308. */
  2309. function mapToArray(map) {
  2310. var index = -1,
  2311. result = Array(map.size);
  2312. map.forEach(function(value, key) {
  2313. result[++index] = [key, value];
  2314. });
  2315. return result;
  2316. }
  2317. /**
  2318. * Creates a unary function that invokes `func` with its argument transformed.
  2319. *
  2320. * @private
  2321. * @param {Function} func The function to wrap.
  2322. * @param {Function} transform The argument transform.
  2323. * @returns {Function} Returns the new function.
  2324. */
  2325. function overArg(func, transform) {
  2326. return function(arg) {
  2327. return func(transform(arg));
  2328. };
  2329. }
  2330. /**
  2331. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2332. * and returns an array of their indexes.
  2333. *
  2334. * @private
  2335. * @param {Array} array The array to modify.
  2336. * @param {*} placeholder The placeholder to replace.
  2337. * @returns {Array} Returns the new array of placeholder indexes.
  2338. */
  2339. function replaceHolders(array, placeholder) {
  2340. var index = -1,
  2341. length = array.length,
  2342. resIndex = 0,
  2343. result = [];
  2344. while (++index < length) {
  2345. var value = array[index];
  2346. if (value === placeholder || value === PLACEHOLDER) {
  2347. array[index] = PLACEHOLDER;
  2348. result[resIndex++] = index;
  2349. }
  2350. }
  2351. return result;
  2352. }
  2353. /**
  2354. * Converts `set` to an array of its values.
  2355. *
  2356. * @private
  2357. * @param {Object} set The set to convert.
  2358. * @returns {Array} Returns the values.
  2359. */
  2360. function setToArray(set) {
  2361. var index = -1,
  2362. result = Array(set.size);
  2363. set.forEach(function(value) {
  2364. result[++index] = value;
  2365. });
  2366. return result;
  2367. }
  2368. /**
  2369. * Converts `set` to its value-value pairs.
  2370. *
  2371. * @private
  2372. * @param {Object} set The set to convert.
  2373. * @returns {Array} Returns the value-value pairs.
  2374. */
  2375. function setToPairs(set) {
  2376. var index = -1,
  2377. result = Array(set.size);
  2378. set.forEach(function(value) {
  2379. result[++index] = [value, value];
  2380. });
  2381. return result;
  2382. }
  2383. /**
  2384. * A specialized version of `_.indexOf` which performs strict equality
  2385. * comparisons of values, i.e. `===`.
  2386. *
  2387. * @private
  2388. * @param {Array} array The array to inspect.
  2389. * @param {*} value The value to search for.
  2390. * @param {number} fromIndex The index to search from.
  2391. * @returns {number} Returns the index of the matched value, else `-1`.
  2392. */
  2393. function strictIndexOf(array, value, fromIndex) {
  2394. var index = fromIndex - 1,
  2395. length = array.length;
  2396. while (++index < length) {
  2397. if (array[index] === value) {
  2398. return index;
  2399. }
  2400. }
  2401. return -1;
  2402. }
  2403. /**
  2404. * A specialized version of `_.lastIndexOf` which performs strict equality
  2405. * comparisons of values, i.e. `===`.
  2406. *
  2407. * @private
  2408. * @param {Array} array The array to inspect.
  2409. * @param {*} value The value to search for.
  2410. * @param {number} fromIndex The index to search from.
  2411. * @returns {number} Returns the index of the matched value, else `-1`.
  2412. */
  2413. function strictLastIndexOf(array, value, fromIndex) {
  2414. var index = fromIndex + 1;
  2415. while (index--) {
  2416. if (array[index] === value) {
  2417. return index;
  2418. }
  2419. }
  2420. return index;
  2421. }
  2422. /**
  2423. * Gets the number of symbols in `string`.
  2424. *
  2425. * @private
  2426. * @param {string} string The string to inspect.
  2427. * @returns {number} Returns the string size.
  2428. */
  2429. function stringSize(string) {
  2430. return hasUnicode(string)
  2431. ? unicodeSize(string)
  2432. : asciiSize(string);
  2433. }
  2434. /**
  2435. * Converts `string` to an array.
  2436. *
  2437. * @private
  2438. * @param {string} string The string to convert.
  2439. * @returns {Array} Returns the converted array.
  2440. */
  2441. function stringToArray(string) {
  2442. return hasUnicode(string)
  2443. ? unicodeToArray(string)
  2444. : asciiToArray(string);
  2445. }
  2446. /**
  2447. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2448. * character of `string`.
  2449. *
  2450. * @private
  2451. * @param {string} string The string to inspect.
  2452. * @returns {number} Returns the index of the last non-whitespace character.
  2453. */
  2454. function trimmedEndIndex(string) {
  2455. var index = string.length;
  2456. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2457. return index;
  2458. }
  2459. /**
  2460. * Used by `_.unescape` to convert HTML entities to characters.
  2461. *
  2462. * @private
  2463. * @param {string} chr The matched character to unescape.
  2464. * @returns {string} Returns the unescaped character.
  2465. */
  2466. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2467. /**
  2468. * Gets the size of a Unicode `string`.
  2469. *
  2470. * @private
  2471. * @param {string} string The string inspect.
  2472. * @returns {number} Returns the string size.
  2473. */
  2474. function unicodeSize(string) {
  2475. var result = reUnicode.lastIndex = 0;
  2476. while (reUnicode.test(string)) {
  2477. ++result;
  2478. }
  2479. return result;
  2480. }
  2481. /**
  2482. * Converts a Unicode `string` to an array.
  2483. *
  2484. * @private
  2485. * @param {string} string The string to convert.
  2486. * @returns {Array} Returns the converted array.
  2487. */
  2488. function unicodeToArray(string) {
  2489. return string.match(reUnicode) || [];
  2490. }
  2491. /**
  2492. * Splits a Unicode `string` into an array of its words.
  2493. *
  2494. * @private
  2495. * @param {string} The string to inspect.
  2496. * @returns {Array} Returns the words of `string`.
  2497. */
  2498. function unicodeWords(string) {
  2499. return string.match(reUnicodeWord) || [];
  2500. }
  2501. /*--------------------------------------------------------------------------*/
  2502. /**
  2503. * Create a new pristine `lodash` function using the `context` object.
  2504. *
  2505. * @static
  2506. * @memberOf _
  2507. * @since 1.1.0
  2508. * @category Util
  2509. * @param {Object} [context=root] The context object.
  2510. * @returns {Function} Returns a new `lodash` function.
  2511. * @example
  2512. *
  2513. * _.mixin({ 'foo': _.constant('foo') });
  2514. *
  2515. * var lodash = _.runInContext();
  2516. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2517. *
  2518. * _.isFunction(_.foo);
  2519. * // => true
  2520. * _.isFunction(_.bar);
  2521. * // => false
  2522. *
  2523. * lodash.isFunction(lodash.foo);
  2524. * // => false
  2525. * lodash.isFunction(lodash.bar);
  2526. * // => true
  2527. *
  2528. * // Create a suped-up `defer` in Node.js.
  2529. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2530. */
  2531. var runInContext = (function runInContext(context) {
  2532. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2533. /** Built-in constructor references. */
  2534. var Array = context.Array,
  2535. Date = context.Date,
  2536. Error = context.Error,
  2537. Function = context.Function,
  2538. Math = context.Math,
  2539. Object = context.Object,
  2540. RegExp = context.RegExp,
  2541. String = context.String,
  2542. TypeError = context.TypeError;
  2543. /** Used for built-in method references. */
  2544. var arrayProto = Array.prototype,
  2545. funcProto = Function.prototype,
  2546. objectProto = Object.prototype;
  2547. /** Used to detect overreaching core-js shims. */
  2548. var coreJsData = context['__core-js_shared__'];
  2549. /** Used to resolve the decompiled source of functions. */
  2550. var funcToString = funcProto.toString;
  2551. /** Used to check objects for own properties. */
  2552. var hasOwnProperty = objectProto.hasOwnProperty;
  2553. /** Used to generate unique IDs. */
  2554. var idCounter = 0;
  2555. /** Used to detect methods masquerading as native. */
  2556. var maskSrcKey = (function() {
  2557. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2558. return uid ? ('Symbol(src)_1.' + uid) : '';
  2559. }());
  2560. /**
  2561. * Used to resolve the
  2562. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2563. * of values.
  2564. */
  2565. var nativeObjectToString = objectProto.toString;
  2566. /** Used to infer the `Object` constructor. */
  2567. var objectCtorString = funcToString.call(Object);
  2568. /** Used to restore the original `_` reference in `_.noConflict`. */
  2569. var oldDash = root._;
  2570. /** Used to detect if a method is native. */
  2571. var reIsNative = RegExp('^' +
  2572. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2573. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2574. );
  2575. /** Built-in value references. */
  2576. var Buffer = moduleExports ? context.Buffer : undefined,
  2577. Symbol = context.Symbol,
  2578. Uint8Array = context.Uint8Array,
  2579. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2580. getPrototype = overArg(Object.getPrototypeOf, Object),
  2581. objectCreate = Object.create,
  2582. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2583. splice = arrayProto.splice,
  2584. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2585. symIterator = Symbol ? Symbol.iterator : undefined,
  2586. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2587. var defineProperty = (function() {
  2588. try {
  2589. var func = getNative(Object, 'defineProperty');
  2590. func({}, '', {});
  2591. return func;
  2592. } catch (e) {}
  2593. }());
  2594. /** Mocked built-ins. */
  2595. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2596. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2597. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2598. /* Built-in method references for those with the same name as other `lodash` methods. */
  2599. var nativeCeil = Math.ceil,
  2600. nativeFloor = Math.floor,
  2601. nativeGetSymbols = Object.getOwnPropertySymbols,
  2602. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2603. nativeIsFinite = context.isFinite,
  2604. nativeJoin = arrayProto.join,
  2605. nativeKeys = overArg(Object.keys, Object),
  2606. nativeMax = Math.max,
  2607. nativeMin = Math.min,
  2608. nativeNow = Date.now,
  2609. nativeParseInt = context.parseInt,
  2610. nativeRandom = Math.random,
  2611. nativeReverse = arrayProto.reverse;
  2612. /* Built-in method references that are verified to be native. */
  2613. var DataView = getNative(context, 'DataView'),
  2614. Map = getNative(context, 'Map'),
  2615. Promise = getNative(context, 'Promise'),
  2616. Set = getNative(context, 'Set'),
  2617. WeakMap = getNative(context, 'WeakMap'),
  2618. nativeCreate = getNative(Object, 'create');
  2619. /** Used to store function metadata. */
  2620. var metaMap = WeakMap && new WeakMap;
  2621. /** Used to lookup unminified function names. */
  2622. var realNames = {};
  2623. /** Used to detect maps, sets, and weakmaps. */
  2624. var dataViewCtorString = toSource(DataView),
  2625. mapCtorString = toSource(Map),
  2626. promiseCtorString = toSource(Promise),
  2627. setCtorString = toSource(Set),
  2628. weakMapCtorString = toSource(WeakMap);
  2629. /** Used to convert symbols to primitives and strings. */
  2630. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2631. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2632. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2633. /*------------------------------------------------------------------------*/
  2634. /**
  2635. * Creates a `lodash` object which wraps `value` to enable implicit method
  2636. * chain sequences. Methods that operate on and return arrays, collections,
  2637. * and functions can be chained together. Methods that retrieve a single value
  2638. * or may return a primitive value will automatically end the chain sequence
  2639. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2640. * with `_#value`.
  2641. *
  2642. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2643. * enabled using `_.chain`.
  2644. *
  2645. * The execution of chained methods is lazy, that is, it's deferred until
  2646. * `_#value` is implicitly or explicitly called.
  2647. *
  2648. * Lazy evaluation allows several methods to support shortcut fusion.
  2649. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2650. * the creation of intermediate arrays and can greatly reduce the number of
  2651. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2652. * fusion if the section is applied to an array and iteratees accept only
  2653. * one argument. The heuristic for whether a section qualifies for shortcut
  2654. * fusion is subject to change.
  2655. *
  2656. * Chaining is supported in custom builds as long as the `_#value` method is
  2657. * directly or indirectly included in the build.
  2658. *
  2659. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2660. *
  2661. * The wrapper `Array` methods are:
  2662. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2663. *
  2664. * The wrapper `String` methods are:
  2665. * `replace` and `split`
  2666. *
  2667. * The wrapper methods that support shortcut fusion are:
  2668. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2669. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2670. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2671. *
  2672. * The chainable wrapper methods are:
  2673. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2674. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2675. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2676. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2677. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2678. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2679. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2680. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2681. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2682. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2683. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2684. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2685. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2686. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2687. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2688. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2689. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2690. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2691. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2692. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2693. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2694. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2695. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2696. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2697. *
  2698. * The wrapper methods that are **not** chainable by default are:
  2699. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2700. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2701. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2702. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2703. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2704. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2705. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2706. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2707. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2708. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2709. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2710. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2711. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2712. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2713. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2714. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2715. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2716. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2717. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2718. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2719. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2720. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2721. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2722. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2723. * `upperFirst`, `value`, and `words`
  2724. *
  2725. * @name _
  2726. * @constructor
  2727. * @category Seq
  2728. * @param {*} value The value to wrap in a `lodash` instance.
  2729. * @returns {Object} Returns the new `lodash` wrapper instance.
  2730. * @example
  2731. *
  2732. * function square(n) {
  2733. * return n * n;
  2734. * }
  2735. *
  2736. * var wrapped = _([1, 2, 3]);
  2737. *
  2738. * // Returns an unwrapped value.
  2739. * wrapped.reduce(_.add);
  2740. * // => 6
  2741. *
  2742. * // Returns a wrapped value.
  2743. * var squares = wrapped.map(square);
  2744. *
  2745. * _.isArray(squares);
  2746. * // => false
  2747. *
  2748. * _.isArray(squares.value());
  2749. * // => true
  2750. */
  2751. function lodash(value) {
  2752. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2753. if (value instanceof LodashWrapper) {
  2754. return value;
  2755. }
  2756. if (hasOwnProperty.call(value, '__wrapped__')) {
  2757. return wrapperClone(value);
  2758. }
  2759. }
  2760. return new LodashWrapper(value);
  2761. }
  2762. /**
  2763. * The base implementation of `_.create` without support for assigning
  2764. * properties to the created object.
  2765. *
  2766. * @private
  2767. * @param {Object} proto The object to inherit from.
  2768. * @returns {Object} Returns the new object.
  2769. */
  2770. var baseCreate = (function() {
  2771. function object() {}
  2772. return function(proto) {
  2773. if (!isObject(proto)) {
  2774. return {};
  2775. }
  2776. if (objectCreate) {
  2777. return objectCreate(proto);
  2778. }
  2779. object.prototype = proto;
  2780. var result = new object;
  2781. object.prototype = undefined;
  2782. return result;
  2783. };
  2784. }());
  2785. /**
  2786. * The function whose prototype chain sequence wrappers inherit from.
  2787. *
  2788. * @private
  2789. */
  2790. function baseLodash() {
  2791. // No operation performed.
  2792. }
  2793. /**
  2794. * The base constructor for creating `lodash` wrapper objects.
  2795. *
  2796. * @private
  2797. * @param {*} value The value to wrap.
  2798. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2799. */
  2800. function LodashWrapper(value, chainAll) {
  2801. this.__wrapped__ = value;
  2802. this.__actions__ = [];
  2803. this.__chain__ = !!chainAll;
  2804. this.__index__ = 0;
  2805. this.__values__ = undefined;
  2806. }
  2807. /**
  2808. * By default, the template delimiters used by lodash are like those in
  2809. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2810. * following template settings to use alternative delimiters.
  2811. *
  2812. * @static
  2813. * @memberOf _
  2814. * @type {Object}
  2815. */
  2816. lodash.templateSettings = {
  2817. /**
  2818. * Used to detect `data` property values to be HTML-escaped.
  2819. *
  2820. * @memberOf _.templateSettings
  2821. * @type {RegExp}
  2822. */
  2823. 'escape': reEscape,
  2824. /**
  2825. * Used to detect code to be evaluated.
  2826. *
  2827. * @memberOf _.templateSettings
  2828. * @type {RegExp}
  2829. */
  2830. 'evaluate': reEvaluate,
  2831. /**
  2832. * Used to detect `data` property values to inject.
  2833. *
  2834. * @memberOf _.templateSettings
  2835. * @type {RegExp}
  2836. */
  2837. 'interpolate': reInterpolate,
  2838. /**
  2839. * Used to reference the data object in the template text.
  2840. *
  2841. * @memberOf _.templateSettings
  2842. * @type {string}
  2843. */
  2844. 'variable': '',
  2845. /**
  2846. * Used to import variables into the compiled template.
  2847. *
  2848. * @memberOf _.templateSettings
  2849. * @type {Object}
  2850. */
  2851. 'imports': {
  2852. /**
  2853. * A reference to the `lodash` function.
  2854. *
  2855. * @memberOf _.templateSettings.imports
  2856. * @type {Function}
  2857. */
  2858. '_': lodash
  2859. }
  2860. };
  2861. // Ensure wrappers are instances of `baseLodash`.
  2862. lodash.prototype = baseLodash.prototype;
  2863. lodash.prototype.constructor = lodash;
  2864. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2865. LodashWrapper.prototype.constructor = LodashWrapper;
  2866. /*------------------------------------------------------------------------*/
  2867. /**
  2868. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2869. *
  2870. * @private
  2871. * @constructor
  2872. * @param {*} value The value to wrap.
  2873. */
  2874. function LazyWrapper(value) {
  2875. this.__wrapped__ = value;
  2876. this.__actions__ = [];
  2877. this.__dir__ = 1;
  2878. this.__filtered__ = false;
  2879. this.__iteratees__ = [];
  2880. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2881. this.__views__ = [];
  2882. }
  2883. /**
  2884. * Creates a clone of the lazy wrapper object.
  2885. *
  2886. * @private
  2887. * @name clone
  2888. * @memberOf LazyWrapper
  2889. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2890. */
  2891. function lazyClone() {
  2892. var result = new LazyWrapper(this.__wrapped__);
  2893. result.__actions__ = copyArray(this.__actions__);
  2894. result.__dir__ = this.__dir__;
  2895. result.__filtered__ = this.__filtered__;
  2896. result.__iteratees__ = copyArray(this.__iteratees__);
  2897. result.__takeCount__ = this.__takeCount__;
  2898. result.__views__ = copyArray(this.__views__);
  2899. return result;
  2900. }
  2901. /**
  2902. * Reverses the direction of lazy iteration.
  2903. *
  2904. * @private
  2905. * @name reverse
  2906. * @memberOf LazyWrapper
  2907. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2908. */
  2909. function lazyReverse() {
  2910. if (this.__filtered__) {
  2911. var result = new LazyWrapper(this);
  2912. result.__dir__ = -1;
  2913. result.__filtered__ = true;
  2914. } else {
  2915. result = this.clone();
  2916. result.__dir__ *= -1;
  2917. }
  2918. return result;
  2919. }
  2920. /**
  2921. * Extracts the unwrapped value from its lazy wrapper.
  2922. *
  2923. * @private
  2924. * @name value
  2925. * @memberOf LazyWrapper
  2926. * @returns {*} Returns the unwrapped value.
  2927. */
  2928. function lazyValue() {
  2929. var array = this.__wrapped__.value(),
  2930. dir = this.__dir__,
  2931. isArr = isArray(array),
  2932. isRight = dir < 0,
  2933. arrLength = isArr ? array.length : 0,
  2934. view = getView(0, arrLength, this.__views__),
  2935. start = view.start,
  2936. end = view.end,
  2937. length = end - start,
  2938. index = isRight ? end : (start - 1),
  2939. iteratees = this.__iteratees__,
  2940. iterLength = iteratees.length,
  2941. resIndex = 0,
  2942. takeCount = nativeMin(length, this.__takeCount__);
  2943. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2944. return baseWrapperValue(array, this.__actions__);
  2945. }
  2946. var result = [];
  2947. outer:
  2948. while (length-- && resIndex < takeCount) {
  2949. index += dir;
  2950. var iterIndex = -1,
  2951. value = array[index];
  2952. while (++iterIndex < iterLength) {
  2953. var data = iteratees[iterIndex],
  2954. iteratee = data.iteratee,
  2955. type = data.type,
  2956. computed = iteratee(value);
  2957. if (type == LAZY_MAP_FLAG) {
  2958. value = computed;
  2959. } else if (!computed) {
  2960. if (type == LAZY_FILTER_FLAG) {
  2961. continue outer;
  2962. } else {
  2963. break outer;
  2964. }
  2965. }
  2966. }
  2967. result[resIndex++] = value;
  2968. }
  2969. return result;
  2970. }
  2971. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2972. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2973. LazyWrapper.prototype.constructor = LazyWrapper;
  2974. /*------------------------------------------------------------------------*/
  2975. /**
  2976. * Creates a hash object.
  2977. *
  2978. * @private
  2979. * @constructor
  2980. * @param {Array} [entries] The key-value pairs to cache.
  2981. */
  2982. function Hash(entries) {
  2983. var index = -1,
  2984. length = entries == null ? 0 : entries.length;
  2985. this.clear();
  2986. while (++index < length) {
  2987. var entry = entries[index];
  2988. this.set(entry[0], entry[1]);
  2989. }
  2990. }
  2991. /**
  2992. * Removes all key-value entries from the hash.
  2993. *
  2994. * @private
  2995. * @name clear
  2996. * @memberOf Hash
  2997. */
  2998. function hashClear() {
  2999. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3000. this.size = 0;
  3001. }
  3002. /**
  3003. * Removes `key` and its value from the hash.
  3004. *
  3005. * @private
  3006. * @name delete
  3007. * @memberOf Hash
  3008. * @param {Object} hash The hash to modify.
  3009. * @param {string} key The key of the value to remove.
  3010. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3011. */
  3012. function hashDelete(key) {
  3013. var result = this.has(key) && delete this.__data__[key];
  3014. this.size -= result ? 1 : 0;
  3015. return result;
  3016. }
  3017. /**
  3018. * Gets the hash value for `key`.
  3019. *
  3020. * @private
  3021. * @name get
  3022. * @memberOf Hash
  3023. * @param {string} key The key of the value to get.
  3024. * @returns {*} Returns the entry value.
  3025. */
  3026. function hashGet(key) {
  3027. var data = this.__data__;
  3028. if (nativeCreate) {
  3029. var result = data[key];
  3030. return result === HASH_UNDEFINED ? undefined : result;
  3031. }
  3032. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3033. }
  3034. /**
  3035. * Checks if a hash value for `key` exists.
  3036. *
  3037. * @private
  3038. * @name has
  3039. * @memberOf Hash
  3040. * @param {string} key The key of the entry to check.
  3041. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3042. */
  3043. function hashHas(key) {
  3044. var data = this.__data__;
  3045. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3046. }
  3047. /**
  3048. * Sets the hash `key` to `value`.
  3049. *
  3050. * @private
  3051. * @name set
  3052. * @memberOf Hash
  3053. * @param {string} key The key of the value to set.
  3054. * @param {*} value The value to set.
  3055. * @returns {Object} Returns the hash instance.
  3056. */
  3057. function hashSet(key, value) {
  3058. var data = this.__data__;
  3059. this.size += this.has(key) ? 0 : 1;
  3060. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3061. return this;
  3062. }
  3063. // Add methods to `Hash`.
  3064. Hash.prototype.clear = hashClear;
  3065. Hash.prototype['delete'] = hashDelete;
  3066. Hash.prototype.get = hashGet;
  3067. Hash.prototype.has = hashHas;
  3068. Hash.prototype.set = hashSet;
  3069. /*------------------------------------------------------------------------*/
  3070. /**
  3071. * Creates an list cache object.
  3072. *
  3073. * @private
  3074. * @constructor
  3075. * @param {Array} [entries] The key-value pairs to cache.
  3076. */
  3077. function ListCache(entries) {
  3078. var index = -1,
  3079. length = entries == null ? 0 : entries.length;
  3080. this.clear();
  3081. while (++index < length) {
  3082. var entry = entries[index];
  3083. this.set(entry[0], entry[1]);
  3084. }
  3085. }
  3086. /**
  3087. * Removes all key-value entries from the list cache.
  3088. *
  3089. * @private
  3090. * @name clear
  3091. * @memberOf ListCache
  3092. */
  3093. function listCacheClear() {
  3094. this.__data__ = [];
  3095. this.size = 0;
  3096. }
  3097. /**
  3098. * Removes `key` and its value from the list cache.
  3099. *
  3100. * @private
  3101. * @name delete
  3102. * @memberOf ListCache
  3103. * @param {string} key The key of the value to remove.
  3104. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3105. */
  3106. function listCacheDelete(key) {
  3107. var data = this.__data__,
  3108. index = assocIndexOf(data, key);
  3109. if (index < 0) {
  3110. return false;
  3111. }
  3112. var lastIndex = data.length - 1;
  3113. if (index == lastIndex) {
  3114. data.pop();
  3115. } else {
  3116. splice.call(data, index, 1);
  3117. }
  3118. --this.size;
  3119. return true;
  3120. }
  3121. /**
  3122. * Gets the list cache value for `key`.
  3123. *
  3124. * @private
  3125. * @name get
  3126. * @memberOf ListCache
  3127. * @param {string} key The key of the value to get.
  3128. * @returns {*} Returns the entry value.
  3129. */
  3130. function listCacheGet(key) {
  3131. var data = this.__data__,
  3132. index = assocIndexOf(data, key);
  3133. return index < 0 ? undefined : data[index][1];
  3134. }
  3135. /**
  3136. * Checks if a list cache value for `key` exists.
  3137. *
  3138. * @private
  3139. * @name has
  3140. * @memberOf ListCache
  3141. * @param {string} key The key of the entry to check.
  3142. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3143. */
  3144. function listCacheHas(key) {
  3145. return assocIndexOf(this.__data__, key) > -1;
  3146. }
  3147. /**
  3148. * Sets the list cache `key` to `value`.
  3149. *
  3150. * @private
  3151. * @name set
  3152. * @memberOf ListCache
  3153. * @param {string} key The key of the value to set.
  3154. * @param {*} value The value to set.
  3155. * @returns {Object} Returns the list cache instance.
  3156. */
  3157. function listCacheSet(key, value) {
  3158. var data = this.__data__,
  3159. index = assocIndexOf(data, key);
  3160. if (index < 0) {
  3161. ++this.size;
  3162. data.push([key, value]);
  3163. } else {
  3164. data[index][1] = value;
  3165. }
  3166. return this;
  3167. }
  3168. // Add methods to `ListCache`.
  3169. ListCache.prototype.clear = listCacheClear;
  3170. ListCache.prototype['delete'] = listCacheDelete;
  3171. ListCache.prototype.get = listCacheGet;
  3172. ListCache.prototype.has = listCacheHas;
  3173. ListCache.prototype.set = listCacheSet;
  3174. /*------------------------------------------------------------------------*/
  3175. /**
  3176. * Creates a map cache object to store key-value pairs.
  3177. *
  3178. * @private
  3179. * @constructor
  3180. * @param {Array} [entries] The key-value pairs to cache.
  3181. */
  3182. function MapCache(entries) {
  3183. var index = -1,
  3184. length = entries == null ? 0 : entries.length;
  3185. this.clear();
  3186. while (++index < length) {
  3187. var entry = entries[index];
  3188. this.set(entry[0], entry[1]);
  3189. }
  3190. }
  3191. /**
  3192. * Removes all key-value entries from the map.
  3193. *
  3194. * @private
  3195. * @name clear
  3196. * @memberOf MapCache
  3197. */
  3198. function mapCacheClear() {
  3199. this.size = 0;
  3200. this.__data__ = {
  3201. 'hash': new Hash,
  3202. 'map': new (Map || ListCache),
  3203. 'string': new Hash
  3204. };
  3205. }
  3206. /**
  3207. * Removes `key` and its value from the map.
  3208. *
  3209. * @private
  3210. * @name delete
  3211. * @memberOf MapCache
  3212. * @param {string} key The key of the value to remove.
  3213. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3214. */
  3215. function mapCacheDelete(key) {
  3216. var result = getMapData(this, key)['delete'](key);
  3217. this.size -= result ? 1 : 0;
  3218. return result;
  3219. }
  3220. /**
  3221. * Gets the map value for `key`.
  3222. *
  3223. * @private
  3224. * @name get
  3225. * @memberOf MapCache
  3226. * @param {string} key The key of the value to get.
  3227. * @returns {*} Returns the entry value.
  3228. */
  3229. function mapCacheGet(key) {
  3230. return getMapData(this, key).get(key);
  3231. }
  3232. /**
  3233. * Checks if a map value for `key` exists.
  3234. *
  3235. * @private
  3236. * @name has
  3237. * @memberOf MapCache
  3238. * @param {string} key The key of the entry to check.
  3239. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3240. */
  3241. function mapCacheHas(key) {
  3242. return getMapData(this, key).has(key);
  3243. }
  3244. /**
  3245. * Sets the map `key` to `value`.
  3246. *
  3247. * @private
  3248. * @name set
  3249. * @memberOf MapCache
  3250. * @param {string} key The key of the value to set.
  3251. * @param {*} value The value to set.
  3252. * @returns {Object} Returns the map cache instance.
  3253. */
  3254. function mapCacheSet(key, value) {
  3255. var data = getMapData(this, key),
  3256. size = data.size;
  3257. data.set(key, value);
  3258. this.size += data.size == size ? 0 : 1;
  3259. return this;
  3260. }
  3261. // Add methods to `MapCache`.
  3262. MapCache.prototype.clear = mapCacheClear;
  3263. MapCache.prototype['delete'] = mapCacheDelete;
  3264. MapCache.prototype.get = mapCacheGet;
  3265. MapCache.prototype.has = mapCacheHas;
  3266. MapCache.prototype.set = mapCacheSet;
  3267. /*------------------------------------------------------------------------*/
  3268. /**
  3269. *
  3270. * Creates an array cache object to store unique values.
  3271. *
  3272. * @private
  3273. * @constructor
  3274. * @param {Array} [values] The values to cache.
  3275. */
  3276. function SetCache(values) {
  3277. var index = -1,
  3278. length = values == null ? 0 : values.length;
  3279. this.__data__ = new MapCache;
  3280. while (++index < length) {
  3281. this.add(values[index]);
  3282. }
  3283. }
  3284. /**
  3285. * Adds `value` to the array cache.
  3286. *
  3287. * @private
  3288. * @name add
  3289. * @memberOf SetCache
  3290. * @alias push
  3291. * @param {*} value The value to cache.
  3292. * @returns {Object} Returns the cache instance.
  3293. */
  3294. function setCacheAdd(value) {
  3295. this.__data__.set(value, HASH_UNDEFINED);
  3296. return this;
  3297. }
  3298. /**
  3299. * Checks if `value` is in the array cache.
  3300. *
  3301. * @private
  3302. * @name has
  3303. * @memberOf SetCache
  3304. * @param {*} value The value to search for.
  3305. * @returns {number} Returns `true` if `value` is found, else `false`.
  3306. */
  3307. function setCacheHas(value) {
  3308. return this.__data__.has(value);
  3309. }
  3310. // Add methods to `SetCache`.
  3311. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3312. SetCache.prototype.has = setCacheHas;
  3313. /*------------------------------------------------------------------------*/
  3314. /**
  3315. * Creates a stack cache object to store key-value pairs.
  3316. *
  3317. * @private
  3318. * @constructor
  3319. * @param {Array} [entries] The key-value pairs to cache.
  3320. */
  3321. function Stack(entries) {
  3322. var data = this.__data__ = new ListCache(entries);
  3323. this.size = data.size;
  3324. }
  3325. /**
  3326. * Removes all key-value entries from the stack.
  3327. *
  3328. * @private
  3329. * @name clear
  3330. * @memberOf Stack
  3331. */
  3332. function stackClear() {
  3333. this.__data__ = new ListCache;
  3334. this.size = 0;
  3335. }
  3336. /**
  3337. * Removes `key` and its value from the stack.
  3338. *
  3339. * @private
  3340. * @name delete
  3341. * @memberOf Stack
  3342. * @param {string} key The key of the value to remove.
  3343. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3344. */
  3345. function stackDelete(key) {
  3346. var data = this.__data__,
  3347. result = data['delete'](key);
  3348. this.size = data.size;
  3349. return result;
  3350. }
  3351. /**
  3352. * Gets the stack value for `key`.
  3353. *
  3354. * @private
  3355. * @name get
  3356. * @memberOf Stack
  3357. * @param {string} key The key of the value to get.
  3358. * @returns {*} Returns the entry value.
  3359. */
  3360. function stackGet(key) {
  3361. return this.__data__.get(key);
  3362. }
  3363. /**
  3364. * Checks if a stack value for `key` exists.
  3365. *
  3366. * @private
  3367. * @name has
  3368. * @memberOf Stack
  3369. * @param {string} key The key of the entry to check.
  3370. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3371. */
  3372. function stackHas(key) {
  3373. return this.__data__.has(key);
  3374. }
  3375. /**
  3376. * Sets the stack `key` to `value`.
  3377. *
  3378. * @private
  3379. * @name set
  3380. * @memberOf Stack
  3381. * @param {string} key The key of the value to set.
  3382. * @param {*} value The value to set.
  3383. * @returns {Object} Returns the stack cache instance.
  3384. */
  3385. function stackSet(key, value) {
  3386. var data = this.__data__;
  3387. if (data instanceof ListCache) {
  3388. var pairs = data.__data__;
  3389. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3390. pairs.push([key, value]);
  3391. this.size = ++data.size;
  3392. return this;
  3393. }
  3394. data = this.__data__ = new MapCache(pairs);
  3395. }
  3396. data.set(key, value);
  3397. this.size = data.size;
  3398. return this;
  3399. }
  3400. // Add methods to `Stack`.
  3401. Stack.prototype.clear = stackClear;
  3402. Stack.prototype['delete'] = stackDelete;
  3403. Stack.prototype.get = stackGet;
  3404. Stack.prototype.has = stackHas;
  3405. Stack.prototype.set = stackSet;
  3406. /*------------------------------------------------------------------------*/
  3407. /**
  3408. * Creates an array of the enumerable property names of the array-like `value`.
  3409. *
  3410. * @private
  3411. * @param {*} value The value to query.
  3412. * @param {boolean} inherited Specify returning inherited property names.
  3413. * @returns {Array} Returns the array of property names.
  3414. */
  3415. function arrayLikeKeys(value, inherited) {
  3416. var isArr = isArray(value),
  3417. isArg = !isArr && isArguments(value),
  3418. isBuff = !isArr && !isArg && isBuffer(value),
  3419. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3420. skipIndexes = isArr || isArg || isBuff || isType,
  3421. result = skipIndexes ? baseTimes(value.length, String) : [],
  3422. length = result.length;
  3423. for (var key in value) {
  3424. if ((inherited || hasOwnProperty.call(value, key)) &&
  3425. !(skipIndexes && (
  3426. // Safari 9 has enumerable `arguments.length` in strict mode.
  3427. key == 'length' ||
  3428. // Node.js 0.10 has enumerable non-index properties on buffers.
  3429. (isBuff && (key == 'offset' || key == 'parent')) ||
  3430. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3431. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3432. // Skip index properties.
  3433. isIndex(key, length)
  3434. ))) {
  3435. result.push(key);
  3436. }
  3437. }
  3438. return result;
  3439. }
  3440. /**
  3441. * A specialized version of `_.sample` for arrays.
  3442. *
  3443. * @private
  3444. * @param {Array} array The array to sample.
  3445. * @returns {*} Returns the random element.
  3446. */
  3447. function arraySample(array) {
  3448. var length = array.length;
  3449. return length ? array[baseRandom(0, length - 1)] : undefined;
  3450. }
  3451. /**
  3452. * A specialized version of `_.sampleSize` for arrays.
  3453. *
  3454. * @private
  3455. * @param {Array} array The array to sample.
  3456. * @param {number} n The number of elements to sample.
  3457. * @returns {Array} Returns the random elements.
  3458. */
  3459. function arraySampleSize(array, n) {
  3460. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3461. }
  3462. /**
  3463. * A specialized version of `_.shuffle` for arrays.
  3464. *
  3465. * @private
  3466. * @param {Array} array The array to shuffle.
  3467. * @returns {Array} Returns the new shuffled array.
  3468. */
  3469. function arrayShuffle(array) {
  3470. return shuffleSelf(copyArray(array));
  3471. }
  3472. /**
  3473. * This function is like `assignValue` except that it doesn't assign
  3474. * `undefined` values.
  3475. *
  3476. * @private
  3477. * @param {Object} object The object to modify.
  3478. * @param {string} key The key of the property to assign.
  3479. * @param {*} value The value to assign.
  3480. */
  3481. function assignMergeValue(object, key, value) {
  3482. if ((value !== undefined && !eq(object[key], value)) ||
  3483. (value === undefined && !(key in object))) {
  3484. baseAssignValue(object, key, value);
  3485. }
  3486. }
  3487. /**
  3488. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3489. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3490. * for equality comparisons.
  3491. *
  3492. * @private
  3493. * @param {Object} object The object to modify.
  3494. * @param {string} key The key of the property to assign.
  3495. * @param {*} value The value to assign.
  3496. */
  3497. function assignValue(object, key, value) {
  3498. var objValue = object[key];
  3499. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3500. (value === undefined && !(key in object))) {
  3501. baseAssignValue(object, key, value);
  3502. }
  3503. }
  3504. /**
  3505. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3506. *
  3507. * @private
  3508. * @param {Array} array The array to inspect.
  3509. * @param {*} key The key to search for.
  3510. * @returns {number} Returns the index of the matched value, else `-1`.
  3511. */
  3512. function assocIndexOf(array, key) {
  3513. var length = array.length;
  3514. while (length--) {
  3515. if (eq(array[length][0], key)) {
  3516. return length;
  3517. }
  3518. }
  3519. return -1;
  3520. }
  3521. /**
  3522. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3523. * by `iteratee` and values set by `setter`.
  3524. *
  3525. * @private
  3526. * @param {Array|Object} collection The collection to iterate over.
  3527. * @param {Function} setter The function to set `accumulator` values.
  3528. * @param {Function} iteratee The iteratee to transform keys.
  3529. * @param {Object} accumulator The initial aggregated object.
  3530. * @returns {Function} Returns `accumulator`.
  3531. */
  3532. function baseAggregator(collection, setter, iteratee, accumulator) {
  3533. baseEach(collection, function(value, key, collection) {
  3534. setter(accumulator, value, iteratee(value), collection);
  3535. });
  3536. return accumulator;
  3537. }
  3538. /**
  3539. * The base implementation of `_.assign` without support for multiple sources
  3540. * or `customizer` functions.
  3541. *
  3542. * @private
  3543. * @param {Object} object The destination object.
  3544. * @param {Object} source The source object.
  3545. * @returns {Object} Returns `object`.
  3546. */
  3547. function baseAssign(object, source) {
  3548. return object && copyObject(source, keys(source), object);
  3549. }
  3550. /**
  3551. * The base implementation of `_.assignIn` without support for multiple sources
  3552. * or `customizer` functions.
  3553. *
  3554. * @private
  3555. * @param {Object} object The destination object.
  3556. * @param {Object} source The source object.
  3557. * @returns {Object} Returns `object`.
  3558. */
  3559. function baseAssignIn(object, source) {
  3560. return object && copyObject(source, keysIn(source), object);
  3561. }
  3562. /**
  3563. * The base implementation of `assignValue` and `assignMergeValue` without
  3564. * value checks.
  3565. *
  3566. * @private
  3567. * @param {Object} object The object to modify.
  3568. * @param {string} key The key of the property to assign.
  3569. * @param {*} value The value to assign.
  3570. */
  3571. function baseAssignValue(object, key, value) {
  3572. if (key == '__proto__' && defineProperty) {
  3573. defineProperty(object, key, {
  3574. 'configurable': true,
  3575. 'enumerable': true,
  3576. 'value': value,
  3577. 'writable': true
  3578. });
  3579. } else {
  3580. object[key] = value;
  3581. }
  3582. }
  3583. /**
  3584. * The base implementation of `_.at` without support for individual paths.
  3585. *
  3586. * @private
  3587. * @param {Object} object The object to iterate over.
  3588. * @param {string[]} paths The property paths to pick.
  3589. * @returns {Array} Returns the picked elements.
  3590. */
  3591. function baseAt(object, paths) {
  3592. var index = -1,
  3593. length = paths.length,
  3594. result = Array(length),
  3595. skip = object == null;
  3596. while (++index < length) {
  3597. result[index] = skip ? undefined : get(object, paths[index]);
  3598. }
  3599. return result;
  3600. }
  3601. /**
  3602. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3603. *
  3604. * @private
  3605. * @param {number} number The number to clamp.
  3606. * @param {number} [lower] The lower bound.
  3607. * @param {number} upper The upper bound.
  3608. * @returns {number} Returns the clamped number.
  3609. */
  3610. function baseClamp(number, lower, upper) {
  3611. if (number === number) {
  3612. if (upper !== undefined) {
  3613. number = number <= upper ? number : upper;
  3614. }
  3615. if (lower !== undefined) {
  3616. number = number >= lower ? number : lower;
  3617. }
  3618. }
  3619. return number;
  3620. }
  3621. /**
  3622. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3623. * traversed objects.
  3624. *
  3625. * @private
  3626. * @param {*} value The value to clone.
  3627. * @param {boolean} bitmask The bitmask flags.
  3628. * 1 - Deep clone
  3629. * 2 - Flatten inherited properties
  3630. * 4 - Clone symbols
  3631. * @param {Function} [customizer] The function to customize cloning.
  3632. * @param {string} [key] The key of `value`.
  3633. * @param {Object} [object] The parent object of `value`.
  3634. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3635. * @returns {*} Returns the cloned value.
  3636. */
  3637. function baseClone(value, bitmask, customizer, key, object, stack) {
  3638. var result,
  3639. isDeep = bitmask & CLONE_DEEP_FLAG,
  3640. isFlat = bitmask & CLONE_FLAT_FLAG,
  3641. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3642. if (customizer) {
  3643. result = object ? customizer(value, key, object, stack) : customizer(value);
  3644. }
  3645. if (result !== undefined) {
  3646. return result;
  3647. }
  3648. if (!isObject(value)) {
  3649. return value;
  3650. }
  3651. var isArr = isArray(value);
  3652. if (isArr) {
  3653. result = initCloneArray(value);
  3654. if (!isDeep) {
  3655. return copyArray(value, result);
  3656. }
  3657. } else {
  3658. var tag = getTag(value),
  3659. isFunc = tag == funcTag || tag == genTag;
  3660. if (isBuffer(value)) {
  3661. return cloneBuffer(value, isDeep);
  3662. }
  3663. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3664. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3665. if (!isDeep) {
  3666. return isFlat
  3667. ? copySymbolsIn(value, baseAssignIn(result, value))
  3668. : copySymbols(value, baseAssign(result, value));
  3669. }
  3670. } else {
  3671. if (!cloneableTags[tag]) {
  3672. return object ? value : {};
  3673. }
  3674. result = initCloneByTag(value, tag, isDeep);
  3675. }
  3676. }
  3677. // Check for circular references and return its corresponding clone.
  3678. stack || (stack = new Stack);
  3679. var stacked = stack.get(value);
  3680. if (stacked) {
  3681. return stacked;
  3682. }
  3683. stack.set(value, result);
  3684. if (isSet(value)) {
  3685. value.forEach(function(subValue) {
  3686. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3687. });
  3688. } else if (isMap(value)) {
  3689. value.forEach(function(subValue, key) {
  3690. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3691. });
  3692. }
  3693. var keysFunc = isFull
  3694. ? (isFlat ? getAllKeysIn : getAllKeys)
  3695. : (isFlat ? keysIn : keys);
  3696. var props = isArr ? undefined : keysFunc(value);
  3697. arrayEach(props || value, function(subValue, key) {
  3698. if (props) {
  3699. key = subValue;
  3700. subValue = value[key];
  3701. }
  3702. // Recursively populate clone (susceptible to call stack limits).
  3703. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3704. });
  3705. return result;
  3706. }
  3707. /**
  3708. * The base implementation of `_.conforms` which doesn't clone `source`.
  3709. *
  3710. * @private
  3711. * @param {Object} source The object of property predicates to conform to.
  3712. * @returns {Function} Returns the new spec function.
  3713. */
  3714. function baseConforms(source) {
  3715. var props = keys(source);
  3716. return function(object) {
  3717. return baseConformsTo(object, source, props);
  3718. };
  3719. }
  3720. /**
  3721. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3722. *
  3723. * @private
  3724. * @param {Object} object The object to inspect.
  3725. * @param {Object} source The object of property predicates to conform to.
  3726. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3727. */
  3728. function baseConformsTo(object, source, props) {
  3729. var length = props.length;
  3730. if (object == null) {
  3731. return !length;
  3732. }
  3733. object = Object(object);
  3734. while (length--) {
  3735. var key = props[length],
  3736. predicate = source[key],
  3737. value = object[key];
  3738. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3739. return false;
  3740. }
  3741. }
  3742. return true;
  3743. }
  3744. /**
  3745. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3746. * to provide to `func`.
  3747. *
  3748. * @private
  3749. * @param {Function} func The function to delay.
  3750. * @param {number} wait The number of milliseconds to delay invocation.
  3751. * @param {Array} args The arguments to provide to `func`.
  3752. * @returns {number|Object} Returns the timer id or timeout object.
  3753. */
  3754. function baseDelay(func, wait, args) {
  3755. if (typeof func != 'function') {
  3756. throw new TypeError(FUNC_ERROR_TEXT);
  3757. }
  3758. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3759. }
  3760. /**
  3761. * The base implementation of methods like `_.difference` without support
  3762. * for excluding multiple arrays or iteratee shorthands.
  3763. *
  3764. * @private
  3765. * @param {Array} array The array to inspect.
  3766. * @param {Array} values The values to exclude.
  3767. * @param {Function} [iteratee] The iteratee invoked per element.
  3768. * @param {Function} [comparator] The comparator invoked per element.
  3769. * @returns {Array} Returns the new array of filtered values.
  3770. */
  3771. function baseDifference(array, values, iteratee, comparator) {
  3772. var index = -1,
  3773. includes = arrayIncludes,
  3774. isCommon = true,
  3775. length = array.length,
  3776. result = [],
  3777. valuesLength = values.length;
  3778. if (!length) {
  3779. return result;
  3780. }
  3781. if (iteratee) {
  3782. values = arrayMap(values, baseUnary(iteratee));
  3783. }
  3784. if (comparator) {
  3785. includes = arrayIncludesWith;
  3786. isCommon = false;
  3787. }
  3788. else if (values.length >= LARGE_ARRAY_SIZE) {
  3789. includes = cacheHas;
  3790. isCommon = false;
  3791. values = new SetCache(values);
  3792. }
  3793. outer:
  3794. while (++index < length) {
  3795. var value = array[index],
  3796. computed = iteratee == null ? value : iteratee(value);
  3797. value = (comparator || value !== 0) ? value : 0;
  3798. if (isCommon && computed === computed) {
  3799. var valuesIndex = valuesLength;
  3800. while (valuesIndex--) {
  3801. if (values[valuesIndex] === computed) {
  3802. continue outer;
  3803. }
  3804. }
  3805. result.push(value);
  3806. }
  3807. else if (!includes(values, computed, comparator)) {
  3808. result.push(value);
  3809. }
  3810. }
  3811. return result;
  3812. }
  3813. /**
  3814. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3815. *
  3816. * @private
  3817. * @param {Array|Object} collection The collection to iterate over.
  3818. * @param {Function} iteratee The function invoked per iteration.
  3819. * @returns {Array|Object} Returns `collection`.
  3820. */
  3821. var baseEach = createBaseEach(baseForOwn);
  3822. /**
  3823. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3824. *
  3825. * @private
  3826. * @param {Array|Object} collection The collection to iterate over.
  3827. * @param {Function} iteratee The function invoked per iteration.
  3828. * @returns {Array|Object} Returns `collection`.
  3829. */
  3830. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3831. /**
  3832. * The base implementation of `_.every` without support for iteratee shorthands.
  3833. *
  3834. * @private
  3835. * @param {Array|Object} collection The collection to iterate over.
  3836. * @param {Function} predicate The function invoked per iteration.
  3837. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3838. * else `false`
  3839. */
  3840. function baseEvery(collection, predicate) {
  3841. var result = true;
  3842. baseEach(collection, function(value, index, collection) {
  3843. result = !!predicate(value, index, collection);
  3844. return result;
  3845. });
  3846. return result;
  3847. }
  3848. /**
  3849. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3850. * `comparator` to determine the extremum value.
  3851. *
  3852. * @private
  3853. * @param {Array} array The array to iterate over.
  3854. * @param {Function} iteratee The iteratee invoked per iteration.
  3855. * @param {Function} comparator The comparator used to compare values.
  3856. * @returns {*} Returns the extremum value.
  3857. */
  3858. function baseExtremum(array, iteratee, comparator) {
  3859. var index = -1,
  3860. length = array.length;
  3861. while (++index < length) {
  3862. var value = array[index],
  3863. current = iteratee(value);
  3864. if (current != null && (computed === undefined
  3865. ? (current === current && !isSymbol(current))
  3866. : comparator(current, computed)
  3867. )) {
  3868. var computed = current,
  3869. result = value;
  3870. }
  3871. }
  3872. return result;
  3873. }
  3874. /**
  3875. * The base implementation of `_.fill` without an iteratee call guard.
  3876. *
  3877. * @private
  3878. * @param {Array} array The array to fill.
  3879. * @param {*} value The value to fill `array` with.
  3880. * @param {number} [start=0] The start position.
  3881. * @param {number} [end=array.length] The end position.
  3882. * @returns {Array} Returns `array`.
  3883. */
  3884. function baseFill(array, value, start, end) {
  3885. var length = array.length;
  3886. start = toInteger(start);
  3887. if (start < 0) {
  3888. start = -start > length ? 0 : (length + start);
  3889. }
  3890. end = (end === undefined || end > length) ? length : toInteger(end);
  3891. if (end < 0) {
  3892. end += length;
  3893. }
  3894. end = start > end ? 0 : toLength(end);
  3895. while (start < end) {
  3896. array[start++] = value;
  3897. }
  3898. return array;
  3899. }
  3900. /**
  3901. * The base implementation of `_.filter` without support for iteratee shorthands.
  3902. *
  3903. * @private
  3904. * @param {Array|Object} collection The collection to iterate over.
  3905. * @param {Function} predicate The function invoked per iteration.
  3906. * @returns {Array} Returns the new filtered array.
  3907. */
  3908. function baseFilter(collection, predicate) {
  3909. var result = [];
  3910. baseEach(collection, function(value, index, collection) {
  3911. if (predicate(value, index, collection)) {
  3912. result.push(value);
  3913. }
  3914. });
  3915. return result;
  3916. }
  3917. /**
  3918. * The base implementation of `_.flatten` with support for restricting flattening.
  3919. *
  3920. * @private
  3921. * @param {Array} array The array to flatten.
  3922. * @param {number} depth The maximum recursion depth.
  3923. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3924. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3925. * @param {Array} [result=[]] The initial result value.
  3926. * @returns {Array} Returns the new flattened array.
  3927. */
  3928. function baseFlatten(array, depth, predicate, isStrict, result) {
  3929. var index = -1,
  3930. length = array.length;
  3931. predicate || (predicate = isFlattenable);
  3932. result || (result = []);
  3933. while (++index < length) {
  3934. var value = array[index];
  3935. if (depth > 0 && predicate(value)) {
  3936. if (depth > 1) {
  3937. // Recursively flatten arrays (susceptible to call stack limits).
  3938. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3939. } else {
  3940. arrayPush(result, value);
  3941. }
  3942. } else if (!isStrict) {
  3943. result[result.length] = value;
  3944. }
  3945. }
  3946. return result;
  3947. }
  3948. /**
  3949. * The base implementation of `baseForOwn` which iterates over `object`
  3950. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3951. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3952. *
  3953. * @private
  3954. * @param {Object} object The object to iterate over.
  3955. * @param {Function} iteratee The function invoked per iteration.
  3956. * @param {Function} keysFunc The function to get the keys of `object`.
  3957. * @returns {Object} Returns `object`.
  3958. */
  3959. var baseFor = createBaseFor();
  3960. /**
  3961. * This function is like `baseFor` except that it iterates over properties
  3962. * in the opposite order.
  3963. *
  3964. * @private
  3965. * @param {Object} object The object to iterate over.
  3966. * @param {Function} iteratee The function invoked per iteration.
  3967. * @param {Function} keysFunc The function to get the keys of `object`.
  3968. * @returns {Object} Returns `object`.
  3969. */
  3970. var baseForRight = createBaseFor(true);
  3971. /**
  3972. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3973. *
  3974. * @private
  3975. * @param {Object} object The object to iterate over.
  3976. * @param {Function} iteratee The function invoked per iteration.
  3977. * @returns {Object} Returns `object`.
  3978. */
  3979. function baseForOwn(object, iteratee) {
  3980. return object && baseFor(object, iteratee, keys);
  3981. }
  3982. /**
  3983. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3984. *
  3985. * @private
  3986. * @param {Object} object The object to iterate over.
  3987. * @param {Function} iteratee The function invoked per iteration.
  3988. * @returns {Object} Returns `object`.
  3989. */
  3990. function baseForOwnRight(object, iteratee) {
  3991. return object && baseForRight(object, iteratee, keys);
  3992. }
  3993. /**
  3994. * The base implementation of `_.functions` which creates an array of
  3995. * `object` function property names filtered from `props`.
  3996. *
  3997. * @private
  3998. * @param {Object} object The object to inspect.
  3999. * @param {Array} props The property names to filter.
  4000. * @returns {Array} Returns the function names.
  4001. */
  4002. function baseFunctions(object, props) {
  4003. return arrayFilter(props, function(key) {
  4004. return isFunction(object[key]);
  4005. });
  4006. }
  4007. /**
  4008. * The base implementation of `_.get` without support for default values.
  4009. *
  4010. * @private
  4011. * @param {Object} object The object to query.
  4012. * @param {Array|string} path The path of the property to get.
  4013. * @returns {*} Returns the resolved value.
  4014. */
  4015. function baseGet(object, path) {
  4016. path = castPath(path, object);
  4017. var index = 0,
  4018. length = path.length;
  4019. while (object != null && index < length) {
  4020. object = object[toKey(path[index++])];
  4021. }
  4022. return (index && index == length) ? object : undefined;
  4023. }
  4024. /**
  4025. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4026. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4027. * symbols of `object`.
  4028. *
  4029. * @private
  4030. * @param {Object} object The object to query.
  4031. * @param {Function} keysFunc The function to get the keys of `object`.
  4032. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4033. * @returns {Array} Returns the array of property names and symbols.
  4034. */
  4035. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4036. var result = keysFunc(object);
  4037. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4038. }
  4039. /**
  4040. * The base implementation of `getTag` without fallbacks for buggy environments.
  4041. *
  4042. * @private
  4043. * @param {*} value The value to query.
  4044. * @returns {string} Returns the `toStringTag`.
  4045. */
  4046. function baseGetTag(value) {
  4047. if (value == null) {
  4048. return value === undefined ? undefinedTag : nullTag;
  4049. }
  4050. return (symToStringTag && symToStringTag in Object(value))
  4051. ? getRawTag(value)
  4052. : objectToString(value);
  4053. }
  4054. /**
  4055. * The base implementation of `_.gt` which doesn't coerce arguments.
  4056. *
  4057. * @private
  4058. * @param {*} value The value to compare.
  4059. * @param {*} other The other value to compare.
  4060. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4061. * else `false`.
  4062. */
  4063. function baseGt(value, other) {
  4064. return value > other;
  4065. }
  4066. /**
  4067. * The base implementation of `_.has` without support for deep paths.
  4068. *
  4069. * @private
  4070. * @param {Object} [object] The object to query.
  4071. * @param {Array|string} key The key to check.
  4072. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4073. */
  4074. function baseHas(object, key) {
  4075. return object != null && hasOwnProperty.call(object, key);
  4076. }
  4077. /**
  4078. * The base implementation of `_.hasIn` without support for deep paths.
  4079. *
  4080. * @private
  4081. * @param {Object} [object] The object to query.
  4082. * @param {Array|string} key The key to check.
  4083. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4084. */
  4085. function baseHasIn(object, key) {
  4086. return object != null && key in Object(object);
  4087. }
  4088. /**
  4089. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4090. *
  4091. * @private
  4092. * @param {number} number The number to check.
  4093. * @param {number} start The start of the range.
  4094. * @param {number} end The end of the range.
  4095. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4096. */
  4097. function baseInRange(number, start, end) {
  4098. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4099. }
  4100. /**
  4101. * The base implementation of methods like `_.intersection`, without support
  4102. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4103. *
  4104. * @private
  4105. * @param {Array} arrays The arrays to inspect.
  4106. * @param {Function} [iteratee] The iteratee invoked per element.
  4107. * @param {Function} [comparator] The comparator invoked per element.
  4108. * @returns {Array} Returns the new array of shared values.
  4109. */
  4110. function baseIntersection(arrays, iteratee, comparator) {
  4111. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4112. length = arrays[0].length,
  4113. othLength = arrays.length,
  4114. othIndex = othLength,
  4115. caches = Array(othLength),
  4116. maxLength = Infinity,
  4117. result = [];
  4118. while (othIndex--) {
  4119. var array = arrays[othIndex];
  4120. if (othIndex && iteratee) {
  4121. array = arrayMap(array, baseUnary(iteratee));
  4122. }
  4123. maxLength = nativeMin(array.length, maxLength);
  4124. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4125. ? new SetCache(othIndex && array)
  4126. : undefined;
  4127. }
  4128. array = arrays[0];
  4129. var index = -1,
  4130. seen = caches[0];
  4131. outer:
  4132. while (++index < length && result.length < maxLength) {
  4133. var value = array[index],
  4134. computed = iteratee ? iteratee(value) : value;
  4135. value = (comparator || value !== 0) ? value : 0;
  4136. if (!(seen
  4137. ? cacheHas(seen, computed)
  4138. : includes(result, computed, comparator)
  4139. )) {
  4140. othIndex = othLength;
  4141. while (--othIndex) {
  4142. var cache = caches[othIndex];
  4143. if (!(cache
  4144. ? cacheHas(cache, computed)
  4145. : includes(arrays[othIndex], computed, comparator))
  4146. ) {
  4147. continue outer;
  4148. }
  4149. }
  4150. if (seen) {
  4151. seen.push(computed);
  4152. }
  4153. result.push(value);
  4154. }
  4155. }
  4156. return result;
  4157. }
  4158. /**
  4159. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4160. * `object` with values transformed by `iteratee` and set by `setter`.
  4161. *
  4162. * @private
  4163. * @param {Object} object The object to iterate over.
  4164. * @param {Function} setter The function to set `accumulator` values.
  4165. * @param {Function} iteratee The iteratee to transform values.
  4166. * @param {Object} accumulator The initial inverted object.
  4167. * @returns {Function} Returns `accumulator`.
  4168. */
  4169. function baseInverter(object, setter, iteratee, accumulator) {
  4170. baseForOwn(object, function(value, key, object) {
  4171. setter(accumulator, iteratee(value), key, object);
  4172. });
  4173. return accumulator;
  4174. }
  4175. /**
  4176. * The base implementation of `_.invoke` without support for individual
  4177. * method arguments.
  4178. *
  4179. * @private
  4180. * @param {Object} object The object to query.
  4181. * @param {Array|string} path The path of the method to invoke.
  4182. * @param {Array} args The arguments to invoke the method with.
  4183. * @returns {*} Returns the result of the invoked method.
  4184. */
  4185. function baseInvoke(object, path, args) {
  4186. path = castPath(path, object);
  4187. object = parent(object, path);
  4188. var func = object == null ? object : object[toKey(last(path))];
  4189. return func == null ? undefined : apply(func, object, args);
  4190. }
  4191. /**
  4192. * The base implementation of `_.isArguments`.
  4193. *
  4194. * @private
  4195. * @param {*} value The value to check.
  4196. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4197. */
  4198. function baseIsArguments(value) {
  4199. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4200. }
  4201. /**
  4202. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4203. *
  4204. * @private
  4205. * @param {*} value The value to check.
  4206. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4207. */
  4208. function baseIsArrayBuffer(value) {
  4209. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4210. }
  4211. /**
  4212. * The base implementation of `_.isDate` without Node.js optimizations.
  4213. *
  4214. * @private
  4215. * @param {*} value The value to check.
  4216. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4217. */
  4218. function baseIsDate(value) {
  4219. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4220. }
  4221. /**
  4222. * The base implementation of `_.isEqual` which supports partial comparisons
  4223. * and tracks traversed objects.
  4224. *
  4225. * @private
  4226. * @param {*} value The value to compare.
  4227. * @param {*} other The other value to compare.
  4228. * @param {boolean} bitmask The bitmask flags.
  4229. * 1 - Unordered comparison
  4230. * 2 - Partial comparison
  4231. * @param {Function} [customizer] The function to customize comparisons.
  4232. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4233. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4234. */
  4235. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4236. if (value === other) {
  4237. return true;
  4238. }
  4239. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4240. return value !== value && other !== other;
  4241. }
  4242. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4243. }
  4244. /**
  4245. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4246. * deep comparisons and tracks traversed objects enabling objects with circular
  4247. * references to be compared.
  4248. *
  4249. * @private
  4250. * @param {Object} object The object to compare.
  4251. * @param {Object} other The other object to compare.
  4252. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4253. * @param {Function} customizer The function to customize comparisons.
  4254. * @param {Function} equalFunc The function to determine equivalents of values.
  4255. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4256. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4257. */
  4258. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4259. var objIsArr = isArray(object),
  4260. othIsArr = isArray(other),
  4261. objTag = objIsArr ? arrayTag : getTag(object),
  4262. othTag = othIsArr ? arrayTag : getTag(other);
  4263. objTag = objTag == argsTag ? objectTag : objTag;
  4264. othTag = othTag == argsTag ? objectTag : othTag;
  4265. var objIsObj = objTag == objectTag,
  4266. othIsObj = othTag == objectTag,
  4267. isSameTag = objTag == othTag;
  4268. if (isSameTag && isBuffer(object)) {
  4269. if (!isBuffer(other)) {
  4270. return false;
  4271. }
  4272. objIsArr = true;
  4273. objIsObj = false;
  4274. }
  4275. if (isSameTag && !objIsObj) {
  4276. stack || (stack = new Stack);
  4277. return (objIsArr || isTypedArray(object))
  4278. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4279. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4280. }
  4281. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4282. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4283. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4284. if (objIsWrapped || othIsWrapped) {
  4285. var objUnwrapped = objIsWrapped ? object.value() : object,
  4286. othUnwrapped = othIsWrapped ? other.value() : other;
  4287. stack || (stack = new Stack);
  4288. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4289. }
  4290. }
  4291. if (!isSameTag) {
  4292. return false;
  4293. }
  4294. stack || (stack = new Stack);
  4295. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4296. }
  4297. /**
  4298. * The base implementation of `_.isMap` without Node.js optimizations.
  4299. *
  4300. * @private
  4301. * @param {*} value The value to check.
  4302. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4303. */
  4304. function baseIsMap(value) {
  4305. return isObjectLike(value) && getTag(value) == mapTag;
  4306. }
  4307. /**
  4308. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4309. *
  4310. * @private
  4311. * @param {Object} object The object to inspect.
  4312. * @param {Object} source The object of property values to match.
  4313. * @param {Array} matchData The property names, values, and compare flags to match.
  4314. * @param {Function} [customizer] The function to customize comparisons.
  4315. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4316. */
  4317. function baseIsMatch(object, source, matchData, customizer) {
  4318. var index = matchData.length,
  4319. length = index,
  4320. noCustomizer = !customizer;
  4321. if (object == null) {
  4322. return !length;
  4323. }
  4324. object = Object(object);
  4325. while (index--) {
  4326. var data = matchData[index];
  4327. if ((noCustomizer && data[2])
  4328. ? data[1] !== object[data[0]]
  4329. : !(data[0] in object)
  4330. ) {
  4331. return false;
  4332. }
  4333. }
  4334. while (++index < length) {
  4335. data = matchData[index];
  4336. var key = data[0],
  4337. objValue = object[key],
  4338. srcValue = data[1];
  4339. if (noCustomizer && data[2]) {
  4340. if (objValue === undefined && !(key in object)) {
  4341. return false;
  4342. }
  4343. } else {
  4344. var stack = new Stack;
  4345. if (customizer) {
  4346. var result = customizer(objValue, srcValue, key, object, source, stack);
  4347. }
  4348. if (!(result === undefined
  4349. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4350. : result
  4351. )) {
  4352. return false;
  4353. }
  4354. }
  4355. }
  4356. return true;
  4357. }
  4358. /**
  4359. * The base implementation of `_.isNative` without bad shim checks.
  4360. *
  4361. * @private
  4362. * @param {*} value The value to check.
  4363. * @returns {boolean} Returns `true` if `value` is a native function,
  4364. * else `false`.
  4365. */
  4366. function baseIsNative(value) {
  4367. if (!isObject(value) || isMasked(value)) {
  4368. return false;
  4369. }
  4370. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4371. return pattern.test(toSource(value));
  4372. }
  4373. /**
  4374. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4375. *
  4376. * @private
  4377. * @param {*} value The value to check.
  4378. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4379. */
  4380. function baseIsRegExp(value) {
  4381. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4382. }
  4383. /**
  4384. * The base implementation of `_.isSet` without Node.js optimizations.
  4385. *
  4386. * @private
  4387. * @param {*} value The value to check.
  4388. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4389. */
  4390. function baseIsSet(value) {
  4391. return isObjectLike(value) && getTag(value) == setTag;
  4392. }
  4393. /**
  4394. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4395. *
  4396. * @private
  4397. * @param {*} value The value to check.
  4398. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4399. */
  4400. function baseIsTypedArray(value) {
  4401. return isObjectLike(value) &&
  4402. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4403. }
  4404. /**
  4405. * The base implementation of `_.iteratee`.
  4406. *
  4407. * @private
  4408. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4409. * @returns {Function} Returns the iteratee.
  4410. */
  4411. function baseIteratee(value) {
  4412. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4413. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4414. if (typeof value == 'function') {
  4415. return value;
  4416. }
  4417. if (value == null) {
  4418. return identity;
  4419. }
  4420. if (typeof value == 'object') {
  4421. return isArray(value)
  4422. ? baseMatchesProperty(value[0], value[1])
  4423. : baseMatches(value);
  4424. }
  4425. return property(value);
  4426. }
  4427. /**
  4428. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4429. *
  4430. * @private
  4431. * @param {Object} object The object to query.
  4432. * @returns {Array} Returns the array of property names.
  4433. */
  4434. function baseKeys(object) {
  4435. if (!isPrototype(object)) {
  4436. return nativeKeys(object);
  4437. }
  4438. var result = [];
  4439. for (var key in Object(object)) {
  4440. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4441. result.push(key);
  4442. }
  4443. }
  4444. return result;
  4445. }
  4446. /**
  4447. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4448. *
  4449. * @private
  4450. * @param {Object} object The object to query.
  4451. * @returns {Array} Returns the array of property names.
  4452. */
  4453. function baseKeysIn(object) {
  4454. if (!isObject(object)) {
  4455. return nativeKeysIn(object);
  4456. }
  4457. var isProto = isPrototype(object),
  4458. result = [];
  4459. for (var key in object) {
  4460. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4461. result.push(key);
  4462. }
  4463. }
  4464. return result;
  4465. }
  4466. /**
  4467. * The base implementation of `_.lt` which doesn't coerce arguments.
  4468. *
  4469. * @private
  4470. * @param {*} value The value to compare.
  4471. * @param {*} other The other value to compare.
  4472. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4473. * else `false`.
  4474. */
  4475. function baseLt(value, other) {
  4476. return value < other;
  4477. }
  4478. /**
  4479. * The base implementation of `_.map` without support for iteratee shorthands.
  4480. *
  4481. * @private
  4482. * @param {Array|Object} collection The collection to iterate over.
  4483. * @param {Function} iteratee The function invoked per iteration.
  4484. * @returns {Array} Returns the new mapped array.
  4485. */
  4486. function baseMap(collection, iteratee) {
  4487. var index = -1,
  4488. result = isArrayLike(collection) ? Array(collection.length) : [];
  4489. baseEach(collection, function(value, key, collection) {
  4490. result[++index] = iteratee(value, key, collection);
  4491. });
  4492. return result;
  4493. }
  4494. /**
  4495. * The base implementation of `_.matches` which doesn't clone `source`.
  4496. *
  4497. * @private
  4498. * @param {Object} source The object of property values to match.
  4499. * @returns {Function} Returns the new spec function.
  4500. */
  4501. function baseMatches(source) {
  4502. var matchData = getMatchData(source);
  4503. if (matchData.length == 1 && matchData[0][2]) {
  4504. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4505. }
  4506. return function(object) {
  4507. return object === source || baseIsMatch(object, source, matchData);
  4508. };
  4509. }
  4510. /**
  4511. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4512. *
  4513. * @private
  4514. * @param {string} path The path of the property to get.
  4515. * @param {*} srcValue The value to match.
  4516. * @returns {Function} Returns the new spec function.
  4517. */
  4518. function baseMatchesProperty(path, srcValue) {
  4519. if (isKey(path) && isStrictComparable(srcValue)) {
  4520. return matchesStrictComparable(toKey(path), srcValue);
  4521. }
  4522. return function(object) {
  4523. var objValue = get(object, path);
  4524. return (objValue === undefined && objValue === srcValue)
  4525. ? hasIn(object, path)
  4526. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4527. };
  4528. }
  4529. /**
  4530. * The base implementation of `_.merge` without support for multiple sources.
  4531. *
  4532. * @private
  4533. * @param {Object} object The destination object.
  4534. * @param {Object} source The source object.
  4535. * @param {number} srcIndex The index of `source`.
  4536. * @param {Function} [customizer] The function to customize merged values.
  4537. * @param {Object} [stack] Tracks traversed source values and their merged
  4538. * counterparts.
  4539. */
  4540. function baseMerge(object, source, srcIndex, customizer, stack) {
  4541. if (object === source) {
  4542. return;
  4543. }
  4544. baseFor(source, function(srcValue, key) {
  4545. stack || (stack = new Stack);
  4546. if (isObject(srcValue)) {
  4547. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4548. }
  4549. else {
  4550. var newValue = customizer
  4551. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4552. : undefined;
  4553. if (newValue === undefined) {
  4554. newValue = srcValue;
  4555. }
  4556. assignMergeValue(object, key, newValue);
  4557. }
  4558. }, keysIn);
  4559. }
  4560. /**
  4561. * A specialized version of `baseMerge` for arrays and objects which performs
  4562. * deep merges and tracks traversed objects enabling objects with circular
  4563. * references to be merged.
  4564. *
  4565. * @private
  4566. * @param {Object} object The destination object.
  4567. * @param {Object} source The source object.
  4568. * @param {string} key The key of the value to merge.
  4569. * @param {number} srcIndex The index of `source`.
  4570. * @param {Function} mergeFunc The function to merge values.
  4571. * @param {Function} [customizer] The function to customize assigned values.
  4572. * @param {Object} [stack] Tracks traversed source values and their merged
  4573. * counterparts.
  4574. */
  4575. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4576. var objValue = safeGet(object, key),
  4577. srcValue = safeGet(source, key),
  4578. stacked = stack.get(srcValue);
  4579. if (stacked) {
  4580. assignMergeValue(object, key, stacked);
  4581. return;
  4582. }
  4583. var newValue = customizer
  4584. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4585. : undefined;
  4586. var isCommon = newValue === undefined;
  4587. if (isCommon) {
  4588. var isArr = isArray(srcValue),
  4589. isBuff = !isArr && isBuffer(srcValue),
  4590. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4591. newValue = srcValue;
  4592. if (isArr || isBuff || isTyped) {
  4593. if (isArray(objValue)) {
  4594. newValue = objValue;
  4595. }
  4596. else if (isArrayLikeObject(objValue)) {
  4597. newValue = copyArray(objValue);
  4598. }
  4599. else if (isBuff) {
  4600. isCommon = false;
  4601. newValue = cloneBuffer(srcValue, true);
  4602. }
  4603. else if (isTyped) {
  4604. isCommon = false;
  4605. newValue = cloneTypedArray(srcValue, true);
  4606. }
  4607. else {
  4608. newValue = [];
  4609. }
  4610. }
  4611. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4612. newValue = objValue;
  4613. if (isArguments(objValue)) {
  4614. newValue = toPlainObject(objValue);
  4615. }
  4616. else if (!isObject(objValue) || isFunction(objValue)) {
  4617. newValue = initCloneObject(srcValue);
  4618. }
  4619. }
  4620. else {
  4621. isCommon = false;
  4622. }
  4623. }
  4624. if (isCommon) {
  4625. // Recursively merge objects and arrays (susceptible to call stack limits).
  4626. stack.set(srcValue, newValue);
  4627. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4628. stack['delete'](srcValue);
  4629. }
  4630. assignMergeValue(object, key, newValue);
  4631. }
  4632. /**
  4633. * The base implementation of `_.nth` which doesn't coerce arguments.
  4634. *
  4635. * @private
  4636. * @param {Array} array The array to query.
  4637. * @param {number} n The index of the element to return.
  4638. * @returns {*} Returns the nth element of `array`.
  4639. */
  4640. function baseNth(array, n) {
  4641. var length = array.length;
  4642. if (!length) {
  4643. return;
  4644. }
  4645. n += n < 0 ? length : 0;
  4646. return isIndex(n, length) ? array[n] : undefined;
  4647. }
  4648. /**
  4649. * The base implementation of `_.orderBy` without param guards.
  4650. *
  4651. * @private
  4652. * @param {Array|Object} collection The collection to iterate over.
  4653. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4654. * @param {string[]} orders The sort orders of `iteratees`.
  4655. * @returns {Array} Returns the new sorted array.
  4656. */
  4657. function baseOrderBy(collection, iteratees, orders) {
  4658. if (iteratees.length) {
  4659. iteratees = arrayMap(iteratees, function(iteratee) {
  4660. if (isArray(iteratee)) {
  4661. return function(value) {
  4662. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4663. }
  4664. }
  4665. return iteratee;
  4666. });
  4667. } else {
  4668. iteratees = [identity];
  4669. }
  4670. var index = -1;
  4671. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4672. var result = baseMap(collection, function(value, key, collection) {
  4673. var criteria = arrayMap(iteratees, function(iteratee) {
  4674. return iteratee(value);
  4675. });
  4676. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4677. });
  4678. return baseSortBy(result, function(object, other) {
  4679. return compareMultiple(object, other, orders);
  4680. });
  4681. }
  4682. /**
  4683. * The base implementation of `_.pick` without support for individual
  4684. * property identifiers.
  4685. *
  4686. * @private
  4687. * @param {Object} object The source object.
  4688. * @param {string[]} paths The property paths to pick.
  4689. * @returns {Object} Returns the new object.
  4690. */
  4691. function basePick(object, paths) {
  4692. return basePickBy(object, paths, function(value, path) {
  4693. return hasIn(object, path);
  4694. });
  4695. }
  4696. /**
  4697. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4698. *
  4699. * @private
  4700. * @param {Object} object The source object.
  4701. * @param {string[]} paths The property paths to pick.
  4702. * @param {Function} predicate The function invoked per property.
  4703. * @returns {Object} Returns the new object.
  4704. */
  4705. function basePickBy(object, paths, predicate) {
  4706. var index = -1,
  4707. length = paths.length,
  4708. result = {};
  4709. while (++index < length) {
  4710. var path = paths[index],
  4711. value = baseGet(object, path);
  4712. if (predicate(value, path)) {
  4713. baseSet(result, castPath(path, object), value);
  4714. }
  4715. }
  4716. return result;
  4717. }
  4718. /**
  4719. * A specialized version of `baseProperty` which supports deep paths.
  4720. *
  4721. * @private
  4722. * @param {Array|string} path The path of the property to get.
  4723. * @returns {Function} Returns the new accessor function.
  4724. */
  4725. function basePropertyDeep(path) {
  4726. return function(object) {
  4727. return baseGet(object, path);
  4728. };
  4729. }
  4730. /**
  4731. * The base implementation of `_.pullAllBy` without support for iteratee
  4732. * shorthands.
  4733. *
  4734. * @private
  4735. * @param {Array} array The array to modify.
  4736. * @param {Array} values The values to remove.
  4737. * @param {Function} [iteratee] The iteratee invoked per element.
  4738. * @param {Function} [comparator] The comparator invoked per element.
  4739. * @returns {Array} Returns `array`.
  4740. */
  4741. function basePullAll(array, values, iteratee, comparator) {
  4742. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4743. index = -1,
  4744. length = values.length,
  4745. seen = array;
  4746. if (array === values) {
  4747. values = copyArray(values);
  4748. }
  4749. if (iteratee) {
  4750. seen = arrayMap(array, baseUnary(iteratee));
  4751. }
  4752. while (++index < length) {
  4753. var fromIndex = 0,
  4754. value = values[index],
  4755. computed = iteratee ? iteratee(value) : value;
  4756. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4757. if (seen !== array) {
  4758. splice.call(seen, fromIndex, 1);
  4759. }
  4760. splice.call(array, fromIndex, 1);
  4761. }
  4762. }
  4763. return array;
  4764. }
  4765. /**
  4766. * The base implementation of `_.pullAt` without support for individual
  4767. * indexes or capturing the removed elements.
  4768. *
  4769. * @private
  4770. * @param {Array} array The array to modify.
  4771. * @param {number[]} indexes The indexes of elements to remove.
  4772. * @returns {Array} Returns `array`.
  4773. */
  4774. function basePullAt(array, indexes) {
  4775. var length = array ? indexes.length : 0,
  4776. lastIndex = length - 1;
  4777. while (length--) {
  4778. var index = indexes[length];
  4779. if (length == lastIndex || index !== previous) {
  4780. var previous = index;
  4781. if (isIndex(index)) {
  4782. splice.call(array, index, 1);
  4783. } else {
  4784. baseUnset(array, index);
  4785. }
  4786. }
  4787. }
  4788. return array;
  4789. }
  4790. /**
  4791. * The base implementation of `_.random` without support for returning
  4792. * floating-point numbers.
  4793. *
  4794. * @private
  4795. * @param {number} lower The lower bound.
  4796. * @param {number} upper The upper bound.
  4797. * @returns {number} Returns the random number.
  4798. */
  4799. function baseRandom(lower, upper) {
  4800. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4801. }
  4802. /**
  4803. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4804. * coerce arguments.
  4805. *
  4806. * @private
  4807. * @param {number} start The start of the range.
  4808. * @param {number} end The end of the range.
  4809. * @param {number} step The value to increment or decrement by.
  4810. * @param {boolean} [fromRight] Specify iterating from right to left.
  4811. * @returns {Array} Returns the range of numbers.
  4812. */
  4813. function baseRange(start, end, step, fromRight) {
  4814. var index = -1,
  4815. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4816. result = Array(length);
  4817. while (length--) {
  4818. result[fromRight ? length : ++index] = start;
  4819. start += step;
  4820. }
  4821. return result;
  4822. }
  4823. /**
  4824. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4825. *
  4826. * @private
  4827. * @param {string} string The string to repeat.
  4828. * @param {number} n The number of times to repeat the string.
  4829. * @returns {string} Returns the repeated string.
  4830. */
  4831. function baseRepeat(string, n) {
  4832. var result = '';
  4833. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4834. return result;
  4835. }
  4836. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4837. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4838. do {
  4839. if (n % 2) {
  4840. result += string;
  4841. }
  4842. n = nativeFloor(n / 2);
  4843. if (n) {
  4844. string += string;
  4845. }
  4846. } while (n);
  4847. return result;
  4848. }
  4849. /**
  4850. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4851. *
  4852. * @private
  4853. * @param {Function} func The function to apply a rest parameter to.
  4854. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4855. * @returns {Function} Returns the new function.
  4856. */
  4857. function baseRest(func, start) {
  4858. return setToString(overRest(func, start, identity), func + '');
  4859. }
  4860. /**
  4861. * The base implementation of `_.sample`.
  4862. *
  4863. * @private
  4864. * @param {Array|Object} collection The collection to sample.
  4865. * @returns {*} Returns the random element.
  4866. */
  4867. function baseSample(collection) {
  4868. return arraySample(values(collection));
  4869. }
  4870. /**
  4871. * The base implementation of `_.sampleSize` without param guards.
  4872. *
  4873. * @private
  4874. * @param {Array|Object} collection The collection to sample.
  4875. * @param {number} n The number of elements to sample.
  4876. * @returns {Array} Returns the random elements.
  4877. */
  4878. function baseSampleSize(collection, n) {
  4879. var array = values(collection);
  4880. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4881. }
  4882. /**
  4883. * The base implementation of `_.set`.
  4884. *
  4885. * @private
  4886. * @param {Object} object The object to modify.
  4887. * @param {Array|string} path The path of the property to set.
  4888. * @param {*} value The value to set.
  4889. * @param {Function} [customizer] The function to customize path creation.
  4890. * @returns {Object} Returns `object`.
  4891. */
  4892. function baseSet(object, path, value, customizer) {
  4893. if (!isObject(object)) {
  4894. return object;
  4895. }
  4896. path = castPath(path, object);
  4897. var index = -1,
  4898. length = path.length,
  4899. lastIndex = length - 1,
  4900. nested = object;
  4901. while (nested != null && ++index < length) {
  4902. var key = toKey(path[index]),
  4903. newValue = value;
  4904. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4905. return object;
  4906. }
  4907. if (index != lastIndex) {
  4908. var objValue = nested[key];
  4909. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4910. if (newValue === undefined) {
  4911. newValue = isObject(objValue)
  4912. ? objValue
  4913. : (isIndex(path[index + 1]) ? [] : {});
  4914. }
  4915. }
  4916. assignValue(nested, key, newValue);
  4917. nested = nested[key];
  4918. }
  4919. return object;
  4920. }
  4921. /**
  4922. * The base implementation of `setData` without support for hot loop shorting.
  4923. *
  4924. * @private
  4925. * @param {Function} func The function to associate metadata with.
  4926. * @param {*} data The metadata.
  4927. * @returns {Function} Returns `func`.
  4928. */
  4929. var baseSetData = !metaMap ? identity : function(func, data) {
  4930. metaMap.set(func, data);
  4931. return func;
  4932. };
  4933. /**
  4934. * The base implementation of `setToString` without support for hot loop shorting.
  4935. *
  4936. * @private
  4937. * @param {Function} func The function to modify.
  4938. * @param {Function} string The `toString` result.
  4939. * @returns {Function} Returns `func`.
  4940. */
  4941. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4942. return defineProperty(func, 'toString', {
  4943. 'configurable': true,
  4944. 'enumerable': false,
  4945. 'value': constant(string),
  4946. 'writable': true
  4947. });
  4948. };
  4949. /**
  4950. * The base implementation of `_.shuffle`.
  4951. *
  4952. * @private
  4953. * @param {Array|Object} collection The collection to shuffle.
  4954. * @returns {Array} Returns the new shuffled array.
  4955. */
  4956. function baseShuffle(collection) {
  4957. return shuffleSelf(values(collection));
  4958. }
  4959. /**
  4960. * The base implementation of `_.slice` without an iteratee call guard.
  4961. *
  4962. * @private
  4963. * @param {Array} array The array to slice.
  4964. * @param {number} [start=0] The start position.
  4965. * @param {number} [end=array.length] The end position.
  4966. * @returns {Array} Returns the slice of `array`.
  4967. */
  4968. function baseSlice(array, start, end) {
  4969. var index = -1,
  4970. length = array.length;
  4971. if (start < 0) {
  4972. start = -start > length ? 0 : (length + start);
  4973. }
  4974. end = end > length ? length : end;
  4975. if (end < 0) {
  4976. end += length;
  4977. }
  4978. length = start > end ? 0 : ((end - start) >>> 0);
  4979. start >>>= 0;
  4980. var result = Array(length);
  4981. while (++index < length) {
  4982. result[index] = array[index + start];
  4983. }
  4984. return result;
  4985. }
  4986. /**
  4987. * The base implementation of `_.some` without support for iteratee shorthands.
  4988. *
  4989. * @private
  4990. * @param {Array|Object} collection The collection to iterate over.
  4991. * @param {Function} predicate The function invoked per iteration.
  4992. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4993. * else `false`.
  4994. */
  4995. function baseSome(collection, predicate) {
  4996. var result;
  4997. baseEach(collection, function(value, index, collection) {
  4998. result = predicate(value, index, collection);
  4999. return !result;
  5000. });
  5001. return !!result;
  5002. }
  5003. /**
  5004. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5005. * performs a binary search of `array` to determine the index at which `value`
  5006. * should be inserted into `array` in order to maintain its sort order.
  5007. *
  5008. * @private
  5009. * @param {Array} array The sorted array to inspect.
  5010. * @param {*} value The value to evaluate.
  5011. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5012. * @returns {number} Returns the index at which `value` should be inserted
  5013. * into `array`.
  5014. */
  5015. function baseSortedIndex(array, value, retHighest) {
  5016. var low = 0,
  5017. high = array == null ? low : array.length;
  5018. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5019. while (low < high) {
  5020. var mid = (low + high) >>> 1,
  5021. computed = array[mid];
  5022. if (computed !== null && !isSymbol(computed) &&
  5023. (retHighest ? (computed <= value) : (computed < value))) {
  5024. low = mid + 1;
  5025. } else {
  5026. high = mid;
  5027. }
  5028. }
  5029. return high;
  5030. }
  5031. return baseSortedIndexBy(array, value, identity, retHighest);
  5032. }
  5033. /**
  5034. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5035. * which invokes `iteratee` for `value` and each element of `array` to compute
  5036. * their sort ranking. The iteratee is invoked with one argument; (value).
  5037. *
  5038. * @private
  5039. * @param {Array} array The sorted array to inspect.
  5040. * @param {*} value The value to evaluate.
  5041. * @param {Function} iteratee The iteratee invoked per element.
  5042. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5043. * @returns {number} Returns the index at which `value` should be inserted
  5044. * into `array`.
  5045. */
  5046. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5047. var low = 0,
  5048. high = array == null ? 0 : array.length;
  5049. if (high === 0) {
  5050. return 0;
  5051. }
  5052. value = iteratee(value);
  5053. var valIsNaN = value !== value,
  5054. valIsNull = value === null,
  5055. valIsSymbol = isSymbol(value),
  5056. valIsUndefined = value === undefined;
  5057. while (low < high) {
  5058. var mid = nativeFloor((low + high) / 2),
  5059. computed = iteratee(array[mid]),
  5060. othIsDefined = computed !== undefined,
  5061. othIsNull = computed === null,
  5062. othIsReflexive = computed === computed,
  5063. othIsSymbol = isSymbol(computed);
  5064. if (valIsNaN) {
  5065. var setLow = retHighest || othIsReflexive;
  5066. } else if (valIsUndefined) {
  5067. setLow = othIsReflexive && (retHighest || othIsDefined);
  5068. } else if (valIsNull) {
  5069. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5070. } else if (valIsSymbol) {
  5071. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5072. } else if (othIsNull || othIsSymbol) {
  5073. setLow = false;
  5074. } else {
  5075. setLow = retHighest ? (computed <= value) : (computed < value);
  5076. }
  5077. if (setLow) {
  5078. low = mid + 1;
  5079. } else {
  5080. high = mid;
  5081. }
  5082. }
  5083. return nativeMin(high, MAX_ARRAY_INDEX);
  5084. }
  5085. /**
  5086. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5087. * support for iteratee shorthands.
  5088. *
  5089. * @private
  5090. * @param {Array} array The array to inspect.
  5091. * @param {Function} [iteratee] The iteratee invoked per element.
  5092. * @returns {Array} Returns the new duplicate free array.
  5093. */
  5094. function baseSortedUniq(array, iteratee) {
  5095. var index = -1,
  5096. length = array.length,
  5097. resIndex = 0,
  5098. result = [];
  5099. while (++index < length) {
  5100. var value = array[index],
  5101. computed = iteratee ? iteratee(value) : value;
  5102. if (!index || !eq(computed, seen)) {
  5103. var seen = computed;
  5104. result[resIndex++] = value === 0 ? 0 : value;
  5105. }
  5106. }
  5107. return result;
  5108. }
  5109. /**
  5110. * The base implementation of `_.toNumber` which doesn't ensure correct
  5111. * conversions of binary, hexadecimal, or octal string values.
  5112. *
  5113. * @private
  5114. * @param {*} value The value to process.
  5115. * @returns {number} Returns the number.
  5116. */
  5117. function baseToNumber(value) {
  5118. if (typeof value == 'number') {
  5119. return value;
  5120. }
  5121. if (isSymbol(value)) {
  5122. return NAN;
  5123. }
  5124. return +value;
  5125. }
  5126. /**
  5127. * The base implementation of `_.toString` which doesn't convert nullish
  5128. * values to empty strings.
  5129. *
  5130. * @private
  5131. * @param {*} value The value to process.
  5132. * @returns {string} Returns the string.
  5133. */
  5134. function baseToString(value) {
  5135. // Exit early for strings to avoid a performance hit in some environments.
  5136. if (typeof value == 'string') {
  5137. return value;
  5138. }
  5139. if (isArray(value)) {
  5140. // Recursively convert values (susceptible to call stack limits).
  5141. return arrayMap(value, baseToString) + '';
  5142. }
  5143. if (isSymbol(value)) {
  5144. return symbolToString ? symbolToString.call(value) : '';
  5145. }
  5146. var result = (value + '');
  5147. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5148. }
  5149. /**
  5150. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5151. *
  5152. * @private
  5153. * @param {Array} array The array to inspect.
  5154. * @param {Function} [iteratee] The iteratee invoked per element.
  5155. * @param {Function} [comparator] The comparator invoked per element.
  5156. * @returns {Array} Returns the new duplicate free array.
  5157. */
  5158. function baseUniq(array, iteratee, comparator) {
  5159. var index = -1,
  5160. includes = arrayIncludes,
  5161. length = array.length,
  5162. isCommon = true,
  5163. result = [],
  5164. seen = result;
  5165. if (comparator) {
  5166. isCommon = false;
  5167. includes = arrayIncludesWith;
  5168. }
  5169. else if (length >= LARGE_ARRAY_SIZE) {
  5170. var set = iteratee ? null : createSet(array);
  5171. if (set) {
  5172. return setToArray(set);
  5173. }
  5174. isCommon = false;
  5175. includes = cacheHas;
  5176. seen = new SetCache;
  5177. }
  5178. else {
  5179. seen = iteratee ? [] : result;
  5180. }
  5181. outer:
  5182. while (++index < length) {
  5183. var value = array[index],
  5184. computed = iteratee ? iteratee(value) : value;
  5185. value = (comparator || value !== 0) ? value : 0;
  5186. if (isCommon && computed === computed) {
  5187. var seenIndex = seen.length;
  5188. while (seenIndex--) {
  5189. if (seen[seenIndex] === computed) {
  5190. continue outer;
  5191. }
  5192. }
  5193. if (iteratee) {
  5194. seen.push(computed);
  5195. }
  5196. result.push(value);
  5197. }
  5198. else if (!includes(seen, computed, comparator)) {
  5199. if (seen !== result) {
  5200. seen.push(computed);
  5201. }
  5202. result.push(value);
  5203. }
  5204. }
  5205. return result;
  5206. }
  5207. /**
  5208. * The base implementation of `_.unset`.
  5209. *
  5210. * @private
  5211. * @param {Object} object The object to modify.
  5212. * @param {Array|string} path The property path to unset.
  5213. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5214. */
  5215. function baseUnset(object, path) {
  5216. path = castPath(path, object);
  5217. object = parent(object, path);
  5218. return object == null || delete object[toKey(last(path))];
  5219. }
  5220. /**
  5221. * The base implementation of `_.update`.
  5222. *
  5223. * @private
  5224. * @param {Object} object The object to modify.
  5225. * @param {Array|string} path The path of the property to update.
  5226. * @param {Function} updater The function to produce the updated value.
  5227. * @param {Function} [customizer] The function to customize path creation.
  5228. * @returns {Object} Returns `object`.
  5229. */
  5230. function baseUpdate(object, path, updater, customizer) {
  5231. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5232. }
  5233. /**
  5234. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5235. * without support for iteratee shorthands.
  5236. *
  5237. * @private
  5238. * @param {Array} array The array to query.
  5239. * @param {Function} predicate The function invoked per iteration.
  5240. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5241. * @param {boolean} [fromRight] Specify iterating from right to left.
  5242. * @returns {Array} Returns the slice of `array`.
  5243. */
  5244. function baseWhile(array, predicate, isDrop, fromRight) {
  5245. var length = array.length,
  5246. index = fromRight ? length : -1;
  5247. while ((fromRight ? index-- : ++index < length) &&
  5248. predicate(array[index], index, array)) {}
  5249. return isDrop
  5250. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5251. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5252. }
  5253. /**
  5254. * The base implementation of `wrapperValue` which returns the result of
  5255. * performing a sequence of actions on the unwrapped `value`, where each
  5256. * successive action is supplied the return value of the previous.
  5257. *
  5258. * @private
  5259. * @param {*} value The unwrapped value.
  5260. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5261. * @returns {*} Returns the resolved value.
  5262. */
  5263. function baseWrapperValue(value, actions) {
  5264. var result = value;
  5265. if (result instanceof LazyWrapper) {
  5266. result = result.value();
  5267. }
  5268. return arrayReduce(actions, function(result, action) {
  5269. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5270. }, result);
  5271. }
  5272. /**
  5273. * The base implementation of methods like `_.xor`, without support for
  5274. * iteratee shorthands, that accepts an array of arrays to inspect.
  5275. *
  5276. * @private
  5277. * @param {Array} arrays The arrays to inspect.
  5278. * @param {Function} [iteratee] The iteratee invoked per element.
  5279. * @param {Function} [comparator] The comparator invoked per element.
  5280. * @returns {Array} Returns the new array of values.
  5281. */
  5282. function baseXor(arrays, iteratee, comparator) {
  5283. var length = arrays.length;
  5284. if (length < 2) {
  5285. return length ? baseUniq(arrays[0]) : [];
  5286. }
  5287. var index = -1,
  5288. result = Array(length);
  5289. while (++index < length) {
  5290. var array = arrays[index],
  5291. othIndex = -1;
  5292. while (++othIndex < length) {
  5293. if (othIndex != index) {
  5294. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5295. }
  5296. }
  5297. }
  5298. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5299. }
  5300. /**
  5301. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5302. *
  5303. * @private
  5304. * @param {Array} props The property identifiers.
  5305. * @param {Array} values The property values.
  5306. * @param {Function} assignFunc The function to assign values.
  5307. * @returns {Object} Returns the new object.
  5308. */
  5309. function baseZipObject(props, values, assignFunc) {
  5310. var index = -1,
  5311. length = props.length,
  5312. valsLength = values.length,
  5313. result = {};
  5314. while (++index < length) {
  5315. var value = index < valsLength ? values[index] : undefined;
  5316. assignFunc(result, props[index], value);
  5317. }
  5318. return result;
  5319. }
  5320. /**
  5321. * Casts `value` to an empty array if it's not an array like object.
  5322. *
  5323. * @private
  5324. * @param {*} value The value to inspect.
  5325. * @returns {Array|Object} Returns the cast array-like object.
  5326. */
  5327. function castArrayLikeObject(value) {
  5328. return isArrayLikeObject(value) ? value : [];
  5329. }
  5330. /**
  5331. * Casts `value` to `identity` if it's not a function.
  5332. *
  5333. * @private
  5334. * @param {*} value The value to inspect.
  5335. * @returns {Function} Returns cast function.
  5336. */
  5337. function castFunction(value) {
  5338. return typeof value == 'function' ? value : identity;
  5339. }
  5340. /**
  5341. * Casts `value` to a path array if it's not one.
  5342. *
  5343. * @private
  5344. * @param {*} value The value to inspect.
  5345. * @param {Object} [object] The object to query keys on.
  5346. * @returns {Array} Returns the cast property path array.
  5347. */
  5348. function castPath(value, object) {
  5349. if (isArray(value)) {
  5350. return value;
  5351. }
  5352. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5353. }
  5354. /**
  5355. * A `baseRest` alias which can be replaced with `identity` by module
  5356. * replacement plugins.
  5357. *
  5358. * @private
  5359. * @type {Function}
  5360. * @param {Function} func The function to apply a rest parameter to.
  5361. * @returns {Function} Returns the new function.
  5362. */
  5363. var castRest = baseRest;
  5364. /**
  5365. * Casts `array` to a slice if it's needed.
  5366. *
  5367. * @private
  5368. * @param {Array} array The array to inspect.
  5369. * @param {number} start The start position.
  5370. * @param {number} [end=array.length] The end position.
  5371. * @returns {Array} Returns the cast slice.
  5372. */
  5373. function castSlice(array, start, end) {
  5374. var length = array.length;
  5375. end = end === undefined ? length : end;
  5376. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5377. }
  5378. /**
  5379. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5380. *
  5381. * @private
  5382. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5383. */
  5384. var clearTimeout = ctxClearTimeout || function(id) {
  5385. return root.clearTimeout(id);
  5386. };
  5387. /**
  5388. * Creates a clone of `buffer`.
  5389. *
  5390. * @private
  5391. * @param {Buffer} buffer The buffer to clone.
  5392. * @param {boolean} [isDeep] Specify a deep clone.
  5393. * @returns {Buffer} Returns the cloned buffer.
  5394. */
  5395. function cloneBuffer(buffer, isDeep) {
  5396. if (isDeep) {
  5397. return buffer.slice();
  5398. }
  5399. var length = buffer.length,
  5400. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5401. buffer.copy(result);
  5402. return result;
  5403. }
  5404. /**
  5405. * Creates a clone of `arrayBuffer`.
  5406. *
  5407. * @private
  5408. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5409. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5410. */
  5411. function cloneArrayBuffer(arrayBuffer) {
  5412. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5413. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5414. return result;
  5415. }
  5416. /**
  5417. * Creates a clone of `dataView`.
  5418. *
  5419. * @private
  5420. * @param {Object} dataView The data view to clone.
  5421. * @param {boolean} [isDeep] Specify a deep clone.
  5422. * @returns {Object} Returns the cloned data view.
  5423. */
  5424. function cloneDataView(dataView, isDeep) {
  5425. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5426. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5427. }
  5428. /**
  5429. * Creates a clone of `regexp`.
  5430. *
  5431. * @private
  5432. * @param {Object} regexp The regexp to clone.
  5433. * @returns {Object} Returns the cloned regexp.
  5434. */
  5435. function cloneRegExp(regexp) {
  5436. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5437. result.lastIndex = regexp.lastIndex;
  5438. return result;
  5439. }
  5440. /**
  5441. * Creates a clone of the `symbol` object.
  5442. *
  5443. * @private
  5444. * @param {Object} symbol The symbol object to clone.
  5445. * @returns {Object} Returns the cloned symbol object.
  5446. */
  5447. function cloneSymbol(symbol) {
  5448. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5449. }
  5450. /**
  5451. * Creates a clone of `typedArray`.
  5452. *
  5453. * @private
  5454. * @param {Object} typedArray The typed array to clone.
  5455. * @param {boolean} [isDeep] Specify a deep clone.
  5456. * @returns {Object} Returns the cloned typed array.
  5457. */
  5458. function cloneTypedArray(typedArray, isDeep) {
  5459. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5460. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5461. }
  5462. /**
  5463. * Compares values to sort them in ascending order.
  5464. *
  5465. * @private
  5466. * @param {*} value The value to compare.
  5467. * @param {*} other The other value to compare.
  5468. * @returns {number} Returns the sort order indicator for `value`.
  5469. */
  5470. function compareAscending(value, other) {
  5471. if (value !== other) {
  5472. var valIsDefined = value !== undefined,
  5473. valIsNull = value === null,
  5474. valIsReflexive = value === value,
  5475. valIsSymbol = isSymbol(value);
  5476. var othIsDefined = other !== undefined,
  5477. othIsNull = other === null,
  5478. othIsReflexive = other === other,
  5479. othIsSymbol = isSymbol(other);
  5480. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5481. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5482. (valIsNull && othIsDefined && othIsReflexive) ||
  5483. (!valIsDefined && othIsReflexive) ||
  5484. !valIsReflexive) {
  5485. return 1;
  5486. }
  5487. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5488. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5489. (othIsNull && valIsDefined && valIsReflexive) ||
  5490. (!othIsDefined && valIsReflexive) ||
  5491. !othIsReflexive) {
  5492. return -1;
  5493. }
  5494. }
  5495. return 0;
  5496. }
  5497. /**
  5498. * Used by `_.orderBy` to compare multiple properties of a value to another
  5499. * and stable sort them.
  5500. *
  5501. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5502. * specify an order of "desc" for descending or "asc" for ascending sort order
  5503. * of corresponding values.
  5504. *
  5505. * @private
  5506. * @param {Object} object The object to compare.
  5507. * @param {Object} other The other object to compare.
  5508. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5509. * @returns {number} Returns the sort order indicator for `object`.
  5510. */
  5511. function compareMultiple(object, other, orders) {
  5512. var index = -1,
  5513. objCriteria = object.criteria,
  5514. othCriteria = other.criteria,
  5515. length = objCriteria.length,
  5516. ordersLength = orders.length;
  5517. while (++index < length) {
  5518. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5519. if (result) {
  5520. if (index >= ordersLength) {
  5521. return result;
  5522. }
  5523. var order = orders[index];
  5524. return result * (order == 'desc' ? -1 : 1);
  5525. }
  5526. }
  5527. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5528. // that causes it, under certain circumstances, to provide the same value for
  5529. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5530. // for more details.
  5531. //
  5532. // This also ensures a stable sort in V8 and other engines.
  5533. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5534. return object.index - other.index;
  5535. }
  5536. /**
  5537. * Creates an array that is the composition of partially applied arguments,
  5538. * placeholders, and provided arguments into a single array of arguments.
  5539. *
  5540. * @private
  5541. * @param {Array} args The provided arguments.
  5542. * @param {Array} partials The arguments to prepend to those provided.
  5543. * @param {Array} holders The `partials` placeholder indexes.
  5544. * @params {boolean} [isCurried] Specify composing for a curried function.
  5545. * @returns {Array} Returns the new array of composed arguments.
  5546. */
  5547. function composeArgs(args, partials, holders, isCurried) {
  5548. var argsIndex = -1,
  5549. argsLength = args.length,
  5550. holdersLength = holders.length,
  5551. leftIndex = -1,
  5552. leftLength = partials.length,
  5553. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5554. result = Array(leftLength + rangeLength),
  5555. isUncurried = !isCurried;
  5556. while (++leftIndex < leftLength) {
  5557. result[leftIndex] = partials[leftIndex];
  5558. }
  5559. while (++argsIndex < holdersLength) {
  5560. if (isUncurried || argsIndex < argsLength) {
  5561. result[holders[argsIndex]] = args[argsIndex];
  5562. }
  5563. }
  5564. while (rangeLength--) {
  5565. result[leftIndex++] = args[argsIndex++];
  5566. }
  5567. return result;
  5568. }
  5569. /**
  5570. * This function is like `composeArgs` except that the arguments composition
  5571. * is tailored for `_.partialRight`.
  5572. *
  5573. * @private
  5574. * @param {Array} args The provided arguments.
  5575. * @param {Array} partials The arguments to append to those provided.
  5576. * @param {Array} holders The `partials` placeholder indexes.
  5577. * @params {boolean} [isCurried] Specify composing for a curried function.
  5578. * @returns {Array} Returns the new array of composed arguments.
  5579. */
  5580. function composeArgsRight(args, partials, holders, isCurried) {
  5581. var argsIndex = -1,
  5582. argsLength = args.length,
  5583. holdersIndex = -1,
  5584. holdersLength = holders.length,
  5585. rightIndex = -1,
  5586. rightLength = partials.length,
  5587. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5588. result = Array(rangeLength + rightLength),
  5589. isUncurried = !isCurried;
  5590. while (++argsIndex < rangeLength) {
  5591. result[argsIndex] = args[argsIndex];
  5592. }
  5593. var offset = argsIndex;
  5594. while (++rightIndex < rightLength) {
  5595. result[offset + rightIndex] = partials[rightIndex];
  5596. }
  5597. while (++holdersIndex < holdersLength) {
  5598. if (isUncurried || argsIndex < argsLength) {
  5599. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5600. }
  5601. }
  5602. return result;
  5603. }
  5604. /**
  5605. * Copies the values of `source` to `array`.
  5606. *
  5607. * @private
  5608. * @param {Array} source The array to copy values from.
  5609. * @param {Array} [array=[]] The array to copy values to.
  5610. * @returns {Array} Returns `array`.
  5611. */
  5612. function copyArray(source, array) {
  5613. var index = -1,
  5614. length = source.length;
  5615. array || (array = Array(length));
  5616. while (++index < length) {
  5617. array[index] = source[index];
  5618. }
  5619. return array;
  5620. }
  5621. /**
  5622. * Copies properties of `source` to `object`.
  5623. *
  5624. * @private
  5625. * @param {Object} source The object to copy properties from.
  5626. * @param {Array} props The property identifiers to copy.
  5627. * @param {Object} [object={}] The object to copy properties to.
  5628. * @param {Function} [customizer] The function to customize copied values.
  5629. * @returns {Object} Returns `object`.
  5630. */
  5631. function copyObject(source, props, object, customizer) {
  5632. var isNew = !object;
  5633. object || (object = {});
  5634. var index = -1,
  5635. length = props.length;
  5636. while (++index < length) {
  5637. var key = props[index];
  5638. var newValue = customizer
  5639. ? customizer(object[key], source[key], key, object, source)
  5640. : undefined;
  5641. if (newValue === undefined) {
  5642. newValue = source[key];
  5643. }
  5644. if (isNew) {
  5645. baseAssignValue(object, key, newValue);
  5646. } else {
  5647. assignValue(object, key, newValue);
  5648. }
  5649. }
  5650. return object;
  5651. }
  5652. /**
  5653. * Copies own symbols of `source` to `object`.
  5654. *
  5655. * @private
  5656. * @param {Object} source The object to copy symbols from.
  5657. * @param {Object} [object={}] The object to copy symbols to.
  5658. * @returns {Object} Returns `object`.
  5659. */
  5660. function copySymbols(source, object) {
  5661. return copyObject(source, getSymbols(source), object);
  5662. }
  5663. /**
  5664. * Copies own and inherited symbols of `source` to `object`.
  5665. *
  5666. * @private
  5667. * @param {Object} source The object to copy symbols from.
  5668. * @param {Object} [object={}] The object to copy symbols to.
  5669. * @returns {Object} Returns `object`.
  5670. */
  5671. function copySymbolsIn(source, object) {
  5672. return copyObject(source, getSymbolsIn(source), object);
  5673. }
  5674. /**
  5675. * Creates a function like `_.groupBy`.
  5676. *
  5677. * @private
  5678. * @param {Function} setter The function to set accumulator values.
  5679. * @param {Function} [initializer] The accumulator object initializer.
  5680. * @returns {Function} Returns the new aggregator function.
  5681. */
  5682. function createAggregator(setter, initializer) {
  5683. return function(collection, iteratee) {
  5684. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5685. accumulator = initializer ? initializer() : {};
  5686. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5687. };
  5688. }
  5689. /**
  5690. * Creates a function like `_.assign`.
  5691. *
  5692. * @private
  5693. * @param {Function} assigner The function to assign values.
  5694. * @returns {Function} Returns the new assigner function.
  5695. */
  5696. function createAssigner(assigner) {
  5697. return baseRest(function(object, sources) {
  5698. var index = -1,
  5699. length = sources.length,
  5700. customizer = length > 1 ? sources[length - 1] : undefined,
  5701. guard = length > 2 ? sources[2] : undefined;
  5702. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5703. ? (length--, customizer)
  5704. : undefined;
  5705. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5706. customizer = length < 3 ? undefined : customizer;
  5707. length = 1;
  5708. }
  5709. object = Object(object);
  5710. while (++index < length) {
  5711. var source = sources[index];
  5712. if (source) {
  5713. assigner(object, source, index, customizer);
  5714. }
  5715. }
  5716. return object;
  5717. });
  5718. }
  5719. /**
  5720. * Creates a `baseEach` or `baseEachRight` function.
  5721. *
  5722. * @private
  5723. * @param {Function} eachFunc The function to iterate over a collection.
  5724. * @param {boolean} [fromRight] Specify iterating from right to left.
  5725. * @returns {Function} Returns the new base function.
  5726. */
  5727. function createBaseEach(eachFunc, fromRight) {
  5728. return function(collection, iteratee) {
  5729. if (collection == null) {
  5730. return collection;
  5731. }
  5732. if (!isArrayLike(collection)) {
  5733. return eachFunc(collection, iteratee);
  5734. }
  5735. var length = collection.length,
  5736. index = fromRight ? length : -1,
  5737. iterable = Object(collection);
  5738. while ((fromRight ? index-- : ++index < length)) {
  5739. if (iteratee(iterable[index], index, iterable) === false) {
  5740. break;
  5741. }
  5742. }
  5743. return collection;
  5744. };
  5745. }
  5746. /**
  5747. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5748. *
  5749. * @private
  5750. * @param {boolean} [fromRight] Specify iterating from right to left.
  5751. * @returns {Function} Returns the new base function.
  5752. */
  5753. function createBaseFor(fromRight) {
  5754. return function(object, iteratee, keysFunc) {
  5755. var index = -1,
  5756. iterable = Object(object),
  5757. props = keysFunc(object),
  5758. length = props.length;
  5759. while (length--) {
  5760. var key = props[fromRight ? length : ++index];
  5761. if (iteratee(iterable[key], key, iterable) === false) {
  5762. break;
  5763. }
  5764. }
  5765. return object;
  5766. };
  5767. }
  5768. /**
  5769. * Creates a function that wraps `func` to invoke it with the optional `this`
  5770. * binding of `thisArg`.
  5771. *
  5772. * @private
  5773. * @param {Function} func The function to wrap.
  5774. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5775. * @param {*} [thisArg] The `this` binding of `func`.
  5776. * @returns {Function} Returns the new wrapped function.
  5777. */
  5778. function createBind(func, bitmask, thisArg) {
  5779. var isBind = bitmask & WRAP_BIND_FLAG,
  5780. Ctor = createCtor(func);
  5781. function wrapper() {
  5782. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5783. return fn.apply(isBind ? thisArg : this, arguments);
  5784. }
  5785. return wrapper;
  5786. }
  5787. /**
  5788. * Creates a function like `_.lowerFirst`.
  5789. *
  5790. * @private
  5791. * @param {string} methodName The name of the `String` case method to use.
  5792. * @returns {Function} Returns the new case function.
  5793. */
  5794. function createCaseFirst(methodName) {
  5795. return function(string) {
  5796. string = toString(string);
  5797. var strSymbols = hasUnicode(string)
  5798. ? stringToArray(string)
  5799. : undefined;
  5800. var chr = strSymbols
  5801. ? strSymbols[0]
  5802. : string.charAt(0);
  5803. var trailing = strSymbols
  5804. ? castSlice(strSymbols, 1).join('')
  5805. : string.slice(1);
  5806. return chr[methodName]() + trailing;
  5807. };
  5808. }
  5809. /**
  5810. * Creates a function like `_.camelCase`.
  5811. *
  5812. * @private
  5813. * @param {Function} callback The function to combine each word.
  5814. * @returns {Function} Returns the new compounder function.
  5815. */
  5816. function createCompounder(callback) {
  5817. return function(string) {
  5818. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5819. };
  5820. }
  5821. /**
  5822. * Creates a function that produces an instance of `Ctor` regardless of
  5823. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5824. *
  5825. * @private
  5826. * @param {Function} Ctor The constructor to wrap.
  5827. * @returns {Function} Returns the new wrapped function.
  5828. */
  5829. function createCtor(Ctor) {
  5830. return function() {
  5831. // Use a `switch` statement to work with class constructors. See
  5832. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5833. // for more details.
  5834. var args = arguments;
  5835. switch (args.length) {
  5836. case 0: return new Ctor;
  5837. case 1: return new Ctor(args[0]);
  5838. case 2: return new Ctor(args[0], args[1]);
  5839. case 3: return new Ctor(args[0], args[1], args[2]);
  5840. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5841. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5842. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5843. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5844. }
  5845. var thisBinding = baseCreate(Ctor.prototype),
  5846. result = Ctor.apply(thisBinding, args);
  5847. // Mimic the constructor's `return` behavior.
  5848. // See https://es5.github.io/#x13.2.2 for more details.
  5849. return isObject(result) ? result : thisBinding;
  5850. };
  5851. }
  5852. /**
  5853. * Creates a function that wraps `func` to enable currying.
  5854. *
  5855. * @private
  5856. * @param {Function} func The function to wrap.
  5857. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5858. * @param {number} arity The arity of `func`.
  5859. * @returns {Function} Returns the new wrapped function.
  5860. */
  5861. function createCurry(func, bitmask, arity) {
  5862. var Ctor = createCtor(func);
  5863. function wrapper() {
  5864. var length = arguments.length,
  5865. args = Array(length),
  5866. index = length,
  5867. placeholder = getHolder(wrapper);
  5868. while (index--) {
  5869. args[index] = arguments[index];
  5870. }
  5871. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5872. ? []
  5873. : replaceHolders(args, placeholder);
  5874. length -= holders.length;
  5875. if (length < arity) {
  5876. return createRecurry(
  5877. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5878. args, holders, undefined, undefined, arity - length);
  5879. }
  5880. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5881. return apply(fn, this, args);
  5882. }
  5883. return wrapper;
  5884. }
  5885. /**
  5886. * Creates a `_.find` or `_.findLast` function.
  5887. *
  5888. * @private
  5889. * @param {Function} findIndexFunc The function to find the collection index.
  5890. * @returns {Function} Returns the new find function.
  5891. */
  5892. function createFind(findIndexFunc) {
  5893. return function(collection, predicate, fromIndex) {
  5894. var iterable = Object(collection);
  5895. if (!isArrayLike(collection)) {
  5896. var iteratee = getIteratee(predicate, 3);
  5897. collection = keys(collection);
  5898. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5899. }
  5900. var index = findIndexFunc(collection, predicate, fromIndex);
  5901. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5902. };
  5903. }
  5904. /**
  5905. * Creates a `_.flow` or `_.flowRight` function.
  5906. *
  5907. * @private
  5908. * @param {boolean} [fromRight] Specify iterating from right to left.
  5909. * @returns {Function} Returns the new flow function.
  5910. */
  5911. function createFlow(fromRight) {
  5912. return flatRest(function(funcs) {
  5913. var length = funcs.length,
  5914. index = length,
  5915. prereq = LodashWrapper.prototype.thru;
  5916. if (fromRight) {
  5917. funcs.reverse();
  5918. }
  5919. while (index--) {
  5920. var func = funcs[index];
  5921. if (typeof func != 'function') {
  5922. throw new TypeError(FUNC_ERROR_TEXT);
  5923. }
  5924. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5925. var wrapper = new LodashWrapper([], true);
  5926. }
  5927. }
  5928. index = wrapper ? index : length;
  5929. while (++index < length) {
  5930. func = funcs[index];
  5931. var funcName = getFuncName(func),
  5932. data = funcName == 'wrapper' ? getData(func) : undefined;
  5933. if (data && isLaziable(data[0]) &&
  5934. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5935. !data[4].length && data[9] == 1
  5936. ) {
  5937. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5938. } else {
  5939. wrapper = (func.length == 1 && isLaziable(func))
  5940. ? wrapper[funcName]()
  5941. : wrapper.thru(func);
  5942. }
  5943. }
  5944. return function() {
  5945. var args = arguments,
  5946. value = args[0];
  5947. if (wrapper && args.length == 1 && isArray(value)) {
  5948. return wrapper.plant(value).value();
  5949. }
  5950. var index = 0,
  5951. result = length ? funcs[index].apply(this, args) : value;
  5952. while (++index < length) {
  5953. result = funcs[index].call(this, result);
  5954. }
  5955. return result;
  5956. };
  5957. });
  5958. }
  5959. /**
  5960. * Creates a function that wraps `func` to invoke it with optional `this`
  5961. * binding of `thisArg`, partial application, and currying.
  5962. *
  5963. * @private
  5964. * @param {Function|string} func The function or method name to wrap.
  5965. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5966. * @param {*} [thisArg] The `this` binding of `func`.
  5967. * @param {Array} [partials] The arguments to prepend to those provided to
  5968. * the new function.
  5969. * @param {Array} [holders] The `partials` placeholder indexes.
  5970. * @param {Array} [partialsRight] The arguments to append to those provided
  5971. * to the new function.
  5972. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5973. * @param {Array} [argPos] The argument positions of the new function.
  5974. * @param {number} [ary] The arity cap of `func`.
  5975. * @param {number} [arity] The arity of `func`.
  5976. * @returns {Function} Returns the new wrapped function.
  5977. */
  5978. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5979. var isAry = bitmask & WRAP_ARY_FLAG,
  5980. isBind = bitmask & WRAP_BIND_FLAG,
  5981. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5982. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5983. isFlip = bitmask & WRAP_FLIP_FLAG,
  5984. Ctor = isBindKey ? undefined : createCtor(func);
  5985. function wrapper() {
  5986. var length = arguments.length,
  5987. args = Array(length),
  5988. index = length;
  5989. while (index--) {
  5990. args[index] = arguments[index];
  5991. }
  5992. if (isCurried) {
  5993. var placeholder = getHolder(wrapper),
  5994. holdersCount = countHolders(args, placeholder);
  5995. }
  5996. if (partials) {
  5997. args = composeArgs(args, partials, holders, isCurried);
  5998. }
  5999. if (partialsRight) {
  6000. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6001. }
  6002. length -= holdersCount;
  6003. if (isCurried && length < arity) {
  6004. var newHolders = replaceHolders(args, placeholder);
  6005. return createRecurry(
  6006. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6007. args, newHolders, argPos, ary, arity - length
  6008. );
  6009. }
  6010. var thisBinding = isBind ? thisArg : this,
  6011. fn = isBindKey ? thisBinding[func] : func;
  6012. length = args.length;
  6013. if (argPos) {
  6014. args = reorder(args, argPos);
  6015. } else if (isFlip && length > 1) {
  6016. args.reverse();
  6017. }
  6018. if (isAry && ary < length) {
  6019. args.length = ary;
  6020. }
  6021. if (this && this !== root && this instanceof wrapper) {
  6022. fn = Ctor || createCtor(fn);
  6023. }
  6024. return fn.apply(thisBinding, args);
  6025. }
  6026. return wrapper;
  6027. }
  6028. /**
  6029. * Creates a function like `_.invertBy`.
  6030. *
  6031. * @private
  6032. * @param {Function} setter The function to set accumulator values.
  6033. * @param {Function} toIteratee The function to resolve iteratees.
  6034. * @returns {Function} Returns the new inverter function.
  6035. */
  6036. function createInverter(setter, toIteratee) {
  6037. return function(object, iteratee) {
  6038. return baseInverter(object, setter, toIteratee(iteratee), {});
  6039. };
  6040. }
  6041. /**
  6042. * Creates a function that performs a mathematical operation on two values.
  6043. *
  6044. * @private
  6045. * @param {Function} operator The function to perform the operation.
  6046. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6047. * @returns {Function} Returns the new mathematical operation function.
  6048. */
  6049. function createMathOperation(operator, defaultValue) {
  6050. return function(value, other) {
  6051. var result;
  6052. if (value === undefined && other === undefined) {
  6053. return defaultValue;
  6054. }
  6055. if (value !== undefined) {
  6056. result = value;
  6057. }
  6058. if (other !== undefined) {
  6059. if (result === undefined) {
  6060. return other;
  6061. }
  6062. if (typeof value == 'string' || typeof other == 'string') {
  6063. value = baseToString(value);
  6064. other = baseToString(other);
  6065. } else {
  6066. value = baseToNumber(value);
  6067. other = baseToNumber(other);
  6068. }
  6069. result = operator(value, other);
  6070. }
  6071. return result;
  6072. };
  6073. }
  6074. /**
  6075. * Creates a function like `_.over`.
  6076. *
  6077. * @private
  6078. * @param {Function} arrayFunc The function to iterate over iteratees.
  6079. * @returns {Function} Returns the new over function.
  6080. */
  6081. function createOver(arrayFunc) {
  6082. return flatRest(function(iteratees) {
  6083. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6084. return baseRest(function(args) {
  6085. var thisArg = this;
  6086. return arrayFunc(iteratees, function(iteratee) {
  6087. return apply(iteratee, thisArg, args);
  6088. });
  6089. });
  6090. });
  6091. }
  6092. /**
  6093. * Creates the padding for `string` based on `length`. The `chars` string
  6094. * is truncated if the number of characters exceeds `length`.
  6095. *
  6096. * @private
  6097. * @param {number} length The padding length.
  6098. * @param {string} [chars=' '] The string used as padding.
  6099. * @returns {string} Returns the padding for `string`.
  6100. */
  6101. function createPadding(length, chars) {
  6102. chars = chars === undefined ? ' ' : baseToString(chars);
  6103. var charsLength = chars.length;
  6104. if (charsLength < 2) {
  6105. return charsLength ? baseRepeat(chars, length) : chars;
  6106. }
  6107. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6108. return hasUnicode(chars)
  6109. ? castSlice(stringToArray(result), 0, length).join('')
  6110. : result.slice(0, length);
  6111. }
  6112. /**
  6113. * Creates a function that wraps `func` to invoke it with the `this` binding
  6114. * of `thisArg` and `partials` prepended to the arguments it receives.
  6115. *
  6116. * @private
  6117. * @param {Function} func The function to wrap.
  6118. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6119. * @param {*} thisArg The `this` binding of `func`.
  6120. * @param {Array} partials The arguments to prepend to those provided to
  6121. * the new function.
  6122. * @returns {Function} Returns the new wrapped function.
  6123. */
  6124. function createPartial(func, bitmask, thisArg, partials) {
  6125. var isBind = bitmask & WRAP_BIND_FLAG,
  6126. Ctor = createCtor(func);
  6127. function wrapper() {
  6128. var argsIndex = -1,
  6129. argsLength = arguments.length,
  6130. leftIndex = -1,
  6131. leftLength = partials.length,
  6132. args = Array(leftLength + argsLength),
  6133. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6134. while (++leftIndex < leftLength) {
  6135. args[leftIndex] = partials[leftIndex];
  6136. }
  6137. while (argsLength--) {
  6138. args[leftIndex++] = arguments[++argsIndex];
  6139. }
  6140. return apply(fn, isBind ? thisArg : this, args);
  6141. }
  6142. return wrapper;
  6143. }
  6144. /**
  6145. * Creates a `_.range` or `_.rangeRight` function.
  6146. *
  6147. * @private
  6148. * @param {boolean} [fromRight] Specify iterating from right to left.
  6149. * @returns {Function} Returns the new range function.
  6150. */
  6151. function createRange(fromRight) {
  6152. return function(start, end, step) {
  6153. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6154. end = step = undefined;
  6155. }
  6156. // Ensure the sign of `-0` is preserved.
  6157. start = toFinite(start);
  6158. if (end === undefined) {
  6159. end = start;
  6160. start = 0;
  6161. } else {
  6162. end = toFinite(end);
  6163. }
  6164. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6165. return baseRange(start, end, step, fromRight);
  6166. };
  6167. }
  6168. /**
  6169. * Creates a function that performs a relational operation on two values.
  6170. *
  6171. * @private
  6172. * @param {Function} operator The function to perform the operation.
  6173. * @returns {Function} Returns the new relational operation function.
  6174. */
  6175. function createRelationalOperation(operator) {
  6176. return function(value, other) {
  6177. if (!(typeof value == 'string' && typeof other == 'string')) {
  6178. value = toNumber(value);
  6179. other = toNumber(other);
  6180. }
  6181. return operator(value, other);
  6182. };
  6183. }
  6184. /**
  6185. * Creates a function that wraps `func` to continue currying.
  6186. *
  6187. * @private
  6188. * @param {Function} func The function to wrap.
  6189. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6190. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6191. * @param {*} placeholder The placeholder value.
  6192. * @param {*} [thisArg] The `this` binding of `func`.
  6193. * @param {Array} [partials] The arguments to prepend to those provided to
  6194. * the new function.
  6195. * @param {Array} [holders] The `partials` placeholder indexes.
  6196. * @param {Array} [argPos] The argument positions of the new function.
  6197. * @param {number} [ary] The arity cap of `func`.
  6198. * @param {number} [arity] The arity of `func`.
  6199. * @returns {Function} Returns the new wrapped function.
  6200. */
  6201. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6202. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6203. newHolders = isCurry ? holders : undefined,
  6204. newHoldersRight = isCurry ? undefined : holders,
  6205. newPartials = isCurry ? partials : undefined,
  6206. newPartialsRight = isCurry ? undefined : partials;
  6207. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6208. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6209. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6210. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6211. }
  6212. var newData = [
  6213. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6214. newHoldersRight, argPos, ary, arity
  6215. ];
  6216. var result = wrapFunc.apply(undefined, newData);
  6217. if (isLaziable(func)) {
  6218. setData(result, newData);
  6219. }
  6220. result.placeholder = placeholder;
  6221. return setWrapToString(result, func, bitmask);
  6222. }
  6223. /**
  6224. * Creates a function like `_.round`.
  6225. *
  6226. * @private
  6227. * @param {string} methodName The name of the `Math` method to use when rounding.
  6228. * @returns {Function} Returns the new round function.
  6229. */
  6230. function createRound(methodName) {
  6231. var func = Math[methodName];
  6232. return function(number, precision) {
  6233. number = toNumber(number);
  6234. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6235. if (precision && nativeIsFinite(number)) {
  6236. // Shift with exponential notation to avoid floating-point issues.
  6237. // See [MDN](https://mdn.io/round#Examples) for more details.
  6238. var pair = (toString(number) + 'e').split('e'),
  6239. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6240. pair = (toString(value) + 'e').split('e');
  6241. return +(pair[0] + 'e' + (+pair[1] - precision));
  6242. }
  6243. return func(number);
  6244. };
  6245. }
  6246. /**
  6247. * Creates a set object of `values`.
  6248. *
  6249. * @private
  6250. * @param {Array} values The values to add to the set.
  6251. * @returns {Object} Returns the new set.
  6252. */
  6253. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6254. return new Set(values);
  6255. };
  6256. /**
  6257. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6258. *
  6259. * @private
  6260. * @param {Function} keysFunc The function to get the keys of a given object.
  6261. * @returns {Function} Returns the new pairs function.
  6262. */
  6263. function createToPairs(keysFunc) {
  6264. return function(object) {
  6265. var tag = getTag(object);
  6266. if (tag == mapTag) {
  6267. return mapToArray(object);
  6268. }
  6269. if (tag == setTag) {
  6270. return setToPairs(object);
  6271. }
  6272. return baseToPairs(object, keysFunc(object));
  6273. };
  6274. }
  6275. /**
  6276. * Creates a function that either curries or invokes `func` with optional
  6277. * `this` binding and partially applied arguments.
  6278. *
  6279. * @private
  6280. * @param {Function|string} func The function or method name to wrap.
  6281. * @param {number} bitmask The bitmask flags.
  6282. * 1 - `_.bind`
  6283. * 2 - `_.bindKey`
  6284. * 4 - `_.curry` or `_.curryRight` of a bound function
  6285. * 8 - `_.curry`
  6286. * 16 - `_.curryRight`
  6287. * 32 - `_.partial`
  6288. * 64 - `_.partialRight`
  6289. * 128 - `_.rearg`
  6290. * 256 - `_.ary`
  6291. * 512 - `_.flip`
  6292. * @param {*} [thisArg] The `this` binding of `func`.
  6293. * @param {Array} [partials] The arguments to be partially applied.
  6294. * @param {Array} [holders] The `partials` placeholder indexes.
  6295. * @param {Array} [argPos] The argument positions of the new function.
  6296. * @param {number} [ary] The arity cap of `func`.
  6297. * @param {number} [arity] The arity of `func`.
  6298. * @returns {Function} Returns the new wrapped function.
  6299. */
  6300. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6301. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6302. if (!isBindKey && typeof func != 'function') {
  6303. throw new TypeError(FUNC_ERROR_TEXT);
  6304. }
  6305. var length = partials ? partials.length : 0;
  6306. if (!length) {
  6307. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6308. partials = holders = undefined;
  6309. }
  6310. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6311. arity = arity === undefined ? arity : toInteger(arity);
  6312. length -= holders ? holders.length : 0;
  6313. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6314. var partialsRight = partials,
  6315. holdersRight = holders;
  6316. partials = holders = undefined;
  6317. }
  6318. var data = isBindKey ? undefined : getData(func);
  6319. var newData = [
  6320. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6321. argPos, ary, arity
  6322. ];
  6323. if (data) {
  6324. mergeData(newData, data);
  6325. }
  6326. func = newData[0];
  6327. bitmask = newData[1];
  6328. thisArg = newData[2];
  6329. partials = newData[3];
  6330. holders = newData[4];
  6331. arity = newData[9] = newData[9] === undefined
  6332. ? (isBindKey ? 0 : func.length)
  6333. : nativeMax(newData[9] - length, 0);
  6334. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6335. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6336. }
  6337. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6338. var result = createBind(func, bitmask, thisArg);
  6339. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6340. result = createCurry(func, bitmask, arity);
  6341. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6342. result = createPartial(func, bitmask, thisArg, partials);
  6343. } else {
  6344. result = createHybrid.apply(undefined, newData);
  6345. }
  6346. var setter = data ? baseSetData : setData;
  6347. return setWrapToString(setter(result, newData), func, bitmask);
  6348. }
  6349. /**
  6350. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6351. * of source objects to the destination object for all destination properties
  6352. * that resolve to `undefined`.
  6353. *
  6354. * @private
  6355. * @param {*} objValue The destination value.
  6356. * @param {*} srcValue The source value.
  6357. * @param {string} key The key of the property to assign.
  6358. * @param {Object} object The parent object of `objValue`.
  6359. * @returns {*} Returns the value to assign.
  6360. */
  6361. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6362. if (objValue === undefined ||
  6363. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6364. return srcValue;
  6365. }
  6366. return objValue;
  6367. }
  6368. /**
  6369. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6370. * objects into destination objects that are passed thru.
  6371. *
  6372. * @private
  6373. * @param {*} objValue The destination value.
  6374. * @param {*} srcValue The source value.
  6375. * @param {string} key The key of the property to merge.
  6376. * @param {Object} object The parent object of `objValue`.
  6377. * @param {Object} source The parent object of `srcValue`.
  6378. * @param {Object} [stack] Tracks traversed source values and their merged
  6379. * counterparts.
  6380. * @returns {*} Returns the value to assign.
  6381. */
  6382. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6383. if (isObject(objValue) && isObject(srcValue)) {
  6384. // Recursively merge objects and arrays (susceptible to call stack limits).
  6385. stack.set(srcValue, objValue);
  6386. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6387. stack['delete'](srcValue);
  6388. }
  6389. return objValue;
  6390. }
  6391. /**
  6392. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6393. * objects.
  6394. *
  6395. * @private
  6396. * @param {*} value The value to inspect.
  6397. * @param {string} key The key of the property to inspect.
  6398. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6399. */
  6400. function customOmitClone(value) {
  6401. return isPlainObject(value) ? undefined : value;
  6402. }
  6403. /**
  6404. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6405. * partial deep comparisons.
  6406. *
  6407. * @private
  6408. * @param {Array} array The array to compare.
  6409. * @param {Array} other The other array to compare.
  6410. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6411. * @param {Function} customizer The function to customize comparisons.
  6412. * @param {Function} equalFunc The function to determine equivalents of values.
  6413. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6414. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6415. */
  6416. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6417. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6418. arrLength = array.length,
  6419. othLength = other.length;
  6420. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6421. return false;
  6422. }
  6423. // Check that cyclic values are equal.
  6424. var arrStacked = stack.get(array);
  6425. var othStacked = stack.get(other);
  6426. if (arrStacked && othStacked) {
  6427. return arrStacked == other && othStacked == array;
  6428. }
  6429. var index = -1,
  6430. result = true,
  6431. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6432. stack.set(array, other);
  6433. stack.set(other, array);
  6434. // Ignore non-index properties.
  6435. while (++index < arrLength) {
  6436. var arrValue = array[index],
  6437. othValue = other[index];
  6438. if (customizer) {
  6439. var compared = isPartial
  6440. ? customizer(othValue, arrValue, index, other, array, stack)
  6441. : customizer(arrValue, othValue, index, array, other, stack);
  6442. }
  6443. if (compared !== undefined) {
  6444. if (compared) {
  6445. continue;
  6446. }
  6447. result = false;
  6448. break;
  6449. }
  6450. // Recursively compare arrays (susceptible to call stack limits).
  6451. if (seen) {
  6452. if (!arraySome(other, function(othValue, othIndex) {
  6453. if (!cacheHas(seen, othIndex) &&
  6454. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6455. return seen.push(othIndex);
  6456. }
  6457. })) {
  6458. result = false;
  6459. break;
  6460. }
  6461. } else if (!(
  6462. arrValue === othValue ||
  6463. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6464. )) {
  6465. result = false;
  6466. break;
  6467. }
  6468. }
  6469. stack['delete'](array);
  6470. stack['delete'](other);
  6471. return result;
  6472. }
  6473. /**
  6474. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6475. * the same `toStringTag`.
  6476. *
  6477. * **Note:** This function only supports comparing values with tags of
  6478. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6479. *
  6480. * @private
  6481. * @param {Object} object The object to compare.
  6482. * @param {Object} other The other object to compare.
  6483. * @param {string} tag The `toStringTag` of the objects to compare.
  6484. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6485. * @param {Function} customizer The function to customize comparisons.
  6486. * @param {Function} equalFunc The function to determine equivalents of values.
  6487. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6488. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6489. */
  6490. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6491. switch (tag) {
  6492. case dataViewTag:
  6493. if ((object.byteLength != other.byteLength) ||
  6494. (object.byteOffset != other.byteOffset)) {
  6495. return false;
  6496. }
  6497. object = object.buffer;
  6498. other = other.buffer;
  6499. case arrayBufferTag:
  6500. if ((object.byteLength != other.byteLength) ||
  6501. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6502. return false;
  6503. }
  6504. return true;
  6505. case boolTag:
  6506. case dateTag:
  6507. case numberTag:
  6508. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6509. // Invalid dates are coerced to `NaN`.
  6510. return eq(+object, +other);
  6511. case errorTag:
  6512. return object.name == other.name && object.message == other.message;
  6513. case regexpTag:
  6514. case stringTag:
  6515. // Coerce regexes to strings and treat strings, primitives and objects,
  6516. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6517. // for more details.
  6518. return object == (other + '');
  6519. case mapTag:
  6520. var convert = mapToArray;
  6521. case setTag:
  6522. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6523. convert || (convert = setToArray);
  6524. if (object.size != other.size && !isPartial) {
  6525. return false;
  6526. }
  6527. // Assume cyclic values are equal.
  6528. var stacked = stack.get(object);
  6529. if (stacked) {
  6530. return stacked == other;
  6531. }
  6532. bitmask |= COMPARE_UNORDERED_FLAG;
  6533. // Recursively compare objects (susceptible to call stack limits).
  6534. stack.set(object, other);
  6535. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6536. stack['delete'](object);
  6537. return result;
  6538. case symbolTag:
  6539. if (symbolValueOf) {
  6540. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6541. }
  6542. }
  6543. return false;
  6544. }
  6545. /**
  6546. * A specialized version of `baseIsEqualDeep` for objects with support for
  6547. * partial deep comparisons.
  6548. *
  6549. * @private
  6550. * @param {Object} object The object to compare.
  6551. * @param {Object} other The other object to compare.
  6552. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6553. * @param {Function} customizer The function to customize comparisons.
  6554. * @param {Function} equalFunc The function to determine equivalents of values.
  6555. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6556. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6557. */
  6558. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6559. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6560. objProps = getAllKeys(object),
  6561. objLength = objProps.length,
  6562. othProps = getAllKeys(other),
  6563. othLength = othProps.length;
  6564. if (objLength != othLength && !isPartial) {
  6565. return false;
  6566. }
  6567. var index = objLength;
  6568. while (index--) {
  6569. var key = objProps[index];
  6570. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6571. return false;
  6572. }
  6573. }
  6574. // Check that cyclic values are equal.
  6575. var objStacked = stack.get(object);
  6576. var othStacked = stack.get(other);
  6577. if (objStacked && othStacked) {
  6578. return objStacked == other && othStacked == object;
  6579. }
  6580. var result = true;
  6581. stack.set(object, other);
  6582. stack.set(other, object);
  6583. var skipCtor = isPartial;
  6584. while (++index < objLength) {
  6585. key = objProps[index];
  6586. var objValue = object[key],
  6587. othValue = other[key];
  6588. if (customizer) {
  6589. var compared = isPartial
  6590. ? customizer(othValue, objValue, key, other, object, stack)
  6591. : customizer(objValue, othValue, key, object, other, stack);
  6592. }
  6593. // Recursively compare objects (susceptible to call stack limits).
  6594. if (!(compared === undefined
  6595. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6596. : compared
  6597. )) {
  6598. result = false;
  6599. break;
  6600. }
  6601. skipCtor || (skipCtor = key == 'constructor');
  6602. }
  6603. if (result && !skipCtor) {
  6604. var objCtor = object.constructor,
  6605. othCtor = other.constructor;
  6606. // Non `Object` object instances with different constructors are not equal.
  6607. if (objCtor != othCtor &&
  6608. ('constructor' in object && 'constructor' in other) &&
  6609. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6610. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6611. result = false;
  6612. }
  6613. }
  6614. stack['delete'](object);
  6615. stack['delete'](other);
  6616. return result;
  6617. }
  6618. /**
  6619. * A specialized version of `baseRest` which flattens the rest array.
  6620. *
  6621. * @private
  6622. * @param {Function} func The function to apply a rest parameter to.
  6623. * @returns {Function} Returns the new function.
  6624. */
  6625. function flatRest(func) {
  6626. return setToString(overRest(func, undefined, flatten), func + '');
  6627. }
  6628. /**
  6629. * Creates an array of own enumerable property names and symbols of `object`.
  6630. *
  6631. * @private
  6632. * @param {Object} object The object to query.
  6633. * @returns {Array} Returns the array of property names and symbols.
  6634. */
  6635. function getAllKeys(object) {
  6636. return baseGetAllKeys(object, keys, getSymbols);
  6637. }
  6638. /**
  6639. * Creates an array of own and inherited enumerable property names and
  6640. * symbols of `object`.
  6641. *
  6642. * @private
  6643. * @param {Object} object The object to query.
  6644. * @returns {Array} Returns the array of property names and symbols.
  6645. */
  6646. function getAllKeysIn(object) {
  6647. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6648. }
  6649. /**
  6650. * Gets metadata for `func`.
  6651. *
  6652. * @private
  6653. * @param {Function} func The function to query.
  6654. * @returns {*} Returns the metadata for `func`.
  6655. */
  6656. var getData = !metaMap ? noop : function(func) {
  6657. return metaMap.get(func);
  6658. };
  6659. /**
  6660. * Gets the name of `func`.
  6661. *
  6662. * @private
  6663. * @param {Function} func The function to query.
  6664. * @returns {string} Returns the function name.
  6665. */
  6666. function getFuncName(func) {
  6667. var result = (func.name + ''),
  6668. array = realNames[result],
  6669. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6670. while (length--) {
  6671. var data = array[length],
  6672. otherFunc = data.func;
  6673. if (otherFunc == null || otherFunc == func) {
  6674. return data.name;
  6675. }
  6676. }
  6677. return result;
  6678. }
  6679. /**
  6680. * Gets the argument placeholder value for `func`.
  6681. *
  6682. * @private
  6683. * @param {Function} func The function to inspect.
  6684. * @returns {*} Returns the placeholder value.
  6685. */
  6686. function getHolder(func) {
  6687. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6688. return object.placeholder;
  6689. }
  6690. /**
  6691. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6692. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6693. * If arguments are provided, the chosen function is invoked with them and
  6694. * its result is returned.
  6695. *
  6696. * @private
  6697. * @param {*} [value] The value to convert to an iteratee.
  6698. * @param {number} [arity] The arity of the created iteratee.
  6699. * @returns {Function} Returns the chosen function or its result.
  6700. */
  6701. function getIteratee() {
  6702. var result = lodash.iteratee || iteratee;
  6703. result = result === iteratee ? baseIteratee : result;
  6704. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6705. }
  6706. /**
  6707. * Gets the data for `map`.
  6708. *
  6709. * @private
  6710. * @param {Object} map The map to query.
  6711. * @param {string} key The reference key.
  6712. * @returns {*} Returns the map data.
  6713. */
  6714. function getMapData(map, key) {
  6715. var data = map.__data__;
  6716. return isKeyable(key)
  6717. ? data[typeof key == 'string' ? 'string' : 'hash']
  6718. : data.map;
  6719. }
  6720. /**
  6721. * Gets the property names, values, and compare flags of `object`.
  6722. *
  6723. * @private
  6724. * @param {Object} object The object to query.
  6725. * @returns {Array} Returns the match data of `object`.
  6726. */
  6727. function getMatchData(object) {
  6728. var result = keys(object),
  6729. length = result.length;
  6730. while (length--) {
  6731. var key = result[length],
  6732. value = object[key];
  6733. result[length] = [key, value, isStrictComparable(value)];
  6734. }
  6735. return result;
  6736. }
  6737. /**
  6738. * Gets the native function at `key` of `object`.
  6739. *
  6740. * @private
  6741. * @param {Object} object The object to query.
  6742. * @param {string} key The key of the method to get.
  6743. * @returns {*} Returns the function if it's native, else `undefined`.
  6744. */
  6745. function getNative(object, key) {
  6746. var value = getValue(object, key);
  6747. return baseIsNative(value) ? value : undefined;
  6748. }
  6749. /**
  6750. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6751. *
  6752. * @private
  6753. * @param {*} value The value to query.
  6754. * @returns {string} Returns the raw `toStringTag`.
  6755. */
  6756. function getRawTag(value) {
  6757. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6758. tag = value[symToStringTag];
  6759. try {
  6760. value[symToStringTag] = undefined;
  6761. var unmasked = true;
  6762. } catch (e) {}
  6763. var result = nativeObjectToString.call(value);
  6764. if (unmasked) {
  6765. if (isOwn) {
  6766. value[symToStringTag] = tag;
  6767. } else {
  6768. delete value[symToStringTag];
  6769. }
  6770. }
  6771. return result;
  6772. }
  6773. /**
  6774. * Creates an array of the own enumerable symbols of `object`.
  6775. *
  6776. * @private
  6777. * @param {Object} object The object to query.
  6778. * @returns {Array} Returns the array of symbols.
  6779. */
  6780. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6781. if (object == null) {
  6782. return [];
  6783. }
  6784. object = Object(object);
  6785. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6786. return propertyIsEnumerable.call(object, symbol);
  6787. });
  6788. };
  6789. /**
  6790. * Creates an array of the own and inherited enumerable symbols of `object`.
  6791. *
  6792. * @private
  6793. * @param {Object} object The object to query.
  6794. * @returns {Array} Returns the array of symbols.
  6795. */
  6796. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6797. var result = [];
  6798. while (object) {
  6799. arrayPush(result, getSymbols(object));
  6800. object = getPrototype(object);
  6801. }
  6802. return result;
  6803. };
  6804. /**
  6805. * Gets the `toStringTag` of `value`.
  6806. *
  6807. * @private
  6808. * @param {*} value The value to query.
  6809. * @returns {string} Returns the `toStringTag`.
  6810. */
  6811. var getTag = baseGetTag;
  6812. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6813. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6814. (Map && getTag(new Map) != mapTag) ||
  6815. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6816. (Set && getTag(new Set) != setTag) ||
  6817. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6818. getTag = function(value) {
  6819. var result = baseGetTag(value),
  6820. Ctor = result == objectTag ? value.constructor : undefined,
  6821. ctorString = Ctor ? toSource(Ctor) : '';
  6822. if (ctorString) {
  6823. switch (ctorString) {
  6824. case dataViewCtorString: return dataViewTag;
  6825. case mapCtorString: return mapTag;
  6826. case promiseCtorString: return promiseTag;
  6827. case setCtorString: return setTag;
  6828. case weakMapCtorString: return weakMapTag;
  6829. }
  6830. }
  6831. return result;
  6832. };
  6833. }
  6834. /**
  6835. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6836. *
  6837. * @private
  6838. * @param {number} start The start of the view.
  6839. * @param {number} end The end of the view.
  6840. * @param {Array} transforms The transformations to apply to the view.
  6841. * @returns {Object} Returns an object containing the `start` and `end`
  6842. * positions of the view.
  6843. */
  6844. function getView(start, end, transforms) {
  6845. var index = -1,
  6846. length = transforms.length;
  6847. while (++index < length) {
  6848. var data = transforms[index],
  6849. size = data.size;
  6850. switch (data.type) {
  6851. case 'drop': start += size; break;
  6852. case 'dropRight': end -= size; break;
  6853. case 'take': end = nativeMin(end, start + size); break;
  6854. case 'takeRight': start = nativeMax(start, end - size); break;
  6855. }
  6856. }
  6857. return { 'start': start, 'end': end };
  6858. }
  6859. /**
  6860. * Extracts wrapper details from the `source` body comment.
  6861. *
  6862. * @private
  6863. * @param {string} source The source to inspect.
  6864. * @returns {Array} Returns the wrapper details.
  6865. */
  6866. function getWrapDetails(source) {
  6867. var match = source.match(reWrapDetails);
  6868. return match ? match[1].split(reSplitDetails) : [];
  6869. }
  6870. /**
  6871. * Checks if `path` exists on `object`.
  6872. *
  6873. * @private
  6874. * @param {Object} object The object to query.
  6875. * @param {Array|string} path The path to check.
  6876. * @param {Function} hasFunc The function to check properties.
  6877. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6878. */
  6879. function hasPath(object, path, hasFunc) {
  6880. path = castPath(path, object);
  6881. var index = -1,
  6882. length = path.length,
  6883. result = false;
  6884. while (++index < length) {
  6885. var key = toKey(path[index]);
  6886. if (!(result = object != null && hasFunc(object, key))) {
  6887. break;
  6888. }
  6889. object = object[key];
  6890. }
  6891. if (result || ++index != length) {
  6892. return result;
  6893. }
  6894. length = object == null ? 0 : object.length;
  6895. return !!length && isLength(length) && isIndex(key, length) &&
  6896. (isArray(object) || isArguments(object));
  6897. }
  6898. /**
  6899. * Initializes an array clone.
  6900. *
  6901. * @private
  6902. * @param {Array} array The array to clone.
  6903. * @returns {Array} Returns the initialized clone.
  6904. */
  6905. function initCloneArray(array) {
  6906. var length = array.length,
  6907. result = new array.constructor(length);
  6908. // Add properties assigned by `RegExp#exec`.
  6909. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6910. result.index = array.index;
  6911. result.input = array.input;
  6912. }
  6913. return result;
  6914. }
  6915. /**
  6916. * Initializes an object clone.
  6917. *
  6918. * @private
  6919. * @param {Object} object The object to clone.
  6920. * @returns {Object} Returns the initialized clone.
  6921. */
  6922. function initCloneObject(object) {
  6923. return (typeof object.constructor == 'function' && !isPrototype(object))
  6924. ? baseCreate(getPrototype(object))
  6925. : {};
  6926. }
  6927. /**
  6928. * Initializes an object clone based on its `toStringTag`.
  6929. *
  6930. * **Note:** This function only supports cloning values with tags of
  6931. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6932. *
  6933. * @private
  6934. * @param {Object} object The object to clone.
  6935. * @param {string} tag The `toStringTag` of the object to clone.
  6936. * @param {boolean} [isDeep] Specify a deep clone.
  6937. * @returns {Object} Returns the initialized clone.
  6938. */
  6939. function initCloneByTag(object, tag, isDeep) {
  6940. var Ctor = object.constructor;
  6941. switch (tag) {
  6942. case arrayBufferTag:
  6943. return cloneArrayBuffer(object);
  6944. case boolTag:
  6945. case dateTag:
  6946. return new Ctor(+object);
  6947. case dataViewTag:
  6948. return cloneDataView(object, isDeep);
  6949. case float32Tag: case float64Tag:
  6950. case int8Tag: case int16Tag: case int32Tag:
  6951. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6952. return cloneTypedArray(object, isDeep);
  6953. case mapTag:
  6954. return new Ctor;
  6955. case numberTag:
  6956. case stringTag:
  6957. return new Ctor(object);
  6958. case regexpTag:
  6959. return cloneRegExp(object);
  6960. case setTag:
  6961. return new Ctor;
  6962. case symbolTag:
  6963. return cloneSymbol(object);
  6964. }
  6965. }
  6966. /**
  6967. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6968. *
  6969. * @private
  6970. * @param {string} source The source to modify.
  6971. * @returns {Array} details The details to insert.
  6972. * @returns {string} Returns the modified source.
  6973. */
  6974. function insertWrapDetails(source, details) {
  6975. var length = details.length;
  6976. if (!length) {
  6977. return source;
  6978. }
  6979. var lastIndex = length - 1;
  6980. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6981. details = details.join(length > 2 ? ', ' : ' ');
  6982. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6983. }
  6984. /**
  6985. * Checks if `value` is a flattenable `arguments` object or array.
  6986. *
  6987. * @private
  6988. * @param {*} value The value to check.
  6989. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6990. */
  6991. function isFlattenable(value) {
  6992. return isArray(value) || isArguments(value) ||
  6993. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6994. }
  6995. /**
  6996. * Checks if `value` is a valid array-like index.
  6997. *
  6998. * @private
  6999. * @param {*} value The value to check.
  7000. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7001. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7002. */
  7003. function isIndex(value, length) {
  7004. var type = typeof value;
  7005. length = length == null ? MAX_SAFE_INTEGER : length;
  7006. return !!length &&
  7007. (type == 'number' ||
  7008. (type != 'symbol' && reIsUint.test(value))) &&
  7009. (value > -1 && value % 1 == 0 && value < length);
  7010. }
  7011. /**
  7012. * Checks if the given arguments are from an iteratee call.
  7013. *
  7014. * @private
  7015. * @param {*} value The potential iteratee value argument.
  7016. * @param {*} index The potential iteratee index or key argument.
  7017. * @param {*} object The potential iteratee object argument.
  7018. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7019. * else `false`.
  7020. */
  7021. function isIterateeCall(value, index, object) {
  7022. if (!isObject(object)) {
  7023. return false;
  7024. }
  7025. var type = typeof index;
  7026. if (type == 'number'
  7027. ? (isArrayLike(object) && isIndex(index, object.length))
  7028. : (type == 'string' && index in object)
  7029. ) {
  7030. return eq(object[index], value);
  7031. }
  7032. return false;
  7033. }
  7034. /**
  7035. * Checks if `value` is a property name and not a property path.
  7036. *
  7037. * @private
  7038. * @param {*} value The value to check.
  7039. * @param {Object} [object] The object to query keys on.
  7040. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7041. */
  7042. function isKey(value, object) {
  7043. if (isArray(value)) {
  7044. return false;
  7045. }
  7046. var type = typeof value;
  7047. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7048. value == null || isSymbol(value)) {
  7049. return true;
  7050. }
  7051. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7052. (object != null && value in Object(object));
  7053. }
  7054. /**
  7055. * Checks if `value` is suitable for use as unique object key.
  7056. *
  7057. * @private
  7058. * @param {*} value The value to check.
  7059. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7060. */
  7061. function isKeyable(value) {
  7062. var type = typeof value;
  7063. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7064. ? (value !== '__proto__')
  7065. : (value === null);
  7066. }
  7067. /**
  7068. * Checks if `func` has a lazy counterpart.
  7069. *
  7070. * @private
  7071. * @param {Function} func The function to check.
  7072. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7073. * else `false`.
  7074. */
  7075. function isLaziable(func) {
  7076. var funcName = getFuncName(func),
  7077. other = lodash[funcName];
  7078. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7079. return false;
  7080. }
  7081. if (func === other) {
  7082. return true;
  7083. }
  7084. var data = getData(other);
  7085. return !!data && func === data[0];
  7086. }
  7087. /**
  7088. * Checks if `func` has its source masked.
  7089. *
  7090. * @private
  7091. * @param {Function} func The function to check.
  7092. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7093. */
  7094. function isMasked(func) {
  7095. return !!maskSrcKey && (maskSrcKey in func);
  7096. }
  7097. /**
  7098. * Checks if `func` is capable of being masked.
  7099. *
  7100. * @private
  7101. * @param {*} value The value to check.
  7102. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7103. */
  7104. var isMaskable = coreJsData ? isFunction : stubFalse;
  7105. /**
  7106. * Checks if `value` is likely a prototype object.
  7107. *
  7108. * @private
  7109. * @param {*} value The value to check.
  7110. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7111. */
  7112. function isPrototype(value) {
  7113. var Ctor = value && value.constructor,
  7114. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7115. return value === proto;
  7116. }
  7117. /**
  7118. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7119. *
  7120. * @private
  7121. * @param {*} value The value to check.
  7122. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7123. * equality comparisons, else `false`.
  7124. */
  7125. function isStrictComparable(value) {
  7126. return value === value && !isObject(value);
  7127. }
  7128. /**
  7129. * A specialized version of `matchesProperty` for source values suitable
  7130. * for strict equality comparisons, i.e. `===`.
  7131. *
  7132. * @private
  7133. * @param {string} key The key of the property to get.
  7134. * @param {*} srcValue The value to match.
  7135. * @returns {Function} Returns the new spec function.
  7136. */
  7137. function matchesStrictComparable(key, srcValue) {
  7138. return function(object) {
  7139. if (object == null) {
  7140. return false;
  7141. }
  7142. return object[key] === srcValue &&
  7143. (srcValue !== undefined || (key in Object(object)));
  7144. };
  7145. }
  7146. /**
  7147. * A specialized version of `_.memoize` which clears the memoized function's
  7148. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7149. *
  7150. * @private
  7151. * @param {Function} func The function to have its output memoized.
  7152. * @returns {Function} Returns the new memoized function.
  7153. */
  7154. function memoizeCapped(func) {
  7155. var result = memoize(func, function(key) {
  7156. if (cache.size === MAX_MEMOIZE_SIZE) {
  7157. cache.clear();
  7158. }
  7159. return key;
  7160. });
  7161. var cache = result.cache;
  7162. return result;
  7163. }
  7164. /**
  7165. * Merges the function metadata of `source` into `data`.
  7166. *
  7167. * Merging metadata reduces the number of wrappers used to invoke a function.
  7168. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7169. * may be applied regardless of execution order. Methods like `_.ary` and
  7170. * `_.rearg` modify function arguments, making the order in which they are
  7171. * executed important, preventing the merging of metadata. However, we make
  7172. * an exception for a safe combined case where curried functions have `_.ary`
  7173. * and or `_.rearg` applied.
  7174. *
  7175. * @private
  7176. * @param {Array} data The destination metadata.
  7177. * @param {Array} source The source metadata.
  7178. * @returns {Array} Returns `data`.
  7179. */
  7180. function mergeData(data, source) {
  7181. var bitmask = data[1],
  7182. srcBitmask = source[1],
  7183. newBitmask = bitmask | srcBitmask,
  7184. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7185. var isCombo =
  7186. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7187. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7188. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7189. // Exit early if metadata can't be merged.
  7190. if (!(isCommon || isCombo)) {
  7191. return data;
  7192. }
  7193. // Use source `thisArg` if available.
  7194. if (srcBitmask & WRAP_BIND_FLAG) {
  7195. data[2] = source[2];
  7196. // Set when currying a bound function.
  7197. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7198. }
  7199. // Compose partial arguments.
  7200. var value = source[3];
  7201. if (value) {
  7202. var partials = data[3];
  7203. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7204. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7205. }
  7206. // Compose partial right arguments.
  7207. value = source[5];
  7208. if (value) {
  7209. partials = data[5];
  7210. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7211. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7212. }
  7213. // Use source `argPos` if available.
  7214. value = source[7];
  7215. if (value) {
  7216. data[7] = value;
  7217. }
  7218. // Use source `ary` if it's smaller.
  7219. if (srcBitmask & WRAP_ARY_FLAG) {
  7220. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7221. }
  7222. // Use source `arity` if one is not provided.
  7223. if (data[9] == null) {
  7224. data[9] = source[9];
  7225. }
  7226. // Use source `func` and merge bitmasks.
  7227. data[0] = source[0];
  7228. data[1] = newBitmask;
  7229. return data;
  7230. }
  7231. /**
  7232. * This function is like
  7233. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7234. * except that it includes inherited enumerable properties.
  7235. *
  7236. * @private
  7237. * @param {Object} object The object to query.
  7238. * @returns {Array} Returns the array of property names.
  7239. */
  7240. function nativeKeysIn(object) {
  7241. var result = [];
  7242. if (object != null) {
  7243. for (var key in Object(object)) {
  7244. result.push(key);
  7245. }
  7246. }
  7247. return result;
  7248. }
  7249. /**
  7250. * Converts `value` to a string using `Object.prototype.toString`.
  7251. *
  7252. * @private
  7253. * @param {*} value The value to convert.
  7254. * @returns {string} Returns the converted string.
  7255. */
  7256. function objectToString(value) {
  7257. return nativeObjectToString.call(value);
  7258. }
  7259. /**
  7260. * A specialized version of `baseRest` which transforms the rest array.
  7261. *
  7262. * @private
  7263. * @param {Function} func The function to apply a rest parameter to.
  7264. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7265. * @param {Function} transform The rest array transform.
  7266. * @returns {Function} Returns the new function.
  7267. */
  7268. function overRest(func, start, transform) {
  7269. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7270. return function() {
  7271. var args = arguments,
  7272. index = -1,
  7273. length = nativeMax(args.length - start, 0),
  7274. array = Array(length);
  7275. while (++index < length) {
  7276. array[index] = args[start + index];
  7277. }
  7278. index = -1;
  7279. var otherArgs = Array(start + 1);
  7280. while (++index < start) {
  7281. otherArgs[index] = args[index];
  7282. }
  7283. otherArgs[start] = transform(array);
  7284. return apply(func, this, otherArgs);
  7285. };
  7286. }
  7287. /**
  7288. * Gets the parent value at `path` of `object`.
  7289. *
  7290. * @private
  7291. * @param {Object} object The object to query.
  7292. * @param {Array} path The path to get the parent value of.
  7293. * @returns {*} Returns the parent value.
  7294. */
  7295. function parent(object, path) {
  7296. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7297. }
  7298. /**
  7299. * Reorder `array` according to the specified indexes where the element at
  7300. * the first index is assigned as the first element, the element at
  7301. * the second index is assigned as the second element, and so on.
  7302. *
  7303. * @private
  7304. * @param {Array} array The array to reorder.
  7305. * @param {Array} indexes The arranged array indexes.
  7306. * @returns {Array} Returns `array`.
  7307. */
  7308. function reorder(array, indexes) {
  7309. var arrLength = array.length,
  7310. length = nativeMin(indexes.length, arrLength),
  7311. oldArray = copyArray(array);
  7312. while (length--) {
  7313. var index = indexes[length];
  7314. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7315. }
  7316. return array;
  7317. }
  7318. /**
  7319. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7320. *
  7321. * @private
  7322. * @param {Object} object The object to query.
  7323. * @param {string} key The key of the property to get.
  7324. * @returns {*} Returns the property value.
  7325. */
  7326. function safeGet(object, key) {
  7327. if (key === 'constructor' && typeof object[key] === 'function') {
  7328. return;
  7329. }
  7330. if (key == '__proto__') {
  7331. return;
  7332. }
  7333. return object[key];
  7334. }
  7335. /**
  7336. * Sets metadata for `func`.
  7337. *
  7338. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7339. * period of time, it will trip its breaker and transition to an identity
  7340. * function to avoid garbage collection pauses in V8. See
  7341. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7342. * for more details.
  7343. *
  7344. * @private
  7345. * @param {Function} func The function to associate metadata with.
  7346. * @param {*} data The metadata.
  7347. * @returns {Function} Returns `func`.
  7348. */
  7349. var setData = shortOut(baseSetData);
  7350. /**
  7351. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7352. *
  7353. * @private
  7354. * @param {Function} func The function to delay.
  7355. * @param {number} wait The number of milliseconds to delay invocation.
  7356. * @returns {number|Object} Returns the timer id or timeout object.
  7357. */
  7358. var setTimeout = ctxSetTimeout || function(func, wait) {
  7359. return root.setTimeout(func, wait);
  7360. };
  7361. /**
  7362. * Sets the `toString` method of `func` to return `string`.
  7363. *
  7364. * @private
  7365. * @param {Function} func The function to modify.
  7366. * @param {Function} string The `toString` result.
  7367. * @returns {Function} Returns `func`.
  7368. */
  7369. var setToString = shortOut(baseSetToString);
  7370. /**
  7371. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7372. * with wrapper details in a comment at the top of the source body.
  7373. *
  7374. * @private
  7375. * @param {Function} wrapper The function to modify.
  7376. * @param {Function} reference The reference function.
  7377. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7378. * @returns {Function} Returns `wrapper`.
  7379. */
  7380. function setWrapToString(wrapper, reference, bitmask) {
  7381. var source = (reference + '');
  7382. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7383. }
  7384. /**
  7385. * Creates a function that'll short out and invoke `identity` instead
  7386. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7387. * milliseconds.
  7388. *
  7389. * @private
  7390. * @param {Function} func The function to restrict.
  7391. * @returns {Function} Returns the new shortable function.
  7392. */
  7393. function shortOut(func) {
  7394. var count = 0,
  7395. lastCalled = 0;
  7396. return function() {
  7397. var stamp = nativeNow(),
  7398. remaining = HOT_SPAN - (stamp - lastCalled);
  7399. lastCalled = stamp;
  7400. if (remaining > 0) {
  7401. if (++count >= HOT_COUNT) {
  7402. return arguments[0];
  7403. }
  7404. } else {
  7405. count = 0;
  7406. }
  7407. return func.apply(undefined, arguments);
  7408. };
  7409. }
  7410. /**
  7411. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7412. *
  7413. * @private
  7414. * @param {Array} array The array to shuffle.
  7415. * @param {number} [size=array.length] The size of `array`.
  7416. * @returns {Array} Returns `array`.
  7417. */
  7418. function shuffleSelf(array, size) {
  7419. var index = -1,
  7420. length = array.length,
  7421. lastIndex = length - 1;
  7422. size = size === undefined ? length : size;
  7423. while (++index < size) {
  7424. var rand = baseRandom(index, lastIndex),
  7425. value = array[rand];
  7426. array[rand] = array[index];
  7427. array[index] = value;
  7428. }
  7429. array.length = size;
  7430. return array;
  7431. }
  7432. /**
  7433. * Converts `string` to a property path array.
  7434. *
  7435. * @private
  7436. * @param {string} string The string to convert.
  7437. * @returns {Array} Returns the property path array.
  7438. */
  7439. var stringToPath = memoizeCapped(function(string) {
  7440. var result = [];
  7441. if (string.charCodeAt(0) === 46 /* . */) {
  7442. result.push('');
  7443. }
  7444. string.replace(rePropName, function(match, number, quote, subString) {
  7445. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7446. });
  7447. return result;
  7448. });
  7449. /**
  7450. * Converts `value` to a string key if it's not a string or symbol.
  7451. *
  7452. * @private
  7453. * @param {*} value The value to inspect.
  7454. * @returns {string|symbol} Returns the key.
  7455. */
  7456. function toKey(value) {
  7457. if (typeof value == 'string' || isSymbol(value)) {
  7458. return value;
  7459. }
  7460. var result = (value + '');
  7461. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7462. }
  7463. /**
  7464. * Converts `func` to its source code.
  7465. *
  7466. * @private
  7467. * @param {Function} func The function to convert.
  7468. * @returns {string} Returns the source code.
  7469. */
  7470. function toSource(func) {
  7471. if (func != null) {
  7472. try {
  7473. return funcToString.call(func);
  7474. } catch (e) {}
  7475. try {
  7476. return (func + '');
  7477. } catch (e) {}
  7478. }
  7479. return '';
  7480. }
  7481. /**
  7482. * Updates wrapper `details` based on `bitmask` flags.
  7483. *
  7484. * @private
  7485. * @returns {Array} details The details to modify.
  7486. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7487. * @returns {Array} Returns `details`.
  7488. */
  7489. function updateWrapDetails(details, bitmask) {
  7490. arrayEach(wrapFlags, function(pair) {
  7491. var value = '_.' + pair[0];
  7492. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7493. details.push(value);
  7494. }
  7495. });
  7496. return details.sort();
  7497. }
  7498. /**
  7499. * Creates a clone of `wrapper`.
  7500. *
  7501. * @private
  7502. * @param {Object} wrapper The wrapper to clone.
  7503. * @returns {Object} Returns the cloned wrapper.
  7504. */
  7505. function wrapperClone(wrapper) {
  7506. if (wrapper instanceof LazyWrapper) {
  7507. return wrapper.clone();
  7508. }
  7509. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7510. result.__actions__ = copyArray(wrapper.__actions__);
  7511. result.__index__ = wrapper.__index__;
  7512. result.__values__ = wrapper.__values__;
  7513. return result;
  7514. }
  7515. /*------------------------------------------------------------------------*/
  7516. /**
  7517. * Creates an array of elements split into groups the length of `size`.
  7518. * If `array` can't be split evenly, the final chunk will be the remaining
  7519. * elements.
  7520. *
  7521. * @static
  7522. * @memberOf _
  7523. * @since 3.0.0
  7524. * @category Array
  7525. * @param {Array} array The array to process.
  7526. * @param {number} [size=1] The length of each chunk
  7527. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7528. * @returns {Array} Returns the new array of chunks.
  7529. * @example
  7530. *
  7531. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7532. * // => [['a', 'b'], ['c', 'd']]
  7533. *
  7534. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7535. * // => [['a', 'b', 'c'], ['d']]
  7536. */
  7537. function chunk(array, size, guard) {
  7538. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7539. size = 1;
  7540. } else {
  7541. size = nativeMax(toInteger(size), 0);
  7542. }
  7543. var length = array == null ? 0 : array.length;
  7544. if (!length || size < 1) {
  7545. return [];
  7546. }
  7547. var index = 0,
  7548. resIndex = 0,
  7549. result = Array(nativeCeil(length / size));
  7550. while (index < length) {
  7551. result[resIndex++] = baseSlice(array, index, (index += size));
  7552. }
  7553. return result;
  7554. }
  7555. /**
  7556. * Creates an array with all falsey values removed. The values `false`, `null`,
  7557. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7558. *
  7559. * @static
  7560. * @memberOf _
  7561. * @since 0.1.0
  7562. * @category Array
  7563. * @param {Array} array The array to compact.
  7564. * @returns {Array} Returns the new array of filtered values.
  7565. * @example
  7566. *
  7567. * _.compact([0, 1, false, 2, '', 3]);
  7568. * // => [1, 2, 3]
  7569. */
  7570. function compact(array) {
  7571. var index = -1,
  7572. length = array == null ? 0 : array.length,
  7573. resIndex = 0,
  7574. result = [];
  7575. while (++index < length) {
  7576. var value = array[index];
  7577. if (value) {
  7578. result[resIndex++] = value;
  7579. }
  7580. }
  7581. return result;
  7582. }
  7583. /**
  7584. * Creates a new array concatenating `array` with any additional arrays
  7585. * and/or values.
  7586. *
  7587. * @static
  7588. * @memberOf _
  7589. * @since 4.0.0
  7590. * @category Array
  7591. * @param {Array} array The array to concatenate.
  7592. * @param {...*} [values] The values to concatenate.
  7593. * @returns {Array} Returns the new concatenated array.
  7594. * @example
  7595. *
  7596. * var array = [1];
  7597. * var other = _.concat(array, 2, [3], [[4]]);
  7598. *
  7599. * console.log(other);
  7600. * // => [1, 2, 3, [4]]
  7601. *
  7602. * console.log(array);
  7603. * // => [1]
  7604. */
  7605. function concat() {
  7606. var length = arguments.length;
  7607. if (!length) {
  7608. return [];
  7609. }
  7610. var args = Array(length - 1),
  7611. array = arguments[0],
  7612. index = length;
  7613. while (index--) {
  7614. args[index - 1] = arguments[index];
  7615. }
  7616. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7617. }
  7618. /**
  7619. * Creates an array of `array` values not included in the other given arrays
  7620. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7621. * for equality comparisons. The order and references of result values are
  7622. * determined by the first array.
  7623. *
  7624. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7625. *
  7626. * @static
  7627. * @memberOf _
  7628. * @since 0.1.0
  7629. * @category Array
  7630. * @param {Array} array The array to inspect.
  7631. * @param {...Array} [values] The values to exclude.
  7632. * @returns {Array} Returns the new array of filtered values.
  7633. * @see _.without, _.xor
  7634. * @example
  7635. *
  7636. * _.difference([2, 1], [2, 3]);
  7637. * // => [1]
  7638. */
  7639. var difference = baseRest(function(array, values) {
  7640. return isArrayLikeObject(array)
  7641. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7642. : [];
  7643. });
  7644. /**
  7645. * This method is like `_.difference` except that it accepts `iteratee` which
  7646. * is invoked for each element of `array` and `values` to generate the criterion
  7647. * by which they're compared. The order and references of result values are
  7648. * determined by the first array. The iteratee is invoked with one argument:
  7649. * (value).
  7650. *
  7651. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7652. *
  7653. * @static
  7654. * @memberOf _
  7655. * @since 4.0.0
  7656. * @category Array
  7657. * @param {Array} array The array to inspect.
  7658. * @param {...Array} [values] The values to exclude.
  7659. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7660. * @returns {Array} Returns the new array of filtered values.
  7661. * @example
  7662. *
  7663. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7664. * // => [1.2]
  7665. *
  7666. * // The `_.property` iteratee shorthand.
  7667. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7668. * // => [{ 'x': 2 }]
  7669. */
  7670. var differenceBy = baseRest(function(array, values) {
  7671. var iteratee = last(values);
  7672. if (isArrayLikeObject(iteratee)) {
  7673. iteratee = undefined;
  7674. }
  7675. return isArrayLikeObject(array)
  7676. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7677. : [];
  7678. });
  7679. /**
  7680. * This method is like `_.difference` except that it accepts `comparator`
  7681. * which is invoked to compare elements of `array` to `values`. The order and
  7682. * references of result values are determined by the first array. The comparator
  7683. * is invoked with two arguments: (arrVal, othVal).
  7684. *
  7685. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7686. *
  7687. * @static
  7688. * @memberOf _
  7689. * @since 4.0.0
  7690. * @category Array
  7691. * @param {Array} array The array to inspect.
  7692. * @param {...Array} [values] The values to exclude.
  7693. * @param {Function} [comparator] The comparator invoked per element.
  7694. * @returns {Array} Returns the new array of filtered values.
  7695. * @example
  7696. *
  7697. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7698. *
  7699. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7700. * // => [{ 'x': 2, 'y': 1 }]
  7701. */
  7702. var differenceWith = baseRest(function(array, values) {
  7703. var comparator = last(values);
  7704. if (isArrayLikeObject(comparator)) {
  7705. comparator = undefined;
  7706. }
  7707. return isArrayLikeObject(array)
  7708. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7709. : [];
  7710. });
  7711. /**
  7712. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7713. *
  7714. * @static
  7715. * @memberOf _
  7716. * @since 0.5.0
  7717. * @category Array
  7718. * @param {Array} array The array to query.
  7719. * @param {number} [n=1] The number of elements to drop.
  7720. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7721. * @returns {Array} Returns the slice of `array`.
  7722. * @example
  7723. *
  7724. * _.drop([1, 2, 3]);
  7725. * // => [2, 3]
  7726. *
  7727. * _.drop([1, 2, 3], 2);
  7728. * // => [3]
  7729. *
  7730. * _.drop([1, 2, 3], 5);
  7731. * // => []
  7732. *
  7733. * _.drop([1, 2, 3], 0);
  7734. * // => [1, 2, 3]
  7735. */
  7736. function drop(array, n, guard) {
  7737. var length = array == null ? 0 : array.length;
  7738. if (!length) {
  7739. return [];
  7740. }
  7741. n = (guard || n === undefined) ? 1 : toInteger(n);
  7742. return baseSlice(array, n < 0 ? 0 : n, length);
  7743. }
  7744. /**
  7745. * Creates a slice of `array` with `n` elements dropped from the end.
  7746. *
  7747. * @static
  7748. * @memberOf _
  7749. * @since 3.0.0
  7750. * @category Array
  7751. * @param {Array} array The array to query.
  7752. * @param {number} [n=1] The number of elements to drop.
  7753. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7754. * @returns {Array} Returns the slice of `array`.
  7755. * @example
  7756. *
  7757. * _.dropRight([1, 2, 3]);
  7758. * // => [1, 2]
  7759. *
  7760. * _.dropRight([1, 2, 3], 2);
  7761. * // => [1]
  7762. *
  7763. * _.dropRight([1, 2, 3], 5);
  7764. * // => []
  7765. *
  7766. * _.dropRight([1, 2, 3], 0);
  7767. * // => [1, 2, 3]
  7768. */
  7769. function dropRight(array, n, guard) {
  7770. var length = array == null ? 0 : array.length;
  7771. if (!length) {
  7772. return [];
  7773. }
  7774. n = (guard || n === undefined) ? 1 : toInteger(n);
  7775. n = length - n;
  7776. return baseSlice(array, 0, n < 0 ? 0 : n);
  7777. }
  7778. /**
  7779. * Creates a slice of `array` excluding elements dropped from the end.
  7780. * Elements are dropped until `predicate` returns falsey. The predicate is
  7781. * invoked with three arguments: (value, index, array).
  7782. *
  7783. * @static
  7784. * @memberOf _
  7785. * @since 3.0.0
  7786. * @category Array
  7787. * @param {Array} array The array to query.
  7788. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7789. * @returns {Array} Returns the slice of `array`.
  7790. * @example
  7791. *
  7792. * var users = [
  7793. * { 'user': 'barney', 'active': true },
  7794. * { 'user': 'fred', 'active': false },
  7795. * { 'user': 'pebbles', 'active': false }
  7796. * ];
  7797. *
  7798. * _.dropRightWhile(users, function(o) { return !o.active; });
  7799. * // => objects for ['barney']
  7800. *
  7801. * // The `_.matches` iteratee shorthand.
  7802. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7803. * // => objects for ['barney', 'fred']
  7804. *
  7805. * // The `_.matchesProperty` iteratee shorthand.
  7806. * _.dropRightWhile(users, ['active', false]);
  7807. * // => objects for ['barney']
  7808. *
  7809. * // The `_.property` iteratee shorthand.
  7810. * _.dropRightWhile(users, 'active');
  7811. * // => objects for ['barney', 'fred', 'pebbles']
  7812. */
  7813. function dropRightWhile(array, predicate) {
  7814. return (array && array.length)
  7815. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7816. : [];
  7817. }
  7818. /**
  7819. * Creates a slice of `array` excluding elements dropped from the beginning.
  7820. * Elements are dropped until `predicate` returns falsey. The predicate is
  7821. * invoked with three arguments: (value, index, array).
  7822. *
  7823. * @static
  7824. * @memberOf _
  7825. * @since 3.0.0
  7826. * @category Array
  7827. * @param {Array} array The array to query.
  7828. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7829. * @returns {Array} Returns the slice of `array`.
  7830. * @example
  7831. *
  7832. * var users = [
  7833. * { 'user': 'barney', 'active': false },
  7834. * { 'user': 'fred', 'active': false },
  7835. * { 'user': 'pebbles', 'active': true }
  7836. * ];
  7837. *
  7838. * _.dropWhile(users, function(o) { return !o.active; });
  7839. * // => objects for ['pebbles']
  7840. *
  7841. * // The `_.matches` iteratee shorthand.
  7842. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7843. * // => objects for ['fred', 'pebbles']
  7844. *
  7845. * // The `_.matchesProperty` iteratee shorthand.
  7846. * _.dropWhile(users, ['active', false]);
  7847. * // => objects for ['pebbles']
  7848. *
  7849. * // The `_.property` iteratee shorthand.
  7850. * _.dropWhile(users, 'active');
  7851. * // => objects for ['barney', 'fred', 'pebbles']
  7852. */
  7853. function dropWhile(array, predicate) {
  7854. return (array && array.length)
  7855. ? baseWhile(array, getIteratee(predicate, 3), true)
  7856. : [];
  7857. }
  7858. /**
  7859. * Fills elements of `array` with `value` from `start` up to, but not
  7860. * including, `end`.
  7861. *
  7862. * **Note:** This method mutates `array`.
  7863. *
  7864. * @static
  7865. * @memberOf _
  7866. * @since 3.2.0
  7867. * @category Array
  7868. * @param {Array} array The array to fill.
  7869. * @param {*} value The value to fill `array` with.
  7870. * @param {number} [start=0] The start position.
  7871. * @param {number} [end=array.length] The end position.
  7872. * @returns {Array} Returns `array`.
  7873. * @example
  7874. *
  7875. * var array = [1, 2, 3];
  7876. *
  7877. * _.fill(array, 'a');
  7878. * console.log(array);
  7879. * // => ['a', 'a', 'a']
  7880. *
  7881. * _.fill(Array(3), 2);
  7882. * // => [2, 2, 2]
  7883. *
  7884. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7885. * // => [4, '*', '*', 10]
  7886. */
  7887. function fill(array, value, start, end) {
  7888. var length = array == null ? 0 : array.length;
  7889. if (!length) {
  7890. return [];
  7891. }
  7892. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7893. start = 0;
  7894. end = length;
  7895. }
  7896. return baseFill(array, value, start, end);
  7897. }
  7898. /**
  7899. * This method is like `_.find` except that it returns the index of the first
  7900. * element `predicate` returns truthy for instead of the element itself.
  7901. *
  7902. * @static
  7903. * @memberOf _
  7904. * @since 1.1.0
  7905. * @category Array
  7906. * @param {Array} array The array to inspect.
  7907. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7908. * @param {number} [fromIndex=0] The index to search from.
  7909. * @returns {number} Returns the index of the found element, else `-1`.
  7910. * @example
  7911. *
  7912. * var users = [
  7913. * { 'user': 'barney', 'active': false },
  7914. * { 'user': 'fred', 'active': false },
  7915. * { 'user': 'pebbles', 'active': true }
  7916. * ];
  7917. *
  7918. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7919. * // => 0
  7920. *
  7921. * // The `_.matches` iteratee shorthand.
  7922. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7923. * // => 1
  7924. *
  7925. * // The `_.matchesProperty` iteratee shorthand.
  7926. * _.findIndex(users, ['active', false]);
  7927. * // => 0
  7928. *
  7929. * // The `_.property` iteratee shorthand.
  7930. * _.findIndex(users, 'active');
  7931. * // => 2
  7932. */
  7933. function findIndex(array, predicate, fromIndex) {
  7934. var length = array == null ? 0 : array.length;
  7935. if (!length) {
  7936. return -1;
  7937. }
  7938. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7939. if (index < 0) {
  7940. index = nativeMax(length + index, 0);
  7941. }
  7942. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7943. }
  7944. /**
  7945. * This method is like `_.findIndex` except that it iterates over elements
  7946. * of `collection` from right to left.
  7947. *
  7948. * @static
  7949. * @memberOf _
  7950. * @since 2.0.0
  7951. * @category Array
  7952. * @param {Array} array The array to inspect.
  7953. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7954. * @param {number} [fromIndex=array.length-1] The index to search from.
  7955. * @returns {number} Returns the index of the found element, else `-1`.
  7956. * @example
  7957. *
  7958. * var users = [
  7959. * { 'user': 'barney', 'active': true },
  7960. * { 'user': 'fred', 'active': false },
  7961. * { 'user': 'pebbles', 'active': false }
  7962. * ];
  7963. *
  7964. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7965. * // => 2
  7966. *
  7967. * // The `_.matches` iteratee shorthand.
  7968. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7969. * // => 0
  7970. *
  7971. * // The `_.matchesProperty` iteratee shorthand.
  7972. * _.findLastIndex(users, ['active', false]);
  7973. * // => 2
  7974. *
  7975. * // The `_.property` iteratee shorthand.
  7976. * _.findLastIndex(users, 'active');
  7977. * // => 0
  7978. */
  7979. function findLastIndex(array, predicate, fromIndex) {
  7980. var length = array == null ? 0 : array.length;
  7981. if (!length) {
  7982. return -1;
  7983. }
  7984. var index = length - 1;
  7985. if (fromIndex !== undefined) {
  7986. index = toInteger(fromIndex);
  7987. index = fromIndex < 0
  7988. ? nativeMax(length + index, 0)
  7989. : nativeMin(index, length - 1);
  7990. }
  7991. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7992. }
  7993. /**
  7994. * Flattens `array` a single level deep.
  7995. *
  7996. * @static
  7997. * @memberOf _
  7998. * @since 0.1.0
  7999. * @category Array
  8000. * @param {Array} array The array to flatten.
  8001. * @returns {Array} Returns the new flattened array.
  8002. * @example
  8003. *
  8004. * _.flatten([1, [2, [3, [4]], 5]]);
  8005. * // => [1, 2, [3, [4]], 5]
  8006. */
  8007. function flatten(array) {
  8008. var length = array == null ? 0 : array.length;
  8009. return length ? baseFlatten(array, 1) : [];
  8010. }
  8011. /**
  8012. * Recursively flattens `array`.
  8013. *
  8014. * @static
  8015. * @memberOf _
  8016. * @since 3.0.0
  8017. * @category Array
  8018. * @param {Array} array The array to flatten.
  8019. * @returns {Array} Returns the new flattened array.
  8020. * @example
  8021. *
  8022. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8023. * // => [1, 2, 3, 4, 5]
  8024. */
  8025. function flattenDeep(array) {
  8026. var length = array == null ? 0 : array.length;
  8027. return length ? baseFlatten(array, INFINITY) : [];
  8028. }
  8029. /**
  8030. * Recursively flatten `array` up to `depth` times.
  8031. *
  8032. * @static
  8033. * @memberOf _
  8034. * @since 4.4.0
  8035. * @category Array
  8036. * @param {Array} array The array to flatten.
  8037. * @param {number} [depth=1] The maximum recursion depth.
  8038. * @returns {Array} Returns the new flattened array.
  8039. * @example
  8040. *
  8041. * var array = [1, [2, [3, [4]], 5]];
  8042. *
  8043. * _.flattenDepth(array, 1);
  8044. * // => [1, 2, [3, [4]], 5]
  8045. *
  8046. * _.flattenDepth(array, 2);
  8047. * // => [1, 2, 3, [4], 5]
  8048. */
  8049. function flattenDepth(array, depth) {
  8050. var length = array == null ? 0 : array.length;
  8051. if (!length) {
  8052. return [];
  8053. }
  8054. depth = depth === undefined ? 1 : toInteger(depth);
  8055. return baseFlatten(array, depth);
  8056. }
  8057. /**
  8058. * The inverse of `_.toPairs`; this method returns an object composed
  8059. * from key-value `pairs`.
  8060. *
  8061. * @static
  8062. * @memberOf _
  8063. * @since 4.0.0
  8064. * @category Array
  8065. * @param {Array} pairs The key-value pairs.
  8066. * @returns {Object} Returns the new object.
  8067. * @example
  8068. *
  8069. * _.fromPairs([['a', 1], ['b', 2]]);
  8070. * // => { 'a': 1, 'b': 2 }
  8071. */
  8072. function fromPairs(pairs) {
  8073. var index = -1,
  8074. length = pairs == null ? 0 : pairs.length,
  8075. result = {};
  8076. while (++index < length) {
  8077. var pair = pairs[index];
  8078. result[pair[0]] = pair[1];
  8079. }
  8080. return result;
  8081. }
  8082. /**
  8083. * Gets the first element of `array`.
  8084. *
  8085. * @static
  8086. * @memberOf _
  8087. * @since 0.1.0
  8088. * @alias first
  8089. * @category Array
  8090. * @param {Array} array The array to query.
  8091. * @returns {*} Returns the first element of `array`.
  8092. * @example
  8093. *
  8094. * _.head([1, 2, 3]);
  8095. * // => 1
  8096. *
  8097. * _.head([]);
  8098. * // => undefined
  8099. */
  8100. function head(array) {
  8101. return (array && array.length) ? array[0] : undefined;
  8102. }
  8103. /**
  8104. * Gets the index at which the first occurrence of `value` is found in `array`
  8105. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8106. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8107. * offset from the end of `array`.
  8108. *
  8109. * @static
  8110. * @memberOf _
  8111. * @since 0.1.0
  8112. * @category Array
  8113. * @param {Array} array The array to inspect.
  8114. * @param {*} value The value to search for.
  8115. * @param {number} [fromIndex=0] The index to search from.
  8116. * @returns {number} Returns the index of the matched value, else `-1`.
  8117. * @example
  8118. *
  8119. * _.indexOf([1, 2, 1, 2], 2);
  8120. * // => 1
  8121. *
  8122. * // Search from the `fromIndex`.
  8123. * _.indexOf([1, 2, 1, 2], 2, 2);
  8124. * // => 3
  8125. */
  8126. function indexOf(array, value, fromIndex) {
  8127. var length = array == null ? 0 : array.length;
  8128. if (!length) {
  8129. return -1;
  8130. }
  8131. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8132. if (index < 0) {
  8133. index = nativeMax(length + index, 0);
  8134. }
  8135. return baseIndexOf(array, value, index);
  8136. }
  8137. /**
  8138. * Gets all but the last element of `array`.
  8139. *
  8140. * @static
  8141. * @memberOf _
  8142. * @since 0.1.0
  8143. * @category Array
  8144. * @param {Array} array The array to query.
  8145. * @returns {Array} Returns the slice of `array`.
  8146. * @example
  8147. *
  8148. * _.initial([1, 2, 3]);
  8149. * // => [1, 2]
  8150. */
  8151. function initial(array) {
  8152. var length = array == null ? 0 : array.length;
  8153. return length ? baseSlice(array, 0, -1) : [];
  8154. }
  8155. /**
  8156. * Creates an array of unique values that are included in all given arrays
  8157. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8158. * for equality comparisons. The order and references of result values are
  8159. * determined by the first array.
  8160. *
  8161. * @static
  8162. * @memberOf _
  8163. * @since 0.1.0
  8164. * @category Array
  8165. * @param {...Array} [arrays] The arrays to inspect.
  8166. * @returns {Array} Returns the new array of intersecting values.
  8167. * @example
  8168. *
  8169. * _.intersection([2, 1], [2, 3]);
  8170. * // => [2]
  8171. */
  8172. var intersection = baseRest(function(arrays) {
  8173. var mapped = arrayMap(arrays, castArrayLikeObject);
  8174. return (mapped.length && mapped[0] === arrays[0])
  8175. ? baseIntersection(mapped)
  8176. : [];
  8177. });
  8178. /**
  8179. * This method is like `_.intersection` except that it accepts `iteratee`
  8180. * which is invoked for each element of each `arrays` to generate the criterion
  8181. * by which they're compared. The order and references of result values are
  8182. * determined by the first array. The iteratee is invoked with one argument:
  8183. * (value).
  8184. *
  8185. * @static
  8186. * @memberOf _
  8187. * @since 4.0.0
  8188. * @category Array
  8189. * @param {...Array} [arrays] The arrays to inspect.
  8190. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8191. * @returns {Array} Returns the new array of intersecting values.
  8192. * @example
  8193. *
  8194. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8195. * // => [2.1]
  8196. *
  8197. * // The `_.property` iteratee shorthand.
  8198. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8199. * // => [{ 'x': 1 }]
  8200. */
  8201. var intersectionBy = baseRest(function(arrays) {
  8202. var iteratee = last(arrays),
  8203. mapped = arrayMap(arrays, castArrayLikeObject);
  8204. if (iteratee === last(mapped)) {
  8205. iteratee = undefined;
  8206. } else {
  8207. mapped.pop();
  8208. }
  8209. return (mapped.length && mapped[0] === arrays[0])
  8210. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8211. : [];
  8212. });
  8213. /**
  8214. * This method is like `_.intersection` except that it accepts `comparator`
  8215. * which is invoked to compare elements of `arrays`. The order and references
  8216. * of result values are determined by the first array. The comparator is
  8217. * invoked with two arguments: (arrVal, othVal).
  8218. *
  8219. * @static
  8220. * @memberOf _
  8221. * @since 4.0.0
  8222. * @category Array
  8223. * @param {...Array} [arrays] The arrays to inspect.
  8224. * @param {Function} [comparator] The comparator invoked per element.
  8225. * @returns {Array} Returns the new array of intersecting values.
  8226. * @example
  8227. *
  8228. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8229. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8230. *
  8231. * _.intersectionWith(objects, others, _.isEqual);
  8232. * // => [{ 'x': 1, 'y': 2 }]
  8233. */
  8234. var intersectionWith = baseRest(function(arrays) {
  8235. var comparator = last(arrays),
  8236. mapped = arrayMap(arrays, castArrayLikeObject);
  8237. comparator = typeof comparator == 'function' ? comparator : undefined;
  8238. if (comparator) {
  8239. mapped.pop();
  8240. }
  8241. return (mapped.length && mapped[0] === arrays[0])
  8242. ? baseIntersection(mapped, undefined, comparator)
  8243. : [];
  8244. });
  8245. /**
  8246. * Converts all elements in `array` into a string separated by `separator`.
  8247. *
  8248. * @static
  8249. * @memberOf _
  8250. * @since 4.0.0
  8251. * @category Array
  8252. * @param {Array} array The array to convert.
  8253. * @param {string} [separator=','] The element separator.
  8254. * @returns {string} Returns the joined string.
  8255. * @example
  8256. *
  8257. * _.join(['a', 'b', 'c'], '~');
  8258. * // => 'a~b~c'
  8259. */
  8260. function join(array, separator) {
  8261. return array == null ? '' : nativeJoin.call(array, separator);
  8262. }
  8263. /**
  8264. * Gets the last element of `array`.
  8265. *
  8266. * @static
  8267. * @memberOf _
  8268. * @since 0.1.0
  8269. * @category Array
  8270. * @param {Array} array The array to query.
  8271. * @returns {*} Returns the last element of `array`.
  8272. * @example
  8273. *
  8274. * _.last([1, 2, 3]);
  8275. * // => 3
  8276. */
  8277. function last(array) {
  8278. var length = array == null ? 0 : array.length;
  8279. return length ? array[length - 1] : undefined;
  8280. }
  8281. /**
  8282. * This method is like `_.indexOf` except that it iterates over elements of
  8283. * `array` from right to left.
  8284. *
  8285. * @static
  8286. * @memberOf _
  8287. * @since 0.1.0
  8288. * @category Array
  8289. * @param {Array} array The array to inspect.
  8290. * @param {*} value The value to search for.
  8291. * @param {number} [fromIndex=array.length-1] The index to search from.
  8292. * @returns {number} Returns the index of the matched value, else `-1`.
  8293. * @example
  8294. *
  8295. * _.lastIndexOf([1, 2, 1, 2], 2);
  8296. * // => 3
  8297. *
  8298. * // Search from the `fromIndex`.
  8299. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8300. * // => 1
  8301. */
  8302. function lastIndexOf(array, value, fromIndex) {
  8303. var length = array == null ? 0 : array.length;
  8304. if (!length) {
  8305. return -1;
  8306. }
  8307. var index = length;
  8308. if (fromIndex !== undefined) {
  8309. index = toInteger(fromIndex);
  8310. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8311. }
  8312. return value === value
  8313. ? strictLastIndexOf(array, value, index)
  8314. : baseFindIndex(array, baseIsNaN, index, true);
  8315. }
  8316. /**
  8317. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8318. * element from the end is returned.
  8319. *
  8320. * @static
  8321. * @memberOf _
  8322. * @since 4.11.0
  8323. * @category Array
  8324. * @param {Array} array The array to query.
  8325. * @param {number} [n=0] The index of the element to return.
  8326. * @returns {*} Returns the nth element of `array`.
  8327. * @example
  8328. *
  8329. * var array = ['a', 'b', 'c', 'd'];
  8330. *
  8331. * _.nth(array, 1);
  8332. * // => 'b'
  8333. *
  8334. * _.nth(array, -2);
  8335. * // => 'c';
  8336. */
  8337. function nth(array, n) {
  8338. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8339. }
  8340. /**
  8341. * Removes all given values from `array` using
  8342. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8343. * for equality comparisons.
  8344. *
  8345. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8346. * to remove elements from an array by predicate.
  8347. *
  8348. * @static
  8349. * @memberOf _
  8350. * @since 2.0.0
  8351. * @category Array
  8352. * @param {Array} array The array to modify.
  8353. * @param {...*} [values] The values to remove.
  8354. * @returns {Array} Returns `array`.
  8355. * @example
  8356. *
  8357. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8358. *
  8359. * _.pull(array, 'a', 'c');
  8360. * console.log(array);
  8361. * // => ['b', 'b']
  8362. */
  8363. var pull = baseRest(pullAll);
  8364. /**
  8365. * This method is like `_.pull` except that it accepts an array of values to remove.
  8366. *
  8367. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8368. *
  8369. * @static
  8370. * @memberOf _
  8371. * @since 4.0.0
  8372. * @category Array
  8373. * @param {Array} array The array to modify.
  8374. * @param {Array} values The values to remove.
  8375. * @returns {Array} Returns `array`.
  8376. * @example
  8377. *
  8378. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8379. *
  8380. * _.pullAll(array, ['a', 'c']);
  8381. * console.log(array);
  8382. * // => ['b', 'b']
  8383. */
  8384. function pullAll(array, values) {
  8385. return (array && array.length && values && values.length)
  8386. ? basePullAll(array, values)
  8387. : array;
  8388. }
  8389. /**
  8390. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8391. * invoked for each element of `array` and `values` to generate the criterion
  8392. * by which they're compared. The iteratee is invoked with one argument: (value).
  8393. *
  8394. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8395. *
  8396. * @static
  8397. * @memberOf _
  8398. * @since 4.0.0
  8399. * @category Array
  8400. * @param {Array} array The array to modify.
  8401. * @param {Array} values The values to remove.
  8402. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8403. * @returns {Array} Returns `array`.
  8404. * @example
  8405. *
  8406. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8407. *
  8408. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8409. * console.log(array);
  8410. * // => [{ 'x': 2 }]
  8411. */
  8412. function pullAllBy(array, values, iteratee) {
  8413. return (array && array.length && values && values.length)
  8414. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8415. : array;
  8416. }
  8417. /**
  8418. * This method is like `_.pullAll` except that it accepts `comparator` which
  8419. * is invoked to compare elements of `array` to `values`. The comparator is
  8420. * invoked with two arguments: (arrVal, othVal).
  8421. *
  8422. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8423. *
  8424. * @static
  8425. * @memberOf _
  8426. * @since 4.6.0
  8427. * @category Array
  8428. * @param {Array} array The array to modify.
  8429. * @param {Array} values The values to remove.
  8430. * @param {Function} [comparator] The comparator invoked per element.
  8431. * @returns {Array} Returns `array`.
  8432. * @example
  8433. *
  8434. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8435. *
  8436. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8437. * console.log(array);
  8438. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8439. */
  8440. function pullAllWith(array, values, comparator) {
  8441. return (array && array.length && values && values.length)
  8442. ? basePullAll(array, values, undefined, comparator)
  8443. : array;
  8444. }
  8445. /**
  8446. * Removes elements from `array` corresponding to `indexes` and returns an
  8447. * array of removed elements.
  8448. *
  8449. * **Note:** Unlike `_.at`, this method mutates `array`.
  8450. *
  8451. * @static
  8452. * @memberOf _
  8453. * @since 3.0.0
  8454. * @category Array
  8455. * @param {Array} array The array to modify.
  8456. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8457. * @returns {Array} Returns the new array of removed elements.
  8458. * @example
  8459. *
  8460. * var array = ['a', 'b', 'c', 'd'];
  8461. * var pulled = _.pullAt(array, [1, 3]);
  8462. *
  8463. * console.log(array);
  8464. * // => ['a', 'c']
  8465. *
  8466. * console.log(pulled);
  8467. * // => ['b', 'd']
  8468. */
  8469. var pullAt = flatRest(function(array, indexes) {
  8470. var length = array == null ? 0 : array.length,
  8471. result = baseAt(array, indexes);
  8472. basePullAt(array, arrayMap(indexes, function(index) {
  8473. return isIndex(index, length) ? +index : index;
  8474. }).sort(compareAscending));
  8475. return result;
  8476. });
  8477. /**
  8478. * Removes all elements from `array` that `predicate` returns truthy for
  8479. * and returns an array of the removed elements. The predicate is invoked
  8480. * with three arguments: (value, index, array).
  8481. *
  8482. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8483. * to pull elements from an array by value.
  8484. *
  8485. * @static
  8486. * @memberOf _
  8487. * @since 2.0.0
  8488. * @category Array
  8489. * @param {Array} array The array to modify.
  8490. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8491. * @returns {Array} Returns the new array of removed elements.
  8492. * @example
  8493. *
  8494. * var array = [1, 2, 3, 4];
  8495. * var evens = _.remove(array, function(n) {
  8496. * return n % 2 == 0;
  8497. * });
  8498. *
  8499. * console.log(array);
  8500. * // => [1, 3]
  8501. *
  8502. * console.log(evens);
  8503. * // => [2, 4]
  8504. */
  8505. function remove(array, predicate) {
  8506. var result = [];
  8507. if (!(array && array.length)) {
  8508. return result;
  8509. }
  8510. var index = -1,
  8511. indexes = [],
  8512. length = array.length;
  8513. predicate = getIteratee(predicate, 3);
  8514. while (++index < length) {
  8515. var value = array[index];
  8516. if (predicate(value, index, array)) {
  8517. result.push(value);
  8518. indexes.push(index);
  8519. }
  8520. }
  8521. basePullAt(array, indexes);
  8522. return result;
  8523. }
  8524. /**
  8525. * Reverses `array` so that the first element becomes the last, the second
  8526. * element becomes the second to last, and so on.
  8527. *
  8528. * **Note:** This method mutates `array` and is based on
  8529. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8530. *
  8531. * @static
  8532. * @memberOf _
  8533. * @since 4.0.0
  8534. * @category Array
  8535. * @param {Array} array The array to modify.
  8536. * @returns {Array} Returns `array`.
  8537. * @example
  8538. *
  8539. * var array = [1, 2, 3];
  8540. *
  8541. * _.reverse(array);
  8542. * // => [3, 2, 1]
  8543. *
  8544. * console.log(array);
  8545. * // => [3, 2, 1]
  8546. */
  8547. function reverse(array) {
  8548. return array == null ? array : nativeReverse.call(array);
  8549. }
  8550. /**
  8551. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8552. *
  8553. * **Note:** This method is used instead of
  8554. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8555. * returned.
  8556. *
  8557. * @static
  8558. * @memberOf _
  8559. * @since 3.0.0
  8560. * @category Array
  8561. * @param {Array} array The array to slice.
  8562. * @param {number} [start=0] The start position.
  8563. * @param {number} [end=array.length] The end position.
  8564. * @returns {Array} Returns the slice of `array`.
  8565. */
  8566. function slice(array, start, end) {
  8567. var length = array == null ? 0 : array.length;
  8568. if (!length) {
  8569. return [];
  8570. }
  8571. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8572. start = 0;
  8573. end = length;
  8574. }
  8575. else {
  8576. start = start == null ? 0 : toInteger(start);
  8577. end = end === undefined ? length : toInteger(end);
  8578. }
  8579. return baseSlice(array, start, end);
  8580. }
  8581. /**
  8582. * Uses a binary search to determine the lowest index at which `value`
  8583. * should be inserted into `array` in order to maintain its sort order.
  8584. *
  8585. * @static
  8586. * @memberOf _
  8587. * @since 0.1.0
  8588. * @category Array
  8589. * @param {Array} array The sorted array to inspect.
  8590. * @param {*} value The value to evaluate.
  8591. * @returns {number} Returns the index at which `value` should be inserted
  8592. * into `array`.
  8593. * @example
  8594. *
  8595. * _.sortedIndex([30, 50], 40);
  8596. * // => 1
  8597. */
  8598. function sortedIndex(array, value) {
  8599. return baseSortedIndex(array, value);
  8600. }
  8601. /**
  8602. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8603. * which is invoked for `value` and each element of `array` to compute their
  8604. * sort ranking. The iteratee is invoked with one argument: (value).
  8605. *
  8606. * @static
  8607. * @memberOf _
  8608. * @since 4.0.0
  8609. * @category Array
  8610. * @param {Array} array The sorted array to inspect.
  8611. * @param {*} value The value to evaluate.
  8612. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8613. * @returns {number} Returns the index at which `value` should be inserted
  8614. * into `array`.
  8615. * @example
  8616. *
  8617. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8618. *
  8619. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8620. * // => 0
  8621. *
  8622. * // The `_.property` iteratee shorthand.
  8623. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8624. * // => 0
  8625. */
  8626. function sortedIndexBy(array, value, iteratee) {
  8627. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8628. }
  8629. /**
  8630. * This method is like `_.indexOf` except that it performs a binary
  8631. * search on a sorted `array`.
  8632. *
  8633. * @static
  8634. * @memberOf _
  8635. * @since 4.0.0
  8636. * @category Array
  8637. * @param {Array} array The array to inspect.
  8638. * @param {*} value The value to search for.
  8639. * @returns {number} Returns the index of the matched value, else `-1`.
  8640. * @example
  8641. *
  8642. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8643. * // => 1
  8644. */
  8645. function sortedIndexOf(array, value) {
  8646. var length = array == null ? 0 : array.length;
  8647. if (length) {
  8648. var index = baseSortedIndex(array, value);
  8649. if (index < length && eq(array[index], value)) {
  8650. return index;
  8651. }
  8652. }
  8653. return -1;
  8654. }
  8655. /**
  8656. * This method is like `_.sortedIndex` except that it returns the highest
  8657. * index at which `value` should be inserted into `array` in order to
  8658. * maintain its sort order.
  8659. *
  8660. * @static
  8661. * @memberOf _
  8662. * @since 3.0.0
  8663. * @category Array
  8664. * @param {Array} array The sorted array to inspect.
  8665. * @param {*} value The value to evaluate.
  8666. * @returns {number} Returns the index at which `value` should be inserted
  8667. * into `array`.
  8668. * @example
  8669. *
  8670. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8671. * // => 4
  8672. */
  8673. function sortedLastIndex(array, value) {
  8674. return baseSortedIndex(array, value, true);
  8675. }
  8676. /**
  8677. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8678. * which is invoked for `value` and each element of `array` to compute their
  8679. * sort ranking. The iteratee is invoked with one argument: (value).
  8680. *
  8681. * @static
  8682. * @memberOf _
  8683. * @since 4.0.0
  8684. * @category Array
  8685. * @param {Array} array The sorted array to inspect.
  8686. * @param {*} value The value to evaluate.
  8687. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8688. * @returns {number} Returns the index at which `value` should be inserted
  8689. * into `array`.
  8690. * @example
  8691. *
  8692. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8693. *
  8694. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8695. * // => 1
  8696. *
  8697. * // The `_.property` iteratee shorthand.
  8698. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8699. * // => 1
  8700. */
  8701. function sortedLastIndexBy(array, value, iteratee) {
  8702. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8703. }
  8704. /**
  8705. * This method is like `_.lastIndexOf` except that it performs a binary
  8706. * search on a sorted `array`.
  8707. *
  8708. * @static
  8709. * @memberOf _
  8710. * @since 4.0.0
  8711. * @category Array
  8712. * @param {Array} array The array to inspect.
  8713. * @param {*} value The value to search for.
  8714. * @returns {number} Returns the index of the matched value, else `-1`.
  8715. * @example
  8716. *
  8717. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8718. * // => 3
  8719. */
  8720. function sortedLastIndexOf(array, value) {
  8721. var length = array == null ? 0 : array.length;
  8722. if (length) {
  8723. var index = baseSortedIndex(array, value, true) - 1;
  8724. if (eq(array[index], value)) {
  8725. return index;
  8726. }
  8727. }
  8728. return -1;
  8729. }
  8730. /**
  8731. * This method is like `_.uniq` except that it's designed and optimized
  8732. * for sorted arrays.
  8733. *
  8734. * @static
  8735. * @memberOf _
  8736. * @since 4.0.0
  8737. * @category Array
  8738. * @param {Array} array The array to inspect.
  8739. * @returns {Array} Returns the new duplicate free array.
  8740. * @example
  8741. *
  8742. * _.sortedUniq([1, 1, 2]);
  8743. * // => [1, 2]
  8744. */
  8745. function sortedUniq(array) {
  8746. return (array && array.length)
  8747. ? baseSortedUniq(array)
  8748. : [];
  8749. }
  8750. /**
  8751. * This method is like `_.uniqBy` except that it's designed and optimized
  8752. * for sorted arrays.
  8753. *
  8754. * @static
  8755. * @memberOf _
  8756. * @since 4.0.0
  8757. * @category Array
  8758. * @param {Array} array The array to inspect.
  8759. * @param {Function} [iteratee] The iteratee invoked per element.
  8760. * @returns {Array} Returns the new duplicate free array.
  8761. * @example
  8762. *
  8763. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8764. * // => [1.1, 2.3]
  8765. */
  8766. function sortedUniqBy(array, iteratee) {
  8767. return (array && array.length)
  8768. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8769. : [];
  8770. }
  8771. /**
  8772. * Gets all but the first element of `array`.
  8773. *
  8774. * @static
  8775. * @memberOf _
  8776. * @since 4.0.0
  8777. * @category Array
  8778. * @param {Array} array The array to query.
  8779. * @returns {Array} Returns the slice of `array`.
  8780. * @example
  8781. *
  8782. * _.tail([1, 2, 3]);
  8783. * // => [2, 3]
  8784. */
  8785. function tail(array) {
  8786. var length = array == null ? 0 : array.length;
  8787. return length ? baseSlice(array, 1, length) : [];
  8788. }
  8789. /**
  8790. * Creates a slice of `array` with `n` elements taken from the beginning.
  8791. *
  8792. * @static
  8793. * @memberOf _
  8794. * @since 0.1.0
  8795. * @category Array
  8796. * @param {Array} array The array to query.
  8797. * @param {number} [n=1] The number of elements to take.
  8798. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8799. * @returns {Array} Returns the slice of `array`.
  8800. * @example
  8801. *
  8802. * _.take([1, 2, 3]);
  8803. * // => [1]
  8804. *
  8805. * _.take([1, 2, 3], 2);
  8806. * // => [1, 2]
  8807. *
  8808. * _.take([1, 2, 3], 5);
  8809. * // => [1, 2, 3]
  8810. *
  8811. * _.take([1, 2, 3], 0);
  8812. * // => []
  8813. */
  8814. function take(array, n, guard) {
  8815. if (!(array && array.length)) {
  8816. return [];
  8817. }
  8818. n = (guard || n === undefined) ? 1 : toInteger(n);
  8819. return baseSlice(array, 0, n < 0 ? 0 : n);
  8820. }
  8821. /**
  8822. * Creates a slice of `array` with `n` elements taken from the end.
  8823. *
  8824. * @static
  8825. * @memberOf _
  8826. * @since 3.0.0
  8827. * @category Array
  8828. * @param {Array} array The array to query.
  8829. * @param {number} [n=1] The number of elements to take.
  8830. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8831. * @returns {Array} Returns the slice of `array`.
  8832. * @example
  8833. *
  8834. * _.takeRight([1, 2, 3]);
  8835. * // => [3]
  8836. *
  8837. * _.takeRight([1, 2, 3], 2);
  8838. * // => [2, 3]
  8839. *
  8840. * _.takeRight([1, 2, 3], 5);
  8841. * // => [1, 2, 3]
  8842. *
  8843. * _.takeRight([1, 2, 3], 0);
  8844. * // => []
  8845. */
  8846. function takeRight(array, n, guard) {
  8847. var length = array == null ? 0 : array.length;
  8848. if (!length) {
  8849. return [];
  8850. }
  8851. n = (guard || n === undefined) ? 1 : toInteger(n);
  8852. n = length - n;
  8853. return baseSlice(array, n < 0 ? 0 : n, length);
  8854. }
  8855. /**
  8856. * Creates a slice of `array` with elements taken from the end. Elements are
  8857. * taken until `predicate` returns falsey. The predicate is invoked with
  8858. * three arguments: (value, index, array).
  8859. *
  8860. * @static
  8861. * @memberOf _
  8862. * @since 3.0.0
  8863. * @category Array
  8864. * @param {Array} array The array to query.
  8865. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8866. * @returns {Array} Returns the slice of `array`.
  8867. * @example
  8868. *
  8869. * var users = [
  8870. * { 'user': 'barney', 'active': true },
  8871. * { 'user': 'fred', 'active': false },
  8872. * { 'user': 'pebbles', 'active': false }
  8873. * ];
  8874. *
  8875. * _.takeRightWhile(users, function(o) { return !o.active; });
  8876. * // => objects for ['fred', 'pebbles']
  8877. *
  8878. * // The `_.matches` iteratee shorthand.
  8879. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8880. * // => objects for ['pebbles']
  8881. *
  8882. * // The `_.matchesProperty` iteratee shorthand.
  8883. * _.takeRightWhile(users, ['active', false]);
  8884. * // => objects for ['fred', 'pebbles']
  8885. *
  8886. * // The `_.property` iteratee shorthand.
  8887. * _.takeRightWhile(users, 'active');
  8888. * // => []
  8889. */
  8890. function takeRightWhile(array, predicate) {
  8891. return (array && array.length)
  8892. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8893. : [];
  8894. }
  8895. /**
  8896. * Creates a slice of `array` with elements taken from the beginning. Elements
  8897. * are taken until `predicate` returns falsey. The predicate is invoked with
  8898. * three arguments: (value, index, array).
  8899. *
  8900. * @static
  8901. * @memberOf _
  8902. * @since 3.0.0
  8903. * @category Array
  8904. * @param {Array} array The array to query.
  8905. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8906. * @returns {Array} Returns the slice of `array`.
  8907. * @example
  8908. *
  8909. * var users = [
  8910. * { 'user': 'barney', 'active': false },
  8911. * { 'user': 'fred', 'active': false },
  8912. * { 'user': 'pebbles', 'active': true }
  8913. * ];
  8914. *
  8915. * _.takeWhile(users, function(o) { return !o.active; });
  8916. * // => objects for ['barney', 'fred']
  8917. *
  8918. * // The `_.matches` iteratee shorthand.
  8919. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8920. * // => objects for ['barney']
  8921. *
  8922. * // The `_.matchesProperty` iteratee shorthand.
  8923. * _.takeWhile(users, ['active', false]);
  8924. * // => objects for ['barney', 'fred']
  8925. *
  8926. * // The `_.property` iteratee shorthand.
  8927. * _.takeWhile(users, 'active');
  8928. * // => []
  8929. */
  8930. function takeWhile(array, predicate) {
  8931. return (array && array.length)
  8932. ? baseWhile(array, getIteratee(predicate, 3))
  8933. : [];
  8934. }
  8935. /**
  8936. * Creates an array of unique values, in order, from all given arrays using
  8937. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8938. * for equality comparisons.
  8939. *
  8940. * @static
  8941. * @memberOf _
  8942. * @since 0.1.0
  8943. * @category Array
  8944. * @param {...Array} [arrays] The arrays to inspect.
  8945. * @returns {Array} Returns the new array of combined values.
  8946. * @example
  8947. *
  8948. * _.union([2], [1, 2]);
  8949. * // => [2, 1]
  8950. */
  8951. var union = baseRest(function(arrays) {
  8952. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8953. });
  8954. /**
  8955. * This method is like `_.union` except that it accepts `iteratee` which is
  8956. * invoked for each element of each `arrays` to generate the criterion by
  8957. * which uniqueness is computed. Result values are chosen from the first
  8958. * array in which the value occurs. The iteratee is invoked with one argument:
  8959. * (value).
  8960. *
  8961. * @static
  8962. * @memberOf _
  8963. * @since 4.0.0
  8964. * @category Array
  8965. * @param {...Array} [arrays] The arrays to inspect.
  8966. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8967. * @returns {Array} Returns the new array of combined values.
  8968. * @example
  8969. *
  8970. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8971. * // => [2.1, 1.2]
  8972. *
  8973. * // The `_.property` iteratee shorthand.
  8974. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8975. * // => [{ 'x': 1 }, { 'x': 2 }]
  8976. */
  8977. var unionBy = baseRest(function(arrays) {
  8978. var iteratee = last(arrays);
  8979. if (isArrayLikeObject(iteratee)) {
  8980. iteratee = undefined;
  8981. }
  8982. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8983. });
  8984. /**
  8985. * This method is like `_.union` except that it accepts `comparator` which
  8986. * is invoked to compare elements of `arrays`. Result values are chosen from
  8987. * the first array in which the value occurs. The comparator is invoked
  8988. * with two arguments: (arrVal, othVal).
  8989. *
  8990. * @static
  8991. * @memberOf _
  8992. * @since 4.0.0
  8993. * @category Array
  8994. * @param {...Array} [arrays] The arrays to inspect.
  8995. * @param {Function} [comparator] The comparator invoked per element.
  8996. * @returns {Array} Returns the new array of combined values.
  8997. * @example
  8998. *
  8999. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9000. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9001. *
  9002. * _.unionWith(objects, others, _.isEqual);
  9003. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9004. */
  9005. var unionWith = baseRest(function(arrays) {
  9006. var comparator = last(arrays);
  9007. comparator = typeof comparator == 'function' ? comparator : undefined;
  9008. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9009. });
  9010. /**
  9011. * Creates a duplicate-free version of an array, using
  9012. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9013. * for equality comparisons, in which only the first occurrence of each element
  9014. * is kept. The order of result values is determined by the order they occur
  9015. * in the array.
  9016. *
  9017. * @static
  9018. * @memberOf _
  9019. * @since 0.1.0
  9020. * @category Array
  9021. * @param {Array} array The array to inspect.
  9022. * @returns {Array} Returns the new duplicate free array.
  9023. * @example
  9024. *
  9025. * _.uniq([2, 1, 2]);
  9026. * // => [2, 1]
  9027. */
  9028. function uniq(array) {
  9029. return (array && array.length) ? baseUniq(array) : [];
  9030. }
  9031. /**
  9032. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9033. * invoked for each element in `array` to generate the criterion by which
  9034. * uniqueness is computed. The order of result values is determined by the
  9035. * order they occur in the array. The iteratee is invoked with one argument:
  9036. * (value).
  9037. *
  9038. * @static
  9039. * @memberOf _
  9040. * @since 4.0.0
  9041. * @category Array
  9042. * @param {Array} array The array to inspect.
  9043. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9044. * @returns {Array} Returns the new duplicate free array.
  9045. * @example
  9046. *
  9047. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9048. * // => [2.1, 1.2]
  9049. *
  9050. * // The `_.property` iteratee shorthand.
  9051. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9052. * // => [{ 'x': 1 }, { 'x': 2 }]
  9053. */
  9054. function uniqBy(array, iteratee) {
  9055. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9056. }
  9057. /**
  9058. * This method is like `_.uniq` except that it accepts `comparator` which
  9059. * is invoked to compare elements of `array`. The order of result values is
  9060. * determined by the order they occur in the array.The comparator is invoked
  9061. * with two arguments: (arrVal, othVal).
  9062. *
  9063. * @static
  9064. * @memberOf _
  9065. * @since 4.0.0
  9066. * @category Array
  9067. * @param {Array} array The array to inspect.
  9068. * @param {Function} [comparator] The comparator invoked per element.
  9069. * @returns {Array} Returns the new duplicate free array.
  9070. * @example
  9071. *
  9072. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9073. *
  9074. * _.uniqWith(objects, _.isEqual);
  9075. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9076. */
  9077. function uniqWith(array, comparator) {
  9078. comparator = typeof comparator == 'function' ? comparator : undefined;
  9079. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9080. }
  9081. /**
  9082. * This method is like `_.zip` except that it accepts an array of grouped
  9083. * elements and creates an array regrouping the elements to their pre-zip
  9084. * configuration.
  9085. *
  9086. * @static
  9087. * @memberOf _
  9088. * @since 1.2.0
  9089. * @category Array
  9090. * @param {Array} array The array of grouped elements to process.
  9091. * @returns {Array} Returns the new array of regrouped elements.
  9092. * @example
  9093. *
  9094. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9095. * // => [['a', 1, true], ['b', 2, false]]
  9096. *
  9097. * _.unzip(zipped);
  9098. * // => [['a', 'b'], [1, 2], [true, false]]
  9099. */
  9100. function unzip(array) {
  9101. if (!(array && array.length)) {
  9102. return [];
  9103. }
  9104. var length = 0;
  9105. array = arrayFilter(array, function(group) {
  9106. if (isArrayLikeObject(group)) {
  9107. length = nativeMax(group.length, length);
  9108. return true;
  9109. }
  9110. });
  9111. return baseTimes(length, function(index) {
  9112. return arrayMap(array, baseProperty(index));
  9113. });
  9114. }
  9115. /**
  9116. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9117. * how regrouped values should be combined. The iteratee is invoked with the
  9118. * elements of each group: (...group).
  9119. *
  9120. * @static
  9121. * @memberOf _
  9122. * @since 3.8.0
  9123. * @category Array
  9124. * @param {Array} array The array of grouped elements to process.
  9125. * @param {Function} [iteratee=_.identity] The function to combine
  9126. * regrouped values.
  9127. * @returns {Array} Returns the new array of regrouped elements.
  9128. * @example
  9129. *
  9130. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9131. * // => [[1, 10, 100], [2, 20, 200]]
  9132. *
  9133. * _.unzipWith(zipped, _.add);
  9134. * // => [3, 30, 300]
  9135. */
  9136. function unzipWith(array, iteratee) {
  9137. if (!(array && array.length)) {
  9138. return [];
  9139. }
  9140. var result = unzip(array);
  9141. if (iteratee == null) {
  9142. return result;
  9143. }
  9144. return arrayMap(result, function(group) {
  9145. return apply(iteratee, undefined, group);
  9146. });
  9147. }
  9148. /**
  9149. * Creates an array excluding all given values using
  9150. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9151. * for equality comparisons.
  9152. *
  9153. * **Note:** Unlike `_.pull`, this method returns a new array.
  9154. *
  9155. * @static
  9156. * @memberOf _
  9157. * @since 0.1.0
  9158. * @category Array
  9159. * @param {Array} array The array to inspect.
  9160. * @param {...*} [values] The values to exclude.
  9161. * @returns {Array} Returns the new array of filtered values.
  9162. * @see _.difference, _.xor
  9163. * @example
  9164. *
  9165. * _.without([2, 1, 2, 3], 1, 2);
  9166. * // => [3]
  9167. */
  9168. var without = baseRest(function(array, values) {
  9169. return isArrayLikeObject(array)
  9170. ? baseDifference(array, values)
  9171. : [];
  9172. });
  9173. /**
  9174. * Creates an array of unique values that is the
  9175. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9176. * of the given arrays. The order of result values is determined by the order
  9177. * they occur in the arrays.
  9178. *
  9179. * @static
  9180. * @memberOf _
  9181. * @since 2.4.0
  9182. * @category Array
  9183. * @param {...Array} [arrays] The arrays to inspect.
  9184. * @returns {Array} Returns the new array of filtered values.
  9185. * @see _.difference, _.without
  9186. * @example
  9187. *
  9188. * _.xor([2, 1], [2, 3]);
  9189. * // => [1, 3]
  9190. */
  9191. var xor = baseRest(function(arrays) {
  9192. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9193. });
  9194. /**
  9195. * This method is like `_.xor` except that it accepts `iteratee` which is
  9196. * invoked for each element of each `arrays` to generate the criterion by
  9197. * which by which they're compared. The order of result values is determined
  9198. * by the order they occur in the arrays. The iteratee is invoked with one
  9199. * argument: (value).
  9200. *
  9201. * @static
  9202. * @memberOf _
  9203. * @since 4.0.0
  9204. * @category Array
  9205. * @param {...Array} [arrays] The arrays to inspect.
  9206. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9207. * @returns {Array} Returns the new array of filtered values.
  9208. * @example
  9209. *
  9210. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9211. * // => [1.2, 3.4]
  9212. *
  9213. * // The `_.property` iteratee shorthand.
  9214. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9215. * // => [{ 'x': 2 }]
  9216. */
  9217. var xorBy = baseRest(function(arrays) {
  9218. var iteratee = last(arrays);
  9219. if (isArrayLikeObject(iteratee)) {
  9220. iteratee = undefined;
  9221. }
  9222. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9223. });
  9224. /**
  9225. * This method is like `_.xor` except that it accepts `comparator` which is
  9226. * invoked to compare elements of `arrays`. The order of result values is
  9227. * determined by the order they occur in the arrays. The comparator is invoked
  9228. * with two arguments: (arrVal, othVal).
  9229. *
  9230. * @static
  9231. * @memberOf _
  9232. * @since 4.0.0
  9233. * @category Array
  9234. * @param {...Array} [arrays] The arrays to inspect.
  9235. * @param {Function} [comparator] The comparator invoked per element.
  9236. * @returns {Array} Returns the new array of filtered values.
  9237. * @example
  9238. *
  9239. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9240. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9241. *
  9242. * _.xorWith(objects, others, _.isEqual);
  9243. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9244. */
  9245. var xorWith = baseRest(function(arrays) {
  9246. var comparator = last(arrays);
  9247. comparator = typeof comparator == 'function' ? comparator : undefined;
  9248. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9249. });
  9250. /**
  9251. * Creates an array of grouped elements, the first of which contains the
  9252. * first elements of the given arrays, the second of which contains the
  9253. * second elements of the given arrays, and so on.
  9254. *
  9255. * @static
  9256. * @memberOf _
  9257. * @since 0.1.0
  9258. * @category Array
  9259. * @param {...Array} [arrays] The arrays to process.
  9260. * @returns {Array} Returns the new array of grouped elements.
  9261. * @example
  9262. *
  9263. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9264. * // => [['a', 1, true], ['b', 2, false]]
  9265. */
  9266. var zip = baseRest(unzip);
  9267. /**
  9268. * This method is like `_.fromPairs` except that it accepts two arrays,
  9269. * one of property identifiers and one of corresponding values.
  9270. *
  9271. * @static
  9272. * @memberOf _
  9273. * @since 0.4.0
  9274. * @category Array
  9275. * @param {Array} [props=[]] The property identifiers.
  9276. * @param {Array} [values=[]] The property values.
  9277. * @returns {Object} Returns the new object.
  9278. * @example
  9279. *
  9280. * _.zipObject(['a', 'b'], [1, 2]);
  9281. * // => { 'a': 1, 'b': 2 }
  9282. */
  9283. function zipObject(props, values) {
  9284. return baseZipObject(props || [], values || [], assignValue);
  9285. }
  9286. /**
  9287. * This method is like `_.zipObject` except that it supports property paths.
  9288. *
  9289. * @static
  9290. * @memberOf _
  9291. * @since 4.1.0
  9292. * @category Array
  9293. * @param {Array} [props=[]] The property identifiers.
  9294. * @param {Array} [values=[]] The property values.
  9295. * @returns {Object} Returns the new object.
  9296. * @example
  9297. *
  9298. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9299. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9300. */
  9301. function zipObjectDeep(props, values) {
  9302. return baseZipObject(props || [], values || [], baseSet);
  9303. }
  9304. /**
  9305. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9306. * how grouped values should be combined. The iteratee is invoked with the
  9307. * elements of each group: (...group).
  9308. *
  9309. * @static
  9310. * @memberOf _
  9311. * @since 3.8.0
  9312. * @category Array
  9313. * @param {...Array} [arrays] The arrays to process.
  9314. * @param {Function} [iteratee=_.identity] The function to combine
  9315. * grouped values.
  9316. * @returns {Array} Returns the new array of grouped elements.
  9317. * @example
  9318. *
  9319. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9320. * return a + b + c;
  9321. * });
  9322. * // => [111, 222]
  9323. */
  9324. var zipWith = baseRest(function(arrays) {
  9325. var length = arrays.length,
  9326. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9327. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9328. return unzipWith(arrays, iteratee);
  9329. });
  9330. /*------------------------------------------------------------------------*/
  9331. /**
  9332. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9333. * chain sequences enabled. The result of such sequences must be unwrapped
  9334. * with `_#value`.
  9335. *
  9336. * @static
  9337. * @memberOf _
  9338. * @since 1.3.0
  9339. * @category Seq
  9340. * @param {*} value The value to wrap.
  9341. * @returns {Object} Returns the new `lodash` wrapper instance.
  9342. * @example
  9343. *
  9344. * var users = [
  9345. * { 'user': 'barney', 'age': 36 },
  9346. * { 'user': 'fred', 'age': 40 },
  9347. * { 'user': 'pebbles', 'age': 1 }
  9348. * ];
  9349. *
  9350. * var youngest = _
  9351. * .chain(users)
  9352. * .sortBy('age')
  9353. * .map(function(o) {
  9354. * return o.user + ' is ' + o.age;
  9355. * })
  9356. * .head()
  9357. * .value();
  9358. * // => 'pebbles is 1'
  9359. */
  9360. function chain(value) {
  9361. var result = lodash(value);
  9362. result.__chain__ = true;
  9363. return result;
  9364. }
  9365. /**
  9366. * This method invokes `interceptor` and returns `value`. The interceptor
  9367. * is invoked with one argument; (value). The purpose of this method is to
  9368. * "tap into" a method chain sequence in order to modify intermediate results.
  9369. *
  9370. * @static
  9371. * @memberOf _
  9372. * @since 0.1.0
  9373. * @category Seq
  9374. * @param {*} value The value to provide to `interceptor`.
  9375. * @param {Function} interceptor The function to invoke.
  9376. * @returns {*} Returns `value`.
  9377. * @example
  9378. *
  9379. * _([1, 2, 3])
  9380. * .tap(function(array) {
  9381. * // Mutate input array.
  9382. * array.pop();
  9383. * })
  9384. * .reverse()
  9385. * .value();
  9386. * // => [2, 1]
  9387. */
  9388. function tap(value, interceptor) {
  9389. interceptor(value);
  9390. return value;
  9391. }
  9392. /**
  9393. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9394. * The purpose of this method is to "pass thru" values replacing intermediate
  9395. * results in a method chain sequence.
  9396. *
  9397. * @static
  9398. * @memberOf _
  9399. * @since 3.0.0
  9400. * @category Seq
  9401. * @param {*} value The value to provide to `interceptor`.
  9402. * @param {Function} interceptor The function to invoke.
  9403. * @returns {*} Returns the result of `interceptor`.
  9404. * @example
  9405. *
  9406. * _(' abc ')
  9407. * .chain()
  9408. * .trim()
  9409. * .thru(function(value) {
  9410. * return [value];
  9411. * })
  9412. * .value();
  9413. * // => ['abc']
  9414. */
  9415. function thru(value, interceptor) {
  9416. return interceptor(value);
  9417. }
  9418. /**
  9419. * This method is the wrapper version of `_.at`.
  9420. *
  9421. * @name at
  9422. * @memberOf _
  9423. * @since 1.0.0
  9424. * @category Seq
  9425. * @param {...(string|string[])} [paths] The property paths to pick.
  9426. * @returns {Object} Returns the new `lodash` wrapper instance.
  9427. * @example
  9428. *
  9429. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9430. *
  9431. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9432. * // => [3, 4]
  9433. */
  9434. var wrapperAt = flatRest(function(paths) {
  9435. var length = paths.length,
  9436. start = length ? paths[0] : 0,
  9437. value = this.__wrapped__,
  9438. interceptor = function(object) { return baseAt(object, paths); };
  9439. if (length > 1 || this.__actions__.length ||
  9440. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9441. return this.thru(interceptor);
  9442. }
  9443. value = value.slice(start, +start + (length ? 1 : 0));
  9444. value.__actions__.push({
  9445. 'func': thru,
  9446. 'args': [interceptor],
  9447. 'thisArg': undefined
  9448. });
  9449. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9450. if (length && !array.length) {
  9451. array.push(undefined);
  9452. }
  9453. return array;
  9454. });
  9455. });
  9456. /**
  9457. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9458. *
  9459. * @name chain
  9460. * @memberOf _
  9461. * @since 0.1.0
  9462. * @category Seq
  9463. * @returns {Object} Returns the new `lodash` wrapper instance.
  9464. * @example
  9465. *
  9466. * var users = [
  9467. * { 'user': 'barney', 'age': 36 },
  9468. * { 'user': 'fred', 'age': 40 }
  9469. * ];
  9470. *
  9471. * // A sequence without explicit chaining.
  9472. * _(users).head();
  9473. * // => { 'user': 'barney', 'age': 36 }
  9474. *
  9475. * // A sequence with explicit chaining.
  9476. * _(users)
  9477. * .chain()
  9478. * .head()
  9479. * .pick('user')
  9480. * .value();
  9481. * // => { 'user': 'barney' }
  9482. */
  9483. function wrapperChain() {
  9484. return chain(this);
  9485. }
  9486. /**
  9487. * Executes the chain sequence and returns the wrapped result.
  9488. *
  9489. * @name commit
  9490. * @memberOf _
  9491. * @since 3.2.0
  9492. * @category Seq
  9493. * @returns {Object} Returns the new `lodash` wrapper instance.
  9494. * @example
  9495. *
  9496. * var array = [1, 2];
  9497. * var wrapped = _(array).push(3);
  9498. *
  9499. * console.log(array);
  9500. * // => [1, 2]
  9501. *
  9502. * wrapped = wrapped.commit();
  9503. * console.log(array);
  9504. * // => [1, 2, 3]
  9505. *
  9506. * wrapped.last();
  9507. * // => 3
  9508. *
  9509. * console.log(array);
  9510. * // => [1, 2, 3]
  9511. */
  9512. function wrapperCommit() {
  9513. return new LodashWrapper(this.value(), this.__chain__);
  9514. }
  9515. /**
  9516. * Gets the next value on a wrapped object following the
  9517. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9518. *
  9519. * @name next
  9520. * @memberOf _
  9521. * @since 4.0.0
  9522. * @category Seq
  9523. * @returns {Object} Returns the next iterator value.
  9524. * @example
  9525. *
  9526. * var wrapped = _([1, 2]);
  9527. *
  9528. * wrapped.next();
  9529. * // => { 'done': false, 'value': 1 }
  9530. *
  9531. * wrapped.next();
  9532. * // => { 'done': false, 'value': 2 }
  9533. *
  9534. * wrapped.next();
  9535. * // => { 'done': true, 'value': undefined }
  9536. */
  9537. function wrapperNext() {
  9538. if (this.__values__ === undefined) {
  9539. this.__values__ = toArray(this.value());
  9540. }
  9541. var done = this.__index__ >= this.__values__.length,
  9542. value = done ? undefined : this.__values__[this.__index__++];
  9543. return { 'done': done, 'value': value };
  9544. }
  9545. /**
  9546. * Enables the wrapper to be iterable.
  9547. *
  9548. * @name Symbol.iterator
  9549. * @memberOf _
  9550. * @since 4.0.0
  9551. * @category Seq
  9552. * @returns {Object} Returns the wrapper object.
  9553. * @example
  9554. *
  9555. * var wrapped = _([1, 2]);
  9556. *
  9557. * wrapped[Symbol.iterator]() === wrapped;
  9558. * // => true
  9559. *
  9560. * Array.from(wrapped);
  9561. * // => [1, 2]
  9562. */
  9563. function wrapperToIterator() {
  9564. return this;
  9565. }
  9566. /**
  9567. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9568. *
  9569. * @name plant
  9570. * @memberOf _
  9571. * @since 3.2.0
  9572. * @category Seq
  9573. * @param {*} value The value to plant.
  9574. * @returns {Object} Returns the new `lodash` wrapper instance.
  9575. * @example
  9576. *
  9577. * function square(n) {
  9578. * return n * n;
  9579. * }
  9580. *
  9581. * var wrapped = _([1, 2]).map(square);
  9582. * var other = wrapped.plant([3, 4]);
  9583. *
  9584. * other.value();
  9585. * // => [9, 16]
  9586. *
  9587. * wrapped.value();
  9588. * // => [1, 4]
  9589. */
  9590. function wrapperPlant(value) {
  9591. var result,
  9592. parent = this;
  9593. while (parent instanceof baseLodash) {
  9594. var clone = wrapperClone(parent);
  9595. clone.__index__ = 0;
  9596. clone.__values__ = undefined;
  9597. if (result) {
  9598. previous.__wrapped__ = clone;
  9599. } else {
  9600. result = clone;
  9601. }
  9602. var previous = clone;
  9603. parent = parent.__wrapped__;
  9604. }
  9605. previous.__wrapped__ = value;
  9606. return result;
  9607. }
  9608. /**
  9609. * This method is the wrapper version of `_.reverse`.
  9610. *
  9611. * **Note:** This method mutates the wrapped array.
  9612. *
  9613. * @name reverse
  9614. * @memberOf _
  9615. * @since 0.1.0
  9616. * @category Seq
  9617. * @returns {Object} Returns the new `lodash` wrapper instance.
  9618. * @example
  9619. *
  9620. * var array = [1, 2, 3];
  9621. *
  9622. * _(array).reverse().value()
  9623. * // => [3, 2, 1]
  9624. *
  9625. * console.log(array);
  9626. * // => [3, 2, 1]
  9627. */
  9628. function wrapperReverse() {
  9629. var value = this.__wrapped__;
  9630. if (value instanceof LazyWrapper) {
  9631. var wrapped = value;
  9632. if (this.__actions__.length) {
  9633. wrapped = new LazyWrapper(this);
  9634. }
  9635. wrapped = wrapped.reverse();
  9636. wrapped.__actions__.push({
  9637. 'func': thru,
  9638. 'args': [reverse],
  9639. 'thisArg': undefined
  9640. });
  9641. return new LodashWrapper(wrapped, this.__chain__);
  9642. }
  9643. return this.thru(reverse);
  9644. }
  9645. /**
  9646. * Executes the chain sequence to resolve the unwrapped value.
  9647. *
  9648. * @name value
  9649. * @memberOf _
  9650. * @since 0.1.0
  9651. * @alias toJSON, valueOf
  9652. * @category Seq
  9653. * @returns {*} Returns the resolved unwrapped value.
  9654. * @example
  9655. *
  9656. * _([1, 2, 3]).value();
  9657. * // => [1, 2, 3]
  9658. */
  9659. function wrapperValue() {
  9660. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9661. }
  9662. /*------------------------------------------------------------------------*/
  9663. /**
  9664. * Creates an object composed of keys generated from the results of running
  9665. * each element of `collection` thru `iteratee`. The corresponding value of
  9666. * each key is the number of times the key was returned by `iteratee`. The
  9667. * iteratee is invoked with one argument: (value).
  9668. *
  9669. * @static
  9670. * @memberOf _
  9671. * @since 0.5.0
  9672. * @category Collection
  9673. * @param {Array|Object} collection The collection to iterate over.
  9674. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9675. * @returns {Object} Returns the composed aggregate object.
  9676. * @example
  9677. *
  9678. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9679. * // => { '4': 1, '6': 2 }
  9680. *
  9681. * // The `_.property` iteratee shorthand.
  9682. * _.countBy(['one', 'two', 'three'], 'length');
  9683. * // => { '3': 2, '5': 1 }
  9684. */
  9685. var countBy = createAggregator(function(result, value, key) {
  9686. if (hasOwnProperty.call(result, key)) {
  9687. ++result[key];
  9688. } else {
  9689. baseAssignValue(result, key, 1);
  9690. }
  9691. });
  9692. /**
  9693. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9694. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9695. * invoked with three arguments: (value, index|key, collection).
  9696. *
  9697. * **Note:** This method returns `true` for
  9698. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9699. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9700. * elements of empty collections.
  9701. *
  9702. * @static
  9703. * @memberOf _
  9704. * @since 0.1.0
  9705. * @category Collection
  9706. * @param {Array|Object} collection The collection to iterate over.
  9707. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9708. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9709. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9710. * else `false`.
  9711. * @example
  9712. *
  9713. * _.every([true, 1, null, 'yes'], Boolean);
  9714. * // => false
  9715. *
  9716. * var users = [
  9717. * { 'user': 'barney', 'age': 36, 'active': false },
  9718. * { 'user': 'fred', 'age': 40, 'active': false }
  9719. * ];
  9720. *
  9721. * // The `_.matches` iteratee shorthand.
  9722. * _.every(users, { 'user': 'barney', 'active': false });
  9723. * // => false
  9724. *
  9725. * // The `_.matchesProperty` iteratee shorthand.
  9726. * _.every(users, ['active', false]);
  9727. * // => true
  9728. *
  9729. * // The `_.property` iteratee shorthand.
  9730. * _.every(users, 'active');
  9731. * // => false
  9732. */
  9733. function every(collection, predicate, guard) {
  9734. var func = isArray(collection) ? arrayEvery : baseEvery;
  9735. if (guard && isIterateeCall(collection, predicate, guard)) {
  9736. predicate = undefined;
  9737. }
  9738. return func(collection, getIteratee(predicate, 3));
  9739. }
  9740. /**
  9741. * Iterates over elements of `collection`, returning an array of all elements
  9742. * `predicate` returns truthy for. The predicate is invoked with three
  9743. * arguments: (value, index|key, collection).
  9744. *
  9745. * **Note:** Unlike `_.remove`, this method returns a new array.
  9746. *
  9747. * @static
  9748. * @memberOf _
  9749. * @since 0.1.0
  9750. * @category Collection
  9751. * @param {Array|Object} collection The collection to iterate over.
  9752. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9753. * @returns {Array} Returns the new filtered array.
  9754. * @see _.reject
  9755. * @example
  9756. *
  9757. * var users = [
  9758. * { 'user': 'barney', 'age': 36, 'active': true },
  9759. * { 'user': 'fred', 'age': 40, 'active': false }
  9760. * ];
  9761. *
  9762. * _.filter(users, function(o) { return !o.active; });
  9763. * // => objects for ['fred']
  9764. *
  9765. * // The `_.matches` iteratee shorthand.
  9766. * _.filter(users, { 'age': 36, 'active': true });
  9767. * // => objects for ['barney']
  9768. *
  9769. * // The `_.matchesProperty` iteratee shorthand.
  9770. * _.filter(users, ['active', false]);
  9771. * // => objects for ['fred']
  9772. *
  9773. * // The `_.property` iteratee shorthand.
  9774. * _.filter(users, 'active');
  9775. * // => objects for ['barney']
  9776. *
  9777. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9778. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9779. * // => objects for ['fred', 'barney']
  9780. */
  9781. function filter(collection, predicate) {
  9782. var func = isArray(collection) ? arrayFilter : baseFilter;
  9783. return func(collection, getIteratee(predicate, 3));
  9784. }
  9785. /**
  9786. * Iterates over elements of `collection`, returning the first element
  9787. * `predicate` returns truthy for. The predicate is invoked with three
  9788. * arguments: (value, index|key, collection).
  9789. *
  9790. * @static
  9791. * @memberOf _
  9792. * @since 0.1.0
  9793. * @category Collection
  9794. * @param {Array|Object} collection The collection to inspect.
  9795. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9796. * @param {number} [fromIndex=0] The index to search from.
  9797. * @returns {*} Returns the matched element, else `undefined`.
  9798. * @example
  9799. *
  9800. * var users = [
  9801. * { 'user': 'barney', 'age': 36, 'active': true },
  9802. * { 'user': 'fred', 'age': 40, 'active': false },
  9803. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9804. * ];
  9805. *
  9806. * _.find(users, function(o) { return o.age < 40; });
  9807. * // => object for 'barney'
  9808. *
  9809. * // The `_.matches` iteratee shorthand.
  9810. * _.find(users, { 'age': 1, 'active': true });
  9811. * // => object for 'pebbles'
  9812. *
  9813. * // The `_.matchesProperty` iteratee shorthand.
  9814. * _.find(users, ['active', false]);
  9815. * // => object for 'fred'
  9816. *
  9817. * // The `_.property` iteratee shorthand.
  9818. * _.find(users, 'active');
  9819. * // => object for 'barney'
  9820. */
  9821. var find = createFind(findIndex);
  9822. /**
  9823. * This method is like `_.find` except that it iterates over elements of
  9824. * `collection` from right to left.
  9825. *
  9826. * @static
  9827. * @memberOf _
  9828. * @since 2.0.0
  9829. * @category Collection
  9830. * @param {Array|Object} collection The collection to inspect.
  9831. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9832. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9833. * @returns {*} Returns the matched element, else `undefined`.
  9834. * @example
  9835. *
  9836. * _.findLast([1, 2, 3, 4], function(n) {
  9837. * return n % 2 == 1;
  9838. * });
  9839. * // => 3
  9840. */
  9841. var findLast = createFind(findLastIndex);
  9842. /**
  9843. * Creates a flattened array of values by running each element in `collection`
  9844. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9845. * with three arguments: (value, index|key, collection).
  9846. *
  9847. * @static
  9848. * @memberOf _
  9849. * @since 4.0.0
  9850. * @category Collection
  9851. * @param {Array|Object} collection The collection to iterate over.
  9852. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9853. * @returns {Array} Returns the new flattened array.
  9854. * @example
  9855. *
  9856. * function duplicate(n) {
  9857. * return [n, n];
  9858. * }
  9859. *
  9860. * _.flatMap([1, 2], duplicate);
  9861. * // => [1, 1, 2, 2]
  9862. */
  9863. function flatMap(collection, iteratee) {
  9864. return baseFlatten(map(collection, iteratee), 1);
  9865. }
  9866. /**
  9867. * This method is like `_.flatMap` except that it recursively flattens the
  9868. * mapped results.
  9869. *
  9870. * @static
  9871. * @memberOf _
  9872. * @since 4.7.0
  9873. * @category Collection
  9874. * @param {Array|Object} collection The collection to iterate over.
  9875. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9876. * @returns {Array} Returns the new flattened array.
  9877. * @example
  9878. *
  9879. * function duplicate(n) {
  9880. * return [[[n, n]]];
  9881. * }
  9882. *
  9883. * _.flatMapDeep([1, 2], duplicate);
  9884. * // => [1, 1, 2, 2]
  9885. */
  9886. function flatMapDeep(collection, iteratee) {
  9887. return baseFlatten(map(collection, iteratee), INFINITY);
  9888. }
  9889. /**
  9890. * This method is like `_.flatMap` except that it recursively flattens the
  9891. * mapped results up to `depth` times.
  9892. *
  9893. * @static
  9894. * @memberOf _
  9895. * @since 4.7.0
  9896. * @category Collection
  9897. * @param {Array|Object} collection The collection to iterate over.
  9898. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9899. * @param {number} [depth=1] The maximum recursion depth.
  9900. * @returns {Array} Returns the new flattened array.
  9901. * @example
  9902. *
  9903. * function duplicate(n) {
  9904. * return [[[n, n]]];
  9905. * }
  9906. *
  9907. * _.flatMapDepth([1, 2], duplicate, 2);
  9908. * // => [[1, 1], [2, 2]]
  9909. */
  9910. function flatMapDepth(collection, iteratee, depth) {
  9911. depth = depth === undefined ? 1 : toInteger(depth);
  9912. return baseFlatten(map(collection, iteratee), depth);
  9913. }
  9914. /**
  9915. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9916. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9917. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9918. *
  9919. * **Note:** As with other "Collections" methods, objects with a "length"
  9920. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9921. * or `_.forOwn` for object iteration.
  9922. *
  9923. * @static
  9924. * @memberOf _
  9925. * @since 0.1.0
  9926. * @alias each
  9927. * @category Collection
  9928. * @param {Array|Object} collection The collection to iterate over.
  9929. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9930. * @returns {Array|Object} Returns `collection`.
  9931. * @see _.forEachRight
  9932. * @example
  9933. *
  9934. * _.forEach([1, 2], function(value) {
  9935. * console.log(value);
  9936. * });
  9937. * // => Logs `1` then `2`.
  9938. *
  9939. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9940. * console.log(key);
  9941. * });
  9942. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9943. */
  9944. function forEach(collection, iteratee) {
  9945. var func = isArray(collection) ? arrayEach : baseEach;
  9946. return func(collection, getIteratee(iteratee, 3));
  9947. }
  9948. /**
  9949. * This method is like `_.forEach` except that it iterates over elements of
  9950. * `collection` from right to left.
  9951. *
  9952. * @static
  9953. * @memberOf _
  9954. * @since 2.0.0
  9955. * @alias eachRight
  9956. * @category Collection
  9957. * @param {Array|Object} collection The collection to iterate over.
  9958. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9959. * @returns {Array|Object} Returns `collection`.
  9960. * @see _.forEach
  9961. * @example
  9962. *
  9963. * _.forEachRight([1, 2], function(value) {
  9964. * console.log(value);
  9965. * });
  9966. * // => Logs `2` then `1`.
  9967. */
  9968. function forEachRight(collection, iteratee) {
  9969. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9970. return func(collection, getIteratee(iteratee, 3));
  9971. }
  9972. /**
  9973. * Creates an object composed of keys generated from the results of running
  9974. * each element of `collection` thru `iteratee`. The order of grouped values
  9975. * is determined by the order they occur in `collection`. The corresponding
  9976. * value of each key is an array of elements responsible for generating the
  9977. * key. The iteratee is invoked with one argument: (value).
  9978. *
  9979. * @static
  9980. * @memberOf _
  9981. * @since 0.1.0
  9982. * @category Collection
  9983. * @param {Array|Object} collection The collection to iterate over.
  9984. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9985. * @returns {Object} Returns the composed aggregate object.
  9986. * @example
  9987. *
  9988. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9989. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9990. *
  9991. * // The `_.property` iteratee shorthand.
  9992. * _.groupBy(['one', 'two', 'three'], 'length');
  9993. * // => { '3': ['one', 'two'], '5': ['three'] }
  9994. */
  9995. var groupBy = createAggregator(function(result, value, key) {
  9996. if (hasOwnProperty.call(result, key)) {
  9997. result[key].push(value);
  9998. } else {
  9999. baseAssignValue(result, key, [value]);
  10000. }
  10001. });
  10002. /**
  10003. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10004. * checked for a substring of `value`, otherwise
  10005. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10006. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10007. * the offset from the end of `collection`.
  10008. *
  10009. * @static
  10010. * @memberOf _
  10011. * @since 0.1.0
  10012. * @category Collection
  10013. * @param {Array|Object|string} collection The collection to inspect.
  10014. * @param {*} value The value to search for.
  10015. * @param {number} [fromIndex=0] The index to search from.
  10016. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10017. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10018. * @example
  10019. *
  10020. * _.includes([1, 2, 3], 1);
  10021. * // => true
  10022. *
  10023. * _.includes([1, 2, 3], 1, 2);
  10024. * // => false
  10025. *
  10026. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10027. * // => true
  10028. *
  10029. * _.includes('abcd', 'bc');
  10030. * // => true
  10031. */
  10032. function includes(collection, value, fromIndex, guard) {
  10033. collection = isArrayLike(collection) ? collection : values(collection);
  10034. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10035. var length = collection.length;
  10036. if (fromIndex < 0) {
  10037. fromIndex = nativeMax(length + fromIndex, 0);
  10038. }
  10039. return isString(collection)
  10040. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10041. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10042. }
  10043. /**
  10044. * Invokes the method at `path` of each element in `collection`, returning
  10045. * an array of the results of each invoked method. Any additional arguments
  10046. * are provided to each invoked method. If `path` is a function, it's invoked
  10047. * for, and `this` bound to, each element in `collection`.
  10048. *
  10049. * @static
  10050. * @memberOf _
  10051. * @since 4.0.0
  10052. * @category Collection
  10053. * @param {Array|Object} collection The collection to iterate over.
  10054. * @param {Array|Function|string} path The path of the method to invoke or
  10055. * the function invoked per iteration.
  10056. * @param {...*} [args] The arguments to invoke each method with.
  10057. * @returns {Array} Returns the array of results.
  10058. * @example
  10059. *
  10060. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10061. * // => [[1, 5, 7], [1, 2, 3]]
  10062. *
  10063. * _.invokeMap([123, 456], String.prototype.split, '');
  10064. * // => [['1', '2', '3'], ['4', '5', '6']]
  10065. */
  10066. var invokeMap = baseRest(function(collection, path, args) {
  10067. var index = -1,
  10068. isFunc = typeof path == 'function',
  10069. result = isArrayLike(collection) ? Array(collection.length) : [];
  10070. baseEach(collection, function(value) {
  10071. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10072. });
  10073. return result;
  10074. });
  10075. /**
  10076. * Creates an object composed of keys generated from the results of running
  10077. * each element of `collection` thru `iteratee`. The corresponding value of
  10078. * each key is the last element responsible for generating the key. The
  10079. * iteratee is invoked with one argument: (value).
  10080. *
  10081. * @static
  10082. * @memberOf _
  10083. * @since 4.0.0
  10084. * @category Collection
  10085. * @param {Array|Object} collection The collection to iterate over.
  10086. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10087. * @returns {Object} Returns the composed aggregate object.
  10088. * @example
  10089. *
  10090. * var array = [
  10091. * { 'dir': 'left', 'code': 97 },
  10092. * { 'dir': 'right', 'code': 100 }
  10093. * ];
  10094. *
  10095. * _.keyBy(array, function(o) {
  10096. * return String.fromCharCode(o.code);
  10097. * });
  10098. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10099. *
  10100. * _.keyBy(array, 'dir');
  10101. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10102. */
  10103. var keyBy = createAggregator(function(result, value, key) {
  10104. baseAssignValue(result, key, value);
  10105. });
  10106. /**
  10107. * Creates an array of values by running each element in `collection` thru
  10108. * `iteratee`. The iteratee is invoked with three arguments:
  10109. * (value, index|key, collection).
  10110. *
  10111. * Many lodash methods are guarded to work as iteratees for methods like
  10112. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10113. *
  10114. * The guarded methods are:
  10115. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10116. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10117. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10118. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10119. *
  10120. * @static
  10121. * @memberOf _
  10122. * @since 0.1.0
  10123. * @category Collection
  10124. * @param {Array|Object} collection The collection to iterate over.
  10125. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10126. * @returns {Array} Returns the new mapped array.
  10127. * @example
  10128. *
  10129. * function square(n) {
  10130. * return n * n;
  10131. * }
  10132. *
  10133. * _.map([4, 8], square);
  10134. * // => [16, 64]
  10135. *
  10136. * _.map({ 'a': 4, 'b': 8 }, square);
  10137. * // => [16, 64] (iteration order is not guaranteed)
  10138. *
  10139. * var users = [
  10140. * { 'user': 'barney' },
  10141. * { 'user': 'fred' }
  10142. * ];
  10143. *
  10144. * // The `_.property` iteratee shorthand.
  10145. * _.map(users, 'user');
  10146. * // => ['barney', 'fred']
  10147. */
  10148. function map(collection, iteratee) {
  10149. var func = isArray(collection) ? arrayMap : baseMap;
  10150. return func(collection, getIteratee(iteratee, 3));
  10151. }
  10152. /**
  10153. * This method is like `_.sortBy` except that it allows specifying the sort
  10154. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10155. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10156. * descending or "asc" for ascending sort order of corresponding values.
  10157. *
  10158. * @static
  10159. * @memberOf _
  10160. * @since 4.0.0
  10161. * @category Collection
  10162. * @param {Array|Object} collection The collection to iterate over.
  10163. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10164. * The iteratees to sort by.
  10165. * @param {string[]} [orders] The sort orders of `iteratees`.
  10166. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10167. * @returns {Array} Returns the new sorted array.
  10168. * @example
  10169. *
  10170. * var users = [
  10171. * { 'user': 'fred', 'age': 48 },
  10172. * { 'user': 'barney', 'age': 34 },
  10173. * { 'user': 'fred', 'age': 40 },
  10174. * { 'user': 'barney', 'age': 36 }
  10175. * ];
  10176. *
  10177. * // Sort by `user` in ascending order and by `age` in descending order.
  10178. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10179. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10180. */
  10181. function orderBy(collection, iteratees, orders, guard) {
  10182. if (collection == null) {
  10183. return [];
  10184. }
  10185. if (!isArray(iteratees)) {
  10186. iteratees = iteratees == null ? [] : [iteratees];
  10187. }
  10188. orders = guard ? undefined : orders;
  10189. if (!isArray(orders)) {
  10190. orders = orders == null ? [] : [orders];
  10191. }
  10192. return baseOrderBy(collection, iteratees, orders);
  10193. }
  10194. /**
  10195. * Creates an array of elements split into two groups, the first of which
  10196. * contains elements `predicate` returns truthy for, the second of which
  10197. * contains elements `predicate` returns falsey for. The predicate is
  10198. * invoked with one argument: (value).
  10199. *
  10200. * @static
  10201. * @memberOf _
  10202. * @since 3.0.0
  10203. * @category Collection
  10204. * @param {Array|Object} collection The collection to iterate over.
  10205. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10206. * @returns {Array} Returns the array of grouped elements.
  10207. * @example
  10208. *
  10209. * var users = [
  10210. * { 'user': 'barney', 'age': 36, 'active': false },
  10211. * { 'user': 'fred', 'age': 40, 'active': true },
  10212. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10213. * ];
  10214. *
  10215. * _.partition(users, function(o) { return o.active; });
  10216. * // => objects for [['fred'], ['barney', 'pebbles']]
  10217. *
  10218. * // The `_.matches` iteratee shorthand.
  10219. * _.partition(users, { 'age': 1, 'active': false });
  10220. * // => objects for [['pebbles'], ['barney', 'fred']]
  10221. *
  10222. * // The `_.matchesProperty` iteratee shorthand.
  10223. * _.partition(users, ['active', false]);
  10224. * // => objects for [['barney', 'pebbles'], ['fred']]
  10225. *
  10226. * // The `_.property` iteratee shorthand.
  10227. * _.partition(users, 'active');
  10228. * // => objects for [['fred'], ['barney', 'pebbles']]
  10229. */
  10230. var partition = createAggregator(function(result, value, key) {
  10231. result[key ? 0 : 1].push(value);
  10232. }, function() { return [[], []]; });
  10233. /**
  10234. * Reduces `collection` to a value which is the accumulated result of running
  10235. * each element in `collection` thru `iteratee`, where each successive
  10236. * invocation is supplied the return value of the previous. If `accumulator`
  10237. * is not given, the first element of `collection` is used as the initial
  10238. * value. The iteratee is invoked with four arguments:
  10239. * (accumulator, value, index|key, collection).
  10240. *
  10241. * Many lodash methods are guarded to work as iteratees for methods like
  10242. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10243. *
  10244. * The guarded methods are:
  10245. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10246. * and `sortBy`
  10247. *
  10248. * @static
  10249. * @memberOf _
  10250. * @since 0.1.0
  10251. * @category Collection
  10252. * @param {Array|Object} collection The collection to iterate over.
  10253. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10254. * @param {*} [accumulator] The initial value.
  10255. * @returns {*} Returns the accumulated value.
  10256. * @see _.reduceRight
  10257. * @example
  10258. *
  10259. * _.reduce([1, 2], function(sum, n) {
  10260. * return sum + n;
  10261. * }, 0);
  10262. * // => 3
  10263. *
  10264. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10265. * (result[value] || (result[value] = [])).push(key);
  10266. * return result;
  10267. * }, {});
  10268. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10269. */
  10270. function reduce(collection, iteratee, accumulator) {
  10271. var func = isArray(collection) ? arrayReduce : baseReduce,
  10272. initAccum = arguments.length < 3;
  10273. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10274. }
  10275. /**
  10276. * This method is like `_.reduce` except that it iterates over elements of
  10277. * `collection` from right to left.
  10278. *
  10279. * @static
  10280. * @memberOf _
  10281. * @since 0.1.0
  10282. * @category Collection
  10283. * @param {Array|Object} collection The collection to iterate over.
  10284. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10285. * @param {*} [accumulator] The initial value.
  10286. * @returns {*} Returns the accumulated value.
  10287. * @see _.reduce
  10288. * @example
  10289. *
  10290. * var array = [[0, 1], [2, 3], [4, 5]];
  10291. *
  10292. * _.reduceRight(array, function(flattened, other) {
  10293. * return flattened.concat(other);
  10294. * }, []);
  10295. * // => [4, 5, 2, 3, 0, 1]
  10296. */
  10297. function reduceRight(collection, iteratee, accumulator) {
  10298. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10299. initAccum = arguments.length < 3;
  10300. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10301. }
  10302. /**
  10303. * The opposite of `_.filter`; this method returns the elements of `collection`
  10304. * that `predicate` does **not** return truthy for.
  10305. *
  10306. * @static
  10307. * @memberOf _
  10308. * @since 0.1.0
  10309. * @category Collection
  10310. * @param {Array|Object} collection The collection to iterate over.
  10311. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10312. * @returns {Array} Returns the new filtered array.
  10313. * @see _.filter
  10314. * @example
  10315. *
  10316. * var users = [
  10317. * { 'user': 'barney', 'age': 36, 'active': false },
  10318. * { 'user': 'fred', 'age': 40, 'active': true }
  10319. * ];
  10320. *
  10321. * _.reject(users, function(o) { return !o.active; });
  10322. * // => objects for ['fred']
  10323. *
  10324. * // The `_.matches` iteratee shorthand.
  10325. * _.reject(users, { 'age': 40, 'active': true });
  10326. * // => objects for ['barney']
  10327. *
  10328. * // The `_.matchesProperty` iteratee shorthand.
  10329. * _.reject(users, ['active', false]);
  10330. * // => objects for ['fred']
  10331. *
  10332. * // The `_.property` iteratee shorthand.
  10333. * _.reject(users, 'active');
  10334. * // => objects for ['barney']
  10335. */
  10336. function reject(collection, predicate) {
  10337. var func = isArray(collection) ? arrayFilter : baseFilter;
  10338. return func(collection, negate(getIteratee(predicate, 3)));
  10339. }
  10340. /**
  10341. * Gets a random element from `collection`.
  10342. *
  10343. * @static
  10344. * @memberOf _
  10345. * @since 2.0.0
  10346. * @category Collection
  10347. * @param {Array|Object} collection The collection to sample.
  10348. * @returns {*} Returns the random element.
  10349. * @example
  10350. *
  10351. * _.sample([1, 2, 3, 4]);
  10352. * // => 2
  10353. */
  10354. function sample(collection) {
  10355. var func = isArray(collection) ? arraySample : baseSample;
  10356. return func(collection);
  10357. }
  10358. /**
  10359. * Gets `n` random elements at unique keys from `collection` up to the
  10360. * size of `collection`.
  10361. *
  10362. * @static
  10363. * @memberOf _
  10364. * @since 4.0.0
  10365. * @category Collection
  10366. * @param {Array|Object} collection The collection to sample.
  10367. * @param {number} [n=1] The number of elements to sample.
  10368. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10369. * @returns {Array} Returns the random elements.
  10370. * @example
  10371. *
  10372. * _.sampleSize([1, 2, 3], 2);
  10373. * // => [3, 1]
  10374. *
  10375. * _.sampleSize([1, 2, 3], 4);
  10376. * // => [2, 3, 1]
  10377. */
  10378. function sampleSize(collection, n, guard) {
  10379. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10380. n = 1;
  10381. } else {
  10382. n = toInteger(n);
  10383. }
  10384. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10385. return func(collection, n);
  10386. }
  10387. /**
  10388. * Creates an array of shuffled values, using a version of the
  10389. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10390. *
  10391. * @static
  10392. * @memberOf _
  10393. * @since 0.1.0
  10394. * @category Collection
  10395. * @param {Array|Object} collection The collection to shuffle.
  10396. * @returns {Array} Returns the new shuffled array.
  10397. * @example
  10398. *
  10399. * _.shuffle([1, 2, 3, 4]);
  10400. * // => [4, 1, 3, 2]
  10401. */
  10402. function shuffle(collection) {
  10403. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10404. return func(collection);
  10405. }
  10406. /**
  10407. * Gets the size of `collection` by returning its length for array-like
  10408. * values or the number of own enumerable string keyed properties for objects.
  10409. *
  10410. * @static
  10411. * @memberOf _
  10412. * @since 0.1.0
  10413. * @category Collection
  10414. * @param {Array|Object|string} collection The collection to inspect.
  10415. * @returns {number} Returns the collection size.
  10416. * @example
  10417. *
  10418. * _.size([1, 2, 3]);
  10419. * // => 3
  10420. *
  10421. * _.size({ 'a': 1, 'b': 2 });
  10422. * // => 2
  10423. *
  10424. * _.size('pebbles');
  10425. * // => 7
  10426. */
  10427. function size(collection) {
  10428. if (collection == null) {
  10429. return 0;
  10430. }
  10431. if (isArrayLike(collection)) {
  10432. return isString(collection) ? stringSize(collection) : collection.length;
  10433. }
  10434. var tag = getTag(collection);
  10435. if (tag == mapTag || tag == setTag) {
  10436. return collection.size;
  10437. }
  10438. return baseKeys(collection).length;
  10439. }
  10440. /**
  10441. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10442. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10443. * invoked with three arguments: (value, index|key, collection).
  10444. *
  10445. * @static
  10446. * @memberOf _
  10447. * @since 0.1.0
  10448. * @category Collection
  10449. * @param {Array|Object} collection The collection to iterate over.
  10450. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10451. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10452. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10453. * else `false`.
  10454. * @example
  10455. *
  10456. * _.some([null, 0, 'yes', false], Boolean);
  10457. * // => true
  10458. *
  10459. * var users = [
  10460. * { 'user': 'barney', 'active': true },
  10461. * { 'user': 'fred', 'active': false }
  10462. * ];
  10463. *
  10464. * // The `_.matches` iteratee shorthand.
  10465. * _.some(users, { 'user': 'barney', 'active': false });
  10466. * // => false
  10467. *
  10468. * // The `_.matchesProperty` iteratee shorthand.
  10469. * _.some(users, ['active', false]);
  10470. * // => true
  10471. *
  10472. * // The `_.property` iteratee shorthand.
  10473. * _.some(users, 'active');
  10474. * // => true
  10475. */
  10476. function some(collection, predicate, guard) {
  10477. var func = isArray(collection) ? arraySome : baseSome;
  10478. if (guard && isIterateeCall(collection, predicate, guard)) {
  10479. predicate = undefined;
  10480. }
  10481. return func(collection, getIteratee(predicate, 3));
  10482. }
  10483. /**
  10484. * Creates an array of elements, sorted in ascending order by the results of
  10485. * running each element in a collection thru each iteratee. This method
  10486. * performs a stable sort, that is, it preserves the original sort order of
  10487. * equal elements. The iteratees are invoked with one argument: (value).
  10488. *
  10489. * @static
  10490. * @memberOf _
  10491. * @since 0.1.0
  10492. * @category Collection
  10493. * @param {Array|Object} collection The collection to iterate over.
  10494. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10495. * The iteratees to sort by.
  10496. * @returns {Array} Returns the new sorted array.
  10497. * @example
  10498. *
  10499. * var users = [
  10500. * { 'user': 'fred', 'age': 48 },
  10501. * { 'user': 'barney', 'age': 36 },
  10502. * { 'user': 'fred', 'age': 30 },
  10503. * { 'user': 'barney', 'age': 34 }
  10504. * ];
  10505. *
  10506. * _.sortBy(users, [function(o) { return o.user; }]);
  10507. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10508. *
  10509. * _.sortBy(users, ['user', 'age']);
  10510. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10511. */
  10512. var sortBy = baseRest(function(collection, iteratees) {
  10513. if (collection == null) {
  10514. return [];
  10515. }
  10516. var length = iteratees.length;
  10517. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10518. iteratees = [];
  10519. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10520. iteratees = [iteratees[0]];
  10521. }
  10522. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10523. });
  10524. /*------------------------------------------------------------------------*/
  10525. /**
  10526. * Gets the timestamp of the number of milliseconds that have elapsed since
  10527. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10528. *
  10529. * @static
  10530. * @memberOf _
  10531. * @since 2.4.0
  10532. * @category Date
  10533. * @returns {number} Returns the timestamp.
  10534. * @example
  10535. *
  10536. * _.defer(function(stamp) {
  10537. * console.log(_.now() - stamp);
  10538. * }, _.now());
  10539. * // => Logs the number of milliseconds it took for the deferred invocation.
  10540. */
  10541. var now = ctxNow || function() {
  10542. return root.Date.now();
  10543. };
  10544. /*------------------------------------------------------------------------*/
  10545. /**
  10546. * The opposite of `_.before`; this method creates a function that invokes
  10547. * `func` once it's called `n` or more times.
  10548. *
  10549. * @static
  10550. * @memberOf _
  10551. * @since 0.1.0
  10552. * @category Function
  10553. * @param {number} n The number of calls before `func` is invoked.
  10554. * @param {Function} func The function to restrict.
  10555. * @returns {Function} Returns the new restricted function.
  10556. * @example
  10557. *
  10558. * var saves = ['profile', 'settings'];
  10559. *
  10560. * var done = _.after(saves.length, function() {
  10561. * console.log('done saving!');
  10562. * });
  10563. *
  10564. * _.forEach(saves, function(type) {
  10565. * asyncSave({ 'type': type, 'complete': done });
  10566. * });
  10567. * // => Logs 'done saving!' after the two async saves have completed.
  10568. */
  10569. function after(n, func) {
  10570. if (typeof func != 'function') {
  10571. throw new TypeError(FUNC_ERROR_TEXT);
  10572. }
  10573. n = toInteger(n);
  10574. return function() {
  10575. if (--n < 1) {
  10576. return func.apply(this, arguments);
  10577. }
  10578. };
  10579. }
  10580. /**
  10581. * Creates a function that invokes `func`, with up to `n` arguments,
  10582. * ignoring any additional arguments.
  10583. *
  10584. * @static
  10585. * @memberOf _
  10586. * @since 3.0.0
  10587. * @category Function
  10588. * @param {Function} func The function to cap arguments for.
  10589. * @param {number} [n=func.length] The arity cap.
  10590. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10591. * @returns {Function} Returns the new capped function.
  10592. * @example
  10593. *
  10594. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10595. * // => [6, 8, 10]
  10596. */
  10597. function ary(func, n, guard) {
  10598. n = guard ? undefined : n;
  10599. n = (func && n == null) ? func.length : n;
  10600. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10601. }
  10602. /**
  10603. * Creates a function that invokes `func`, with the `this` binding and arguments
  10604. * of the created function, while it's called less than `n` times. Subsequent
  10605. * calls to the created function return the result of the last `func` invocation.
  10606. *
  10607. * @static
  10608. * @memberOf _
  10609. * @since 3.0.0
  10610. * @category Function
  10611. * @param {number} n The number of calls at which `func` is no longer invoked.
  10612. * @param {Function} func The function to restrict.
  10613. * @returns {Function} Returns the new restricted function.
  10614. * @example
  10615. *
  10616. * jQuery(element).on('click', _.before(5, addContactToList));
  10617. * // => Allows adding up to 4 contacts to the list.
  10618. */
  10619. function before(n, func) {
  10620. var result;
  10621. if (typeof func != 'function') {
  10622. throw new TypeError(FUNC_ERROR_TEXT);
  10623. }
  10624. n = toInteger(n);
  10625. return function() {
  10626. if (--n > 0) {
  10627. result = func.apply(this, arguments);
  10628. }
  10629. if (n <= 1) {
  10630. func = undefined;
  10631. }
  10632. return result;
  10633. };
  10634. }
  10635. /**
  10636. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10637. * and `partials` prepended to the arguments it receives.
  10638. *
  10639. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10640. * may be used as a placeholder for partially applied arguments.
  10641. *
  10642. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10643. * property of bound functions.
  10644. *
  10645. * @static
  10646. * @memberOf _
  10647. * @since 0.1.0
  10648. * @category Function
  10649. * @param {Function} func The function to bind.
  10650. * @param {*} thisArg The `this` binding of `func`.
  10651. * @param {...*} [partials] The arguments to be partially applied.
  10652. * @returns {Function} Returns the new bound function.
  10653. * @example
  10654. *
  10655. * function greet(greeting, punctuation) {
  10656. * return greeting + ' ' + this.user + punctuation;
  10657. * }
  10658. *
  10659. * var object = { 'user': 'fred' };
  10660. *
  10661. * var bound = _.bind(greet, object, 'hi');
  10662. * bound('!');
  10663. * // => 'hi fred!'
  10664. *
  10665. * // Bound with placeholders.
  10666. * var bound = _.bind(greet, object, _, '!');
  10667. * bound('hi');
  10668. * // => 'hi fred!'
  10669. */
  10670. var bind = baseRest(function(func, thisArg, partials) {
  10671. var bitmask = WRAP_BIND_FLAG;
  10672. if (partials.length) {
  10673. var holders = replaceHolders(partials, getHolder(bind));
  10674. bitmask |= WRAP_PARTIAL_FLAG;
  10675. }
  10676. return createWrap(func, bitmask, thisArg, partials, holders);
  10677. });
  10678. /**
  10679. * Creates a function that invokes the method at `object[key]` with `partials`
  10680. * prepended to the arguments it receives.
  10681. *
  10682. * This method differs from `_.bind` by allowing bound functions to reference
  10683. * methods that may be redefined or don't yet exist. See
  10684. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10685. * for more details.
  10686. *
  10687. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10688. * builds, may be used as a placeholder for partially applied arguments.
  10689. *
  10690. * @static
  10691. * @memberOf _
  10692. * @since 0.10.0
  10693. * @category Function
  10694. * @param {Object} object The object to invoke the method on.
  10695. * @param {string} key The key of the method.
  10696. * @param {...*} [partials] The arguments to be partially applied.
  10697. * @returns {Function} Returns the new bound function.
  10698. * @example
  10699. *
  10700. * var object = {
  10701. * 'user': 'fred',
  10702. * 'greet': function(greeting, punctuation) {
  10703. * return greeting + ' ' + this.user + punctuation;
  10704. * }
  10705. * };
  10706. *
  10707. * var bound = _.bindKey(object, 'greet', 'hi');
  10708. * bound('!');
  10709. * // => 'hi fred!'
  10710. *
  10711. * object.greet = function(greeting, punctuation) {
  10712. * return greeting + 'ya ' + this.user + punctuation;
  10713. * };
  10714. *
  10715. * bound('!');
  10716. * // => 'hiya fred!'
  10717. *
  10718. * // Bound with placeholders.
  10719. * var bound = _.bindKey(object, 'greet', _, '!');
  10720. * bound('hi');
  10721. * // => 'hiya fred!'
  10722. */
  10723. var bindKey = baseRest(function(object, key, partials) {
  10724. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10725. if (partials.length) {
  10726. var holders = replaceHolders(partials, getHolder(bindKey));
  10727. bitmask |= WRAP_PARTIAL_FLAG;
  10728. }
  10729. return createWrap(key, bitmask, object, partials, holders);
  10730. });
  10731. /**
  10732. * Creates a function that accepts arguments of `func` and either invokes
  10733. * `func` returning its result, if at least `arity` number of arguments have
  10734. * been provided, or returns a function that accepts the remaining `func`
  10735. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10736. * is not sufficient.
  10737. *
  10738. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10739. * may be used as a placeholder for provided arguments.
  10740. *
  10741. * **Note:** This method doesn't set the "length" property of curried functions.
  10742. *
  10743. * @static
  10744. * @memberOf _
  10745. * @since 2.0.0
  10746. * @category Function
  10747. * @param {Function} func The function to curry.
  10748. * @param {number} [arity=func.length] The arity of `func`.
  10749. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10750. * @returns {Function} Returns the new curried function.
  10751. * @example
  10752. *
  10753. * var abc = function(a, b, c) {
  10754. * return [a, b, c];
  10755. * };
  10756. *
  10757. * var curried = _.curry(abc);
  10758. *
  10759. * curried(1)(2)(3);
  10760. * // => [1, 2, 3]
  10761. *
  10762. * curried(1, 2)(3);
  10763. * // => [1, 2, 3]
  10764. *
  10765. * curried(1, 2, 3);
  10766. * // => [1, 2, 3]
  10767. *
  10768. * // Curried with placeholders.
  10769. * curried(1)(_, 3)(2);
  10770. * // => [1, 2, 3]
  10771. */
  10772. function curry(func, arity, guard) {
  10773. arity = guard ? undefined : arity;
  10774. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10775. result.placeholder = curry.placeholder;
  10776. return result;
  10777. }
  10778. /**
  10779. * This method is like `_.curry` except that arguments are applied to `func`
  10780. * in the manner of `_.partialRight` instead of `_.partial`.
  10781. *
  10782. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10783. * builds, may be used as a placeholder for provided arguments.
  10784. *
  10785. * **Note:** This method doesn't set the "length" property of curried functions.
  10786. *
  10787. * @static
  10788. * @memberOf _
  10789. * @since 3.0.0
  10790. * @category Function
  10791. * @param {Function} func The function to curry.
  10792. * @param {number} [arity=func.length] The arity of `func`.
  10793. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10794. * @returns {Function} Returns the new curried function.
  10795. * @example
  10796. *
  10797. * var abc = function(a, b, c) {
  10798. * return [a, b, c];
  10799. * };
  10800. *
  10801. * var curried = _.curryRight(abc);
  10802. *
  10803. * curried(3)(2)(1);
  10804. * // => [1, 2, 3]
  10805. *
  10806. * curried(2, 3)(1);
  10807. * // => [1, 2, 3]
  10808. *
  10809. * curried(1, 2, 3);
  10810. * // => [1, 2, 3]
  10811. *
  10812. * // Curried with placeholders.
  10813. * curried(3)(1, _)(2);
  10814. * // => [1, 2, 3]
  10815. */
  10816. function curryRight(func, arity, guard) {
  10817. arity = guard ? undefined : arity;
  10818. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10819. result.placeholder = curryRight.placeholder;
  10820. return result;
  10821. }
  10822. /**
  10823. * Creates a debounced function that delays invoking `func` until after `wait`
  10824. * milliseconds have elapsed since the last time the debounced function was
  10825. * invoked. The debounced function comes with a `cancel` method to cancel
  10826. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10827. * Provide `options` to indicate whether `func` should be invoked on the
  10828. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10829. * with the last arguments provided to the debounced function. Subsequent
  10830. * calls to the debounced function return the result of the last `func`
  10831. * invocation.
  10832. *
  10833. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10834. * invoked on the trailing edge of the timeout only if the debounced function
  10835. * is invoked more than once during the `wait` timeout.
  10836. *
  10837. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10838. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10839. *
  10840. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10841. * for details over the differences between `_.debounce` and `_.throttle`.
  10842. *
  10843. * @static
  10844. * @memberOf _
  10845. * @since 0.1.0
  10846. * @category Function
  10847. * @param {Function} func The function to debounce.
  10848. * @param {number} [wait=0] The number of milliseconds to delay.
  10849. * @param {Object} [options={}] The options object.
  10850. * @param {boolean} [options.leading=false]
  10851. * Specify invoking on the leading edge of the timeout.
  10852. * @param {number} [options.maxWait]
  10853. * The maximum time `func` is allowed to be delayed before it's invoked.
  10854. * @param {boolean} [options.trailing=true]
  10855. * Specify invoking on the trailing edge of the timeout.
  10856. * @returns {Function} Returns the new debounced function.
  10857. * @example
  10858. *
  10859. * // Avoid costly calculations while the window size is in flux.
  10860. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10861. *
  10862. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10863. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10864. * 'leading': true,
  10865. * 'trailing': false
  10866. * }));
  10867. *
  10868. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10869. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10870. * var source = new EventSource('/stream');
  10871. * jQuery(source).on('message', debounced);
  10872. *
  10873. * // Cancel the trailing debounced invocation.
  10874. * jQuery(window).on('popstate', debounced.cancel);
  10875. */
  10876. function debounce(func, wait, options) {
  10877. var lastArgs,
  10878. lastThis,
  10879. maxWait,
  10880. result,
  10881. timerId,
  10882. lastCallTime,
  10883. lastInvokeTime = 0,
  10884. leading = false,
  10885. maxing = false,
  10886. trailing = true;
  10887. if (typeof func != 'function') {
  10888. throw new TypeError(FUNC_ERROR_TEXT);
  10889. }
  10890. wait = toNumber(wait) || 0;
  10891. if (isObject(options)) {
  10892. leading = !!options.leading;
  10893. maxing = 'maxWait' in options;
  10894. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10895. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10896. }
  10897. function invokeFunc(time) {
  10898. var args = lastArgs,
  10899. thisArg = lastThis;
  10900. lastArgs = lastThis = undefined;
  10901. lastInvokeTime = time;
  10902. result = func.apply(thisArg, args);
  10903. return result;
  10904. }
  10905. function leadingEdge(time) {
  10906. // Reset any `maxWait` timer.
  10907. lastInvokeTime = time;
  10908. // Start the timer for the trailing edge.
  10909. timerId = setTimeout(timerExpired, wait);
  10910. // Invoke the leading edge.
  10911. return leading ? invokeFunc(time) : result;
  10912. }
  10913. function remainingWait(time) {
  10914. var timeSinceLastCall = time - lastCallTime,
  10915. timeSinceLastInvoke = time - lastInvokeTime,
  10916. timeWaiting = wait - timeSinceLastCall;
  10917. return maxing
  10918. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10919. : timeWaiting;
  10920. }
  10921. function shouldInvoke(time) {
  10922. var timeSinceLastCall = time - lastCallTime,
  10923. timeSinceLastInvoke = time - lastInvokeTime;
  10924. // Either this is the first call, activity has stopped and we're at the
  10925. // trailing edge, the system time has gone backwards and we're treating
  10926. // it as the trailing edge, or we've hit the `maxWait` limit.
  10927. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10928. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10929. }
  10930. function timerExpired() {
  10931. var time = now();
  10932. if (shouldInvoke(time)) {
  10933. return trailingEdge(time);
  10934. }
  10935. // Restart the timer.
  10936. timerId = setTimeout(timerExpired, remainingWait(time));
  10937. }
  10938. function trailingEdge(time) {
  10939. timerId = undefined;
  10940. // Only invoke if we have `lastArgs` which means `func` has been
  10941. // debounced at least once.
  10942. if (trailing && lastArgs) {
  10943. return invokeFunc(time);
  10944. }
  10945. lastArgs = lastThis = undefined;
  10946. return result;
  10947. }
  10948. function cancel() {
  10949. if (timerId !== undefined) {
  10950. clearTimeout(timerId);
  10951. }
  10952. lastInvokeTime = 0;
  10953. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10954. }
  10955. function flush() {
  10956. return timerId === undefined ? result : trailingEdge(now());
  10957. }
  10958. function debounced() {
  10959. var time = now(),
  10960. isInvoking = shouldInvoke(time);
  10961. lastArgs = arguments;
  10962. lastThis = this;
  10963. lastCallTime = time;
  10964. if (isInvoking) {
  10965. if (timerId === undefined) {
  10966. return leadingEdge(lastCallTime);
  10967. }
  10968. if (maxing) {
  10969. // Handle invocations in a tight loop.
  10970. clearTimeout(timerId);
  10971. timerId = setTimeout(timerExpired, wait);
  10972. return invokeFunc(lastCallTime);
  10973. }
  10974. }
  10975. if (timerId === undefined) {
  10976. timerId = setTimeout(timerExpired, wait);
  10977. }
  10978. return result;
  10979. }
  10980. debounced.cancel = cancel;
  10981. debounced.flush = flush;
  10982. return debounced;
  10983. }
  10984. /**
  10985. * Defers invoking the `func` until the current call stack has cleared. Any
  10986. * additional arguments are provided to `func` when it's invoked.
  10987. *
  10988. * @static
  10989. * @memberOf _
  10990. * @since 0.1.0
  10991. * @category Function
  10992. * @param {Function} func The function to defer.
  10993. * @param {...*} [args] The arguments to invoke `func` with.
  10994. * @returns {number} Returns the timer id.
  10995. * @example
  10996. *
  10997. * _.defer(function(text) {
  10998. * console.log(text);
  10999. * }, 'deferred');
  11000. * // => Logs 'deferred' after one millisecond.
  11001. */
  11002. var defer = baseRest(function(func, args) {
  11003. return baseDelay(func, 1, args);
  11004. });
  11005. /**
  11006. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11007. * provided to `func` when it's invoked.
  11008. *
  11009. * @static
  11010. * @memberOf _
  11011. * @since 0.1.0
  11012. * @category Function
  11013. * @param {Function} func The function to delay.
  11014. * @param {number} wait The number of milliseconds to delay invocation.
  11015. * @param {...*} [args] The arguments to invoke `func` with.
  11016. * @returns {number} Returns the timer id.
  11017. * @example
  11018. *
  11019. * _.delay(function(text) {
  11020. * console.log(text);
  11021. * }, 1000, 'later');
  11022. * // => Logs 'later' after one second.
  11023. */
  11024. var delay = baseRest(function(func, wait, args) {
  11025. return baseDelay(func, toNumber(wait) || 0, args);
  11026. });
  11027. /**
  11028. * Creates a function that invokes `func` with arguments reversed.
  11029. *
  11030. * @static
  11031. * @memberOf _
  11032. * @since 4.0.0
  11033. * @category Function
  11034. * @param {Function} func The function to flip arguments for.
  11035. * @returns {Function} Returns the new flipped function.
  11036. * @example
  11037. *
  11038. * var flipped = _.flip(function() {
  11039. * return _.toArray(arguments);
  11040. * });
  11041. *
  11042. * flipped('a', 'b', 'c', 'd');
  11043. * // => ['d', 'c', 'b', 'a']
  11044. */
  11045. function flip(func) {
  11046. return createWrap(func, WRAP_FLIP_FLAG);
  11047. }
  11048. /**
  11049. * Creates a function that memoizes the result of `func`. If `resolver` is
  11050. * provided, it determines the cache key for storing the result based on the
  11051. * arguments provided to the memoized function. By default, the first argument
  11052. * provided to the memoized function is used as the map cache key. The `func`
  11053. * is invoked with the `this` binding of the memoized function.
  11054. *
  11055. * **Note:** The cache is exposed as the `cache` property on the memoized
  11056. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11057. * constructor with one whose instances implement the
  11058. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11059. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11060. *
  11061. * @static
  11062. * @memberOf _
  11063. * @since 0.1.0
  11064. * @category Function
  11065. * @param {Function} func The function to have its output memoized.
  11066. * @param {Function} [resolver] The function to resolve the cache key.
  11067. * @returns {Function} Returns the new memoized function.
  11068. * @example
  11069. *
  11070. * var object = { 'a': 1, 'b': 2 };
  11071. * var other = { 'c': 3, 'd': 4 };
  11072. *
  11073. * var values = _.memoize(_.values);
  11074. * values(object);
  11075. * // => [1, 2]
  11076. *
  11077. * values(other);
  11078. * // => [3, 4]
  11079. *
  11080. * object.a = 2;
  11081. * values(object);
  11082. * // => [1, 2]
  11083. *
  11084. * // Modify the result cache.
  11085. * values.cache.set(object, ['a', 'b']);
  11086. * values(object);
  11087. * // => ['a', 'b']
  11088. *
  11089. * // Replace `_.memoize.Cache`.
  11090. * _.memoize.Cache = WeakMap;
  11091. */
  11092. function memoize(func, resolver) {
  11093. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11094. throw new TypeError(FUNC_ERROR_TEXT);
  11095. }
  11096. var memoized = function() {
  11097. var args = arguments,
  11098. key = resolver ? resolver.apply(this, args) : args[0],
  11099. cache = memoized.cache;
  11100. if (cache.has(key)) {
  11101. return cache.get(key);
  11102. }
  11103. var result = func.apply(this, args);
  11104. memoized.cache = cache.set(key, result) || cache;
  11105. return result;
  11106. };
  11107. memoized.cache = new (memoize.Cache || MapCache);
  11108. return memoized;
  11109. }
  11110. // Expose `MapCache`.
  11111. memoize.Cache = MapCache;
  11112. /**
  11113. * Creates a function that negates the result of the predicate `func`. The
  11114. * `func` predicate is invoked with the `this` binding and arguments of the
  11115. * created function.
  11116. *
  11117. * @static
  11118. * @memberOf _
  11119. * @since 3.0.0
  11120. * @category Function
  11121. * @param {Function} predicate The predicate to negate.
  11122. * @returns {Function} Returns the new negated function.
  11123. * @example
  11124. *
  11125. * function isEven(n) {
  11126. * return n % 2 == 0;
  11127. * }
  11128. *
  11129. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11130. * // => [1, 3, 5]
  11131. */
  11132. function negate(predicate) {
  11133. if (typeof predicate != 'function') {
  11134. throw new TypeError(FUNC_ERROR_TEXT);
  11135. }
  11136. return function() {
  11137. var args = arguments;
  11138. switch (args.length) {
  11139. case 0: return !predicate.call(this);
  11140. case 1: return !predicate.call(this, args[0]);
  11141. case 2: return !predicate.call(this, args[0], args[1]);
  11142. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11143. }
  11144. return !predicate.apply(this, args);
  11145. };
  11146. }
  11147. /**
  11148. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11149. * to the function return the value of the first invocation. The `func` is
  11150. * invoked with the `this` binding and arguments of the created function.
  11151. *
  11152. * @static
  11153. * @memberOf _
  11154. * @since 0.1.0
  11155. * @category Function
  11156. * @param {Function} func The function to restrict.
  11157. * @returns {Function} Returns the new restricted function.
  11158. * @example
  11159. *
  11160. * var initialize = _.once(createApplication);
  11161. * initialize();
  11162. * initialize();
  11163. * // => `createApplication` is invoked once
  11164. */
  11165. function once(func) {
  11166. return before(2, func);
  11167. }
  11168. /**
  11169. * Creates a function that invokes `func` with its arguments transformed.
  11170. *
  11171. * @static
  11172. * @since 4.0.0
  11173. * @memberOf _
  11174. * @category Function
  11175. * @param {Function} func The function to wrap.
  11176. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11177. * The argument transforms.
  11178. * @returns {Function} Returns the new function.
  11179. * @example
  11180. *
  11181. * function doubled(n) {
  11182. * return n * 2;
  11183. * }
  11184. *
  11185. * function square(n) {
  11186. * return n * n;
  11187. * }
  11188. *
  11189. * var func = _.overArgs(function(x, y) {
  11190. * return [x, y];
  11191. * }, [square, doubled]);
  11192. *
  11193. * func(9, 3);
  11194. * // => [81, 6]
  11195. *
  11196. * func(10, 5);
  11197. * // => [100, 10]
  11198. */
  11199. var overArgs = castRest(function(func, transforms) {
  11200. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11201. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11202. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11203. var funcsLength = transforms.length;
  11204. return baseRest(function(args) {
  11205. var index = -1,
  11206. length = nativeMin(args.length, funcsLength);
  11207. while (++index < length) {
  11208. args[index] = transforms[index].call(this, args[index]);
  11209. }
  11210. return apply(func, this, args);
  11211. });
  11212. });
  11213. /**
  11214. * Creates a function that invokes `func` with `partials` prepended to the
  11215. * arguments it receives. This method is like `_.bind` except it does **not**
  11216. * alter the `this` binding.
  11217. *
  11218. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11219. * builds, may be used as a placeholder for partially applied arguments.
  11220. *
  11221. * **Note:** This method doesn't set the "length" property of partially
  11222. * applied functions.
  11223. *
  11224. * @static
  11225. * @memberOf _
  11226. * @since 0.2.0
  11227. * @category Function
  11228. * @param {Function} func The function to partially apply arguments to.
  11229. * @param {...*} [partials] The arguments to be partially applied.
  11230. * @returns {Function} Returns the new partially applied function.
  11231. * @example
  11232. *
  11233. * function greet(greeting, name) {
  11234. * return greeting + ' ' + name;
  11235. * }
  11236. *
  11237. * var sayHelloTo = _.partial(greet, 'hello');
  11238. * sayHelloTo('fred');
  11239. * // => 'hello fred'
  11240. *
  11241. * // Partially applied with placeholders.
  11242. * var greetFred = _.partial(greet, _, 'fred');
  11243. * greetFred('hi');
  11244. * // => 'hi fred'
  11245. */
  11246. var partial = baseRest(function(func, partials) {
  11247. var holders = replaceHolders(partials, getHolder(partial));
  11248. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11249. });
  11250. /**
  11251. * This method is like `_.partial` except that partially applied arguments
  11252. * are appended to the arguments it receives.
  11253. *
  11254. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11255. * builds, may be used as a placeholder for partially applied arguments.
  11256. *
  11257. * **Note:** This method doesn't set the "length" property of partially
  11258. * applied functions.
  11259. *
  11260. * @static
  11261. * @memberOf _
  11262. * @since 1.0.0
  11263. * @category Function
  11264. * @param {Function} func The function to partially apply arguments to.
  11265. * @param {...*} [partials] The arguments to be partially applied.
  11266. * @returns {Function} Returns the new partially applied function.
  11267. * @example
  11268. *
  11269. * function greet(greeting, name) {
  11270. * return greeting + ' ' + name;
  11271. * }
  11272. *
  11273. * var greetFred = _.partialRight(greet, 'fred');
  11274. * greetFred('hi');
  11275. * // => 'hi fred'
  11276. *
  11277. * // Partially applied with placeholders.
  11278. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11279. * sayHelloTo('fred');
  11280. * // => 'hello fred'
  11281. */
  11282. var partialRight = baseRest(function(func, partials) {
  11283. var holders = replaceHolders(partials, getHolder(partialRight));
  11284. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11285. });
  11286. /**
  11287. * Creates a function that invokes `func` with arguments arranged according
  11288. * to the specified `indexes` where the argument value at the first index is
  11289. * provided as the first argument, the argument value at the second index is
  11290. * provided as the second argument, and so on.
  11291. *
  11292. * @static
  11293. * @memberOf _
  11294. * @since 3.0.0
  11295. * @category Function
  11296. * @param {Function} func The function to rearrange arguments for.
  11297. * @param {...(number|number[])} indexes The arranged argument indexes.
  11298. * @returns {Function} Returns the new function.
  11299. * @example
  11300. *
  11301. * var rearged = _.rearg(function(a, b, c) {
  11302. * return [a, b, c];
  11303. * }, [2, 0, 1]);
  11304. *
  11305. * rearged('b', 'c', 'a')
  11306. * // => ['a', 'b', 'c']
  11307. */
  11308. var rearg = flatRest(function(func, indexes) {
  11309. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11310. });
  11311. /**
  11312. * Creates a function that invokes `func` with the `this` binding of the
  11313. * created function and arguments from `start` and beyond provided as
  11314. * an array.
  11315. *
  11316. * **Note:** This method is based on the
  11317. * [rest parameter](https://mdn.io/rest_parameters).
  11318. *
  11319. * @static
  11320. * @memberOf _
  11321. * @since 4.0.0
  11322. * @category Function
  11323. * @param {Function} func The function to apply a rest parameter to.
  11324. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11325. * @returns {Function} Returns the new function.
  11326. * @example
  11327. *
  11328. * var say = _.rest(function(what, names) {
  11329. * return what + ' ' + _.initial(names).join(', ') +
  11330. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11331. * });
  11332. *
  11333. * say('hello', 'fred', 'barney', 'pebbles');
  11334. * // => 'hello fred, barney, & pebbles'
  11335. */
  11336. function rest(func, start) {
  11337. if (typeof func != 'function') {
  11338. throw new TypeError(FUNC_ERROR_TEXT);
  11339. }
  11340. start = start === undefined ? start : toInteger(start);
  11341. return baseRest(func, start);
  11342. }
  11343. /**
  11344. * Creates a function that invokes `func` with the `this` binding of the
  11345. * create function and an array of arguments much like
  11346. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11347. *
  11348. * **Note:** This method is based on the
  11349. * [spread operator](https://mdn.io/spread_operator).
  11350. *
  11351. * @static
  11352. * @memberOf _
  11353. * @since 3.2.0
  11354. * @category Function
  11355. * @param {Function} func The function to spread arguments over.
  11356. * @param {number} [start=0] The start position of the spread.
  11357. * @returns {Function} Returns the new function.
  11358. * @example
  11359. *
  11360. * var say = _.spread(function(who, what) {
  11361. * return who + ' says ' + what;
  11362. * });
  11363. *
  11364. * say(['fred', 'hello']);
  11365. * // => 'fred says hello'
  11366. *
  11367. * var numbers = Promise.all([
  11368. * Promise.resolve(40),
  11369. * Promise.resolve(36)
  11370. * ]);
  11371. *
  11372. * numbers.then(_.spread(function(x, y) {
  11373. * return x + y;
  11374. * }));
  11375. * // => a Promise of 76
  11376. */
  11377. function spread(func, start) {
  11378. if (typeof func != 'function') {
  11379. throw new TypeError(FUNC_ERROR_TEXT);
  11380. }
  11381. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11382. return baseRest(function(args) {
  11383. var array = args[start],
  11384. otherArgs = castSlice(args, 0, start);
  11385. if (array) {
  11386. arrayPush(otherArgs, array);
  11387. }
  11388. return apply(func, this, otherArgs);
  11389. });
  11390. }
  11391. /**
  11392. * Creates a throttled function that only invokes `func` at most once per
  11393. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11394. * method to cancel delayed `func` invocations and a `flush` method to
  11395. * immediately invoke them. Provide `options` to indicate whether `func`
  11396. * should be invoked on the leading and/or trailing edge of the `wait`
  11397. * timeout. The `func` is invoked with the last arguments provided to the
  11398. * throttled function. Subsequent calls to the throttled function return the
  11399. * result of the last `func` invocation.
  11400. *
  11401. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11402. * invoked on the trailing edge of the timeout only if the throttled function
  11403. * is invoked more than once during the `wait` timeout.
  11404. *
  11405. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11406. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11407. *
  11408. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11409. * for details over the differences between `_.throttle` and `_.debounce`.
  11410. *
  11411. * @static
  11412. * @memberOf _
  11413. * @since 0.1.0
  11414. * @category Function
  11415. * @param {Function} func The function to throttle.
  11416. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11417. * @param {Object} [options={}] The options object.
  11418. * @param {boolean} [options.leading=true]
  11419. * Specify invoking on the leading edge of the timeout.
  11420. * @param {boolean} [options.trailing=true]
  11421. * Specify invoking on the trailing edge of the timeout.
  11422. * @returns {Function} Returns the new throttled function.
  11423. * @example
  11424. *
  11425. * // Avoid excessively updating the position while scrolling.
  11426. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11427. *
  11428. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11429. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11430. * jQuery(element).on('click', throttled);
  11431. *
  11432. * // Cancel the trailing throttled invocation.
  11433. * jQuery(window).on('popstate', throttled.cancel);
  11434. */
  11435. function throttle(func, wait, options) {
  11436. var leading = true,
  11437. trailing = true;
  11438. if (typeof func != 'function') {
  11439. throw new TypeError(FUNC_ERROR_TEXT);
  11440. }
  11441. if (isObject(options)) {
  11442. leading = 'leading' in options ? !!options.leading : leading;
  11443. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11444. }
  11445. return debounce(func, wait, {
  11446. 'leading': leading,
  11447. 'maxWait': wait,
  11448. 'trailing': trailing
  11449. });
  11450. }
  11451. /**
  11452. * Creates a function that accepts up to one argument, ignoring any
  11453. * additional arguments.
  11454. *
  11455. * @static
  11456. * @memberOf _
  11457. * @since 4.0.0
  11458. * @category Function
  11459. * @param {Function} func The function to cap arguments for.
  11460. * @returns {Function} Returns the new capped function.
  11461. * @example
  11462. *
  11463. * _.map(['6', '8', '10'], _.unary(parseInt));
  11464. * // => [6, 8, 10]
  11465. */
  11466. function unary(func) {
  11467. return ary(func, 1);
  11468. }
  11469. /**
  11470. * Creates a function that provides `value` to `wrapper` as its first
  11471. * argument. Any additional arguments provided to the function are appended
  11472. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11473. * binding of the created function.
  11474. *
  11475. * @static
  11476. * @memberOf _
  11477. * @since 0.1.0
  11478. * @category Function
  11479. * @param {*} value The value to wrap.
  11480. * @param {Function} [wrapper=identity] The wrapper function.
  11481. * @returns {Function} Returns the new function.
  11482. * @example
  11483. *
  11484. * var p = _.wrap(_.escape, function(func, text) {
  11485. * return '<p>' + func(text) + '</p>';
  11486. * });
  11487. *
  11488. * p('fred, barney, & pebbles');
  11489. * // => '<p>fred, barney, &amp; pebbles</p>'
  11490. */
  11491. function wrap(value, wrapper) {
  11492. return partial(castFunction(wrapper), value);
  11493. }
  11494. /*------------------------------------------------------------------------*/
  11495. /**
  11496. * Casts `value` as an array if it's not one.
  11497. *
  11498. * @static
  11499. * @memberOf _
  11500. * @since 4.4.0
  11501. * @category Lang
  11502. * @param {*} value The value to inspect.
  11503. * @returns {Array} Returns the cast array.
  11504. * @example
  11505. *
  11506. * _.castArray(1);
  11507. * // => [1]
  11508. *
  11509. * _.castArray({ 'a': 1 });
  11510. * // => [{ 'a': 1 }]
  11511. *
  11512. * _.castArray('abc');
  11513. * // => ['abc']
  11514. *
  11515. * _.castArray(null);
  11516. * // => [null]
  11517. *
  11518. * _.castArray(undefined);
  11519. * // => [undefined]
  11520. *
  11521. * _.castArray();
  11522. * // => []
  11523. *
  11524. * var array = [1, 2, 3];
  11525. * console.log(_.castArray(array) === array);
  11526. * // => true
  11527. */
  11528. function castArray() {
  11529. if (!arguments.length) {
  11530. return [];
  11531. }
  11532. var value = arguments[0];
  11533. return isArray(value) ? value : [value];
  11534. }
  11535. /**
  11536. * Creates a shallow clone of `value`.
  11537. *
  11538. * **Note:** This method is loosely based on the
  11539. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11540. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11541. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11542. * arrays. The own enumerable properties of `arguments` objects are cloned
  11543. * as plain objects. An empty object is returned for uncloneable values such
  11544. * as error objects, functions, DOM nodes, and WeakMaps.
  11545. *
  11546. * @static
  11547. * @memberOf _
  11548. * @since 0.1.0
  11549. * @category Lang
  11550. * @param {*} value The value to clone.
  11551. * @returns {*} Returns the cloned value.
  11552. * @see _.cloneDeep
  11553. * @example
  11554. *
  11555. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11556. *
  11557. * var shallow = _.clone(objects);
  11558. * console.log(shallow[0] === objects[0]);
  11559. * // => true
  11560. */
  11561. function clone(value) {
  11562. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11563. }
  11564. /**
  11565. * This method is like `_.clone` except that it accepts `customizer` which
  11566. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11567. * cloning is handled by the method instead. The `customizer` is invoked with
  11568. * up to four arguments; (value [, index|key, object, stack]).
  11569. *
  11570. * @static
  11571. * @memberOf _
  11572. * @since 4.0.0
  11573. * @category Lang
  11574. * @param {*} value The value to clone.
  11575. * @param {Function} [customizer] The function to customize cloning.
  11576. * @returns {*} Returns the cloned value.
  11577. * @see _.cloneDeepWith
  11578. * @example
  11579. *
  11580. * function customizer(value) {
  11581. * if (_.isElement(value)) {
  11582. * return value.cloneNode(false);
  11583. * }
  11584. * }
  11585. *
  11586. * var el = _.cloneWith(document.body, customizer);
  11587. *
  11588. * console.log(el === document.body);
  11589. * // => false
  11590. * console.log(el.nodeName);
  11591. * // => 'BODY'
  11592. * console.log(el.childNodes.length);
  11593. * // => 0
  11594. */
  11595. function cloneWith(value, customizer) {
  11596. customizer = typeof customizer == 'function' ? customizer : undefined;
  11597. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11598. }
  11599. /**
  11600. * This method is like `_.clone` except that it recursively clones `value`.
  11601. *
  11602. * @static
  11603. * @memberOf _
  11604. * @since 1.0.0
  11605. * @category Lang
  11606. * @param {*} value The value to recursively clone.
  11607. * @returns {*} Returns the deep cloned value.
  11608. * @see _.clone
  11609. * @example
  11610. *
  11611. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11612. *
  11613. * var deep = _.cloneDeep(objects);
  11614. * console.log(deep[0] === objects[0]);
  11615. * // => false
  11616. */
  11617. function cloneDeep(value) {
  11618. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11619. }
  11620. /**
  11621. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11622. *
  11623. * @static
  11624. * @memberOf _
  11625. * @since 4.0.0
  11626. * @category Lang
  11627. * @param {*} value The value to recursively clone.
  11628. * @param {Function} [customizer] The function to customize cloning.
  11629. * @returns {*} Returns the deep cloned value.
  11630. * @see _.cloneWith
  11631. * @example
  11632. *
  11633. * function customizer(value) {
  11634. * if (_.isElement(value)) {
  11635. * return value.cloneNode(true);
  11636. * }
  11637. * }
  11638. *
  11639. * var el = _.cloneDeepWith(document.body, customizer);
  11640. *
  11641. * console.log(el === document.body);
  11642. * // => false
  11643. * console.log(el.nodeName);
  11644. * // => 'BODY'
  11645. * console.log(el.childNodes.length);
  11646. * // => 20
  11647. */
  11648. function cloneDeepWith(value, customizer) {
  11649. customizer = typeof customizer == 'function' ? customizer : undefined;
  11650. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11651. }
  11652. /**
  11653. * Checks if `object` conforms to `source` by invoking the predicate
  11654. * properties of `source` with the corresponding property values of `object`.
  11655. *
  11656. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11657. * partially applied.
  11658. *
  11659. * @static
  11660. * @memberOf _
  11661. * @since 4.14.0
  11662. * @category Lang
  11663. * @param {Object} object The object to inspect.
  11664. * @param {Object} source The object of property predicates to conform to.
  11665. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11666. * @example
  11667. *
  11668. * var object = { 'a': 1, 'b': 2 };
  11669. *
  11670. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11671. * // => true
  11672. *
  11673. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11674. * // => false
  11675. */
  11676. function conformsTo(object, source) {
  11677. return source == null || baseConformsTo(object, source, keys(source));
  11678. }
  11679. /**
  11680. * Performs a
  11681. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11682. * comparison between two values to determine if they are equivalent.
  11683. *
  11684. * @static
  11685. * @memberOf _
  11686. * @since 4.0.0
  11687. * @category Lang
  11688. * @param {*} value The value to compare.
  11689. * @param {*} other The other value to compare.
  11690. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11691. * @example
  11692. *
  11693. * var object = { 'a': 1 };
  11694. * var other = { 'a': 1 };
  11695. *
  11696. * _.eq(object, object);
  11697. * // => true
  11698. *
  11699. * _.eq(object, other);
  11700. * // => false
  11701. *
  11702. * _.eq('a', 'a');
  11703. * // => true
  11704. *
  11705. * _.eq('a', Object('a'));
  11706. * // => false
  11707. *
  11708. * _.eq(NaN, NaN);
  11709. * // => true
  11710. */
  11711. function eq(value, other) {
  11712. return value === other || (value !== value && other !== other);
  11713. }
  11714. /**
  11715. * Checks if `value` is greater than `other`.
  11716. *
  11717. * @static
  11718. * @memberOf _
  11719. * @since 3.9.0
  11720. * @category Lang
  11721. * @param {*} value The value to compare.
  11722. * @param {*} other The other value to compare.
  11723. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11724. * else `false`.
  11725. * @see _.lt
  11726. * @example
  11727. *
  11728. * _.gt(3, 1);
  11729. * // => true
  11730. *
  11731. * _.gt(3, 3);
  11732. * // => false
  11733. *
  11734. * _.gt(1, 3);
  11735. * // => false
  11736. */
  11737. var gt = createRelationalOperation(baseGt);
  11738. /**
  11739. * Checks if `value` is greater than or equal to `other`.
  11740. *
  11741. * @static
  11742. * @memberOf _
  11743. * @since 3.9.0
  11744. * @category Lang
  11745. * @param {*} value The value to compare.
  11746. * @param {*} other The other value to compare.
  11747. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11748. * `other`, else `false`.
  11749. * @see _.lte
  11750. * @example
  11751. *
  11752. * _.gte(3, 1);
  11753. * // => true
  11754. *
  11755. * _.gte(3, 3);
  11756. * // => true
  11757. *
  11758. * _.gte(1, 3);
  11759. * // => false
  11760. */
  11761. var gte = createRelationalOperation(function(value, other) {
  11762. return value >= other;
  11763. });
  11764. /**
  11765. * Checks if `value` is likely an `arguments` object.
  11766. *
  11767. * @static
  11768. * @memberOf _
  11769. * @since 0.1.0
  11770. * @category Lang
  11771. * @param {*} value The value to check.
  11772. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11773. * else `false`.
  11774. * @example
  11775. *
  11776. * _.isArguments(function() { return arguments; }());
  11777. * // => true
  11778. *
  11779. * _.isArguments([1, 2, 3]);
  11780. * // => false
  11781. */
  11782. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11783. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11784. !propertyIsEnumerable.call(value, 'callee');
  11785. };
  11786. /**
  11787. * Checks if `value` is classified as an `Array` object.
  11788. *
  11789. * @static
  11790. * @memberOf _
  11791. * @since 0.1.0
  11792. * @category Lang
  11793. * @param {*} value The value to check.
  11794. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11795. * @example
  11796. *
  11797. * _.isArray([1, 2, 3]);
  11798. * // => true
  11799. *
  11800. * _.isArray(document.body.children);
  11801. * // => false
  11802. *
  11803. * _.isArray('abc');
  11804. * // => false
  11805. *
  11806. * _.isArray(_.noop);
  11807. * // => false
  11808. */
  11809. var isArray = Array.isArray;
  11810. /**
  11811. * Checks if `value` is classified as an `ArrayBuffer` object.
  11812. *
  11813. * @static
  11814. * @memberOf _
  11815. * @since 4.3.0
  11816. * @category Lang
  11817. * @param {*} value The value to check.
  11818. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11819. * @example
  11820. *
  11821. * _.isArrayBuffer(new ArrayBuffer(2));
  11822. * // => true
  11823. *
  11824. * _.isArrayBuffer(new Array(2));
  11825. * // => false
  11826. */
  11827. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11828. /**
  11829. * Checks if `value` is array-like. A value is considered array-like if it's
  11830. * not a function and has a `value.length` that's an integer greater than or
  11831. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11832. *
  11833. * @static
  11834. * @memberOf _
  11835. * @since 4.0.0
  11836. * @category Lang
  11837. * @param {*} value The value to check.
  11838. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11839. * @example
  11840. *
  11841. * _.isArrayLike([1, 2, 3]);
  11842. * // => true
  11843. *
  11844. * _.isArrayLike(document.body.children);
  11845. * // => true
  11846. *
  11847. * _.isArrayLike('abc');
  11848. * // => true
  11849. *
  11850. * _.isArrayLike(_.noop);
  11851. * // => false
  11852. */
  11853. function isArrayLike(value) {
  11854. return value != null && isLength(value.length) && !isFunction(value);
  11855. }
  11856. /**
  11857. * This method is like `_.isArrayLike` except that it also checks if `value`
  11858. * is an object.
  11859. *
  11860. * @static
  11861. * @memberOf _
  11862. * @since 4.0.0
  11863. * @category Lang
  11864. * @param {*} value The value to check.
  11865. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11866. * else `false`.
  11867. * @example
  11868. *
  11869. * _.isArrayLikeObject([1, 2, 3]);
  11870. * // => true
  11871. *
  11872. * _.isArrayLikeObject(document.body.children);
  11873. * // => true
  11874. *
  11875. * _.isArrayLikeObject('abc');
  11876. * // => false
  11877. *
  11878. * _.isArrayLikeObject(_.noop);
  11879. * // => false
  11880. */
  11881. function isArrayLikeObject(value) {
  11882. return isObjectLike(value) && isArrayLike(value);
  11883. }
  11884. /**
  11885. * Checks if `value` is classified as a boolean primitive or object.
  11886. *
  11887. * @static
  11888. * @memberOf _
  11889. * @since 0.1.0
  11890. * @category Lang
  11891. * @param {*} value The value to check.
  11892. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11893. * @example
  11894. *
  11895. * _.isBoolean(false);
  11896. * // => true
  11897. *
  11898. * _.isBoolean(null);
  11899. * // => false
  11900. */
  11901. function isBoolean(value) {
  11902. return value === true || value === false ||
  11903. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11904. }
  11905. /**
  11906. * Checks if `value` is a buffer.
  11907. *
  11908. * @static
  11909. * @memberOf _
  11910. * @since 4.3.0
  11911. * @category Lang
  11912. * @param {*} value The value to check.
  11913. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11914. * @example
  11915. *
  11916. * _.isBuffer(new Buffer(2));
  11917. * // => true
  11918. *
  11919. * _.isBuffer(new Uint8Array(2));
  11920. * // => false
  11921. */
  11922. var isBuffer = nativeIsBuffer || stubFalse;
  11923. /**
  11924. * Checks if `value` is classified as a `Date` object.
  11925. *
  11926. * @static
  11927. * @memberOf _
  11928. * @since 0.1.0
  11929. * @category Lang
  11930. * @param {*} value The value to check.
  11931. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11932. * @example
  11933. *
  11934. * _.isDate(new Date);
  11935. * // => true
  11936. *
  11937. * _.isDate('Mon April 23 2012');
  11938. * // => false
  11939. */
  11940. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11941. /**
  11942. * Checks if `value` is likely a DOM element.
  11943. *
  11944. * @static
  11945. * @memberOf _
  11946. * @since 0.1.0
  11947. * @category Lang
  11948. * @param {*} value The value to check.
  11949. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11950. * @example
  11951. *
  11952. * _.isElement(document.body);
  11953. * // => true
  11954. *
  11955. * _.isElement('<body>');
  11956. * // => false
  11957. */
  11958. function isElement(value) {
  11959. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11960. }
  11961. /**
  11962. * Checks if `value` is an empty object, collection, map, or set.
  11963. *
  11964. * Objects are considered empty if they have no own enumerable string keyed
  11965. * properties.
  11966. *
  11967. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11968. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11969. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11970. *
  11971. * @static
  11972. * @memberOf _
  11973. * @since 0.1.0
  11974. * @category Lang
  11975. * @param {*} value The value to check.
  11976. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11977. * @example
  11978. *
  11979. * _.isEmpty(null);
  11980. * // => true
  11981. *
  11982. * _.isEmpty(true);
  11983. * // => true
  11984. *
  11985. * _.isEmpty(1);
  11986. * // => true
  11987. *
  11988. * _.isEmpty([1, 2, 3]);
  11989. * // => false
  11990. *
  11991. * _.isEmpty({ 'a': 1 });
  11992. * // => false
  11993. */
  11994. function isEmpty(value) {
  11995. if (value == null) {
  11996. return true;
  11997. }
  11998. if (isArrayLike(value) &&
  11999. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12000. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12001. return !value.length;
  12002. }
  12003. var tag = getTag(value);
  12004. if (tag == mapTag || tag == setTag) {
  12005. return !value.size;
  12006. }
  12007. if (isPrototype(value)) {
  12008. return !baseKeys(value).length;
  12009. }
  12010. for (var key in value) {
  12011. if (hasOwnProperty.call(value, key)) {
  12012. return false;
  12013. }
  12014. }
  12015. return true;
  12016. }
  12017. /**
  12018. * Performs a deep comparison between two values to determine if they are
  12019. * equivalent.
  12020. *
  12021. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12022. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12023. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12024. * by their own, not inherited, enumerable properties. Functions and DOM
  12025. * nodes are compared by strict equality, i.e. `===`.
  12026. *
  12027. * @static
  12028. * @memberOf _
  12029. * @since 0.1.0
  12030. * @category Lang
  12031. * @param {*} value The value to compare.
  12032. * @param {*} other The other value to compare.
  12033. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12034. * @example
  12035. *
  12036. * var object = { 'a': 1 };
  12037. * var other = { 'a': 1 };
  12038. *
  12039. * _.isEqual(object, other);
  12040. * // => true
  12041. *
  12042. * object === other;
  12043. * // => false
  12044. */
  12045. function isEqual(value, other) {
  12046. return baseIsEqual(value, other);
  12047. }
  12048. /**
  12049. * This method is like `_.isEqual` except that it accepts `customizer` which
  12050. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12051. * are handled by the method instead. The `customizer` is invoked with up to
  12052. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12053. *
  12054. * @static
  12055. * @memberOf _
  12056. * @since 4.0.0
  12057. * @category Lang
  12058. * @param {*} value The value to compare.
  12059. * @param {*} other The other value to compare.
  12060. * @param {Function} [customizer] The function to customize comparisons.
  12061. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12062. * @example
  12063. *
  12064. * function isGreeting(value) {
  12065. * return /^h(?:i|ello)$/.test(value);
  12066. * }
  12067. *
  12068. * function customizer(objValue, othValue) {
  12069. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12070. * return true;
  12071. * }
  12072. * }
  12073. *
  12074. * var array = ['hello', 'goodbye'];
  12075. * var other = ['hi', 'goodbye'];
  12076. *
  12077. * _.isEqualWith(array, other, customizer);
  12078. * // => true
  12079. */
  12080. function isEqualWith(value, other, customizer) {
  12081. customizer = typeof customizer == 'function' ? customizer : undefined;
  12082. var result = customizer ? customizer(value, other) : undefined;
  12083. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12084. }
  12085. /**
  12086. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12087. * `SyntaxError`, `TypeError`, or `URIError` object.
  12088. *
  12089. * @static
  12090. * @memberOf _
  12091. * @since 3.0.0
  12092. * @category Lang
  12093. * @param {*} value The value to check.
  12094. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12095. * @example
  12096. *
  12097. * _.isError(new Error);
  12098. * // => true
  12099. *
  12100. * _.isError(Error);
  12101. * // => false
  12102. */
  12103. function isError(value) {
  12104. if (!isObjectLike(value)) {
  12105. return false;
  12106. }
  12107. var tag = baseGetTag(value);
  12108. return tag == errorTag || tag == domExcTag ||
  12109. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12110. }
  12111. /**
  12112. * Checks if `value` is a finite primitive number.
  12113. *
  12114. * **Note:** This method is based on
  12115. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12116. *
  12117. * @static
  12118. * @memberOf _
  12119. * @since 0.1.0
  12120. * @category Lang
  12121. * @param {*} value The value to check.
  12122. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12123. * @example
  12124. *
  12125. * _.isFinite(3);
  12126. * // => true
  12127. *
  12128. * _.isFinite(Number.MIN_VALUE);
  12129. * // => true
  12130. *
  12131. * _.isFinite(Infinity);
  12132. * // => false
  12133. *
  12134. * _.isFinite('3');
  12135. * // => false
  12136. */
  12137. function isFinite(value) {
  12138. return typeof value == 'number' && nativeIsFinite(value);
  12139. }
  12140. /**
  12141. * Checks if `value` is classified as a `Function` object.
  12142. *
  12143. * @static
  12144. * @memberOf _
  12145. * @since 0.1.0
  12146. * @category Lang
  12147. * @param {*} value The value to check.
  12148. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12149. * @example
  12150. *
  12151. * _.isFunction(_);
  12152. * // => true
  12153. *
  12154. * _.isFunction(/abc/);
  12155. * // => false
  12156. */
  12157. function isFunction(value) {
  12158. if (!isObject(value)) {
  12159. return false;
  12160. }
  12161. // The use of `Object#toString` avoids issues with the `typeof` operator
  12162. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12163. var tag = baseGetTag(value);
  12164. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12165. }
  12166. /**
  12167. * Checks if `value` is an integer.
  12168. *
  12169. * **Note:** This method is based on
  12170. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12171. *
  12172. * @static
  12173. * @memberOf _
  12174. * @since 4.0.0
  12175. * @category Lang
  12176. * @param {*} value The value to check.
  12177. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12178. * @example
  12179. *
  12180. * _.isInteger(3);
  12181. * // => true
  12182. *
  12183. * _.isInteger(Number.MIN_VALUE);
  12184. * // => false
  12185. *
  12186. * _.isInteger(Infinity);
  12187. * // => false
  12188. *
  12189. * _.isInteger('3');
  12190. * // => false
  12191. */
  12192. function isInteger(value) {
  12193. return typeof value == 'number' && value == toInteger(value);
  12194. }
  12195. /**
  12196. * Checks if `value` is a valid array-like length.
  12197. *
  12198. * **Note:** This method is loosely based on
  12199. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12200. *
  12201. * @static
  12202. * @memberOf _
  12203. * @since 4.0.0
  12204. * @category Lang
  12205. * @param {*} value The value to check.
  12206. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12207. * @example
  12208. *
  12209. * _.isLength(3);
  12210. * // => true
  12211. *
  12212. * _.isLength(Number.MIN_VALUE);
  12213. * // => false
  12214. *
  12215. * _.isLength(Infinity);
  12216. * // => false
  12217. *
  12218. * _.isLength('3');
  12219. * // => false
  12220. */
  12221. function isLength(value) {
  12222. return typeof value == 'number' &&
  12223. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12224. }
  12225. /**
  12226. * Checks if `value` is the
  12227. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12228. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12229. *
  12230. * @static
  12231. * @memberOf _
  12232. * @since 0.1.0
  12233. * @category Lang
  12234. * @param {*} value The value to check.
  12235. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12236. * @example
  12237. *
  12238. * _.isObject({});
  12239. * // => true
  12240. *
  12241. * _.isObject([1, 2, 3]);
  12242. * // => true
  12243. *
  12244. * _.isObject(_.noop);
  12245. * // => true
  12246. *
  12247. * _.isObject(null);
  12248. * // => false
  12249. */
  12250. function isObject(value) {
  12251. var type = typeof value;
  12252. return value != null && (type == 'object' || type == 'function');
  12253. }
  12254. /**
  12255. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12256. * and has a `typeof` result of "object".
  12257. *
  12258. * @static
  12259. * @memberOf _
  12260. * @since 4.0.0
  12261. * @category Lang
  12262. * @param {*} value The value to check.
  12263. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12264. * @example
  12265. *
  12266. * _.isObjectLike({});
  12267. * // => true
  12268. *
  12269. * _.isObjectLike([1, 2, 3]);
  12270. * // => true
  12271. *
  12272. * _.isObjectLike(_.noop);
  12273. * // => false
  12274. *
  12275. * _.isObjectLike(null);
  12276. * // => false
  12277. */
  12278. function isObjectLike(value) {
  12279. return value != null && typeof value == 'object';
  12280. }
  12281. /**
  12282. * Checks if `value` is classified as a `Map` object.
  12283. *
  12284. * @static
  12285. * @memberOf _
  12286. * @since 4.3.0
  12287. * @category Lang
  12288. * @param {*} value The value to check.
  12289. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12290. * @example
  12291. *
  12292. * _.isMap(new Map);
  12293. * // => true
  12294. *
  12295. * _.isMap(new WeakMap);
  12296. * // => false
  12297. */
  12298. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12299. /**
  12300. * Performs a partial deep comparison between `object` and `source` to
  12301. * determine if `object` contains equivalent property values.
  12302. *
  12303. * **Note:** This method is equivalent to `_.matches` when `source` is
  12304. * partially applied.
  12305. *
  12306. * Partial comparisons will match empty array and empty object `source`
  12307. * values against any array or object value, respectively. See `_.isEqual`
  12308. * for a list of supported value comparisons.
  12309. *
  12310. * @static
  12311. * @memberOf _
  12312. * @since 3.0.0
  12313. * @category Lang
  12314. * @param {Object} object The object to inspect.
  12315. * @param {Object} source The object of property values to match.
  12316. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12317. * @example
  12318. *
  12319. * var object = { 'a': 1, 'b': 2 };
  12320. *
  12321. * _.isMatch(object, { 'b': 2 });
  12322. * // => true
  12323. *
  12324. * _.isMatch(object, { 'b': 1 });
  12325. * // => false
  12326. */
  12327. function isMatch(object, source) {
  12328. return object === source || baseIsMatch(object, source, getMatchData(source));
  12329. }
  12330. /**
  12331. * This method is like `_.isMatch` except that it accepts `customizer` which
  12332. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12333. * are handled by the method instead. The `customizer` is invoked with five
  12334. * arguments: (objValue, srcValue, index|key, object, source).
  12335. *
  12336. * @static
  12337. * @memberOf _
  12338. * @since 4.0.0
  12339. * @category Lang
  12340. * @param {Object} object The object to inspect.
  12341. * @param {Object} source The object of property values to match.
  12342. * @param {Function} [customizer] The function to customize comparisons.
  12343. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12344. * @example
  12345. *
  12346. * function isGreeting(value) {
  12347. * return /^h(?:i|ello)$/.test(value);
  12348. * }
  12349. *
  12350. * function customizer(objValue, srcValue) {
  12351. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12352. * return true;
  12353. * }
  12354. * }
  12355. *
  12356. * var object = { 'greeting': 'hello' };
  12357. * var source = { 'greeting': 'hi' };
  12358. *
  12359. * _.isMatchWith(object, source, customizer);
  12360. * // => true
  12361. */
  12362. function isMatchWith(object, source, customizer) {
  12363. customizer = typeof customizer == 'function' ? customizer : undefined;
  12364. return baseIsMatch(object, source, getMatchData(source), customizer);
  12365. }
  12366. /**
  12367. * Checks if `value` is `NaN`.
  12368. *
  12369. * **Note:** This method is based on
  12370. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12371. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12372. * `undefined` and other non-number values.
  12373. *
  12374. * @static
  12375. * @memberOf _
  12376. * @since 0.1.0
  12377. * @category Lang
  12378. * @param {*} value The value to check.
  12379. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12380. * @example
  12381. *
  12382. * _.isNaN(NaN);
  12383. * // => true
  12384. *
  12385. * _.isNaN(new Number(NaN));
  12386. * // => true
  12387. *
  12388. * isNaN(undefined);
  12389. * // => true
  12390. *
  12391. * _.isNaN(undefined);
  12392. * // => false
  12393. */
  12394. function isNaN(value) {
  12395. // An `NaN` primitive is the only value that is not equal to itself.
  12396. // Perform the `toStringTag` check first to avoid errors with some
  12397. // ActiveX objects in IE.
  12398. return isNumber(value) && value != +value;
  12399. }
  12400. /**
  12401. * Checks if `value` is a pristine native function.
  12402. *
  12403. * **Note:** This method can't reliably detect native functions in the presence
  12404. * of the core-js package because core-js circumvents this kind of detection.
  12405. * Despite multiple requests, the core-js maintainer has made it clear: any
  12406. * attempt to fix the detection will be obstructed. As a result, we're left
  12407. * with little choice but to throw an error. Unfortunately, this also affects
  12408. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12409. * which rely on core-js.
  12410. *
  12411. * @static
  12412. * @memberOf _
  12413. * @since 3.0.0
  12414. * @category Lang
  12415. * @param {*} value The value to check.
  12416. * @returns {boolean} Returns `true` if `value` is a native function,
  12417. * else `false`.
  12418. * @example
  12419. *
  12420. * _.isNative(Array.prototype.push);
  12421. * // => true
  12422. *
  12423. * _.isNative(_);
  12424. * // => false
  12425. */
  12426. function isNative(value) {
  12427. if (isMaskable(value)) {
  12428. throw new Error(CORE_ERROR_TEXT);
  12429. }
  12430. return baseIsNative(value);
  12431. }
  12432. /**
  12433. * Checks if `value` is `null`.
  12434. *
  12435. * @static
  12436. * @memberOf _
  12437. * @since 0.1.0
  12438. * @category Lang
  12439. * @param {*} value The value to check.
  12440. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12441. * @example
  12442. *
  12443. * _.isNull(null);
  12444. * // => true
  12445. *
  12446. * _.isNull(void 0);
  12447. * // => false
  12448. */
  12449. function isNull(value) {
  12450. return value === null;
  12451. }
  12452. /**
  12453. * Checks if `value` is `null` or `undefined`.
  12454. *
  12455. * @static
  12456. * @memberOf _
  12457. * @since 4.0.0
  12458. * @category Lang
  12459. * @param {*} value The value to check.
  12460. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12461. * @example
  12462. *
  12463. * _.isNil(null);
  12464. * // => true
  12465. *
  12466. * _.isNil(void 0);
  12467. * // => true
  12468. *
  12469. * _.isNil(NaN);
  12470. * // => false
  12471. */
  12472. function isNil(value) {
  12473. return value == null;
  12474. }
  12475. /**
  12476. * Checks if `value` is classified as a `Number` primitive or object.
  12477. *
  12478. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12479. * classified as numbers, use the `_.isFinite` method.
  12480. *
  12481. * @static
  12482. * @memberOf _
  12483. * @since 0.1.0
  12484. * @category Lang
  12485. * @param {*} value The value to check.
  12486. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12487. * @example
  12488. *
  12489. * _.isNumber(3);
  12490. * // => true
  12491. *
  12492. * _.isNumber(Number.MIN_VALUE);
  12493. * // => true
  12494. *
  12495. * _.isNumber(Infinity);
  12496. * // => true
  12497. *
  12498. * _.isNumber('3');
  12499. * // => false
  12500. */
  12501. function isNumber(value) {
  12502. return typeof value == 'number' ||
  12503. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12504. }
  12505. /**
  12506. * Checks if `value` is a plain object, that is, an object created by the
  12507. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12508. *
  12509. * @static
  12510. * @memberOf _
  12511. * @since 0.8.0
  12512. * @category Lang
  12513. * @param {*} value The value to check.
  12514. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12515. * @example
  12516. *
  12517. * function Foo() {
  12518. * this.a = 1;
  12519. * }
  12520. *
  12521. * _.isPlainObject(new Foo);
  12522. * // => false
  12523. *
  12524. * _.isPlainObject([1, 2, 3]);
  12525. * // => false
  12526. *
  12527. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12528. * // => true
  12529. *
  12530. * _.isPlainObject(Object.create(null));
  12531. * // => true
  12532. */
  12533. function isPlainObject(value) {
  12534. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12535. return false;
  12536. }
  12537. var proto = getPrototype(value);
  12538. if (proto === null) {
  12539. return true;
  12540. }
  12541. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12542. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12543. funcToString.call(Ctor) == objectCtorString;
  12544. }
  12545. /**
  12546. * Checks if `value` is classified as a `RegExp` object.
  12547. *
  12548. * @static
  12549. * @memberOf _
  12550. * @since 0.1.0
  12551. * @category Lang
  12552. * @param {*} value The value to check.
  12553. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12554. * @example
  12555. *
  12556. * _.isRegExp(/abc/);
  12557. * // => true
  12558. *
  12559. * _.isRegExp('/abc/');
  12560. * // => false
  12561. */
  12562. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12563. /**
  12564. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12565. * double precision number which isn't the result of a rounded unsafe integer.
  12566. *
  12567. * **Note:** This method is based on
  12568. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12569. *
  12570. * @static
  12571. * @memberOf _
  12572. * @since 4.0.0
  12573. * @category Lang
  12574. * @param {*} value The value to check.
  12575. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12576. * @example
  12577. *
  12578. * _.isSafeInteger(3);
  12579. * // => true
  12580. *
  12581. * _.isSafeInteger(Number.MIN_VALUE);
  12582. * // => false
  12583. *
  12584. * _.isSafeInteger(Infinity);
  12585. * // => false
  12586. *
  12587. * _.isSafeInteger('3');
  12588. * // => false
  12589. */
  12590. function isSafeInteger(value) {
  12591. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12592. }
  12593. /**
  12594. * Checks if `value` is classified as a `Set` object.
  12595. *
  12596. * @static
  12597. * @memberOf _
  12598. * @since 4.3.0
  12599. * @category Lang
  12600. * @param {*} value The value to check.
  12601. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12602. * @example
  12603. *
  12604. * _.isSet(new Set);
  12605. * // => true
  12606. *
  12607. * _.isSet(new WeakSet);
  12608. * // => false
  12609. */
  12610. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12611. /**
  12612. * Checks if `value` is classified as a `String` primitive or object.
  12613. *
  12614. * @static
  12615. * @since 0.1.0
  12616. * @memberOf _
  12617. * @category Lang
  12618. * @param {*} value The value to check.
  12619. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12620. * @example
  12621. *
  12622. * _.isString('abc');
  12623. * // => true
  12624. *
  12625. * _.isString(1);
  12626. * // => false
  12627. */
  12628. function isString(value) {
  12629. return typeof value == 'string' ||
  12630. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12631. }
  12632. /**
  12633. * Checks if `value` is classified as a `Symbol` primitive or object.
  12634. *
  12635. * @static
  12636. * @memberOf _
  12637. * @since 4.0.0
  12638. * @category Lang
  12639. * @param {*} value The value to check.
  12640. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12641. * @example
  12642. *
  12643. * _.isSymbol(Symbol.iterator);
  12644. * // => true
  12645. *
  12646. * _.isSymbol('abc');
  12647. * // => false
  12648. */
  12649. function isSymbol(value) {
  12650. return typeof value == 'symbol' ||
  12651. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12652. }
  12653. /**
  12654. * Checks if `value` is classified as a typed array.
  12655. *
  12656. * @static
  12657. * @memberOf _
  12658. * @since 3.0.0
  12659. * @category Lang
  12660. * @param {*} value The value to check.
  12661. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12662. * @example
  12663. *
  12664. * _.isTypedArray(new Uint8Array);
  12665. * // => true
  12666. *
  12667. * _.isTypedArray([]);
  12668. * // => false
  12669. */
  12670. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12671. /**
  12672. * Checks if `value` is `undefined`.
  12673. *
  12674. * @static
  12675. * @since 0.1.0
  12676. * @memberOf _
  12677. * @category Lang
  12678. * @param {*} value The value to check.
  12679. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12680. * @example
  12681. *
  12682. * _.isUndefined(void 0);
  12683. * // => true
  12684. *
  12685. * _.isUndefined(null);
  12686. * // => false
  12687. */
  12688. function isUndefined(value) {
  12689. return value === undefined;
  12690. }
  12691. /**
  12692. * Checks if `value` is classified as a `WeakMap` object.
  12693. *
  12694. * @static
  12695. * @memberOf _
  12696. * @since 4.3.0
  12697. * @category Lang
  12698. * @param {*} value The value to check.
  12699. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12700. * @example
  12701. *
  12702. * _.isWeakMap(new WeakMap);
  12703. * // => true
  12704. *
  12705. * _.isWeakMap(new Map);
  12706. * // => false
  12707. */
  12708. function isWeakMap(value) {
  12709. return isObjectLike(value) && getTag(value) == weakMapTag;
  12710. }
  12711. /**
  12712. * Checks if `value` is classified as a `WeakSet` object.
  12713. *
  12714. * @static
  12715. * @memberOf _
  12716. * @since 4.3.0
  12717. * @category Lang
  12718. * @param {*} value The value to check.
  12719. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12720. * @example
  12721. *
  12722. * _.isWeakSet(new WeakSet);
  12723. * // => true
  12724. *
  12725. * _.isWeakSet(new Set);
  12726. * // => false
  12727. */
  12728. function isWeakSet(value) {
  12729. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12730. }
  12731. /**
  12732. * Checks if `value` is less than `other`.
  12733. *
  12734. * @static
  12735. * @memberOf _
  12736. * @since 3.9.0
  12737. * @category Lang
  12738. * @param {*} value The value to compare.
  12739. * @param {*} other The other value to compare.
  12740. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12741. * else `false`.
  12742. * @see _.gt
  12743. * @example
  12744. *
  12745. * _.lt(1, 3);
  12746. * // => true
  12747. *
  12748. * _.lt(3, 3);
  12749. * // => false
  12750. *
  12751. * _.lt(3, 1);
  12752. * // => false
  12753. */
  12754. var lt = createRelationalOperation(baseLt);
  12755. /**
  12756. * Checks if `value` is less than or equal to `other`.
  12757. *
  12758. * @static
  12759. * @memberOf _
  12760. * @since 3.9.0
  12761. * @category Lang
  12762. * @param {*} value The value to compare.
  12763. * @param {*} other The other value to compare.
  12764. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12765. * `other`, else `false`.
  12766. * @see _.gte
  12767. * @example
  12768. *
  12769. * _.lte(1, 3);
  12770. * // => true
  12771. *
  12772. * _.lte(3, 3);
  12773. * // => true
  12774. *
  12775. * _.lte(3, 1);
  12776. * // => false
  12777. */
  12778. var lte = createRelationalOperation(function(value, other) {
  12779. return value <= other;
  12780. });
  12781. /**
  12782. * Converts `value` to an array.
  12783. *
  12784. * @static
  12785. * @since 0.1.0
  12786. * @memberOf _
  12787. * @category Lang
  12788. * @param {*} value The value to convert.
  12789. * @returns {Array} Returns the converted array.
  12790. * @example
  12791. *
  12792. * _.toArray({ 'a': 1, 'b': 2 });
  12793. * // => [1, 2]
  12794. *
  12795. * _.toArray('abc');
  12796. * // => ['a', 'b', 'c']
  12797. *
  12798. * _.toArray(1);
  12799. * // => []
  12800. *
  12801. * _.toArray(null);
  12802. * // => []
  12803. */
  12804. function toArray(value) {
  12805. if (!value) {
  12806. return [];
  12807. }
  12808. if (isArrayLike(value)) {
  12809. return isString(value) ? stringToArray(value) : copyArray(value);
  12810. }
  12811. if (symIterator && value[symIterator]) {
  12812. return iteratorToArray(value[symIterator]());
  12813. }
  12814. var tag = getTag(value),
  12815. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12816. return func(value);
  12817. }
  12818. /**
  12819. * Converts `value` to a finite number.
  12820. *
  12821. * @static
  12822. * @memberOf _
  12823. * @since 4.12.0
  12824. * @category Lang
  12825. * @param {*} value The value to convert.
  12826. * @returns {number} Returns the converted number.
  12827. * @example
  12828. *
  12829. * _.toFinite(3.2);
  12830. * // => 3.2
  12831. *
  12832. * _.toFinite(Number.MIN_VALUE);
  12833. * // => 5e-324
  12834. *
  12835. * _.toFinite(Infinity);
  12836. * // => 1.7976931348623157e+308
  12837. *
  12838. * _.toFinite('3.2');
  12839. * // => 3.2
  12840. */
  12841. function toFinite(value) {
  12842. if (!value) {
  12843. return value === 0 ? value : 0;
  12844. }
  12845. value = toNumber(value);
  12846. if (value === INFINITY || value === -INFINITY) {
  12847. var sign = (value < 0 ? -1 : 1);
  12848. return sign * MAX_INTEGER;
  12849. }
  12850. return value === value ? value : 0;
  12851. }
  12852. /**
  12853. * Converts `value` to an integer.
  12854. *
  12855. * **Note:** This method is loosely based on
  12856. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12857. *
  12858. * @static
  12859. * @memberOf _
  12860. * @since 4.0.0
  12861. * @category Lang
  12862. * @param {*} value The value to convert.
  12863. * @returns {number} Returns the converted integer.
  12864. * @example
  12865. *
  12866. * _.toInteger(3.2);
  12867. * // => 3
  12868. *
  12869. * _.toInteger(Number.MIN_VALUE);
  12870. * // => 0
  12871. *
  12872. * _.toInteger(Infinity);
  12873. * // => 1.7976931348623157e+308
  12874. *
  12875. * _.toInteger('3.2');
  12876. * // => 3
  12877. */
  12878. function toInteger(value) {
  12879. var result = toFinite(value),
  12880. remainder = result % 1;
  12881. return result === result ? (remainder ? result - remainder : result) : 0;
  12882. }
  12883. /**
  12884. * Converts `value` to an integer suitable for use as the length of an
  12885. * array-like object.
  12886. *
  12887. * **Note:** This method is based on
  12888. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12889. *
  12890. * @static
  12891. * @memberOf _
  12892. * @since 4.0.0
  12893. * @category Lang
  12894. * @param {*} value The value to convert.
  12895. * @returns {number} Returns the converted integer.
  12896. * @example
  12897. *
  12898. * _.toLength(3.2);
  12899. * // => 3
  12900. *
  12901. * _.toLength(Number.MIN_VALUE);
  12902. * // => 0
  12903. *
  12904. * _.toLength(Infinity);
  12905. * // => 4294967295
  12906. *
  12907. * _.toLength('3.2');
  12908. * // => 3
  12909. */
  12910. function toLength(value) {
  12911. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12912. }
  12913. /**
  12914. * Converts `value` to a number.
  12915. *
  12916. * @static
  12917. * @memberOf _
  12918. * @since 4.0.0
  12919. * @category Lang
  12920. * @param {*} value The value to process.
  12921. * @returns {number} Returns the number.
  12922. * @example
  12923. *
  12924. * _.toNumber(3.2);
  12925. * // => 3.2
  12926. *
  12927. * _.toNumber(Number.MIN_VALUE);
  12928. * // => 5e-324
  12929. *
  12930. * _.toNumber(Infinity);
  12931. * // => Infinity
  12932. *
  12933. * _.toNumber('3.2');
  12934. * // => 3.2
  12935. */
  12936. function toNumber(value) {
  12937. if (typeof value == 'number') {
  12938. return value;
  12939. }
  12940. if (isSymbol(value)) {
  12941. return NAN;
  12942. }
  12943. if (isObject(value)) {
  12944. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12945. value = isObject(other) ? (other + '') : other;
  12946. }
  12947. if (typeof value != 'string') {
  12948. return value === 0 ? value : +value;
  12949. }
  12950. value = baseTrim(value);
  12951. var isBinary = reIsBinary.test(value);
  12952. return (isBinary || reIsOctal.test(value))
  12953. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12954. : (reIsBadHex.test(value) ? NAN : +value);
  12955. }
  12956. /**
  12957. * Converts `value` to a plain object flattening inherited enumerable string
  12958. * keyed properties of `value` to own properties of the plain object.
  12959. *
  12960. * @static
  12961. * @memberOf _
  12962. * @since 3.0.0
  12963. * @category Lang
  12964. * @param {*} value The value to convert.
  12965. * @returns {Object} Returns the converted plain object.
  12966. * @example
  12967. *
  12968. * function Foo() {
  12969. * this.b = 2;
  12970. * }
  12971. *
  12972. * Foo.prototype.c = 3;
  12973. *
  12974. * _.assign({ 'a': 1 }, new Foo);
  12975. * // => { 'a': 1, 'b': 2 }
  12976. *
  12977. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12978. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12979. */
  12980. function toPlainObject(value) {
  12981. return copyObject(value, keysIn(value));
  12982. }
  12983. /**
  12984. * Converts `value` to a safe integer. A safe integer can be compared and
  12985. * represented correctly.
  12986. *
  12987. * @static
  12988. * @memberOf _
  12989. * @since 4.0.0
  12990. * @category Lang
  12991. * @param {*} value The value to convert.
  12992. * @returns {number} Returns the converted integer.
  12993. * @example
  12994. *
  12995. * _.toSafeInteger(3.2);
  12996. * // => 3
  12997. *
  12998. * _.toSafeInteger(Number.MIN_VALUE);
  12999. * // => 0
  13000. *
  13001. * _.toSafeInteger(Infinity);
  13002. * // => 9007199254740991
  13003. *
  13004. * _.toSafeInteger('3.2');
  13005. * // => 3
  13006. */
  13007. function toSafeInteger(value) {
  13008. return value
  13009. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13010. : (value === 0 ? value : 0);
  13011. }
  13012. /**
  13013. * Converts `value` to a string. An empty string is returned for `null`
  13014. * and `undefined` values. The sign of `-0` is preserved.
  13015. *
  13016. * @static
  13017. * @memberOf _
  13018. * @since 4.0.0
  13019. * @category Lang
  13020. * @param {*} value The value to convert.
  13021. * @returns {string} Returns the converted string.
  13022. * @example
  13023. *
  13024. * _.toString(null);
  13025. * // => ''
  13026. *
  13027. * _.toString(-0);
  13028. * // => '-0'
  13029. *
  13030. * _.toString([1, 2, 3]);
  13031. * // => '1,2,3'
  13032. */
  13033. function toString(value) {
  13034. return value == null ? '' : baseToString(value);
  13035. }
  13036. /*------------------------------------------------------------------------*/
  13037. /**
  13038. * Assigns own enumerable string keyed properties of source objects to the
  13039. * destination object. Source objects are applied from left to right.
  13040. * Subsequent sources overwrite property assignments of previous sources.
  13041. *
  13042. * **Note:** This method mutates `object` and is loosely based on
  13043. * [`Object.assign`](https://mdn.io/Object/assign).
  13044. *
  13045. * @static
  13046. * @memberOf _
  13047. * @since 0.10.0
  13048. * @category Object
  13049. * @param {Object} object The destination object.
  13050. * @param {...Object} [sources] The source objects.
  13051. * @returns {Object} Returns `object`.
  13052. * @see _.assignIn
  13053. * @example
  13054. *
  13055. * function Foo() {
  13056. * this.a = 1;
  13057. * }
  13058. *
  13059. * function Bar() {
  13060. * this.c = 3;
  13061. * }
  13062. *
  13063. * Foo.prototype.b = 2;
  13064. * Bar.prototype.d = 4;
  13065. *
  13066. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13067. * // => { 'a': 1, 'c': 3 }
  13068. */
  13069. var assign = createAssigner(function(object, source) {
  13070. if (isPrototype(source) || isArrayLike(source)) {
  13071. copyObject(source, keys(source), object);
  13072. return;
  13073. }
  13074. for (var key in source) {
  13075. if (hasOwnProperty.call(source, key)) {
  13076. assignValue(object, key, source[key]);
  13077. }
  13078. }
  13079. });
  13080. /**
  13081. * This method is like `_.assign` except that it iterates over own and
  13082. * inherited source properties.
  13083. *
  13084. * **Note:** This method mutates `object`.
  13085. *
  13086. * @static
  13087. * @memberOf _
  13088. * @since 4.0.0
  13089. * @alias extend
  13090. * @category Object
  13091. * @param {Object} object The destination object.
  13092. * @param {...Object} [sources] The source objects.
  13093. * @returns {Object} Returns `object`.
  13094. * @see _.assign
  13095. * @example
  13096. *
  13097. * function Foo() {
  13098. * this.a = 1;
  13099. * }
  13100. *
  13101. * function Bar() {
  13102. * this.c = 3;
  13103. * }
  13104. *
  13105. * Foo.prototype.b = 2;
  13106. * Bar.prototype.d = 4;
  13107. *
  13108. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13109. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13110. */
  13111. var assignIn = createAssigner(function(object, source) {
  13112. copyObject(source, keysIn(source), object);
  13113. });
  13114. /**
  13115. * This method is like `_.assignIn` except that it accepts `customizer`
  13116. * which is invoked to produce the assigned values. If `customizer` returns
  13117. * `undefined`, assignment is handled by the method instead. The `customizer`
  13118. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13119. *
  13120. * **Note:** This method mutates `object`.
  13121. *
  13122. * @static
  13123. * @memberOf _
  13124. * @since 4.0.0
  13125. * @alias extendWith
  13126. * @category Object
  13127. * @param {Object} object The destination object.
  13128. * @param {...Object} sources The source objects.
  13129. * @param {Function} [customizer] The function to customize assigned values.
  13130. * @returns {Object} Returns `object`.
  13131. * @see _.assignWith
  13132. * @example
  13133. *
  13134. * function customizer(objValue, srcValue) {
  13135. * return _.isUndefined(objValue) ? srcValue : objValue;
  13136. * }
  13137. *
  13138. * var defaults = _.partialRight(_.assignInWith, customizer);
  13139. *
  13140. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13141. * // => { 'a': 1, 'b': 2 }
  13142. */
  13143. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13144. copyObject(source, keysIn(source), object, customizer);
  13145. });
  13146. /**
  13147. * This method is like `_.assign` except that it accepts `customizer`
  13148. * which is invoked to produce the assigned values. If `customizer` returns
  13149. * `undefined`, assignment is handled by the method instead. The `customizer`
  13150. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13151. *
  13152. * **Note:** This method mutates `object`.
  13153. *
  13154. * @static
  13155. * @memberOf _
  13156. * @since 4.0.0
  13157. * @category Object
  13158. * @param {Object} object The destination object.
  13159. * @param {...Object} sources The source objects.
  13160. * @param {Function} [customizer] The function to customize assigned values.
  13161. * @returns {Object} Returns `object`.
  13162. * @see _.assignInWith
  13163. * @example
  13164. *
  13165. * function customizer(objValue, srcValue) {
  13166. * return _.isUndefined(objValue) ? srcValue : objValue;
  13167. * }
  13168. *
  13169. * var defaults = _.partialRight(_.assignWith, customizer);
  13170. *
  13171. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13172. * // => { 'a': 1, 'b': 2 }
  13173. */
  13174. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13175. copyObject(source, keys(source), object, customizer);
  13176. });
  13177. /**
  13178. * Creates an array of values corresponding to `paths` of `object`.
  13179. *
  13180. * @static
  13181. * @memberOf _
  13182. * @since 1.0.0
  13183. * @category Object
  13184. * @param {Object} object The object to iterate over.
  13185. * @param {...(string|string[])} [paths] The property paths to pick.
  13186. * @returns {Array} Returns the picked values.
  13187. * @example
  13188. *
  13189. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13190. *
  13191. * _.at(object, ['a[0].b.c', 'a[1]']);
  13192. * // => [3, 4]
  13193. */
  13194. var at = flatRest(baseAt);
  13195. /**
  13196. * Creates an object that inherits from the `prototype` object. If a
  13197. * `properties` object is given, its own enumerable string keyed properties
  13198. * are assigned to the created object.
  13199. *
  13200. * @static
  13201. * @memberOf _
  13202. * @since 2.3.0
  13203. * @category Object
  13204. * @param {Object} prototype The object to inherit from.
  13205. * @param {Object} [properties] The properties to assign to the object.
  13206. * @returns {Object} Returns the new object.
  13207. * @example
  13208. *
  13209. * function Shape() {
  13210. * this.x = 0;
  13211. * this.y = 0;
  13212. * }
  13213. *
  13214. * function Circle() {
  13215. * Shape.call(this);
  13216. * }
  13217. *
  13218. * Circle.prototype = _.create(Shape.prototype, {
  13219. * 'constructor': Circle
  13220. * });
  13221. *
  13222. * var circle = new Circle;
  13223. * circle instanceof Circle;
  13224. * // => true
  13225. *
  13226. * circle instanceof Shape;
  13227. * // => true
  13228. */
  13229. function create(prototype, properties) {
  13230. var result = baseCreate(prototype);
  13231. return properties == null ? result : baseAssign(result, properties);
  13232. }
  13233. /**
  13234. * Assigns own and inherited enumerable string keyed properties of source
  13235. * objects to the destination object for all destination properties that
  13236. * resolve to `undefined`. Source objects are applied from left to right.
  13237. * Once a property is set, additional values of the same property are ignored.
  13238. *
  13239. * **Note:** This method mutates `object`.
  13240. *
  13241. * @static
  13242. * @since 0.1.0
  13243. * @memberOf _
  13244. * @category Object
  13245. * @param {Object} object The destination object.
  13246. * @param {...Object} [sources] The source objects.
  13247. * @returns {Object} Returns `object`.
  13248. * @see _.defaultsDeep
  13249. * @example
  13250. *
  13251. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13252. * // => { 'a': 1, 'b': 2 }
  13253. */
  13254. var defaults = baseRest(function(object, sources) {
  13255. object = Object(object);
  13256. var index = -1;
  13257. var length = sources.length;
  13258. var guard = length > 2 ? sources[2] : undefined;
  13259. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13260. length = 1;
  13261. }
  13262. while (++index < length) {
  13263. var source = sources[index];
  13264. var props = keysIn(source);
  13265. var propsIndex = -1;
  13266. var propsLength = props.length;
  13267. while (++propsIndex < propsLength) {
  13268. var key = props[propsIndex];
  13269. var value = object[key];
  13270. if (value === undefined ||
  13271. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13272. object[key] = source[key];
  13273. }
  13274. }
  13275. }
  13276. return object;
  13277. });
  13278. /**
  13279. * This method is like `_.defaults` except that it recursively assigns
  13280. * default properties.
  13281. *
  13282. * **Note:** This method mutates `object`.
  13283. *
  13284. * @static
  13285. * @memberOf _
  13286. * @since 3.10.0
  13287. * @category Object
  13288. * @param {Object} object The destination object.
  13289. * @param {...Object} [sources] The source objects.
  13290. * @returns {Object} Returns `object`.
  13291. * @see _.defaults
  13292. * @example
  13293. *
  13294. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13295. * // => { 'a': { 'b': 2, 'c': 3 } }
  13296. */
  13297. var defaultsDeep = baseRest(function(args) {
  13298. args.push(undefined, customDefaultsMerge);
  13299. return apply(mergeWith, undefined, args);
  13300. });
  13301. /**
  13302. * This method is like `_.find` except that it returns the key of the first
  13303. * element `predicate` returns truthy for instead of the element itself.
  13304. *
  13305. * @static
  13306. * @memberOf _
  13307. * @since 1.1.0
  13308. * @category Object
  13309. * @param {Object} object The object to inspect.
  13310. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13311. * @returns {string|undefined} Returns the key of the matched element,
  13312. * else `undefined`.
  13313. * @example
  13314. *
  13315. * var users = {
  13316. * 'barney': { 'age': 36, 'active': true },
  13317. * 'fred': { 'age': 40, 'active': false },
  13318. * 'pebbles': { 'age': 1, 'active': true }
  13319. * };
  13320. *
  13321. * _.findKey(users, function(o) { return o.age < 40; });
  13322. * // => 'barney' (iteration order is not guaranteed)
  13323. *
  13324. * // The `_.matches` iteratee shorthand.
  13325. * _.findKey(users, { 'age': 1, 'active': true });
  13326. * // => 'pebbles'
  13327. *
  13328. * // The `_.matchesProperty` iteratee shorthand.
  13329. * _.findKey(users, ['active', false]);
  13330. * // => 'fred'
  13331. *
  13332. * // The `_.property` iteratee shorthand.
  13333. * _.findKey(users, 'active');
  13334. * // => 'barney'
  13335. */
  13336. function findKey(object, predicate) {
  13337. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13338. }
  13339. /**
  13340. * This method is like `_.findKey` except that it iterates over elements of
  13341. * a collection in the opposite order.
  13342. *
  13343. * @static
  13344. * @memberOf _
  13345. * @since 2.0.0
  13346. * @category Object
  13347. * @param {Object} object The object to inspect.
  13348. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13349. * @returns {string|undefined} Returns the key of the matched element,
  13350. * else `undefined`.
  13351. * @example
  13352. *
  13353. * var users = {
  13354. * 'barney': { 'age': 36, 'active': true },
  13355. * 'fred': { 'age': 40, 'active': false },
  13356. * 'pebbles': { 'age': 1, 'active': true }
  13357. * };
  13358. *
  13359. * _.findLastKey(users, function(o) { return o.age < 40; });
  13360. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13361. *
  13362. * // The `_.matches` iteratee shorthand.
  13363. * _.findLastKey(users, { 'age': 36, 'active': true });
  13364. * // => 'barney'
  13365. *
  13366. * // The `_.matchesProperty` iteratee shorthand.
  13367. * _.findLastKey(users, ['active', false]);
  13368. * // => 'fred'
  13369. *
  13370. * // The `_.property` iteratee shorthand.
  13371. * _.findLastKey(users, 'active');
  13372. * // => 'pebbles'
  13373. */
  13374. function findLastKey(object, predicate) {
  13375. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13376. }
  13377. /**
  13378. * Iterates over own and inherited enumerable string keyed properties of an
  13379. * object and invokes `iteratee` for each property. The iteratee is invoked
  13380. * with three arguments: (value, key, object). Iteratee functions may exit
  13381. * iteration early by explicitly returning `false`.
  13382. *
  13383. * @static
  13384. * @memberOf _
  13385. * @since 0.3.0
  13386. * @category Object
  13387. * @param {Object} object The object to iterate over.
  13388. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13389. * @returns {Object} Returns `object`.
  13390. * @see _.forInRight
  13391. * @example
  13392. *
  13393. * function Foo() {
  13394. * this.a = 1;
  13395. * this.b = 2;
  13396. * }
  13397. *
  13398. * Foo.prototype.c = 3;
  13399. *
  13400. * _.forIn(new Foo, function(value, key) {
  13401. * console.log(key);
  13402. * });
  13403. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13404. */
  13405. function forIn(object, iteratee) {
  13406. return object == null
  13407. ? object
  13408. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13409. }
  13410. /**
  13411. * This method is like `_.forIn` except that it iterates over properties of
  13412. * `object` in the opposite order.
  13413. *
  13414. * @static
  13415. * @memberOf _
  13416. * @since 2.0.0
  13417. * @category Object
  13418. * @param {Object} object The object to iterate over.
  13419. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13420. * @returns {Object} Returns `object`.
  13421. * @see _.forIn
  13422. * @example
  13423. *
  13424. * function Foo() {
  13425. * this.a = 1;
  13426. * this.b = 2;
  13427. * }
  13428. *
  13429. * Foo.prototype.c = 3;
  13430. *
  13431. * _.forInRight(new Foo, function(value, key) {
  13432. * console.log(key);
  13433. * });
  13434. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13435. */
  13436. function forInRight(object, iteratee) {
  13437. return object == null
  13438. ? object
  13439. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13440. }
  13441. /**
  13442. * Iterates over own enumerable string keyed properties of an object and
  13443. * invokes `iteratee` for each property. The iteratee is invoked with three
  13444. * arguments: (value, key, object). Iteratee functions may exit iteration
  13445. * early by explicitly returning `false`.
  13446. *
  13447. * @static
  13448. * @memberOf _
  13449. * @since 0.3.0
  13450. * @category Object
  13451. * @param {Object} object The object to iterate over.
  13452. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13453. * @returns {Object} Returns `object`.
  13454. * @see _.forOwnRight
  13455. * @example
  13456. *
  13457. * function Foo() {
  13458. * this.a = 1;
  13459. * this.b = 2;
  13460. * }
  13461. *
  13462. * Foo.prototype.c = 3;
  13463. *
  13464. * _.forOwn(new Foo, function(value, key) {
  13465. * console.log(key);
  13466. * });
  13467. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13468. */
  13469. function forOwn(object, iteratee) {
  13470. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13471. }
  13472. /**
  13473. * This method is like `_.forOwn` except that it iterates over properties of
  13474. * `object` in the opposite order.
  13475. *
  13476. * @static
  13477. * @memberOf _
  13478. * @since 2.0.0
  13479. * @category Object
  13480. * @param {Object} object The object to iterate over.
  13481. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13482. * @returns {Object} Returns `object`.
  13483. * @see _.forOwn
  13484. * @example
  13485. *
  13486. * function Foo() {
  13487. * this.a = 1;
  13488. * this.b = 2;
  13489. * }
  13490. *
  13491. * Foo.prototype.c = 3;
  13492. *
  13493. * _.forOwnRight(new Foo, function(value, key) {
  13494. * console.log(key);
  13495. * });
  13496. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13497. */
  13498. function forOwnRight(object, iteratee) {
  13499. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13500. }
  13501. /**
  13502. * Creates an array of function property names from own enumerable properties
  13503. * of `object`.
  13504. *
  13505. * @static
  13506. * @since 0.1.0
  13507. * @memberOf _
  13508. * @category Object
  13509. * @param {Object} object The object to inspect.
  13510. * @returns {Array} Returns the function names.
  13511. * @see _.functionsIn
  13512. * @example
  13513. *
  13514. * function Foo() {
  13515. * this.a = _.constant('a');
  13516. * this.b = _.constant('b');
  13517. * }
  13518. *
  13519. * Foo.prototype.c = _.constant('c');
  13520. *
  13521. * _.functions(new Foo);
  13522. * // => ['a', 'b']
  13523. */
  13524. function functions(object) {
  13525. return object == null ? [] : baseFunctions(object, keys(object));
  13526. }
  13527. /**
  13528. * Creates an array of function property names from own and inherited
  13529. * enumerable properties of `object`.
  13530. *
  13531. * @static
  13532. * @memberOf _
  13533. * @since 4.0.0
  13534. * @category Object
  13535. * @param {Object} object The object to inspect.
  13536. * @returns {Array} Returns the function names.
  13537. * @see _.functions
  13538. * @example
  13539. *
  13540. * function Foo() {
  13541. * this.a = _.constant('a');
  13542. * this.b = _.constant('b');
  13543. * }
  13544. *
  13545. * Foo.prototype.c = _.constant('c');
  13546. *
  13547. * _.functionsIn(new Foo);
  13548. * // => ['a', 'b', 'c']
  13549. */
  13550. function functionsIn(object) {
  13551. return object == null ? [] : baseFunctions(object, keysIn(object));
  13552. }
  13553. /**
  13554. * Gets the value at `path` of `object`. If the resolved value is
  13555. * `undefined`, the `defaultValue` is returned in its place.
  13556. *
  13557. * @static
  13558. * @memberOf _
  13559. * @since 3.7.0
  13560. * @category Object
  13561. * @param {Object} object The object to query.
  13562. * @param {Array|string} path The path of the property to get.
  13563. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13564. * @returns {*} Returns the resolved value.
  13565. * @example
  13566. *
  13567. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13568. *
  13569. * _.get(object, 'a[0].b.c');
  13570. * // => 3
  13571. *
  13572. * _.get(object, ['a', '0', 'b', 'c']);
  13573. * // => 3
  13574. *
  13575. * _.get(object, 'a.b.c', 'default');
  13576. * // => 'default'
  13577. */
  13578. function get(object, path, defaultValue) {
  13579. var result = object == null ? undefined : baseGet(object, path);
  13580. return result === undefined ? defaultValue : result;
  13581. }
  13582. /**
  13583. * Checks if `path` is a direct property of `object`.
  13584. *
  13585. * @static
  13586. * @since 0.1.0
  13587. * @memberOf _
  13588. * @category Object
  13589. * @param {Object} object The object to query.
  13590. * @param {Array|string} path The path to check.
  13591. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13592. * @example
  13593. *
  13594. * var object = { 'a': { 'b': 2 } };
  13595. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13596. *
  13597. * _.has(object, 'a');
  13598. * // => true
  13599. *
  13600. * _.has(object, 'a.b');
  13601. * // => true
  13602. *
  13603. * _.has(object, ['a', 'b']);
  13604. * // => true
  13605. *
  13606. * _.has(other, 'a');
  13607. * // => false
  13608. */
  13609. function has(object, path) {
  13610. return object != null && hasPath(object, path, baseHas);
  13611. }
  13612. /**
  13613. * Checks if `path` is a direct or inherited property of `object`.
  13614. *
  13615. * @static
  13616. * @memberOf _
  13617. * @since 4.0.0
  13618. * @category Object
  13619. * @param {Object} object The object to query.
  13620. * @param {Array|string} path The path to check.
  13621. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13622. * @example
  13623. *
  13624. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13625. *
  13626. * _.hasIn(object, 'a');
  13627. * // => true
  13628. *
  13629. * _.hasIn(object, 'a.b');
  13630. * // => true
  13631. *
  13632. * _.hasIn(object, ['a', 'b']);
  13633. * // => true
  13634. *
  13635. * _.hasIn(object, 'b');
  13636. * // => false
  13637. */
  13638. function hasIn(object, path) {
  13639. return object != null && hasPath(object, path, baseHasIn);
  13640. }
  13641. /**
  13642. * Creates an object composed of the inverted keys and values of `object`.
  13643. * If `object` contains duplicate values, subsequent values overwrite
  13644. * property assignments of previous values.
  13645. *
  13646. * @static
  13647. * @memberOf _
  13648. * @since 0.7.0
  13649. * @category Object
  13650. * @param {Object} object The object to invert.
  13651. * @returns {Object} Returns the new inverted object.
  13652. * @example
  13653. *
  13654. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13655. *
  13656. * _.invert(object);
  13657. * // => { '1': 'c', '2': 'b' }
  13658. */
  13659. var invert = createInverter(function(result, value, key) {
  13660. if (value != null &&
  13661. typeof value.toString != 'function') {
  13662. value = nativeObjectToString.call(value);
  13663. }
  13664. result[value] = key;
  13665. }, constant(identity));
  13666. /**
  13667. * This method is like `_.invert` except that the inverted object is generated
  13668. * from the results of running each element of `object` thru `iteratee`. The
  13669. * corresponding inverted value of each inverted key is an array of keys
  13670. * responsible for generating the inverted value. The iteratee is invoked
  13671. * with one argument: (value).
  13672. *
  13673. * @static
  13674. * @memberOf _
  13675. * @since 4.1.0
  13676. * @category Object
  13677. * @param {Object} object The object to invert.
  13678. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13679. * @returns {Object} Returns the new inverted object.
  13680. * @example
  13681. *
  13682. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13683. *
  13684. * _.invertBy(object);
  13685. * // => { '1': ['a', 'c'], '2': ['b'] }
  13686. *
  13687. * _.invertBy(object, function(value) {
  13688. * return 'group' + value;
  13689. * });
  13690. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13691. */
  13692. var invertBy = createInverter(function(result, value, key) {
  13693. if (value != null &&
  13694. typeof value.toString != 'function') {
  13695. value = nativeObjectToString.call(value);
  13696. }
  13697. if (hasOwnProperty.call(result, value)) {
  13698. result[value].push(key);
  13699. } else {
  13700. result[value] = [key];
  13701. }
  13702. }, getIteratee);
  13703. /**
  13704. * Invokes the method at `path` of `object`.
  13705. *
  13706. * @static
  13707. * @memberOf _
  13708. * @since 4.0.0
  13709. * @category Object
  13710. * @param {Object} object The object to query.
  13711. * @param {Array|string} path The path of the method to invoke.
  13712. * @param {...*} [args] The arguments to invoke the method with.
  13713. * @returns {*} Returns the result of the invoked method.
  13714. * @example
  13715. *
  13716. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13717. *
  13718. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13719. * // => [2, 3]
  13720. */
  13721. var invoke = baseRest(baseInvoke);
  13722. /**
  13723. * Creates an array of the own enumerable property names of `object`.
  13724. *
  13725. * **Note:** Non-object values are coerced to objects. See the
  13726. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13727. * for more details.
  13728. *
  13729. * @static
  13730. * @since 0.1.0
  13731. * @memberOf _
  13732. * @category Object
  13733. * @param {Object} object The object to query.
  13734. * @returns {Array} Returns the array of property names.
  13735. * @example
  13736. *
  13737. * function Foo() {
  13738. * this.a = 1;
  13739. * this.b = 2;
  13740. * }
  13741. *
  13742. * Foo.prototype.c = 3;
  13743. *
  13744. * _.keys(new Foo);
  13745. * // => ['a', 'b'] (iteration order is not guaranteed)
  13746. *
  13747. * _.keys('hi');
  13748. * // => ['0', '1']
  13749. */
  13750. function keys(object) {
  13751. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13752. }
  13753. /**
  13754. * Creates an array of the own and inherited enumerable property names of `object`.
  13755. *
  13756. * **Note:** Non-object values are coerced to objects.
  13757. *
  13758. * @static
  13759. * @memberOf _
  13760. * @since 3.0.0
  13761. * @category Object
  13762. * @param {Object} object The object to query.
  13763. * @returns {Array} Returns the array of property names.
  13764. * @example
  13765. *
  13766. * function Foo() {
  13767. * this.a = 1;
  13768. * this.b = 2;
  13769. * }
  13770. *
  13771. * Foo.prototype.c = 3;
  13772. *
  13773. * _.keysIn(new Foo);
  13774. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13775. */
  13776. function keysIn(object) {
  13777. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13778. }
  13779. /**
  13780. * The opposite of `_.mapValues`; this method creates an object with the
  13781. * same values as `object` and keys generated by running each own enumerable
  13782. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13783. * with three arguments: (value, key, object).
  13784. *
  13785. * @static
  13786. * @memberOf _
  13787. * @since 3.8.0
  13788. * @category Object
  13789. * @param {Object} object The object to iterate over.
  13790. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13791. * @returns {Object} Returns the new mapped object.
  13792. * @see _.mapValues
  13793. * @example
  13794. *
  13795. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13796. * return key + value;
  13797. * });
  13798. * // => { 'a1': 1, 'b2': 2 }
  13799. */
  13800. function mapKeys(object, iteratee) {
  13801. var result = {};
  13802. iteratee = getIteratee(iteratee, 3);
  13803. baseForOwn(object, function(value, key, object) {
  13804. baseAssignValue(result, iteratee(value, key, object), value);
  13805. });
  13806. return result;
  13807. }
  13808. /**
  13809. * Creates an object with the same keys as `object` and values generated
  13810. * by running each own enumerable string keyed property of `object` thru
  13811. * `iteratee`. The iteratee is invoked with three arguments:
  13812. * (value, key, object).
  13813. *
  13814. * @static
  13815. * @memberOf _
  13816. * @since 2.4.0
  13817. * @category Object
  13818. * @param {Object} object The object to iterate over.
  13819. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13820. * @returns {Object} Returns the new mapped object.
  13821. * @see _.mapKeys
  13822. * @example
  13823. *
  13824. * var users = {
  13825. * 'fred': { 'user': 'fred', 'age': 40 },
  13826. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13827. * };
  13828. *
  13829. * _.mapValues(users, function(o) { return o.age; });
  13830. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13831. *
  13832. * // The `_.property` iteratee shorthand.
  13833. * _.mapValues(users, 'age');
  13834. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13835. */
  13836. function mapValues(object, iteratee) {
  13837. var result = {};
  13838. iteratee = getIteratee(iteratee, 3);
  13839. baseForOwn(object, function(value, key, object) {
  13840. baseAssignValue(result, key, iteratee(value, key, object));
  13841. });
  13842. return result;
  13843. }
  13844. /**
  13845. * This method is like `_.assign` except that it recursively merges own and
  13846. * inherited enumerable string keyed properties of source objects into the
  13847. * destination object. Source properties that resolve to `undefined` are
  13848. * skipped if a destination value exists. Array and plain object properties
  13849. * are merged recursively. Other objects and value types are overridden by
  13850. * assignment. Source objects are applied from left to right. Subsequent
  13851. * sources overwrite property assignments of previous sources.
  13852. *
  13853. * **Note:** This method mutates `object`.
  13854. *
  13855. * @static
  13856. * @memberOf _
  13857. * @since 0.5.0
  13858. * @category Object
  13859. * @param {Object} object The destination object.
  13860. * @param {...Object} [sources] The source objects.
  13861. * @returns {Object} Returns `object`.
  13862. * @example
  13863. *
  13864. * var object = {
  13865. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13866. * };
  13867. *
  13868. * var other = {
  13869. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13870. * };
  13871. *
  13872. * _.merge(object, other);
  13873. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13874. */
  13875. var merge = createAssigner(function(object, source, srcIndex) {
  13876. baseMerge(object, source, srcIndex);
  13877. });
  13878. /**
  13879. * This method is like `_.merge` except that it accepts `customizer` which
  13880. * is invoked to produce the merged values of the destination and source
  13881. * properties. If `customizer` returns `undefined`, merging is handled by the
  13882. * method instead. The `customizer` is invoked with six arguments:
  13883. * (objValue, srcValue, key, object, source, stack).
  13884. *
  13885. * **Note:** This method mutates `object`.
  13886. *
  13887. * @static
  13888. * @memberOf _
  13889. * @since 4.0.0
  13890. * @category Object
  13891. * @param {Object} object The destination object.
  13892. * @param {...Object} sources The source objects.
  13893. * @param {Function} customizer The function to customize assigned values.
  13894. * @returns {Object} Returns `object`.
  13895. * @example
  13896. *
  13897. * function customizer(objValue, srcValue) {
  13898. * if (_.isArray(objValue)) {
  13899. * return objValue.concat(srcValue);
  13900. * }
  13901. * }
  13902. *
  13903. * var object = { 'a': [1], 'b': [2] };
  13904. * var other = { 'a': [3], 'b': [4] };
  13905. *
  13906. * _.mergeWith(object, other, customizer);
  13907. * // => { 'a': [1, 3], 'b': [2, 4] }
  13908. */
  13909. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13910. baseMerge(object, source, srcIndex, customizer);
  13911. });
  13912. /**
  13913. * The opposite of `_.pick`; this method creates an object composed of the
  13914. * own and inherited enumerable property paths of `object` that are not omitted.
  13915. *
  13916. * **Note:** This method is considerably slower than `_.pick`.
  13917. *
  13918. * @static
  13919. * @since 0.1.0
  13920. * @memberOf _
  13921. * @category Object
  13922. * @param {Object} object The source object.
  13923. * @param {...(string|string[])} [paths] The property paths to omit.
  13924. * @returns {Object} Returns the new object.
  13925. * @example
  13926. *
  13927. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13928. *
  13929. * _.omit(object, ['a', 'c']);
  13930. * // => { 'b': '2' }
  13931. */
  13932. var omit = flatRest(function(object, paths) {
  13933. var result = {};
  13934. if (object == null) {
  13935. return result;
  13936. }
  13937. var isDeep = false;
  13938. paths = arrayMap(paths, function(path) {
  13939. path = castPath(path, object);
  13940. isDeep || (isDeep = path.length > 1);
  13941. return path;
  13942. });
  13943. copyObject(object, getAllKeysIn(object), result);
  13944. if (isDeep) {
  13945. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13946. }
  13947. var length = paths.length;
  13948. while (length--) {
  13949. baseUnset(result, paths[length]);
  13950. }
  13951. return result;
  13952. });
  13953. /**
  13954. * The opposite of `_.pickBy`; this method creates an object composed of
  13955. * the own and inherited enumerable string keyed properties of `object` that
  13956. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13957. * arguments: (value, key).
  13958. *
  13959. * @static
  13960. * @memberOf _
  13961. * @since 4.0.0
  13962. * @category Object
  13963. * @param {Object} object The source object.
  13964. * @param {Function} [predicate=_.identity] The function invoked per property.
  13965. * @returns {Object} Returns the new object.
  13966. * @example
  13967. *
  13968. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13969. *
  13970. * _.omitBy(object, _.isNumber);
  13971. * // => { 'b': '2' }
  13972. */
  13973. function omitBy(object, predicate) {
  13974. return pickBy(object, negate(getIteratee(predicate)));
  13975. }
  13976. /**
  13977. * Creates an object composed of the picked `object` properties.
  13978. *
  13979. * @static
  13980. * @since 0.1.0
  13981. * @memberOf _
  13982. * @category Object
  13983. * @param {Object} object The source object.
  13984. * @param {...(string|string[])} [paths] The property paths to pick.
  13985. * @returns {Object} Returns the new object.
  13986. * @example
  13987. *
  13988. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13989. *
  13990. * _.pick(object, ['a', 'c']);
  13991. * // => { 'a': 1, 'c': 3 }
  13992. */
  13993. var pick = flatRest(function(object, paths) {
  13994. return object == null ? {} : basePick(object, paths);
  13995. });
  13996. /**
  13997. * Creates an object composed of the `object` properties `predicate` returns
  13998. * truthy for. The predicate is invoked with two arguments: (value, key).
  13999. *
  14000. * @static
  14001. * @memberOf _
  14002. * @since 4.0.0
  14003. * @category Object
  14004. * @param {Object} object The source object.
  14005. * @param {Function} [predicate=_.identity] The function invoked per property.
  14006. * @returns {Object} Returns the new object.
  14007. * @example
  14008. *
  14009. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14010. *
  14011. * _.pickBy(object, _.isNumber);
  14012. * // => { 'a': 1, 'c': 3 }
  14013. */
  14014. function pickBy(object, predicate) {
  14015. if (object == null) {
  14016. return {};
  14017. }
  14018. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14019. return [prop];
  14020. });
  14021. predicate = getIteratee(predicate);
  14022. return basePickBy(object, props, function(value, path) {
  14023. return predicate(value, path[0]);
  14024. });
  14025. }
  14026. /**
  14027. * This method is like `_.get` except that if the resolved value is a
  14028. * function it's invoked with the `this` binding of its parent object and
  14029. * its result is returned.
  14030. *
  14031. * @static
  14032. * @since 0.1.0
  14033. * @memberOf _
  14034. * @category Object
  14035. * @param {Object} object The object to query.
  14036. * @param {Array|string} path The path of the property to resolve.
  14037. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14038. * @returns {*} Returns the resolved value.
  14039. * @example
  14040. *
  14041. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14042. *
  14043. * _.result(object, 'a[0].b.c1');
  14044. * // => 3
  14045. *
  14046. * _.result(object, 'a[0].b.c2');
  14047. * // => 4
  14048. *
  14049. * _.result(object, 'a[0].b.c3', 'default');
  14050. * // => 'default'
  14051. *
  14052. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14053. * // => 'default'
  14054. */
  14055. function result(object, path, defaultValue) {
  14056. path = castPath(path, object);
  14057. var index = -1,
  14058. length = path.length;
  14059. // Ensure the loop is entered when path is empty.
  14060. if (!length) {
  14061. length = 1;
  14062. object = undefined;
  14063. }
  14064. while (++index < length) {
  14065. var value = object == null ? undefined : object[toKey(path[index])];
  14066. if (value === undefined) {
  14067. index = length;
  14068. value = defaultValue;
  14069. }
  14070. object = isFunction(value) ? value.call(object) : value;
  14071. }
  14072. return object;
  14073. }
  14074. /**
  14075. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14076. * it's created. Arrays are created for missing index properties while objects
  14077. * are created for all other missing properties. Use `_.setWith` to customize
  14078. * `path` creation.
  14079. *
  14080. * **Note:** This method mutates `object`.
  14081. *
  14082. * @static
  14083. * @memberOf _
  14084. * @since 3.7.0
  14085. * @category Object
  14086. * @param {Object} object The object to modify.
  14087. * @param {Array|string} path The path of the property to set.
  14088. * @param {*} value The value to set.
  14089. * @returns {Object} Returns `object`.
  14090. * @example
  14091. *
  14092. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14093. *
  14094. * _.set(object, 'a[0].b.c', 4);
  14095. * console.log(object.a[0].b.c);
  14096. * // => 4
  14097. *
  14098. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14099. * console.log(object.x[0].y.z);
  14100. * // => 5
  14101. */
  14102. function set(object, path, value) {
  14103. return object == null ? object : baseSet(object, path, value);
  14104. }
  14105. /**
  14106. * This method is like `_.set` except that it accepts `customizer` which is
  14107. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14108. * path creation is handled by the method instead. The `customizer` is invoked
  14109. * with three arguments: (nsValue, key, nsObject).
  14110. *
  14111. * **Note:** This method mutates `object`.
  14112. *
  14113. * @static
  14114. * @memberOf _
  14115. * @since 4.0.0
  14116. * @category Object
  14117. * @param {Object} object The object to modify.
  14118. * @param {Array|string} path The path of the property to set.
  14119. * @param {*} value The value to set.
  14120. * @param {Function} [customizer] The function to customize assigned values.
  14121. * @returns {Object} Returns `object`.
  14122. * @example
  14123. *
  14124. * var object = {};
  14125. *
  14126. * _.setWith(object, '[0][1]', 'a', Object);
  14127. * // => { '0': { '1': 'a' } }
  14128. */
  14129. function setWith(object, path, value, customizer) {
  14130. customizer = typeof customizer == 'function' ? customizer : undefined;
  14131. return object == null ? object : baseSet(object, path, value, customizer);
  14132. }
  14133. /**
  14134. * Creates an array of own enumerable string keyed-value pairs for `object`
  14135. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14136. * entries are returned.
  14137. *
  14138. * @static
  14139. * @memberOf _
  14140. * @since 4.0.0
  14141. * @alias entries
  14142. * @category Object
  14143. * @param {Object} object The object to query.
  14144. * @returns {Array} Returns the key-value pairs.
  14145. * @example
  14146. *
  14147. * function Foo() {
  14148. * this.a = 1;
  14149. * this.b = 2;
  14150. * }
  14151. *
  14152. * Foo.prototype.c = 3;
  14153. *
  14154. * _.toPairs(new Foo);
  14155. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14156. */
  14157. var toPairs = createToPairs(keys);
  14158. /**
  14159. * Creates an array of own and inherited enumerable string keyed-value pairs
  14160. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14161. * or set, its entries are returned.
  14162. *
  14163. * @static
  14164. * @memberOf _
  14165. * @since 4.0.0
  14166. * @alias entriesIn
  14167. * @category Object
  14168. * @param {Object} object The object to query.
  14169. * @returns {Array} Returns the key-value pairs.
  14170. * @example
  14171. *
  14172. * function Foo() {
  14173. * this.a = 1;
  14174. * this.b = 2;
  14175. * }
  14176. *
  14177. * Foo.prototype.c = 3;
  14178. *
  14179. * _.toPairsIn(new Foo);
  14180. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14181. */
  14182. var toPairsIn = createToPairs(keysIn);
  14183. /**
  14184. * An alternative to `_.reduce`; this method transforms `object` to a new
  14185. * `accumulator` object which is the result of running each of its own
  14186. * enumerable string keyed properties thru `iteratee`, with each invocation
  14187. * potentially mutating the `accumulator` object. If `accumulator` is not
  14188. * provided, a new object with the same `[[Prototype]]` will be used. The
  14189. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14190. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14191. *
  14192. * @static
  14193. * @memberOf _
  14194. * @since 1.3.0
  14195. * @category Object
  14196. * @param {Object} object The object to iterate over.
  14197. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14198. * @param {*} [accumulator] The custom accumulator value.
  14199. * @returns {*} Returns the accumulated value.
  14200. * @example
  14201. *
  14202. * _.transform([2, 3, 4], function(result, n) {
  14203. * result.push(n *= n);
  14204. * return n % 2 == 0;
  14205. * }, []);
  14206. * // => [4, 9]
  14207. *
  14208. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14209. * (result[value] || (result[value] = [])).push(key);
  14210. * }, {});
  14211. * // => { '1': ['a', 'c'], '2': ['b'] }
  14212. */
  14213. function transform(object, iteratee, accumulator) {
  14214. var isArr = isArray(object),
  14215. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14216. iteratee = getIteratee(iteratee, 4);
  14217. if (accumulator == null) {
  14218. var Ctor = object && object.constructor;
  14219. if (isArrLike) {
  14220. accumulator = isArr ? new Ctor : [];
  14221. }
  14222. else if (isObject(object)) {
  14223. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14224. }
  14225. else {
  14226. accumulator = {};
  14227. }
  14228. }
  14229. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14230. return iteratee(accumulator, value, index, object);
  14231. });
  14232. return accumulator;
  14233. }
  14234. /**
  14235. * Removes the property at `path` of `object`.
  14236. *
  14237. * **Note:** This method mutates `object`.
  14238. *
  14239. * @static
  14240. * @memberOf _
  14241. * @since 4.0.0
  14242. * @category Object
  14243. * @param {Object} object The object to modify.
  14244. * @param {Array|string} path The path of the property to unset.
  14245. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14246. * @example
  14247. *
  14248. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14249. * _.unset(object, 'a[0].b.c');
  14250. * // => true
  14251. *
  14252. * console.log(object);
  14253. * // => { 'a': [{ 'b': {} }] };
  14254. *
  14255. * _.unset(object, ['a', '0', 'b', 'c']);
  14256. * // => true
  14257. *
  14258. * console.log(object);
  14259. * // => { 'a': [{ 'b': {} }] };
  14260. */
  14261. function unset(object, path) {
  14262. return object == null ? true : baseUnset(object, path);
  14263. }
  14264. /**
  14265. * This method is like `_.set` except that accepts `updater` to produce the
  14266. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14267. * is invoked with one argument: (value).
  14268. *
  14269. * **Note:** This method mutates `object`.
  14270. *
  14271. * @static
  14272. * @memberOf _
  14273. * @since 4.6.0
  14274. * @category Object
  14275. * @param {Object} object The object to modify.
  14276. * @param {Array|string} path The path of the property to set.
  14277. * @param {Function} updater The function to produce the updated value.
  14278. * @returns {Object} Returns `object`.
  14279. * @example
  14280. *
  14281. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14282. *
  14283. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14284. * console.log(object.a[0].b.c);
  14285. * // => 9
  14286. *
  14287. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14288. * console.log(object.x[0].y.z);
  14289. * // => 0
  14290. */
  14291. function update(object, path, updater) {
  14292. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14293. }
  14294. /**
  14295. * This method is like `_.update` except that it accepts `customizer` which is
  14296. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14297. * path creation is handled by the method instead. The `customizer` is invoked
  14298. * with three arguments: (nsValue, key, nsObject).
  14299. *
  14300. * **Note:** This method mutates `object`.
  14301. *
  14302. * @static
  14303. * @memberOf _
  14304. * @since 4.6.0
  14305. * @category Object
  14306. * @param {Object} object The object to modify.
  14307. * @param {Array|string} path The path of the property to set.
  14308. * @param {Function} updater The function to produce the updated value.
  14309. * @param {Function} [customizer] The function to customize assigned values.
  14310. * @returns {Object} Returns `object`.
  14311. * @example
  14312. *
  14313. * var object = {};
  14314. *
  14315. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14316. * // => { '0': { '1': 'a' } }
  14317. */
  14318. function updateWith(object, path, updater, customizer) {
  14319. customizer = typeof customizer == 'function' ? customizer : undefined;
  14320. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14321. }
  14322. /**
  14323. * Creates an array of the own enumerable string keyed property values of `object`.
  14324. *
  14325. * **Note:** Non-object values are coerced to objects.
  14326. *
  14327. * @static
  14328. * @since 0.1.0
  14329. * @memberOf _
  14330. * @category Object
  14331. * @param {Object} object The object to query.
  14332. * @returns {Array} Returns the array of property values.
  14333. * @example
  14334. *
  14335. * function Foo() {
  14336. * this.a = 1;
  14337. * this.b = 2;
  14338. * }
  14339. *
  14340. * Foo.prototype.c = 3;
  14341. *
  14342. * _.values(new Foo);
  14343. * // => [1, 2] (iteration order is not guaranteed)
  14344. *
  14345. * _.values('hi');
  14346. * // => ['h', 'i']
  14347. */
  14348. function values(object) {
  14349. return object == null ? [] : baseValues(object, keys(object));
  14350. }
  14351. /**
  14352. * Creates an array of the own and inherited enumerable string keyed property
  14353. * values of `object`.
  14354. *
  14355. * **Note:** Non-object values are coerced to objects.
  14356. *
  14357. * @static
  14358. * @memberOf _
  14359. * @since 3.0.0
  14360. * @category Object
  14361. * @param {Object} object The object to query.
  14362. * @returns {Array} Returns the array of property values.
  14363. * @example
  14364. *
  14365. * function Foo() {
  14366. * this.a = 1;
  14367. * this.b = 2;
  14368. * }
  14369. *
  14370. * Foo.prototype.c = 3;
  14371. *
  14372. * _.valuesIn(new Foo);
  14373. * // => [1, 2, 3] (iteration order is not guaranteed)
  14374. */
  14375. function valuesIn(object) {
  14376. return object == null ? [] : baseValues(object, keysIn(object));
  14377. }
  14378. /*------------------------------------------------------------------------*/
  14379. /**
  14380. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14381. *
  14382. * @static
  14383. * @memberOf _
  14384. * @since 4.0.0
  14385. * @category Number
  14386. * @param {number} number The number to clamp.
  14387. * @param {number} [lower] The lower bound.
  14388. * @param {number} upper The upper bound.
  14389. * @returns {number} Returns the clamped number.
  14390. * @example
  14391. *
  14392. * _.clamp(-10, -5, 5);
  14393. * // => -5
  14394. *
  14395. * _.clamp(10, -5, 5);
  14396. * // => 5
  14397. */
  14398. function clamp(number, lower, upper) {
  14399. if (upper === undefined) {
  14400. upper = lower;
  14401. lower = undefined;
  14402. }
  14403. if (upper !== undefined) {
  14404. upper = toNumber(upper);
  14405. upper = upper === upper ? upper : 0;
  14406. }
  14407. if (lower !== undefined) {
  14408. lower = toNumber(lower);
  14409. lower = lower === lower ? lower : 0;
  14410. }
  14411. return baseClamp(toNumber(number), lower, upper);
  14412. }
  14413. /**
  14414. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14415. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14416. * If `start` is greater than `end` the params are swapped to support
  14417. * negative ranges.
  14418. *
  14419. * @static
  14420. * @memberOf _
  14421. * @since 3.3.0
  14422. * @category Number
  14423. * @param {number} number The number to check.
  14424. * @param {number} [start=0] The start of the range.
  14425. * @param {number} end The end of the range.
  14426. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14427. * @see _.range, _.rangeRight
  14428. * @example
  14429. *
  14430. * _.inRange(3, 2, 4);
  14431. * // => true
  14432. *
  14433. * _.inRange(4, 8);
  14434. * // => true
  14435. *
  14436. * _.inRange(4, 2);
  14437. * // => false
  14438. *
  14439. * _.inRange(2, 2);
  14440. * // => false
  14441. *
  14442. * _.inRange(1.2, 2);
  14443. * // => true
  14444. *
  14445. * _.inRange(5.2, 4);
  14446. * // => false
  14447. *
  14448. * _.inRange(-3, -2, -6);
  14449. * // => true
  14450. */
  14451. function inRange(number, start, end) {
  14452. start = toFinite(start);
  14453. if (end === undefined) {
  14454. end = start;
  14455. start = 0;
  14456. } else {
  14457. end = toFinite(end);
  14458. }
  14459. number = toNumber(number);
  14460. return baseInRange(number, start, end);
  14461. }
  14462. /**
  14463. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14464. * If only one argument is provided a number between `0` and the given number
  14465. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14466. * floats, a floating-point number is returned instead of an integer.
  14467. *
  14468. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14469. * floating-point values which can produce unexpected results.
  14470. *
  14471. * @static
  14472. * @memberOf _
  14473. * @since 0.7.0
  14474. * @category Number
  14475. * @param {number} [lower=0] The lower bound.
  14476. * @param {number} [upper=1] The upper bound.
  14477. * @param {boolean} [floating] Specify returning a floating-point number.
  14478. * @returns {number} Returns the random number.
  14479. * @example
  14480. *
  14481. * _.random(0, 5);
  14482. * // => an integer between 0 and 5
  14483. *
  14484. * _.random(5);
  14485. * // => also an integer between 0 and 5
  14486. *
  14487. * _.random(5, true);
  14488. * // => a floating-point number between 0 and 5
  14489. *
  14490. * _.random(1.2, 5.2);
  14491. * // => a floating-point number between 1.2 and 5.2
  14492. */
  14493. function random(lower, upper, floating) {
  14494. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14495. upper = floating = undefined;
  14496. }
  14497. if (floating === undefined) {
  14498. if (typeof upper == 'boolean') {
  14499. floating = upper;
  14500. upper = undefined;
  14501. }
  14502. else if (typeof lower == 'boolean') {
  14503. floating = lower;
  14504. lower = undefined;
  14505. }
  14506. }
  14507. if (lower === undefined && upper === undefined) {
  14508. lower = 0;
  14509. upper = 1;
  14510. }
  14511. else {
  14512. lower = toFinite(lower);
  14513. if (upper === undefined) {
  14514. upper = lower;
  14515. lower = 0;
  14516. } else {
  14517. upper = toFinite(upper);
  14518. }
  14519. }
  14520. if (lower > upper) {
  14521. var temp = lower;
  14522. lower = upper;
  14523. upper = temp;
  14524. }
  14525. if (floating || lower % 1 || upper % 1) {
  14526. var rand = nativeRandom();
  14527. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14528. }
  14529. return baseRandom(lower, upper);
  14530. }
  14531. /*------------------------------------------------------------------------*/
  14532. /**
  14533. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14534. *
  14535. * @static
  14536. * @memberOf _
  14537. * @since 3.0.0
  14538. * @category String
  14539. * @param {string} [string=''] The string to convert.
  14540. * @returns {string} Returns the camel cased string.
  14541. * @example
  14542. *
  14543. * _.camelCase('Foo Bar');
  14544. * // => 'fooBar'
  14545. *
  14546. * _.camelCase('--foo-bar--');
  14547. * // => 'fooBar'
  14548. *
  14549. * _.camelCase('__FOO_BAR__');
  14550. * // => 'fooBar'
  14551. */
  14552. var camelCase = createCompounder(function(result, word, index) {
  14553. word = word.toLowerCase();
  14554. return result + (index ? capitalize(word) : word);
  14555. });
  14556. /**
  14557. * Converts the first character of `string` to upper case and the remaining
  14558. * to lower case.
  14559. *
  14560. * @static
  14561. * @memberOf _
  14562. * @since 3.0.0
  14563. * @category String
  14564. * @param {string} [string=''] The string to capitalize.
  14565. * @returns {string} Returns the capitalized string.
  14566. * @example
  14567. *
  14568. * _.capitalize('FRED');
  14569. * // => 'Fred'
  14570. */
  14571. function capitalize(string) {
  14572. return upperFirst(toString(string).toLowerCase());
  14573. }
  14574. /**
  14575. * Deburrs `string` by converting
  14576. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14577. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14578. * letters to basic Latin letters and removing
  14579. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14580. *
  14581. * @static
  14582. * @memberOf _
  14583. * @since 3.0.0
  14584. * @category String
  14585. * @param {string} [string=''] The string to deburr.
  14586. * @returns {string} Returns the deburred string.
  14587. * @example
  14588. *
  14589. * _.deburr('déjà vu');
  14590. * // => 'deja vu'
  14591. */
  14592. function deburr(string) {
  14593. string = toString(string);
  14594. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14595. }
  14596. /**
  14597. * Checks if `string` ends with the given target string.
  14598. *
  14599. * @static
  14600. * @memberOf _
  14601. * @since 3.0.0
  14602. * @category String
  14603. * @param {string} [string=''] The string to inspect.
  14604. * @param {string} [target] The string to search for.
  14605. * @param {number} [position=string.length] The position to search up to.
  14606. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14607. * else `false`.
  14608. * @example
  14609. *
  14610. * _.endsWith('abc', 'c');
  14611. * // => true
  14612. *
  14613. * _.endsWith('abc', 'b');
  14614. * // => false
  14615. *
  14616. * _.endsWith('abc', 'b', 2);
  14617. * // => true
  14618. */
  14619. function endsWith(string, target, position) {
  14620. string = toString(string);
  14621. target = baseToString(target);
  14622. var length = string.length;
  14623. position = position === undefined
  14624. ? length
  14625. : baseClamp(toInteger(position), 0, length);
  14626. var end = position;
  14627. position -= target.length;
  14628. return position >= 0 && string.slice(position, end) == target;
  14629. }
  14630. /**
  14631. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14632. * corresponding HTML entities.
  14633. *
  14634. * **Note:** No other characters are escaped. To escape additional
  14635. * characters use a third-party library like [_he_](https://mths.be/he).
  14636. *
  14637. * Though the ">" character is escaped for symmetry, characters like
  14638. * ">" and "/" don't need escaping in HTML and have no special meaning
  14639. * unless they're part of a tag or unquoted attribute value. See
  14640. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14641. * (under "semi-related fun fact") for more details.
  14642. *
  14643. * When working with HTML you should always
  14644. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14645. * XSS vectors.
  14646. *
  14647. * @static
  14648. * @since 0.1.0
  14649. * @memberOf _
  14650. * @category String
  14651. * @param {string} [string=''] The string to escape.
  14652. * @returns {string} Returns the escaped string.
  14653. * @example
  14654. *
  14655. * _.escape('fred, barney, & pebbles');
  14656. * // => 'fred, barney, &amp; pebbles'
  14657. */
  14658. function escape(string) {
  14659. string = toString(string);
  14660. return (string && reHasUnescapedHtml.test(string))
  14661. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14662. : string;
  14663. }
  14664. /**
  14665. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14666. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14667. *
  14668. * @static
  14669. * @memberOf _
  14670. * @since 3.0.0
  14671. * @category String
  14672. * @param {string} [string=''] The string to escape.
  14673. * @returns {string} Returns the escaped string.
  14674. * @example
  14675. *
  14676. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14677. * // => '\[lodash\]\(https://lodash\.com/\)'
  14678. */
  14679. function escapeRegExp(string) {
  14680. string = toString(string);
  14681. return (string && reHasRegExpChar.test(string))
  14682. ? string.replace(reRegExpChar, '\\$&')
  14683. : string;
  14684. }
  14685. /**
  14686. * Converts `string` to
  14687. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14688. *
  14689. * @static
  14690. * @memberOf _
  14691. * @since 3.0.0
  14692. * @category String
  14693. * @param {string} [string=''] The string to convert.
  14694. * @returns {string} Returns the kebab cased string.
  14695. * @example
  14696. *
  14697. * _.kebabCase('Foo Bar');
  14698. * // => 'foo-bar'
  14699. *
  14700. * _.kebabCase('fooBar');
  14701. * // => 'foo-bar'
  14702. *
  14703. * _.kebabCase('__FOO_BAR__');
  14704. * // => 'foo-bar'
  14705. */
  14706. var kebabCase = createCompounder(function(result, word, index) {
  14707. return result + (index ? '-' : '') + word.toLowerCase();
  14708. });
  14709. /**
  14710. * Converts `string`, as space separated words, to lower case.
  14711. *
  14712. * @static
  14713. * @memberOf _
  14714. * @since 4.0.0
  14715. * @category String
  14716. * @param {string} [string=''] The string to convert.
  14717. * @returns {string} Returns the lower cased string.
  14718. * @example
  14719. *
  14720. * _.lowerCase('--Foo-Bar--');
  14721. * // => 'foo bar'
  14722. *
  14723. * _.lowerCase('fooBar');
  14724. * // => 'foo bar'
  14725. *
  14726. * _.lowerCase('__FOO_BAR__');
  14727. * // => 'foo bar'
  14728. */
  14729. var lowerCase = createCompounder(function(result, word, index) {
  14730. return result + (index ? ' ' : '') + word.toLowerCase();
  14731. });
  14732. /**
  14733. * Converts the first character of `string` to lower case.
  14734. *
  14735. * @static
  14736. * @memberOf _
  14737. * @since 4.0.0
  14738. * @category String
  14739. * @param {string} [string=''] The string to convert.
  14740. * @returns {string} Returns the converted string.
  14741. * @example
  14742. *
  14743. * _.lowerFirst('Fred');
  14744. * // => 'fred'
  14745. *
  14746. * _.lowerFirst('FRED');
  14747. * // => 'fRED'
  14748. */
  14749. var lowerFirst = createCaseFirst('toLowerCase');
  14750. /**
  14751. * Pads `string` on the left and right sides if it's shorter than `length`.
  14752. * Padding characters are truncated if they can't be evenly divided by `length`.
  14753. *
  14754. * @static
  14755. * @memberOf _
  14756. * @since 3.0.0
  14757. * @category String
  14758. * @param {string} [string=''] The string to pad.
  14759. * @param {number} [length=0] The padding length.
  14760. * @param {string} [chars=' '] The string used as padding.
  14761. * @returns {string} Returns the padded string.
  14762. * @example
  14763. *
  14764. * _.pad('abc', 8);
  14765. * // => ' abc '
  14766. *
  14767. * _.pad('abc', 8, '_-');
  14768. * // => '_-abc_-_'
  14769. *
  14770. * _.pad('abc', 3);
  14771. * // => 'abc'
  14772. */
  14773. function pad(string, length, chars) {
  14774. string = toString(string);
  14775. length = toInteger(length);
  14776. var strLength = length ? stringSize(string) : 0;
  14777. if (!length || strLength >= length) {
  14778. return string;
  14779. }
  14780. var mid = (length - strLength) / 2;
  14781. return (
  14782. createPadding(nativeFloor(mid), chars) +
  14783. string +
  14784. createPadding(nativeCeil(mid), chars)
  14785. );
  14786. }
  14787. /**
  14788. * Pads `string` on the right side if it's shorter than `length`. Padding
  14789. * characters are truncated if they exceed `length`.
  14790. *
  14791. * @static
  14792. * @memberOf _
  14793. * @since 4.0.0
  14794. * @category String
  14795. * @param {string} [string=''] The string to pad.
  14796. * @param {number} [length=0] The padding length.
  14797. * @param {string} [chars=' '] The string used as padding.
  14798. * @returns {string} Returns the padded string.
  14799. * @example
  14800. *
  14801. * _.padEnd('abc', 6);
  14802. * // => 'abc '
  14803. *
  14804. * _.padEnd('abc', 6, '_-');
  14805. * // => 'abc_-_'
  14806. *
  14807. * _.padEnd('abc', 3);
  14808. * // => 'abc'
  14809. */
  14810. function padEnd(string, length, chars) {
  14811. string = toString(string);
  14812. length = toInteger(length);
  14813. var strLength = length ? stringSize(string) : 0;
  14814. return (length && strLength < length)
  14815. ? (string + createPadding(length - strLength, chars))
  14816. : string;
  14817. }
  14818. /**
  14819. * Pads `string` on the left side if it's shorter than `length`. Padding
  14820. * characters are truncated if they exceed `length`.
  14821. *
  14822. * @static
  14823. * @memberOf _
  14824. * @since 4.0.0
  14825. * @category String
  14826. * @param {string} [string=''] The string to pad.
  14827. * @param {number} [length=0] The padding length.
  14828. * @param {string} [chars=' '] The string used as padding.
  14829. * @returns {string} Returns the padded string.
  14830. * @example
  14831. *
  14832. * _.padStart('abc', 6);
  14833. * // => ' abc'
  14834. *
  14835. * _.padStart('abc', 6, '_-');
  14836. * // => '_-_abc'
  14837. *
  14838. * _.padStart('abc', 3);
  14839. * // => 'abc'
  14840. */
  14841. function padStart(string, length, chars) {
  14842. string = toString(string);
  14843. length = toInteger(length);
  14844. var strLength = length ? stringSize(string) : 0;
  14845. return (length && strLength < length)
  14846. ? (createPadding(length - strLength, chars) + string)
  14847. : string;
  14848. }
  14849. /**
  14850. * Converts `string` to an integer of the specified radix. If `radix` is
  14851. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14852. * hexadecimal, in which case a `radix` of `16` is used.
  14853. *
  14854. * **Note:** This method aligns with the
  14855. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14856. *
  14857. * @static
  14858. * @memberOf _
  14859. * @since 1.1.0
  14860. * @category String
  14861. * @param {string} string The string to convert.
  14862. * @param {number} [radix=10] The radix to interpret `value` by.
  14863. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14864. * @returns {number} Returns the converted integer.
  14865. * @example
  14866. *
  14867. * _.parseInt('08');
  14868. * // => 8
  14869. *
  14870. * _.map(['6', '08', '10'], _.parseInt);
  14871. * // => [6, 8, 10]
  14872. */
  14873. function parseInt(string, radix, guard) {
  14874. if (guard || radix == null) {
  14875. radix = 0;
  14876. } else if (radix) {
  14877. radix = +radix;
  14878. }
  14879. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14880. }
  14881. /**
  14882. * Repeats the given string `n` times.
  14883. *
  14884. * @static
  14885. * @memberOf _
  14886. * @since 3.0.0
  14887. * @category String
  14888. * @param {string} [string=''] The string to repeat.
  14889. * @param {number} [n=1] The number of times to repeat the string.
  14890. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14891. * @returns {string} Returns the repeated string.
  14892. * @example
  14893. *
  14894. * _.repeat('*', 3);
  14895. * // => '***'
  14896. *
  14897. * _.repeat('abc', 2);
  14898. * // => 'abcabc'
  14899. *
  14900. * _.repeat('abc', 0);
  14901. * // => ''
  14902. */
  14903. function repeat(string, n, guard) {
  14904. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14905. n = 1;
  14906. } else {
  14907. n = toInteger(n);
  14908. }
  14909. return baseRepeat(toString(string), n);
  14910. }
  14911. /**
  14912. * Replaces matches for `pattern` in `string` with `replacement`.
  14913. *
  14914. * **Note:** This method is based on
  14915. * [`String#replace`](https://mdn.io/String/replace).
  14916. *
  14917. * @static
  14918. * @memberOf _
  14919. * @since 4.0.0
  14920. * @category String
  14921. * @param {string} [string=''] The string to modify.
  14922. * @param {RegExp|string} pattern The pattern to replace.
  14923. * @param {Function|string} replacement The match replacement.
  14924. * @returns {string} Returns the modified string.
  14925. * @example
  14926. *
  14927. * _.replace('Hi Fred', 'Fred', 'Barney');
  14928. * // => 'Hi Barney'
  14929. */
  14930. function replace() {
  14931. var args = arguments,
  14932. string = toString(args[0]);
  14933. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14934. }
  14935. /**
  14936. * Converts `string` to
  14937. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14938. *
  14939. * @static
  14940. * @memberOf _
  14941. * @since 3.0.0
  14942. * @category String
  14943. * @param {string} [string=''] The string to convert.
  14944. * @returns {string} Returns the snake cased string.
  14945. * @example
  14946. *
  14947. * _.snakeCase('Foo Bar');
  14948. * // => 'foo_bar'
  14949. *
  14950. * _.snakeCase('fooBar');
  14951. * // => 'foo_bar'
  14952. *
  14953. * _.snakeCase('--FOO-BAR--');
  14954. * // => 'foo_bar'
  14955. */
  14956. var snakeCase = createCompounder(function(result, word, index) {
  14957. return result + (index ? '_' : '') + word.toLowerCase();
  14958. });
  14959. /**
  14960. * Splits `string` by `separator`.
  14961. *
  14962. * **Note:** This method is based on
  14963. * [`String#split`](https://mdn.io/String/split).
  14964. *
  14965. * @static
  14966. * @memberOf _
  14967. * @since 4.0.0
  14968. * @category String
  14969. * @param {string} [string=''] The string to split.
  14970. * @param {RegExp|string} separator The separator pattern to split by.
  14971. * @param {number} [limit] The length to truncate results to.
  14972. * @returns {Array} Returns the string segments.
  14973. * @example
  14974. *
  14975. * _.split('a-b-c', '-', 2);
  14976. * // => ['a', 'b']
  14977. */
  14978. function split(string, separator, limit) {
  14979. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14980. separator = limit = undefined;
  14981. }
  14982. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14983. if (!limit) {
  14984. return [];
  14985. }
  14986. string = toString(string);
  14987. if (string && (
  14988. typeof separator == 'string' ||
  14989. (separator != null && !isRegExp(separator))
  14990. )) {
  14991. separator = baseToString(separator);
  14992. if (!separator && hasUnicode(string)) {
  14993. return castSlice(stringToArray(string), 0, limit);
  14994. }
  14995. }
  14996. return string.split(separator, limit);
  14997. }
  14998. /**
  14999. * Converts `string` to
  15000. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15001. *
  15002. * @static
  15003. * @memberOf _
  15004. * @since 3.1.0
  15005. * @category String
  15006. * @param {string} [string=''] The string to convert.
  15007. * @returns {string} Returns the start cased string.
  15008. * @example
  15009. *
  15010. * _.startCase('--foo-bar--');
  15011. * // => 'Foo Bar'
  15012. *
  15013. * _.startCase('fooBar');
  15014. * // => 'Foo Bar'
  15015. *
  15016. * _.startCase('__FOO_BAR__');
  15017. * // => 'FOO BAR'
  15018. */
  15019. var startCase = createCompounder(function(result, word, index) {
  15020. return result + (index ? ' ' : '') + upperFirst(word);
  15021. });
  15022. /**
  15023. * Checks if `string` starts with the given target string.
  15024. *
  15025. * @static
  15026. * @memberOf _
  15027. * @since 3.0.0
  15028. * @category String
  15029. * @param {string} [string=''] The string to inspect.
  15030. * @param {string} [target] The string to search for.
  15031. * @param {number} [position=0] The position to search from.
  15032. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15033. * else `false`.
  15034. * @example
  15035. *
  15036. * _.startsWith('abc', 'a');
  15037. * // => true
  15038. *
  15039. * _.startsWith('abc', 'b');
  15040. * // => false
  15041. *
  15042. * _.startsWith('abc', 'b', 1);
  15043. * // => true
  15044. */
  15045. function startsWith(string, target, position) {
  15046. string = toString(string);
  15047. position = position == null
  15048. ? 0
  15049. : baseClamp(toInteger(position), 0, string.length);
  15050. target = baseToString(target);
  15051. return string.slice(position, position + target.length) == target;
  15052. }
  15053. /**
  15054. * Creates a compiled template function that can interpolate data properties
  15055. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15056. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15057. * properties may be accessed as free variables in the template. If a setting
  15058. * object is given, it takes precedence over `_.templateSettings` values.
  15059. *
  15060. * **Note:** In the development build `_.template` utilizes
  15061. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15062. * for easier debugging.
  15063. *
  15064. * For more information on precompiling templates see
  15065. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15066. *
  15067. * For more information on Chrome extension sandboxes see
  15068. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15069. *
  15070. * @static
  15071. * @since 0.1.0
  15072. * @memberOf _
  15073. * @category String
  15074. * @param {string} [string=''] The template string.
  15075. * @param {Object} [options={}] The options object.
  15076. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15077. * The HTML "escape" delimiter.
  15078. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15079. * The "evaluate" delimiter.
  15080. * @param {Object} [options.imports=_.templateSettings.imports]
  15081. * An object to import into the template as free variables.
  15082. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15083. * The "interpolate" delimiter.
  15084. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15085. * The sourceURL of the compiled template.
  15086. * @param {string} [options.variable='obj']
  15087. * The data object variable name.
  15088. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15089. * @returns {Function} Returns the compiled template function.
  15090. * @example
  15091. *
  15092. * // Use the "interpolate" delimiter to create a compiled template.
  15093. * var compiled = _.template('hello <%= user %>!');
  15094. * compiled({ 'user': 'fred' });
  15095. * // => 'hello fred!'
  15096. *
  15097. * // Use the HTML "escape" delimiter to escape data property values.
  15098. * var compiled = _.template('<b><%- value %></b>');
  15099. * compiled({ 'value': '<script>' });
  15100. * // => '<b>&lt;script&gt;</b>'
  15101. *
  15102. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15103. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15104. * compiled({ 'users': ['fred', 'barney'] });
  15105. * // => '<li>fred</li><li>barney</li>'
  15106. *
  15107. * // Use the internal `print` function in "evaluate" delimiters.
  15108. * var compiled = _.template('<% print("hello " + user); %>!');
  15109. * compiled({ 'user': 'barney' });
  15110. * // => 'hello barney!'
  15111. *
  15112. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15113. * // Disable support by replacing the "interpolate" delimiter.
  15114. * var compiled = _.template('hello ${ user }!');
  15115. * compiled({ 'user': 'pebbles' });
  15116. * // => 'hello pebbles!'
  15117. *
  15118. * // Use backslashes to treat delimiters as plain text.
  15119. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15120. * compiled({ 'value': 'ignored' });
  15121. * // => '<%- value %>'
  15122. *
  15123. * // Use the `imports` option to import `jQuery` as `jq`.
  15124. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15125. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15126. * compiled({ 'users': ['fred', 'barney'] });
  15127. * // => '<li>fred</li><li>barney</li>'
  15128. *
  15129. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15130. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15131. * compiled(data);
  15132. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15133. *
  15134. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15135. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15136. * compiled.source;
  15137. * // => function(data) {
  15138. * // var __t, __p = '';
  15139. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15140. * // return __p;
  15141. * // }
  15142. *
  15143. * // Use custom template delimiters.
  15144. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15145. * var compiled = _.template('hello {{ user }}!');
  15146. * compiled({ 'user': 'mustache' });
  15147. * // => 'hello mustache!'
  15148. *
  15149. * // Use the `source` property to inline compiled templates for meaningful
  15150. * // line numbers in error messages and stack traces.
  15151. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15152. * var JST = {\
  15153. * "main": ' + _.template(mainText).source + '\
  15154. * };\
  15155. * ');
  15156. */
  15157. function template(string, options, guard) {
  15158. // Based on John Resig's `tmpl` implementation
  15159. // (http://ejohn.org/blog/javascript-micro-templating/)
  15160. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15161. var settings = lodash.templateSettings;
  15162. if (guard && isIterateeCall(string, options, guard)) {
  15163. options = undefined;
  15164. }
  15165. string = toString(string);
  15166. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15167. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15168. importsKeys = keys(imports),
  15169. importsValues = baseValues(imports, importsKeys);
  15170. var isEscaping,
  15171. isEvaluating,
  15172. index = 0,
  15173. interpolate = options.interpolate || reNoMatch,
  15174. source = "__p += '";
  15175. // Compile the regexp to match each delimiter.
  15176. var reDelimiters = RegExp(
  15177. (options.escape || reNoMatch).source + '|' +
  15178. interpolate.source + '|' +
  15179. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15180. (options.evaluate || reNoMatch).source + '|$'
  15181. , 'g');
  15182. // Use a sourceURL for easier debugging.
  15183. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15184. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15185. // and escape the comment, thus injecting code that gets evaled.
  15186. var sourceURL = '//# sourceURL=' +
  15187. (hasOwnProperty.call(options, 'sourceURL')
  15188. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15189. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15190. ) + '\n';
  15191. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15192. interpolateValue || (interpolateValue = esTemplateValue);
  15193. // Escape characters that can't be included in string literals.
  15194. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15195. // Replace delimiters with snippets.
  15196. if (escapeValue) {
  15197. isEscaping = true;
  15198. source += "' +\n__e(" + escapeValue + ") +\n'";
  15199. }
  15200. if (evaluateValue) {
  15201. isEvaluating = true;
  15202. source += "';\n" + evaluateValue + ";\n__p += '";
  15203. }
  15204. if (interpolateValue) {
  15205. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15206. }
  15207. index = offset + match.length;
  15208. // The JS engine embedded in Adobe products needs `match` returned in
  15209. // order to produce the correct `offset` value.
  15210. return match;
  15211. });
  15212. source += "';\n";
  15213. // If `variable` is not specified wrap a with-statement around the generated
  15214. // code to add the data object to the top of the scope chain.
  15215. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15216. if (!variable) {
  15217. source = 'with (obj) {\n' + source + '\n}\n';
  15218. }
  15219. // Throw an error if a forbidden character was found in `variable`, to prevent
  15220. // potential command injection attacks.
  15221. else if (reForbiddenIdentifierChars.test(variable)) {
  15222. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15223. }
  15224. // Cleanup code by stripping empty strings.
  15225. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15226. .replace(reEmptyStringMiddle, '$1')
  15227. .replace(reEmptyStringTrailing, '$1;');
  15228. // Frame code as the function body.
  15229. source = 'function(' + (variable || 'obj') + ') {\n' +
  15230. (variable
  15231. ? ''
  15232. : 'obj || (obj = {});\n'
  15233. ) +
  15234. "var __t, __p = ''" +
  15235. (isEscaping
  15236. ? ', __e = _.escape'
  15237. : ''
  15238. ) +
  15239. (isEvaluating
  15240. ? ', __j = Array.prototype.join;\n' +
  15241. "function print() { __p += __j.call(arguments, '') }\n"
  15242. : ';\n'
  15243. ) +
  15244. source +
  15245. 'return __p\n}';
  15246. var result = attempt(function() {
  15247. return Function(importsKeys, sourceURL + 'return ' + source)
  15248. .apply(undefined, importsValues);
  15249. });
  15250. // Provide the compiled function's source by its `toString` method or
  15251. // the `source` property as a convenience for inlining compiled templates.
  15252. result.source = source;
  15253. if (isError(result)) {
  15254. throw result;
  15255. }
  15256. return result;
  15257. }
  15258. /**
  15259. * Converts `string`, as a whole, to lower case just like
  15260. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15261. *
  15262. * @static
  15263. * @memberOf _
  15264. * @since 4.0.0
  15265. * @category String
  15266. * @param {string} [string=''] The string to convert.
  15267. * @returns {string} Returns the lower cased string.
  15268. * @example
  15269. *
  15270. * _.toLower('--Foo-Bar--');
  15271. * // => '--foo-bar--'
  15272. *
  15273. * _.toLower('fooBar');
  15274. * // => 'foobar'
  15275. *
  15276. * _.toLower('__FOO_BAR__');
  15277. * // => '__foo_bar__'
  15278. */
  15279. function toLower(value) {
  15280. return toString(value).toLowerCase();
  15281. }
  15282. /**
  15283. * Converts `string`, as a whole, to upper case just like
  15284. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15285. *
  15286. * @static
  15287. * @memberOf _
  15288. * @since 4.0.0
  15289. * @category String
  15290. * @param {string} [string=''] The string to convert.
  15291. * @returns {string} Returns the upper cased string.
  15292. * @example
  15293. *
  15294. * _.toUpper('--foo-bar--');
  15295. * // => '--FOO-BAR--'
  15296. *
  15297. * _.toUpper('fooBar');
  15298. * // => 'FOOBAR'
  15299. *
  15300. * _.toUpper('__foo_bar__');
  15301. * // => '__FOO_BAR__'
  15302. */
  15303. function toUpper(value) {
  15304. return toString(value).toUpperCase();
  15305. }
  15306. /**
  15307. * Removes leading and trailing whitespace or specified characters from `string`.
  15308. *
  15309. * @static
  15310. * @memberOf _
  15311. * @since 3.0.0
  15312. * @category String
  15313. * @param {string} [string=''] The string to trim.
  15314. * @param {string} [chars=whitespace] The characters to trim.
  15315. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15316. * @returns {string} Returns the trimmed string.
  15317. * @example
  15318. *
  15319. * _.trim(' abc ');
  15320. * // => 'abc'
  15321. *
  15322. * _.trim('-_-abc-_-', '_-');
  15323. * // => 'abc'
  15324. *
  15325. * _.map([' foo ', ' bar '], _.trim);
  15326. * // => ['foo', 'bar']
  15327. */
  15328. function trim(string, chars, guard) {
  15329. string = toString(string);
  15330. if (string && (guard || chars === undefined)) {
  15331. return baseTrim(string);
  15332. }
  15333. if (!string || !(chars = baseToString(chars))) {
  15334. return string;
  15335. }
  15336. var strSymbols = stringToArray(string),
  15337. chrSymbols = stringToArray(chars),
  15338. start = charsStartIndex(strSymbols, chrSymbols),
  15339. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15340. return castSlice(strSymbols, start, end).join('');
  15341. }
  15342. /**
  15343. * Removes trailing whitespace or specified characters from `string`.
  15344. *
  15345. * @static
  15346. * @memberOf _
  15347. * @since 4.0.0
  15348. * @category String
  15349. * @param {string} [string=''] The string to trim.
  15350. * @param {string} [chars=whitespace] The characters to trim.
  15351. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15352. * @returns {string} Returns the trimmed string.
  15353. * @example
  15354. *
  15355. * _.trimEnd(' abc ');
  15356. * // => ' abc'
  15357. *
  15358. * _.trimEnd('-_-abc-_-', '_-');
  15359. * // => '-_-abc'
  15360. */
  15361. function trimEnd(string, chars, guard) {
  15362. string = toString(string);
  15363. if (string && (guard || chars === undefined)) {
  15364. return string.slice(0, trimmedEndIndex(string) + 1);
  15365. }
  15366. if (!string || !(chars = baseToString(chars))) {
  15367. return string;
  15368. }
  15369. var strSymbols = stringToArray(string),
  15370. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15371. return castSlice(strSymbols, 0, end).join('');
  15372. }
  15373. /**
  15374. * Removes leading whitespace or specified characters from `string`.
  15375. *
  15376. * @static
  15377. * @memberOf _
  15378. * @since 4.0.0
  15379. * @category String
  15380. * @param {string} [string=''] The string to trim.
  15381. * @param {string} [chars=whitespace] The characters to trim.
  15382. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15383. * @returns {string} Returns the trimmed string.
  15384. * @example
  15385. *
  15386. * _.trimStart(' abc ');
  15387. * // => 'abc '
  15388. *
  15389. * _.trimStart('-_-abc-_-', '_-');
  15390. * // => 'abc-_-'
  15391. */
  15392. function trimStart(string, chars, guard) {
  15393. string = toString(string);
  15394. if (string && (guard || chars === undefined)) {
  15395. return string.replace(reTrimStart, '');
  15396. }
  15397. if (!string || !(chars = baseToString(chars))) {
  15398. return string;
  15399. }
  15400. var strSymbols = stringToArray(string),
  15401. start = charsStartIndex(strSymbols, stringToArray(chars));
  15402. return castSlice(strSymbols, start).join('');
  15403. }
  15404. /**
  15405. * Truncates `string` if it's longer than the given maximum string length.
  15406. * The last characters of the truncated string are replaced with the omission
  15407. * string which defaults to "...".
  15408. *
  15409. * @static
  15410. * @memberOf _
  15411. * @since 4.0.0
  15412. * @category String
  15413. * @param {string} [string=''] The string to truncate.
  15414. * @param {Object} [options={}] The options object.
  15415. * @param {number} [options.length=30] The maximum string length.
  15416. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15417. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15418. * @returns {string} Returns the truncated string.
  15419. * @example
  15420. *
  15421. * _.truncate('hi-diddly-ho there, neighborino');
  15422. * // => 'hi-diddly-ho there, neighbo...'
  15423. *
  15424. * _.truncate('hi-diddly-ho there, neighborino', {
  15425. * 'length': 24,
  15426. * 'separator': ' '
  15427. * });
  15428. * // => 'hi-diddly-ho there,...'
  15429. *
  15430. * _.truncate('hi-diddly-ho there, neighborino', {
  15431. * 'length': 24,
  15432. * 'separator': /,? +/
  15433. * });
  15434. * // => 'hi-diddly-ho there...'
  15435. *
  15436. * _.truncate('hi-diddly-ho there, neighborino', {
  15437. * 'omission': ' [...]'
  15438. * });
  15439. * // => 'hi-diddly-ho there, neig [...]'
  15440. */
  15441. function truncate(string, options) {
  15442. var length = DEFAULT_TRUNC_LENGTH,
  15443. omission = DEFAULT_TRUNC_OMISSION;
  15444. if (isObject(options)) {
  15445. var separator = 'separator' in options ? options.separator : separator;
  15446. length = 'length' in options ? toInteger(options.length) : length;
  15447. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15448. }
  15449. string = toString(string);
  15450. var strLength = string.length;
  15451. if (hasUnicode(string)) {
  15452. var strSymbols = stringToArray(string);
  15453. strLength = strSymbols.length;
  15454. }
  15455. if (length >= strLength) {
  15456. return string;
  15457. }
  15458. var end = length - stringSize(omission);
  15459. if (end < 1) {
  15460. return omission;
  15461. }
  15462. var result = strSymbols
  15463. ? castSlice(strSymbols, 0, end).join('')
  15464. : string.slice(0, end);
  15465. if (separator === undefined) {
  15466. return result + omission;
  15467. }
  15468. if (strSymbols) {
  15469. end += (result.length - end);
  15470. }
  15471. if (isRegExp(separator)) {
  15472. if (string.slice(end).search(separator)) {
  15473. var match,
  15474. substring = result;
  15475. if (!separator.global) {
  15476. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15477. }
  15478. separator.lastIndex = 0;
  15479. while ((match = separator.exec(substring))) {
  15480. var newEnd = match.index;
  15481. }
  15482. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15483. }
  15484. } else if (string.indexOf(baseToString(separator), end) != end) {
  15485. var index = result.lastIndexOf(separator);
  15486. if (index > -1) {
  15487. result = result.slice(0, index);
  15488. }
  15489. }
  15490. return result + omission;
  15491. }
  15492. /**
  15493. * The inverse of `_.escape`; this method converts the HTML entities
  15494. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15495. * their corresponding characters.
  15496. *
  15497. * **Note:** No other HTML entities are unescaped. To unescape additional
  15498. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15499. *
  15500. * @static
  15501. * @memberOf _
  15502. * @since 0.6.0
  15503. * @category String
  15504. * @param {string} [string=''] The string to unescape.
  15505. * @returns {string} Returns the unescaped string.
  15506. * @example
  15507. *
  15508. * _.unescape('fred, barney, &amp; pebbles');
  15509. * // => 'fred, barney, & pebbles'
  15510. */
  15511. function unescape(string) {
  15512. string = toString(string);
  15513. return (string && reHasEscapedHtml.test(string))
  15514. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15515. : string;
  15516. }
  15517. /**
  15518. * Converts `string`, as space separated words, to upper case.
  15519. *
  15520. * @static
  15521. * @memberOf _
  15522. * @since 4.0.0
  15523. * @category String
  15524. * @param {string} [string=''] The string to convert.
  15525. * @returns {string} Returns the upper cased string.
  15526. * @example
  15527. *
  15528. * _.upperCase('--foo-bar');
  15529. * // => 'FOO BAR'
  15530. *
  15531. * _.upperCase('fooBar');
  15532. * // => 'FOO BAR'
  15533. *
  15534. * _.upperCase('__foo_bar__');
  15535. * // => 'FOO BAR'
  15536. */
  15537. var upperCase = createCompounder(function(result, word, index) {
  15538. return result + (index ? ' ' : '') + word.toUpperCase();
  15539. });
  15540. /**
  15541. * Converts the first character of `string` to upper case.
  15542. *
  15543. * @static
  15544. * @memberOf _
  15545. * @since 4.0.0
  15546. * @category String
  15547. * @param {string} [string=''] The string to convert.
  15548. * @returns {string} Returns the converted string.
  15549. * @example
  15550. *
  15551. * _.upperFirst('fred');
  15552. * // => 'Fred'
  15553. *
  15554. * _.upperFirst('FRED');
  15555. * // => 'FRED'
  15556. */
  15557. var upperFirst = createCaseFirst('toUpperCase');
  15558. /**
  15559. * Splits `string` into an array of its words.
  15560. *
  15561. * @static
  15562. * @memberOf _
  15563. * @since 3.0.0
  15564. * @category String
  15565. * @param {string} [string=''] The string to inspect.
  15566. * @param {RegExp|string} [pattern] The pattern to match words.
  15567. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15568. * @returns {Array} Returns the words of `string`.
  15569. * @example
  15570. *
  15571. * _.words('fred, barney, & pebbles');
  15572. * // => ['fred', 'barney', 'pebbles']
  15573. *
  15574. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15575. * // => ['fred', 'barney', '&', 'pebbles']
  15576. */
  15577. function words(string, pattern, guard) {
  15578. string = toString(string);
  15579. pattern = guard ? undefined : pattern;
  15580. if (pattern === undefined) {
  15581. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15582. }
  15583. return string.match(pattern) || [];
  15584. }
  15585. /*------------------------------------------------------------------------*/
  15586. /**
  15587. * Attempts to invoke `func`, returning either the result or the caught error
  15588. * object. Any additional arguments are provided to `func` when it's invoked.
  15589. *
  15590. * @static
  15591. * @memberOf _
  15592. * @since 3.0.0
  15593. * @category Util
  15594. * @param {Function} func The function to attempt.
  15595. * @param {...*} [args] The arguments to invoke `func` with.
  15596. * @returns {*} Returns the `func` result or error object.
  15597. * @example
  15598. *
  15599. * // Avoid throwing errors for invalid selectors.
  15600. * var elements = _.attempt(function(selector) {
  15601. * return document.querySelectorAll(selector);
  15602. * }, '>_>');
  15603. *
  15604. * if (_.isError(elements)) {
  15605. * elements = [];
  15606. * }
  15607. */
  15608. var attempt = baseRest(function(func, args) {
  15609. try {
  15610. return apply(func, undefined, args);
  15611. } catch (e) {
  15612. return isError(e) ? e : new Error(e);
  15613. }
  15614. });
  15615. /**
  15616. * Binds methods of an object to the object itself, overwriting the existing
  15617. * method.
  15618. *
  15619. * **Note:** This method doesn't set the "length" property of bound functions.
  15620. *
  15621. * @static
  15622. * @since 0.1.0
  15623. * @memberOf _
  15624. * @category Util
  15625. * @param {Object} object The object to bind and assign the bound methods to.
  15626. * @param {...(string|string[])} methodNames The object method names to bind.
  15627. * @returns {Object} Returns `object`.
  15628. * @example
  15629. *
  15630. * var view = {
  15631. * 'label': 'docs',
  15632. * 'click': function() {
  15633. * console.log('clicked ' + this.label);
  15634. * }
  15635. * };
  15636. *
  15637. * _.bindAll(view, ['click']);
  15638. * jQuery(element).on('click', view.click);
  15639. * // => Logs 'clicked docs' when clicked.
  15640. */
  15641. var bindAll = flatRest(function(object, methodNames) {
  15642. arrayEach(methodNames, function(key) {
  15643. key = toKey(key);
  15644. baseAssignValue(object, key, bind(object[key], object));
  15645. });
  15646. return object;
  15647. });
  15648. /**
  15649. * Creates a function that iterates over `pairs` and invokes the corresponding
  15650. * function of the first predicate to return truthy. The predicate-function
  15651. * pairs are invoked with the `this` binding and arguments of the created
  15652. * function.
  15653. *
  15654. * @static
  15655. * @memberOf _
  15656. * @since 4.0.0
  15657. * @category Util
  15658. * @param {Array} pairs The predicate-function pairs.
  15659. * @returns {Function} Returns the new composite function.
  15660. * @example
  15661. *
  15662. * var func = _.cond([
  15663. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15664. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15665. * [_.stubTrue, _.constant('no match')]
  15666. * ]);
  15667. *
  15668. * func({ 'a': 1, 'b': 2 });
  15669. * // => 'matches A'
  15670. *
  15671. * func({ 'a': 0, 'b': 1 });
  15672. * // => 'matches B'
  15673. *
  15674. * func({ 'a': '1', 'b': '2' });
  15675. * // => 'no match'
  15676. */
  15677. function cond(pairs) {
  15678. var length = pairs == null ? 0 : pairs.length,
  15679. toIteratee = getIteratee();
  15680. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15681. if (typeof pair[1] != 'function') {
  15682. throw new TypeError(FUNC_ERROR_TEXT);
  15683. }
  15684. return [toIteratee(pair[0]), pair[1]];
  15685. });
  15686. return baseRest(function(args) {
  15687. var index = -1;
  15688. while (++index < length) {
  15689. var pair = pairs[index];
  15690. if (apply(pair[0], this, args)) {
  15691. return apply(pair[1], this, args);
  15692. }
  15693. }
  15694. });
  15695. }
  15696. /**
  15697. * Creates a function that invokes the predicate properties of `source` with
  15698. * the corresponding property values of a given object, returning `true` if
  15699. * all predicates return truthy, else `false`.
  15700. *
  15701. * **Note:** The created function is equivalent to `_.conformsTo` with
  15702. * `source` partially applied.
  15703. *
  15704. * @static
  15705. * @memberOf _
  15706. * @since 4.0.0
  15707. * @category Util
  15708. * @param {Object} source The object of property predicates to conform to.
  15709. * @returns {Function} Returns the new spec function.
  15710. * @example
  15711. *
  15712. * var objects = [
  15713. * { 'a': 2, 'b': 1 },
  15714. * { 'a': 1, 'b': 2 }
  15715. * ];
  15716. *
  15717. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15718. * // => [{ 'a': 1, 'b': 2 }]
  15719. */
  15720. function conforms(source) {
  15721. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15722. }
  15723. /**
  15724. * Creates a function that returns `value`.
  15725. *
  15726. * @static
  15727. * @memberOf _
  15728. * @since 2.4.0
  15729. * @category Util
  15730. * @param {*} value The value to return from the new function.
  15731. * @returns {Function} Returns the new constant function.
  15732. * @example
  15733. *
  15734. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15735. *
  15736. * console.log(objects);
  15737. * // => [{ 'a': 1 }, { 'a': 1 }]
  15738. *
  15739. * console.log(objects[0] === objects[1]);
  15740. * // => true
  15741. */
  15742. function constant(value) {
  15743. return function() {
  15744. return value;
  15745. };
  15746. }
  15747. /**
  15748. * Checks `value` to determine whether a default value should be returned in
  15749. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15750. * or `undefined`.
  15751. *
  15752. * @static
  15753. * @memberOf _
  15754. * @since 4.14.0
  15755. * @category Util
  15756. * @param {*} value The value to check.
  15757. * @param {*} defaultValue The default value.
  15758. * @returns {*} Returns the resolved value.
  15759. * @example
  15760. *
  15761. * _.defaultTo(1, 10);
  15762. * // => 1
  15763. *
  15764. * _.defaultTo(undefined, 10);
  15765. * // => 10
  15766. */
  15767. function defaultTo(value, defaultValue) {
  15768. return (value == null || value !== value) ? defaultValue : value;
  15769. }
  15770. /**
  15771. * Creates a function that returns the result of invoking the given functions
  15772. * with the `this` binding of the created function, where each successive
  15773. * invocation is supplied the return value of the previous.
  15774. *
  15775. * @static
  15776. * @memberOf _
  15777. * @since 3.0.0
  15778. * @category Util
  15779. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15780. * @returns {Function} Returns the new composite function.
  15781. * @see _.flowRight
  15782. * @example
  15783. *
  15784. * function square(n) {
  15785. * return n * n;
  15786. * }
  15787. *
  15788. * var addSquare = _.flow([_.add, square]);
  15789. * addSquare(1, 2);
  15790. * // => 9
  15791. */
  15792. var flow = createFlow();
  15793. /**
  15794. * This method is like `_.flow` except that it creates a function that
  15795. * invokes the given functions from right to left.
  15796. *
  15797. * @static
  15798. * @since 3.0.0
  15799. * @memberOf _
  15800. * @category Util
  15801. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15802. * @returns {Function} Returns the new composite function.
  15803. * @see _.flow
  15804. * @example
  15805. *
  15806. * function square(n) {
  15807. * return n * n;
  15808. * }
  15809. *
  15810. * var addSquare = _.flowRight([square, _.add]);
  15811. * addSquare(1, 2);
  15812. * // => 9
  15813. */
  15814. var flowRight = createFlow(true);
  15815. /**
  15816. * This method returns the first argument it receives.
  15817. *
  15818. * @static
  15819. * @since 0.1.0
  15820. * @memberOf _
  15821. * @category Util
  15822. * @param {*} value Any value.
  15823. * @returns {*} Returns `value`.
  15824. * @example
  15825. *
  15826. * var object = { 'a': 1 };
  15827. *
  15828. * console.log(_.identity(object) === object);
  15829. * // => true
  15830. */
  15831. function identity(value) {
  15832. return value;
  15833. }
  15834. /**
  15835. * Creates a function that invokes `func` with the arguments of the created
  15836. * function. If `func` is a property name, the created function returns the
  15837. * property value for a given element. If `func` is an array or object, the
  15838. * created function returns `true` for elements that contain the equivalent
  15839. * source properties, otherwise it returns `false`.
  15840. *
  15841. * @static
  15842. * @since 4.0.0
  15843. * @memberOf _
  15844. * @category Util
  15845. * @param {*} [func=_.identity] The value to convert to a callback.
  15846. * @returns {Function} Returns the callback.
  15847. * @example
  15848. *
  15849. * var users = [
  15850. * { 'user': 'barney', 'age': 36, 'active': true },
  15851. * { 'user': 'fred', 'age': 40, 'active': false }
  15852. * ];
  15853. *
  15854. * // The `_.matches` iteratee shorthand.
  15855. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15856. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15857. *
  15858. * // The `_.matchesProperty` iteratee shorthand.
  15859. * _.filter(users, _.iteratee(['user', 'fred']));
  15860. * // => [{ 'user': 'fred', 'age': 40 }]
  15861. *
  15862. * // The `_.property` iteratee shorthand.
  15863. * _.map(users, _.iteratee('user'));
  15864. * // => ['barney', 'fred']
  15865. *
  15866. * // Create custom iteratee shorthands.
  15867. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15868. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15869. * return func.test(string);
  15870. * };
  15871. * });
  15872. *
  15873. * _.filter(['abc', 'def'], /ef/);
  15874. * // => ['def']
  15875. */
  15876. function iteratee(func) {
  15877. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15878. }
  15879. /**
  15880. * Creates a function that performs a partial deep comparison between a given
  15881. * object and `source`, returning `true` if the given object has equivalent
  15882. * property values, else `false`.
  15883. *
  15884. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15885. * partially applied.
  15886. *
  15887. * Partial comparisons will match empty array and empty object `source`
  15888. * values against any array or object value, respectively. See `_.isEqual`
  15889. * for a list of supported value comparisons.
  15890. *
  15891. * **Note:** Multiple values can be checked by combining several matchers
  15892. * using `_.overSome`
  15893. *
  15894. * @static
  15895. * @memberOf _
  15896. * @since 3.0.0
  15897. * @category Util
  15898. * @param {Object} source The object of property values to match.
  15899. * @returns {Function} Returns the new spec function.
  15900. * @example
  15901. *
  15902. * var objects = [
  15903. * { 'a': 1, 'b': 2, 'c': 3 },
  15904. * { 'a': 4, 'b': 5, 'c': 6 }
  15905. * ];
  15906. *
  15907. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15908. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15909. *
  15910. * // Checking for several possible values
  15911. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15912. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15913. */
  15914. function matches(source) {
  15915. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15916. }
  15917. /**
  15918. * Creates a function that performs a partial deep comparison between the
  15919. * value at `path` of a given object to `srcValue`, returning `true` if the
  15920. * object value is equivalent, else `false`.
  15921. *
  15922. * **Note:** Partial comparisons will match empty array and empty object
  15923. * `srcValue` values against any array or object value, respectively. See
  15924. * `_.isEqual` for a list of supported value comparisons.
  15925. *
  15926. * **Note:** Multiple values can be checked by combining several matchers
  15927. * using `_.overSome`
  15928. *
  15929. * @static
  15930. * @memberOf _
  15931. * @since 3.2.0
  15932. * @category Util
  15933. * @param {Array|string} path The path of the property to get.
  15934. * @param {*} srcValue The value to match.
  15935. * @returns {Function} Returns the new spec function.
  15936. * @example
  15937. *
  15938. * var objects = [
  15939. * { 'a': 1, 'b': 2, 'c': 3 },
  15940. * { 'a': 4, 'b': 5, 'c': 6 }
  15941. * ];
  15942. *
  15943. * _.find(objects, _.matchesProperty('a', 4));
  15944. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15945. *
  15946. * // Checking for several possible values
  15947. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15948. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15949. */
  15950. function matchesProperty(path, srcValue) {
  15951. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15952. }
  15953. /**
  15954. * Creates a function that invokes the method at `path` of a given object.
  15955. * Any additional arguments are provided to the invoked method.
  15956. *
  15957. * @static
  15958. * @memberOf _
  15959. * @since 3.7.0
  15960. * @category Util
  15961. * @param {Array|string} path The path of the method to invoke.
  15962. * @param {...*} [args] The arguments to invoke the method with.
  15963. * @returns {Function} Returns the new invoker function.
  15964. * @example
  15965. *
  15966. * var objects = [
  15967. * { 'a': { 'b': _.constant(2) } },
  15968. * { 'a': { 'b': _.constant(1) } }
  15969. * ];
  15970. *
  15971. * _.map(objects, _.method('a.b'));
  15972. * // => [2, 1]
  15973. *
  15974. * _.map(objects, _.method(['a', 'b']));
  15975. * // => [2, 1]
  15976. */
  15977. var method = baseRest(function(path, args) {
  15978. return function(object) {
  15979. return baseInvoke(object, path, args);
  15980. };
  15981. });
  15982. /**
  15983. * The opposite of `_.method`; this method creates a function that invokes
  15984. * the method at a given path of `object`. Any additional arguments are
  15985. * provided to the invoked method.
  15986. *
  15987. * @static
  15988. * @memberOf _
  15989. * @since 3.7.0
  15990. * @category Util
  15991. * @param {Object} object The object to query.
  15992. * @param {...*} [args] The arguments to invoke the method with.
  15993. * @returns {Function} Returns the new invoker function.
  15994. * @example
  15995. *
  15996. * var array = _.times(3, _.constant),
  15997. * object = { 'a': array, 'b': array, 'c': array };
  15998. *
  15999. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16000. * // => [2, 0]
  16001. *
  16002. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16003. * // => [2, 0]
  16004. */
  16005. var methodOf = baseRest(function(object, args) {
  16006. return function(path) {
  16007. return baseInvoke(object, path, args);
  16008. };
  16009. });
  16010. /**
  16011. * Adds all own enumerable string keyed function properties of a source
  16012. * object to the destination object. If `object` is a function, then methods
  16013. * are added to its prototype as well.
  16014. *
  16015. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16016. * avoid conflicts caused by modifying the original.
  16017. *
  16018. * @static
  16019. * @since 0.1.0
  16020. * @memberOf _
  16021. * @category Util
  16022. * @param {Function|Object} [object=lodash] The destination object.
  16023. * @param {Object} source The object of functions to add.
  16024. * @param {Object} [options={}] The options object.
  16025. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16026. * @returns {Function|Object} Returns `object`.
  16027. * @example
  16028. *
  16029. * function vowels(string) {
  16030. * return _.filter(string, function(v) {
  16031. * return /[aeiou]/i.test(v);
  16032. * });
  16033. * }
  16034. *
  16035. * _.mixin({ 'vowels': vowels });
  16036. * _.vowels('fred');
  16037. * // => ['e']
  16038. *
  16039. * _('fred').vowels().value();
  16040. * // => ['e']
  16041. *
  16042. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16043. * _('fred').vowels();
  16044. * // => ['e']
  16045. */
  16046. function mixin(object, source, options) {
  16047. var props = keys(source),
  16048. methodNames = baseFunctions(source, props);
  16049. if (options == null &&
  16050. !(isObject(source) && (methodNames.length || !props.length))) {
  16051. options = source;
  16052. source = object;
  16053. object = this;
  16054. methodNames = baseFunctions(source, keys(source));
  16055. }
  16056. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16057. isFunc = isFunction(object);
  16058. arrayEach(methodNames, function(methodName) {
  16059. var func = source[methodName];
  16060. object[methodName] = func;
  16061. if (isFunc) {
  16062. object.prototype[methodName] = function() {
  16063. var chainAll = this.__chain__;
  16064. if (chain || chainAll) {
  16065. var result = object(this.__wrapped__),
  16066. actions = result.__actions__ = copyArray(this.__actions__);
  16067. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16068. result.__chain__ = chainAll;
  16069. return result;
  16070. }
  16071. return func.apply(object, arrayPush([this.value()], arguments));
  16072. };
  16073. }
  16074. });
  16075. return object;
  16076. }
  16077. /**
  16078. * Reverts the `_` variable to its previous value and returns a reference to
  16079. * the `lodash` function.
  16080. *
  16081. * @static
  16082. * @since 0.1.0
  16083. * @memberOf _
  16084. * @category Util
  16085. * @returns {Function} Returns the `lodash` function.
  16086. * @example
  16087. *
  16088. * var lodash = _.noConflict();
  16089. */
  16090. function noConflict() {
  16091. if (root._ === this) {
  16092. root._ = oldDash;
  16093. }
  16094. return this;
  16095. }
  16096. /**
  16097. * This method returns `undefined`.
  16098. *
  16099. * @static
  16100. * @memberOf _
  16101. * @since 2.3.0
  16102. * @category Util
  16103. * @example
  16104. *
  16105. * _.times(2, _.noop);
  16106. * // => [undefined, undefined]
  16107. */
  16108. function noop() {
  16109. // No operation performed.
  16110. }
  16111. /**
  16112. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16113. * the nth argument from the end is returned.
  16114. *
  16115. * @static
  16116. * @memberOf _
  16117. * @since 4.0.0
  16118. * @category Util
  16119. * @param {number} [n=0] The index of the argument to return.
  16120. * @returns {Function} Returns the new pass-thru function.
  16121. * @example
  16122. *
  16123. * var func = _.nthArg(1);
  16124. * func('a', 'b', 'c', 'd');
  16125. * // => 'b'
  16126. *
  16127. * var func = _.nthArg(-2);
  16128. * func('a', 'b', 'c', 'd');
  16129. * // => 'c'
  16130. */
  16131. function nthArg(n) {
  16132. n = toInteger(n);
  16133. return baseRest(function(args) {
  16134. return baseNth(args, n);
  16135. });
  16136. }
  16137. /**
  16138. * Creates a function that invokes `iteratees` with the arguments it receives
  16139. * and returns their results.
  16140. *
  16141. * @static
  16142. * @memberOf _
  16143. * @since 4.0.0
  16144. * @category Util
  16145. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16146. * The iteratees to invoke.
  16147. * @returns {Function} Returns the new function.
  16148. * @example
  16149. *
  16150. * var func = _.over([Math.max, Math.min]);
  16151. *
  16152. * func(1, 2, 3, 4);
  16153. * // => [4, 1]
  16154. */
  16155. var over = createOver(arrayMap);
  16156. /**
  16157. * Creates a function that checks if **all** of the `predicates` return
  16158. * truthy when invoked with the arguments it receives.
  16159. *
  16160. * Following shorthands are possible for providing predicates.
  16161. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16162. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16163. *
  16164. * @static
  16165. * @memberOf _
  16166. * @since 4.0.0
  16167. * @category Util
  16168. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16169. * The predicates to check.
  16170. * @returns {Function} Returns the new function.
  16171. * @example
  16172. *
  16173. * var func = _.overEvery([Boolean, isFinite]);
  16174. *
  16175. * func('1');
  16176. * // => true
  16177. *
  16178. * func(null);
  16179. * // => false
  16180. *
  16181. * func(NaN);
  16182. * // => false
  16183. */
  16184. var overEvery = createOver(arrayEvery);
  16185. /**
  16186. * Creates a function that checks if **any** of the `predicates` return
  16187. * truthy when invoked with the arguments it receives.
  16188. *
  16189. * Following shorthands are possible for providing predicates.
  16190. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16191. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16192. *
  16193. * @static
  16194. * @memberOf _
  16195. * @since 4.0.0
  16196. * @category Util
  16197. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16198. * The predicates to check.
  16199. * @returns {Function} Returns the new function.
  16200. * @example
  16201. *
  16202. * var func = _.overSome([Boolean, isFinite]);
  16203. *
  16204. * func('1');
  16205. * // => true
  16206. *
  16207. * func(null);
  16208. * // => true
  16209. *
  16210. * func(NaN);
  16211. * // => false
  16212. *
  16213. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16214. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16215. */
  16216. var overSome = createOver(arraySome);
  16217. /**
  16218. * Creates a function that returns the value at `path` of a given object.
  16219. *
  16220. * @static
  16221. * @memberOf _
  16222. * @since 2.4.0
  16223. * @category Util
  16224. * @param {Array|string} path The path of the property to get.
  16225. * @returns {Function} Returns the new accessor function.
  16226. * @example
  16227. *
  16228. * var objects = [
  16229. * { 'a': { 'b': 2 } },
  16230. * { 'a': { 'b': 1 } }
  16231. * ];
  16232. *
  16233. * _.map(objects, _.property('a.b'));
  16234. * // => [2, 1]
  16235. *
  16236. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16237. * // => [1, 2]
  16238. */
  16239. function property(path) {
  16240. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16241. }
  16242. /**
  16243. * The opposite of `_.property`; this method creates a function that returns
  16244. * the value at a given path of `object`.
  16245. *
  16246. * @static
  16247. * @memberOf _
  16248. * @since 3.0.0
  16249. * @category Util
  16250. * @param {Object} object The object to query.
  16251. * @returns {Function} Returns the new accessor function.
  16252. * @example
  16253. *
  16254. * var array = [0, 1, 2],
  16255. * object = { 'a': array, 'b': array, 'c': array };
  16256. *
  16257. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16258. * // => [2, 0]
  16259. *
  16260. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16261. * // => [2, 0]
  16262. */
  16263. function propertyOf(object) {
  16264. return function(path) {
  16265. return object == null ? undefined : baseGet(object, path);
  16266. };
  16267. }
  16268. /**
  16269. * Creates an array of numbers (positive and/or negative) progressing from
  16270. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16271. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16272. * it's set to `start` with `start` then set to `0`.
  16273. *
  16274. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16275. * floating-point values which can produce unexpected results.
  16276. *
  16277. * @static
  16278. * @since 0.1.0
  16279. * @memberOf _
  16280. * @category Util
  16281. * @param {number} [start=0] The start of the range.
  16282. * @param {number} end The end of the range.
  16283. * @param {number} [step=1] The value to increment or decrement by.
  16284. * @returns {Array} Returns the range of numbers.
  16285. * @see _.inRange, _.rangeRight
  16286. * @example
  16287. *
  16288. * _.range(4);
  16289. * // => [0, 1, 2, 3]
  16290. *
  16291. * _.range(-4);
  16292. * // => [0, -1, -2, -3]
  16293. *
  16294. * _.range(1, 5);
  16295. * // => [1, 2, 3, 4]
  16296. *
  16297. * _.range(0, 20, 5);
  16298. * // => [0, 5, 10, 15]
  16299. *
  16300. * _.range(0, -4, -1);
  16301. * // => [0, -1, -2, -3]
  16302. *
  16303. * _.range(1, 4, 0);
  16304. * // => [1, 1, 1]
  16305. *
  16306. * _.range(0);
  16307. * // => []
  16308. */
  16309. var range = createRange();
  16310. /**
  16311. * This method is like `_.range` except that it populates values in
  16312. * descending order.
  16313. *
  16314. * @static
  16315. * @memberOf _
  16316. * @since 4.0.0
  16317. * @category Util
  16318. * @param {number} [start=0] The start of the range.
  16319. * @param {number} end The end of the range.
  16320. * @param {number} [step=1] The value to increment or decrement by.
  16321. * @returns {Array} Returns the range of numbers.
  16322. * @see _.inRange, _.range
  16323. * @example
  16324. *
  16325. * _.rangeRight(4);
  16326. * // => [3, 2, 1, 0]
  16327. *
  16328. * _.rangeRight(-4);
  16329. * // => [-3, -2, -1, 0]
  16330. *
  16331. * _.rangeRight(1, 5);
  16332. * // => [4, 3, 2, 1]
  16333. *
  16334. * _.rangeRight(0, 20, 5);
  16335. * // => [15, 10, 5, 0]
  16336. *
  16337. * _.rangeRight(0, -4, -1);
  16338. * // => [-3, -2, -1, 0]
  16339. *
  16340. * _.rangeRight(1, 4, 0);
  16341. * // => [1, 1, 1]
  16342. *
  16343. * _.rangeRight(0);
  16344. * // => []
  16345. */
  16346. var rangeRight = createRange(true);
  16347. /**
  16348. * This method returns a new empty array.
  16349. *
  16350. * @static
  16351. * @memberOf _
  16352. * @since 4.13.0
  16353. * @category Util
  16354. * @returns {Array} Returns the new empty array.
  16355. * @example
  16356. *
  16357. * var arrays = _.times(2, _.stubArray);
  16358. *
  16359. * console.log(arrays);
  16360. * // => [[], []]
  16361. *
  16362. * console.log(arrays[0] === arrays[1]);
  16363. * // => false
  16364. */
  16365. function stubArray() {
  16366. return [];
  16367. }
  16368. /**
  16369. * This method returns `false`.
  16370. *
  16371. * @static
  16372. * @memberOf _
  16373. * @since 4.13.0
  16374. * @category Util
  16375. * @returns {boolean} Returns `false`.
  16376. * @example
  16377. *
  16378. * _.times(2, _.stubFalse);
  16379. * // => [false, false]
  16380. */
  16381. function stubFalse() {
  16382. return false;
  16383. }
  16384. /**
  16385. * This method returns a new empty object.
  16386. *
  16387. * @static
  16388. * @memberOf _
  16389. * @since 4.13.0
  16390. * @category Util
  16391. * @returns {Object} Returns the new empty object.
  16392. * @example
  16393. *
  16394. * var objects = _.times(2, _.stubObject);
  16395. *
  16396. * console.log(objects);
  16397. * // => [{}, {}]
  16398. *
  16399. * console.log(objects[0] === objects[1]);
  16400. * // => false
  16401. */
  16402. function stubObject() {
  16403. return {};
  16404. }
  16405. /**
  16406. * This method returns an empty string.
  16407. *
  16408. * @static
  16409. * @memberOf _
  16410. * @since 4.13.0
  16411. * @category Util
  16412. * @returns {string} Returns the empty string.
  16413. * @example
  16414. *
  16415. * _.times(2, _.stubString);
  16416. * // => ['', '']
  16417. */
  16418. function stubString() {
  16419. return '';
  16420. }
  16421. /**
  16422. * This method returns `true`.
  16423. *
  16424. * @static
  16425. * @memberOf _
  16426. * @since 4.13.0
  16427. * @category Util
  16428. * @returns {boolean} Returns `true`.
  16429. * @example
  16430. *
  16431. * _.times(2, _.stubTrue);
  16432. * // => [true, true]
  16433. */
  16434. function stubTrue() {
  16435. return true;
  16436. }
  16437. /**
  16438. * Invokes the iteratee `n` times, returning an array of the results of
  16439. * each invocation. The iteratee is invoked with one argument; (index).
  16440. *
  16441. * @static
  16442. * @since 0.1.0
  16443. * @memberOf _
  16444. * @category Util
  16445. * @param {number} n The number of times to invoke `iteratee`.
  16446. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16447. * @returns {Array} Returns the array of results.
  16448. * @example
  16449. *
  16450. * _.times(3, String);
  16451. * // => ['0', '1', '2']
  16452. *
  16453. * _.times(4, _.constant(0));
  16454. * // => [0, 0, 0, 0]
  16455. */
  16456. function times(n, iteratee) {
  16457. n = toInteger(n);
  16458. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16459. return [];
  16460. }
  16461. var index = MAX_ARRAY_LENGTH,
  16462. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16463. iteratee = getIteratee(iteratee);
  16464. n -= MAX_ARRAY_LENGTH;
  16465. var result = baseTimes(length, iteratee);
  16466. while (++index < n) {
  16467. iteratee(index);
  16468. }
  16469. return result;
  16470. }
  16471. /**
  16472. * Converts `value` to a property path array.
  16473. *
  16474. * @static
  16475. * @memberOf _
  16476. * @since 4.0.0
  16477. * @category Util
  16478. * @param {*} value The value to convert.
  16479. * @returns {Array} Returns the new property path array.
  16480. * @example
  16481. *
  16482. * _.toPath('a.b.c');
  16483. * // => ['a', 'b', 'c']
  16484. *
  16485. * _.toPath('a[0].b.c');
  16486. * // => ['a', '0', 'b', 'c']
  16487. */
  16488. function toPath(value) {
  16489. if (isArray(value)) {
  16490. return arrayMap(value, toKey);
  16491. }
  16492. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16493. }
  16494. /**
  16495. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16496. *
  16497. * @static
  16498. * @since 0.1.0
  16499. * @memberOf _
  16500. * @category Util
  16501. * @param {string} [prefix=''] The value to prefix the ID with.
  16502. * @returns {string} Returns the unique ID.
  16503. * @example
  16504. *
  16505. * _.uniqueId('contact_');
  16506. * // => 'contact_104'
  16507. *
  16508. * _.uniqueId();
  16509. * // => '105'
  16510. */
  16511. function uniqueId(prefix) {
  16512. var id = ++idCounter;
  16513. return toString(prefix) + id;
  16514. }
  16515. /*------------------------------------------------------------------------*/
  16516. /**
  16517. * Adds two numbers.
  16518. *
  16519. * @static
  16520. * @memberOf _
  16521. * @since 3.4.0
  16522. * @category Math
  16523. * @param {number} augend The first number in an addition.
  16524. * @param {number} addend The second number in an addition.
  16525. * @returns {number} Returns the total.
  16526. * @example
  16527. *
  16528. * _.add(6, 4);
  16529. * // => 10
  16530. */
  16531. var add = createMathOperation(function(augend, addend) {
  16532. return augend + addend;
  16533. }, 0);
  16534. /**
  16535. * Computes `number` rounded up to `precision`.
  16536. *
  16537. * @static
  16538. * @memberOf _
  16539. * @since 3.10.0
  16540. * @category Math
  16541. * @param {number} number The number to round up.
  16542. * @param {number} [precision=0] The precision to round up to.
  16543. * @returns {number} Returns the rounded up number.
  16544. * @example
  16545. *
  16546. * _.ceil(4.006);
  16547. * // => 5
  16548. *
  16549. * _.ceil(6.004, 2);
  16550. * // => 6.01
  16551. *
  16552. * _.ceil(6040, -2);
  16553. * // => 6100
  16554. */
  16555. var ceil = createRound('ceil');
  16556. /**
  16557. * Divide two numbers.
  16558. *
  16559. * @static
  16560. * @memberOf _
  16561. * @since 4.7.0
  16562. * @category Math
  16563. * @param {number} dividend The first number in a division.
  16564. * @param {number} divisor The second number in a division.
  16565. * @returns {number} Returns the quotient.
  16566. * @example
  16567. *
  16568. * _.divide(6, 4);
  16569. * // => 1.5
  16570. */
  16571. var divide = createMathOperation(function(dividend, divisor) {
  16572. return dividend / divisor;
  16573. }, 1);
  16574. /**
  16575. * Computes `number` rounded down to `precision`.
  16576. *
  16577. * @static
  16578. * @memberOf _
  16579. * @since 3.10.0
  16580. * @category Math
  16581. * @param {number} number The number to round down.
  16582. * @param {number} [precision=0] The precision to round down to.
  16583. * @returns {number} Returns the rounded down number.
  16584. * @example
  16585. *
  16586. * _.floor(4.006);
  16587. * // => 4
  16588. *
  16589. * _.floor(0.046, 2);
  16590. * // => 0.04
  16591. *
  16592. * _.floor(4060, -2);
  16593. * // => 4000
  16594. */
  16595. var floor = createRound('floor');
  16596. /**
  16597. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16598. * `undefined` is returned.
  16599. *
  16600. * @static
  16601. * @since 0.1.0
  16602. * @memberOf _
  16603. * @category Math
  16604. * @param {Array} array The array to iterate over.
  16605. * @returns {*} Returns the maximum value.
  16606. * @example
  16607. *
  16608. * _.max([4, 2, 8, 6]);
  16609. * // => 8
  16610. *
  16611. * _.max([]);
  16612. * // => undefined
  16613. */
  16614. function max(array) {
  16615. return (array && array.length)
  16616. ? baseExtremum(array, identity, baseGt)
  16617. : undefined;
  16618. }
  16619. /**
  16620. * This method is like `_.max` except that it accepts `iteratee` which is
  16621. * invoked for each element in `array` to generate the criterion by which
  16622. * the value is ranked. The iteratee is invoked with one argument: (value).
  16623. *
  16624. * @static
  16625. * @memberOf _
  16626. * @since 4.0.0
  16627. * @category Math
  16628. * @param {Array} array The array to iterate over.
  16629. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16630. * @returns {*} Returns the maximum value.
  16631. * @example
  16632. *
  16633. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16634. *
  16635. * _.maxBy(objects, function(o) { return o.n; });
  16636. * // => { 'n': 2 }
  16637. *
  16638. * // The `_.property` iteratee shorthand.
  16639. * _.maxBy(objects, 'n');
  16640. * // => { 'n': 2 }
  16641. */
  16642. function maxBy(array, iteratee) {
  16643. return (array && array.length)
  16644. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16645. : undefined;
  16646. }
  16647. /**
  16648. * Computes the mean of the values in `array`.
  16649. *
  16650. * @static
  16651. * @memberOf _
  16652. * @since 4.0.0
  16653. * @category Math
  16654. * @param {Array} array The array to iterate over.
  16655. * @returns {number} Returns the mean.
  16656. * @example
  16657. *
  16658. * _.mean([4, 2, 8, 6]);
  16659. * // => 5
  16660. */
  16661. function mean(array) {
  16662. return baseMean(array, identity);
  16663. }
  16664. /**
  16665. * This method is like `_.mean` except that it accepts `iteratee` which is
  16666. * invoked for each element in `array` to generate the value to be averaged.
  16667. * The iteratee is invoked with one argument: (value).
  16668. *
  16669. * @static
  16670. * @memberOf _
  16671. * @since 4.7.0
  16672. * @category Math
  16673. * @param {Array} array The array to iterate over.
  16674. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16675. * @returns {number} Returns the mean.
  16676. * @example
  16677. *
  16678. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16679. *
  16680. * _.meanBy(objects, function(o) { return o.n; });
  16681. * // => 5
  16682. *
  16683. * // The `_.property` iteratee shorthand.
  16684. * _.meanBy(objects, 'n');
  16685. * // => 5
  16686. */
  16687. function meanBy(array, iteratee) {
  16688. return baseMean(array, getIteratee(iteratee, 2));
  16689. }
  16690. /**
  16691. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16692. * `undefined` is returned.
  16693. *
  16694. * @static
  16695. * @since 0.1.0
  16696. * @memberOf _
  16697. * @category Math
  16698. * @param {Array} array The array to iterate over.
  16699. * @returns {*} Returns the minimum value.
  16700. * @example
  16701. *
  16702. * _.min([4, 2, 8, 6]);
  16703. * // => 2
  16704. *
  16705. * _.min([]);
  16706. * // => undefined
  16707. */
  16708. function min(array) {
  16709. return (array && array.length)
  16710. ? baseExtremum(array, identity, baseLt)
  16711. : undefined;
  16712. }
  16713. /**
  16714. * This method is like `_.min` except that it accepts `iteratee` which is
  16715. * invoked for each element in `array` to generate the criterion by which
  16716. * the value is ranked. The iteratee is invoked with one argument: (value).
  16717. *
  16718. * @static
  16719. * @memberOf _
  16720. * @since 4.0.0
  16721. * @category Math
  16722. * @param {Array} array The array to iterate over.
  16723. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16724. * @returns {*} Returns the minimum value.
  16725. * @example
  16726. *
  16727. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16728. *
  16729. * _.minBy(objects, function(o) { return o.n; });
  16730. * // => { 'n': 1 }
  16731. *
  16732. * // The `_.property` iteratee shorthand.
  16733. * _.minBy(objects, 'n');
  16734. * // => { 'n': 1 }
  16735. */
  16736. function minBy(array, iteratee) {
  16737. return (array && array.length)
  16738. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16739. : undefined;
  16740. }
  16741. /**
  16742. * Multiply two numbers.
  16743. *
  16744. * @static
  16745. * @memberOf _
  16746. * @since 4.7.0
  16747. * @category Math
  16748. * @param {number} multiplier The first number in a multiplication.
  16749. * @param {number} multiplicand The second number in a multiplication.
  16750. * @returns {number} Returns the product.
  16751. * @example
  16752. *
  16753. * _.multiply(6, 4);
  16754. * // => 24
  16755. */
  16756. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16757. return multiplier * multiplicand;
  16758. }, 1);
  16759. /**
  16760. * Computes `number` rounded to `precision`.
  16761. *
  16762. * @static
  16763. * @memberOf _
  16764. * @since 3.10.0
  16765. * @category Math
  16766. * @param {number} number The number to round.
  16767. * @param {number} [precision=0] The precision to round to.
  16768. * @returns {number} Returns the rounded number.
  16769. * @example
  16770. *
  16771. * _.round(4.006);
  16772. * // => 4
  16773. *
  16774. * _.round(4.006, 2);
  16775. * // => 4.01
  16776. *
  16777. * _.round(4060, -2);
  16778. * // => 4100
  16779. */
  16780. var round = createRound('round');
  16781. /**
  16782. * Subtract two numbers.
  16783. *
  16784. * @static
  16785. * @memberOf _
  16786. * @since 4.0.0
  16787. * @category Math
  16788. * @param {number} minuend The first number in a subtraction.
  16789. * @param {number} subtrahend The second number in a subtraction.
  16790. * @returns {number} Returns the difference.
  16791. * @example
  16792. *
  16793. * _.subtract(6, 4);
  16794. * // => 2
  16795. */
  16796. var subtract = createMathOperation(function(minuend, subtrahend) {
  16797. return minuend - subtrahend;
  16798. }, 0);
  16799. /**
  16800. * Computes the sum of the values in `array`.
  16801. *
  16802. * @static
  16803. * @memberOf _
  16804. * @since 3.4.0
  16805. * @category Math
  16806. * @param {Array} array The array to iterate over.
  16807. * @returns {number} Returns the sum.
  16808. * @example
  16809. *
  16810. * _.sum([4, 2, 8, 6]);
  16811. * // => 20
  16812. */
  16813. function sum(array) {
  16814. return (array && array.length)
  16815. ? baseSum(array, identity)
  16816. : 0;
  16817. }
  16818. /**
  16819. * This method is like `_.sum` except that it accepts `iteratee` which is
  16820. * invoked for each element in `array` to generate the value to be summed.
  16821. * The iteratee is invoked with one argument: (value).
  16822. *
  16823. * @static
  16824. * @memberOf _
  16825. * @since 4.0.0
  16826. * @category Math
  16827. * @param {Array} array The array to iterate over.
  16828. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16829. * @returns {number} Returns the sum.
  16830. * @example
  16831. *
  16832. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16833. *
  16834. * _.sumBy(objects, function(o) { return o.n; });
  16835. * // => 20
  16836. *
  16837. * // The `_.property` iteratee shorthand.
  16838. * _.sumBy(objects, 'n');
  16839. * // => 20
  16840. */
  16841. function sumBy(array, iteratee) {
  16842. return (array && array.length)
  16843. ? baseSum(array, getIteratee(iteratee, 2))
  16844. : 0;
  16845. }
  16846. /*------------------------------------------------------------------------*/
  16847. // Add methods that return wrapped values in chain sequences.
  16848. lodash.after = after;
  16849. lodash.ary = ary;
  16850. lodash.assign = assign;
  16851. lodash.assignIn = assignIn;
  16852. lodash.assignInWith = assignInWith;
  16853. lodash.assignWith = assignWith;
  16854. lodash.at = at;
  16855. lodash.before = before;
  16856. lodash.bind = bind;
  16857. lodash.bindAll = bindAll;
  16858. lodash.bindKey = bindKey;
  16859. lodash.castArray = castArray;
  16860. lodash.chain = chain;
  16861. lodash.chunk = chunk;
  16862. lodash.compact = compact;
  16863. lodash.concat = concat;
  16864. lodash.cond = cond;
  16865. lodash.conforms = conforms;
  16866. lodash.constant = constant;
  16867. lodash.countBy = countBy;
  16868. lodash.create = create;
  16869. lodash.curry = curry;
  16870. lodash.curryRight = curryRight;
  16871. lodash.debounce = debounce;
  16872. lodash.defaults = defaults;
  16873. lodash.defaultsDeep = defaultsDeep;
  16874. lodash.defer = defer;
  16875. lodash.delay = delay;
  16876. lodash.difference = difference;
  16877. lodash.differenceBy = differenceBy;
  16878. lodash.differenceWith = differenceWith;
  16879. lodash.drop = drop;
  16880. lodash.dropRight = dropRight;
  16881. lodash.dropRightWhile = dropRightWhile;
  16882. lodash.dropWhile = dropWhile;
  16883. lodash.fill = fill;
  16884. lodash.filter = filter;
  16885. lodash.flatMap = flatMap;
  16886. lodash.flatMapDeep = flatMapDeep;
  16887. lodash.flatMapDepth = flatMapDepth;
  16888. lodash.flatten = flatten;
  16889. lodash.flattenDeep = flattenDeep;
  16890. lodash.flattenDepth = flattenDepth;
  16891. lodash.flip = flip;
  16892. lodash.flow = flow;
  16893. lodash.flowRight = flowRight;
  16894. lodash.fromPairs = fromPairs;
  16895. lodash.functions = functions;
  16896. lodash.functionsIn = functionsIn;
  16897. lodash.groupBy = groupBy;
  16898. lodash.initial = initial;
  16899. lodash.intersection = intersection;
  16900. lodash.intersectionBy = intersectionBy;
  16901. lodash.intersectionWith = intersectionWith;
  16902. lodash.invert = invert;
  16903. lodash.invertBy = invertBy;
  16904. lodash.invokeMap = invokeMap;
  16905. lodash.iteratee = iteratee;
  16906. lodash.keyBy = keyBy;
  16907. lodash.keys = keys;
  16908. lodash.keysIn = keysIn;
  16909. lodash.map = map;
  16910. lodash.mapKeys = mapKeys;
  16911. lodash.mapValues = mapValues;
  16912. lodash.matches = matches;
  16913. lodash.matchesProperty = matchesProperty;
  16914. lodash.memoize = memoize;
  16915. lodash.merge = merge;
  16916. lodash.mergeWith = mergeWith;
  16917. lodash.method = method;
  16918. lodash.methodOf = methodOf;
  16919. lodash.mixin = mixin;
  16920. lodash.negate = negate;
  16921. lodash.nthArg = nthArg;
  16922. lodash.omit = omit;
  16923. lodash.omitBy = omitBy;
  16924. lodash.once = once;
  16925. lodash.orderBy = orderBy;
  16926. lodash.over = over;
  16927. lodash.overArgs = overArgs;
  16928. lodash.overEvery = overEvery;
  16929. lodash.overSome = overSome;
  16930. lodash.partial = partial;
  16931. lodash.partialRight = partialRight;
  16932. lodash.partition = partition;
  16933. lodash.pick = pick;
  16934. lodash.pickBy = pickBy;
  16935. lodash.property = property;
  16936. lodash.propertyOf = propertyOf;
  16937. lodash.pull = pull;
  16938. lodash.pullAll = pullAll;
  16939. lodash.pullAllBy = pullAllBy;
  16940. lodash.pullAllWith = pullAllWith;
  16941. lodash.pullAt = pullAt;
  16942. lodash.range = range;
  16943. lodash.rangeRight = rangeRight;
  16944. lodash.rearg = rearg;
  16945. lodash.reject = reject;
  16946. lodash.remove = remove;
  16947. lodash.rest = rest;
  16948. lodash.reverse = reverse;
  16949. lodash.sampleSize = sampleSize;
  16950. lodash.set = set;
  16951. lodash.setWith = setWith;
  16952. lodash.shuffle = shuffle;
  16953. lodash.slice = slice;
  16954. lodash.sortBy = sortBy;
  16955. lodash.sortedUniq = sortedUniq;
  16956. lodash.sortedUniqBy = sortedUniqBy;
  16957. lodash.split = split;
  16958. lodash.spread = spread;
  16959. lodash.tail = tail;
  16960. lodash.take = take;
  16961. lodash.takeRight = takeRight;
  16962. lodash.takeRightWhile = takeRightWhile;
  16963. lodash.takeWhile = takeWhile;
  16964. lodash.tap = tap;
  16965. lodash.throttle = throttle;
  16966. lodash.thru = thru;
  16967. lodash.toArray = toArray;
  16968. lodash.toPairs = toPairs;
  16969. lodash.toPairsIn = toPairsIn;
  16970. lodash.toPath = toPath;
  16971. lodash.toPlainObject = toPlainObject;
  16972. lodash.transform = transform;
  16973. lodash.unary = unary;
  16974. lodash.union = union;
  16975. lodash.unionBy = unionBy;
  16976. lodash.unionWith = unionWith;
  16977. lodash.uniq = uniq;
  16978. lodash.uniqBy = uniqBy;
  16979. lodash.uniqWith = uniqWith;
  16980. lodash.unset = unset;
  16981. lodash.unzip = unzip;
  16982. lodash.unzipWith = unzipWith;
  16983. lodash.update = update;
  16984. lodash.updateWith = updateWith;
  16985. lodash.values = values;
  16986. lodash.valuesIn = valuesIn;
  16987. lodash.without = without;
  16988. lodash.words = words;
  16989. lodash.wrap = wrap;
  16990. lodash.xor = xor;
  16991. lodash.xorBy = xorBy;
  16992. lodash.xorWith = xorWith;
  16993. lodash.zip = zip;
  16994. lodash.zipObject = zipObject;
  16995. lodash.zipObjectDeep = zipObjectDeep;
  16996. lodash.zipWith = zipWith;
  16997. // Add aliases.
  16998. lodash.entries = toPairs;
  16999. lodash.entriesIn = toPairsIn;
  17000. lodash.extend = assignIn;
  17001. lodash.extendWith = assignInWith;
  17002. // Add methods to `lodash.prototype`.
  17003. mixin(lodash, lodash);
  17004. /*------------------------------------------------------------------------*/
  17005. // Add methods that return unwrapped values in chain sequences.
  17006. lodash.add = add;
  17007. lodash.attempt = attempt;
  17008. lodash.camelCase = camelCase;
  17009. lodash.capitalize = capitalize;
  17010. lodash.ceil = ceil;
  17011. lodash.clamp = clamp;
  17012. lodash.clone = clone;
  17013. lodash.cloneDeep = cloneDeep;
  17014. lodash.cloneDeepWith = cloneDeepWith;
  17015. lodash.cloneWith = cloneWith;
  17016. lodash.conformsTo = conformsTo;
  17017. lodash.deburr = deburr;
  17018. lodash.defaultTo = defaultTo;
  17019. lodash.divide = divide;
  17020. lodash.endsWith = endsWith;
  17021. lodash.eq = eq;
  17022. lodash.escape = escape;
  17023. lodash.escapeRegExp = escapeRegExp;
  17024. lodash.every = every;
  17025. lodash.find = find;
  17026. lodash.findIndex = findIndex;
  17027. lodash.findKey = findKey;
  17028. lodash.findLast = findLast;
  17029. lodash.findLastIndex = findLastIndex;
  17030. lodash.findLastKey = findLastKey;
  17031. lodash.floor = floor;
  17032. lodash.forEach = forEach;
  17033. lodash.forEachRight = forEachRight;
  17034. lodash.forIn = forIn;
  17035. lodash.forInRight = forInRight;
  17036. lodash.forOwn = forOwn;
  17037. lodash.forOwnRight = forOwnRight;
  17038. lodash.get = get;
  17039. lodash.gt = gt;
  17040. lodash.gte = gte;
  17041. lodash.has = has;
  17042. lodash.hasIn = hasIn;
  17043. lodash.head = head;
  17044. lodash.identity = identity;
  17045. lodash.includes = includes;
  17046. lodash.indexOf = indexOf;
  17047. lodash.inRange = inRange;
  17048. lodash.invoke = invoke;
  17049. lodash.isArguments = isArguments;
  17050. lodash.isArray = isArray;
  17051. lodash.isArrayBuffer = isArrayBuffer;
  17052. lodash.isArrayLike = isArrayLike;
  17053. lodash.isArrayLikeObject = isArrayLikeObject;
  17054. lodash.isBoolean = isBoolean;
  17055. lodash.isBuffer = isBuffer;
  17056. lodash.isDate = isDate;
  17057. lodash.isElement = isElement;
  17058. lodash.isEmpty = isEmpty;
  17059. lodash.isEqual = isEqual;
  17060. lodash.isEqualWith = isEqualWith;
  17061. lodash.isError = isError;
  17062. lodash.isFinite = isFinite;
  17063. lodash.isFunction = isFunction;
  17064. lodash.isInteger = isInteger;
  17065. lodash.isLength = isLength;
  17066. lodash.isMap = isMap;
  17067. lodash.isMatch = isMatch;
  17068. lodash.isMatchWith = isMatchWith;
  17069. lodash.isNaN = isNaN;
  17070. lodash.isNative = isNative;
  17071. lodash.isNil = isNil;
  17072. lodash.isNull = isNull;
  17073. lodash.isNumber = isNumber;
  17074. lodash.isObject = isObject;
  17075. lodash.isObjectLike = isObjectLike;
  17076. lodash.isPlainObject = isPlainObject;
  17077. lodash.isRegExp = isRegExp;
  17078. lodash.isSafeInteger = isSafeInteger;
  17079. lodash.isSet = isSet;
  17080. lodash.isString = isString;
  17081. lodash.isSymbol = isSymbol;
  17082. lodash.isTypedArray = isTypedArray;
  17083. lodash.isUndefined = isUndefined;
  17084. lodash.isWeakMap = isWeakMap;
  17085. lodash.isWeakSet = isWeakSet;
  17086. lodash.join = join;
  17087. lodash.kebabCase = kebabCase;
  17088. lodash.last = last;
  17089. lodash.lastIndexOf = lastIndexOf;
  17090. lodash.lowerCase = lowerCase;
  17091. lodash.lowerFirst = lowerFirst;
  17092. lodash.lt = lt;
  17093. lodash.lte = lte;
  17094. lodash.max = max;
  17095. lodash.maxBy = maxBy;
  17096. lodash.mean = mean;
  17097. lodash.meanBy = meanBy;
  17098. lodash.min = min;
  17099. lodash.minBy = minBy;
  17100. lodash.stubArray = stubArray;
  17101. lodash.stubFalse = stubFalse;
  17102. lodash.stubObject = stubObject;
  17103. lodash.stubString = stubString;
  17104. lodash.stubTrue = stubTrue;
  17105. lodash.multiply = multiply;
  17106. lodash.nth = nth;
  17107. lodash.noConflict = noConflict;
  17108. lodash.noop = noop;
  17109. lodash.now = now;
  17110. lodash.pad = pad;
  17111. lodash.padEnd = padEnd;
  17112. lodash.padStart = padStart;
  17113. lodash.parseInt = parseInt;
  17114. lodash.random = random;
  17115. lodash.reduce = reduce;
  17116. lodash.reduceRight = reduceRight;
  17117. lodash.repeat = repeat;
  17118. lodash.replace = replace;
  17119. lodash.result = result;
  17120. lodash.round = round;
  17121. lodash.runInContext = runInContext;
  17122. lodash.sample = sample;
  17123. lodash.size = size;
  17124. lodash.snakeCase = snakeCase;
  17125. lodash.some = some;
  17126. lodash.sortedIndex = sortedIndex;
  17127. lodash.sortedIndexBy = sortedIndexBy;
  17128. lodash.sortedIndexOf = sortedIndexOf;
  17129. lodash.sortedLastIndex = sortedLastIndex;
  17130. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17131. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17132. lodash.startCase = startCase;
  17133. lodash.startsWith = startsWith;
  17134. lodash.subtract = subtract;
  17135. lodash.sum = sum;
  17136. lodash.sumBy = sumBy;
  17137. lodash.template = template;
  17138. lodash.times = times;
  17139. lodash.toFinite = toFinite;
  17140. lodash.toInteger = toInteger;
  17141. lodash.toLength = toLength;
  17142. lodash.toLower = toLower;
  17143. lodash.toNumber = toNumber;
  17144. lodash.toSafeInteger = toSafeInteger;
  17145. lodash.toString = toString;
  17146. lodash.toUpper = toUpper;
  17147. lodash.trim = trim;
  17148. lodash.trimEnd = trimEnd;
  17149. lodash.trimStart = trimStart;
  17150. lodash.truncate = truncate;
  17151. lodash.unescape = unescape;
  17152. lodash.uniqueId = uniqueId;
  17153. lodash.upperCase = upperCase;
  17154. lodash.upperFirst = upperFirst;
  17155. // Add aliases.
  17156. lodash.each = forEach;
  17157. lodash.eachRight = forEachRight;
  17158. lodash.first = head;
  17159. mixin(lodash, (function() {
  17160. var source = {};
  17161. baseForOwn(lodash, function(func, methodName) {
  17162. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17163. source[methodName] = func;
  17164. }
  17165. });
  17166. return source;
  17167. }()), { 'chain': false });
  17168. /*------------------------------------------------------------------------*/
  17169. /**
  17170. * The semantic version number.
  17171. *
  17172. * @static
  17173. * @memberOf _
  17174. * @type {string}
  17175. */
  17176. lodash.VERSION = VERSION;
  17177. // Assign default placeholders.
  17178. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17179. lodash[methodName].placeholder = lodash;
  17180. });
  17181. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17182. arrayEach(['drop', 'take'], function(methodName, index) {
  17183. LazyWrapper.prototype[methodName] = function(n) {
  17184. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17185. var result = (this.__filtered__ && !index)
  17186. ? new LazyWrapper(this)
  17187. : this.clone();
  17188. if (result.__filtered__) {
  17189. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17190. } else {
  17191. result.__views__.push({
  17192. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17193. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17194. });
  17195. }
  17196. return result;
  17197. };
  17198. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17199. return this.reverse()[methodName](n).reverse();
  17200. };
  17201. });
  17202. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17203. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17204. var type = index + 1,
  17205. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17206. LazyWrapper.prototype[methodName] = function(iteratee) {
  17207. var result = this.clone();
  17208. result.__iteratees__.push({
  17209. 'iteratee': getIteratee(iteratee, 3),
  17210. 'type': type
  17211. });
  17212. result.__filtered__ = result.__filtered__ || isFilter;
  17213. return result;
  17214. };
  17215. });
  17216. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17217. arrayEach(['head', 'last'], function(methodName, index) {
  17218. var takeName = 'take' + (index ? 'Right' : '');
  17219. LazyWrapper.prototype[methodName] = function() {
  17220. return this[takeName](1).value()[0];
  17221. };
  17222. });
  17223. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17224. arrayEach(['initial', 'tail'], function(methodName, index) {
  17225. var dropName = 'drop' + (index ? '' : 'Right');
  17226. LazyWrapper.prototype[methodName] = function() {
  17227. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17228. };
  17229. });
  17230. LazyWrapper.prototype.compact = function() {
  17231. return this.filter(identity);
  17232. };
  17233. LazyWrapper.prototype.find = function(predicate) {
  17234. return this.filter(predicate).head();
  17235. };
  17236. LazyWrapper.prototype.findLast = function(predicate) {
  17237. return this.reverse().find(predicate);
  17238. };
  17239. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17240. if (typeof path == 'function') {
  17241. return new LazyWrapper(this);
  17242. }
  17243. return this.map(function(value) {
  17244. return baseInvoke(value, path, args);
  17245. });
  17246. });
  17247. LazyWrapper.prototype.reject = function(predicate) {
  17248. return this.filter(negate(getIteratee(predicate)));
  17249. };
  17250. LazyWrapper.prototype.slice = function(start, end) {
  17251. start = toInteger(start);
  17252. var result = this;
  17253. if (result.__filtered__ && (start > 0 || end < 0)) {
  17254. return new LazyWrapper(result);
  17255. }
  17256. if (start < 0) {
  17257. result = result.takeRight(-start);
  17258. } else if (start) {
  17259. result = result.drop(start);
  17260. }
  17261. if (end !== undefined) {
  17262. end = toInteger(end);
  17263. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17264. }
  17265. return result;
  17266. };
  17267. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17268. return this.reverse().takeWhile(predicate).reverse();
  17269. };
  17270. LazyWrapper.prototype.toArray = function() {
  17271. return this.take(MAX_ARRAY_LENGTH);
  17272. };
  17273. // Add `LazyWrapper` methods to `lodash.prototype`.
  17274. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17275. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17276. isTaker = /^(?:head|last)$/.test(methodName),
  17277. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17278. retUnwrapped = isTaker || /^find/.test(methodName);
  17279. if (!lodashFunc) {
  17280. return;
  17281. }
  17282. lodash.prototype[methodName] = function() {
  17283. var value = this.__wrapped__,
  17284. args = isTaker ? [1] : arguments,
  17285. isLazy = value instanceof LazyWrapper,
  17286. iteratee = args[0],
  17287. useLazy = isLazy || isArray(value);
  17288. var interceptor = function(value) {
  17289. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17290. return (isTaker && chainAll) ? result[0] : result;
  17291. };
  17292. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17293. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17294. isLazy = useLazy = false;
  17295. }
  17296. var chainAll = this.__chain__,
  17297. isHybrid = !!this.__actions__.length,
  17298. isUnwrapped = retUnwrapped && !chainAll,
  17299. onlyLazy = isLazy && !isHybrid;
  17300. if (!retUnwrapped && useLazy) {
  17301. value = onlyLazy ? value : new LazyWrapper(this);
  17302. var result = func.apply(value, args);
  17303. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17304. return new LodashWrapper(result, chainAll);
  17305. }
  17306. if (isUnwrapped && onlyLazy) {
  17307. return func.apply(this, args);
  17308. }
  17309. result = this.thru(interceptor);
  17310. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17311. };
  17312. });
  17313. // Add `Array` methods to `lodash.prototype`.
  17314. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17315. var func = arrayProto[methodName],
  17316. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17317. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17318. lodash.prototype[methodName] = function() {
  17319. var args = arguments;
  17320. if (retUnwrapped && !this.__chain__) {
  17321. var value = this.value();
  17322. return func.apply(isArray(value) ? value : [], args);
  17323. }
  17324. return this[chainName](function(value) {
  17325. return func.apply(isArray(value) ? value : [], args);
  17326. });
  17327. };
  17328. });
  17329. // Map minified method names to their real names.
  17330. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17331. var lodashFunc = lodash[methodName];
  17332. if (lodashFunc) {
  17333. var key = lodashFunc.name + '';
  17334. if (!hasOwnProperty.call(realNames, key)) {
  17335. realNames[key] = [];
  17336. }
  17337. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17338. }
  17339. });
  17340. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17341. 'name': 'wrapper',
  17342. 'func': undefined
  17343. }];
  17344. // Add methods to `LazyWrapper`.
  17345. LazyWrapper.prototype.clone = lazyClone;
  17346. LazyWrapper.prototype.reverse = lazyReverse;
  17347. LazyWrapper.prototype.value = lazyValue;
  17348. // Add chain sequence methods to the `lodash` wrapper.
  17349. lodash.prototype.at = wrapperAt;
  17350. lodash.prototype.chain = wrapperChain;
  17351. lodash.prototype.commit = wrapperCommit;
  17352. lodash.prototype.next = wrapperNext;
  17353. lodash.prototype.plant = wrapperPlant;
  17354. lodash.prototype.reverse = wrapperReverse;
  17355. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17356. // Add lazy aliases.
  17357. lodash.prototype.first = lodash.prototype.head;
  17358. if (symIterator) {
  17359. lodash.prototype[symIterator] = wrapperToIterator;
  17360. }
  17361. return lodash;
  17362. });
  17363. /*--------------------------------------------------------------------------*/
  17364. // Export lodash.
  17365. var _ = runInContext();
  17366. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17367. if (true) {
  17368. // Expose Lodash on the global object to prevent errors when Lodash is
  17369. // loaded by a script tag in the presence of an AMD loader.
  17370. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17371. // Use `_.noConflict` to remove Lodash from the global object.
  17372. root._ = _;
  17373. // Define as an anonymous module so, through path mapping, it can be
  17374. // referenced as the "underscore" module.
  17375. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17376. return _;
  17377. }).call(exports, __webpack_require__, exports, module),
  17378. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17379. }
  17380. // Check for `exports` after `define` in case a build optimizer adds it.
  17381. else {}
  17382. }.call(this));
  17383. /***/ }),
  17384. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17385. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17386. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17387. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17389. "use strict";
  17390. __webpack_require__.r(__webpack_exports__);
  17391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17392. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17393. /* harmony export */ });
  17394. /* 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");
  17395. /* 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__);
  17396. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_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]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17397. var options = {};
  17398. options.insert = "head";
  17399. options.singleton = false;
  17400. 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17401. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17402. /***/ }),
  17403. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17404. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17405. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17406. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17407. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17408. "use strict";
  17409. __webpack_require__.r(__webpack_exports__);
  17410. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17411. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17412. /* harmony export */ });
  17413. /* 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");
  17414. /* 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__);
  17415. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17416. var options = {};
  17417. options.insert = "head";
  17418. options.singleton = false;
  17419. 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17420. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17421. /***/ }),
  17422. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17423. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17424. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17425. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17426. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17427. "use strict";
  17428. __webpack_require__.r(__webpack_exports__);
  17429. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17430. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17431. /* harmony export */ });
  17432. /* 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");
  17433. /* 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__);
  17434. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_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]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17435. var options = {};
  17436. options.insert = "head";
  17437. options.singleton = false;
  17438. 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17439. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17440. /***/ }),
  17441. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17442. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17443. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17444. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17445. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17446. "use strict";
  17447. __webpack_require__.r(__webpack_exports__);
  17448. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17449. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17450. /* harmony export */ });
  17451. /* harmony import */ var _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");
  17452. /* 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__);
  17453. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17454. var options = {};
  17455. options.insert = "head";
  17456. options.singleton = false;
  17457. 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_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17458. /* 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_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17459. /***/ }),
  17460. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17461. /*!******************************************************!*\
  17462. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17463. \******************************************************/
  17464. /***/ ((__unused_webpack_module, exports) => {
  17465. "use strict";
  17466. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17467. // runtime helper for setting properties on components
  17468. // in a tree-shakable way
  17469. exports["default"] = (sfc, props) => {
  17470. const target = sfc.__vccOpts || sfc;
  17471. for (const [key, val] of props) {
  17472. target[key] = val;
  17473. }
  17474. return target;
  17475. };
  17476. /***/ }),
  17477. /***/ "./resources/js/components/AppButtonLink.vue":
  17478. /*!***************************************************!*\
  17479. !*** ./resources/js/components/AppButtonLink.vue ***!
  17480. \***************************************************/
  17481. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17482. "use strict";
  17483. __webpack_require__.r(__webpack_exports__);
  17484. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17485. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17486. /* harmony export */ });
  17487. /* 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");
  17488. /* 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");
  17489. /* 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");
  17490. ;
  17491. 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"]])
  17492. /* hot reload */
  17493. if (false) {}
  17494. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17495. /***/ }),
  17496. /***/ "./resources/js/components/AppMessage.vue":
  17497. /*!************************************************!*\
  17498. !*** ./resources/js/components/AppMessage.vue ***!
  17499. \************************************************/
  17500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17501. "use strict";
  17502. __webpack_require__.r(__webpack_exports__);
  17503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17504. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17505. /* harmony export */ });
  17506. /* 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");
  17507. /* 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");
  17508. /* 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");
  17509. ;
  17510. 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"]])
  17511. /* hot reload */
  17512. if (false) {}
  17513. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17514. /***/ }),
  17515. /***/ "./resources/js/components/AppPagination.vue":
  17516. /*!***************************************************!*\
  17517. !*** ./resources/js/components/AppPagination.vue ***!
  17518. \***************************************************/
  17519. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17520. "use strict";
  17521. __webpack_require__.r(__webpack_exports__);
  17522. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17523. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17524. /* harmony export */ });
  17525. /* 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");
  17526. /* 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");
  17527. /* 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");
  17528. ;
  17529. 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"]])
  17530. /* hot reload */
  17531. if (false) {}
  17532. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17533. /***/ }),
  17534. /***/ "./resources/js/components/AppSearch.vue":
  17535. /*!***********************************************!*\
  17536. !*** ./resources/js/components/AppSearch.vue ***!
  17537. \***********************************************/
  17538. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17539. "use strict";
  17540. __webpack_require__.r(__webpack_exports__);
  17541. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17542. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17543. /* harmony export */ });
  17544. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17545. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17546. /* 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");
  17547. ;
  17548. 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"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17549. /* hot reload */
  17550. if (false) {}
  17551. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17552. /***/ }),
  17553. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17554. /*!**************************************************************!*\
  17555. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17556. \**************************************************************/
  17557. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17558. "use strict";
  17559. __webpack_require__.r(__webpack_exports__);
  17560. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17561. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17562. /* harmony export */ });
  17563. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17564. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17565. const script = {}
  17566. ;
  17567. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17568. /* hot reload */
  17569. if (false) {}
  17570. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17571. /***/ }),
  17572. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17573. /*!***************************************************************!*\
  17574. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17575. \***************************************************************/
  17576. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17577. "use strict";
  17578. __webpack_require__.r(__webpack_exports__);
  17579. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17580. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17581. /* harmony export */ });
  17582. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17583. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17584. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17585. /* 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");
  17586. ;
  17587. 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"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17588. /* hot reload */
  17589. if (false) {}
  17590. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17591. /***/ }),
  17592. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17593. /*!******************************************************************!*\
  17594. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17595. \******************************************************************/
  17596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17597. "use strict";
  17598. __webpack_require__.r(__webpack_exports__);
  17599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17600. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17601. /* harmony export */ });
  17602. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17603. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17604. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17605. /* 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");
  17606. ;
  17607. 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"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17608. /* hot reload */
  17609. if (false) {}
  17610. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17611. /***/ }),
  17612. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17613. /*!**************************************************************!*\
  17614. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17615. \**************************************************************/
  17616. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17617. "use strict";
  17618. __webpack_require__.r(__webpack_exports__);
  17619. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17620. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17621. /* harmony export */ });
  17622. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17623. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17624. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17625. /* 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");
  17626. ;
  17627. 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"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17628. /* hot reload */
  17629. if (false) {}
  17630. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17631. /***/ }),
  17632. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17633. /*!************************************************************!*\
  17634. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17635. \************************************************************/
  17636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17637. "use strict";
  17638. __webpack_require__.r(__webpack_exports__);
  17639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17640. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17641. /* harmony export */ });
  17642. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17643. /* 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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17644. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17645. /* 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");
  17646. ;
  17647. 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_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17648. /* hot reload */
  17649. if (false) {}
  17650. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17651. /***/ }),
  17652. /***/ "./resources/js/pages/Customers/Index.vue":
  17653. /*!************************************************!*\
  17654. !*** ./resources/js/pages/Customers/Index.vue ***!
  17655. \************************************************/
  17656. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17657. "use strict";
  17658. __webpack_require__.r(__webpack_exports__);
  17659. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17660. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17661. /* harmony export */ });
  17662. /* 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");
  17663. /* 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");
  17664. /* 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");
  17665. ;
  17666. 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"]])
  17667. /* hot reload */
  17668. if (false) {}
  17669. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17670. /***/ }),
  17671. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17672. /*!**************************************************************************************!*\
  17673. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17674. \**************************************************************************************/
  17675. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17676. "use strict";
  17677. __webpack_require__.r(__webpack_exports__);
  17678. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17679. /* 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"])
  17680. /* harmony export */ });
  17681. /* 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");
  17682. /***/ }),
  17683. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17684. /*!***********************************************************************************!*\
  17685. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17686. \***********************************************************************************/
  17687. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17688. "use strict";
  17689. __webpack_require__.r(__webpack_exports__);
  17690. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17691. /* 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"])
  17692. /* harmony export */ });
  17693. /* 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");
  17694. /***/ }),
  17695. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17696. /*!**************************************************************************************!*\
  17697. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17698. \**************************************************************************************/
  17699. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17700. "use strict";
  17701. __webpack_require__.r(__webpack_exports__);
  17702. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17703. /* 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"])
  17704. /* harmony export */ });
  17705. /* 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");
  17706. /***/ }),
  17707. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17708. /*!**********************************************************************************!*\
  17709. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17710. \**********************************************************************************/
  17711. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17712. "use strict";
  17713. __webpack_require__.r(__webpack_exports__);
  17714. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17715. /* 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_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17716. /* harmony export */ });
  17717. /* 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_AppSearch_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]!./AppSearch.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/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17718. /***/ }),
  17719. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17720. /*!**************************************************************************************************!*\
  17721. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17722. \**************************************************************************************************/
  17723. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17724. "use strict";
  17725. __webpack_require__.r(__webpack_exports__);
  17726. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17727. /* 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_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17728. /* harmony export */ });
  17729. /* 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_Sidebar_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]!./Sidebar.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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17730. /***/ }),
  17731. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17732. /*!*****************************************************************************************************!*\
  17733. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17734. \*****************************************************************************************************/
  17735. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17736. "use strict";
  17737. __webpack_require__.r(__webpack_exports__);
  17738. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17739. /* 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_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17740. /* harmony export */ });
  17741. /* 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_SubSidebar_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]!./SubSidebar.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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17742. /***/ }),
  17743. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17744. /*!*************************************************************************************************!*\
  17745. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17746. \*************************************************************************************************/
  17747. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17748. "use strict";
  17749. __webpack_require__.r(__webpack_exports__);
  17750. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17751. /* 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_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17752. /* harmony export */ });
  17753. /* 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_TopBar_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]!./TopBar.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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17754. /***/ }),
  17755. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17756. /*!***********************************************************************************************!*\
  17757. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17758. \***********************************************************************************************/
  17759. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17760. "use strict";
  17761. __webpack_require__.r(__webpack_exports__);
  17762. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17763. /* 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"])
  17764. /* harmony export */ });
  17765. /* 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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17766. /***/ }),
  17767. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  17768. /*!***********************************************************************************!*\
  17769. !*** ./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17770. \***********************************************************************************/
  17771. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17772. "use strict";
  17773. __webpack_require__.r(__webpack_exports__);
  17774. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17775. /* 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"])
  17776. /* harmony export */ });
  17777. /* 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");
  17778. /***/ }),
  17779. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17780. /*!*********************************************************************************!*\
  17781. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17782. \*********************************************************************************/
  17783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17784. "use strict";
  17785. __webpack_require__.r(__webpack_exports__);
  17786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17787. /* 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)
  17788. /* harmony export */ });
  17789. /* 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");
  17790. /***/ }),
  17791. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17792. /*!******************************************************************************!*\
  17793. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17794. \******************************************************************************/
  17795. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17796. "use strict";
  17797. __webpack_require__.r(__webpack_exports__);
  17798. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17799. /* 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)
  17800. /* harmony export */ });
  17801. /* 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");
  17802. /***/ }),
  17803. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17804. /*!*********************************************************************************!*\
  17805. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17806. \*********************************************************************************/
  17807. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17808. "use strict";
  17809. __webpack_require__.r(__webpack_exports__);
  17810. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17811. /* 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)
  17812. /* harmony export */ });
  17813. /* 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");
  17814. /***/ }),
  17815. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17816. /*!*****************************************************************************!*\
  17817. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17818. \*****************************************************************************/
  17819. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17820. "use strict";
  17821. __webpack_require__.r(__webpack_exports__);
  17822. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17823. /* 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_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17824. /* harmony export */ });
  17825. /* 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_AppSearch_vue_vue_type_template_id_5b9fdcce__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]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17826. /***/ }),
  17827. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17828. /*!********************************************************************************************!*\
  17829. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17830. \********************************************************************************************/
  17831. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17832. "use strict";
  17833. __webpack_require__.r(__webpack_exports__);
  17834. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17835. /* 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_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17836. /* harmony export */ });
  17837. /* 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_Footer_vue_vue_type_template_id_dbb3aa76__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]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17838. /***/ }),
  17839. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17840. /*!*********************************************************************************************************!*\
  17841. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17842. \*********************************************************************************************************/
  17843. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17844. "use strict";
  17845. __webpack_require__.r(__webpack_exports__);
  17846. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17847. /* 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_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17848. /* harmony export */ });
  17849. /* 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_Sidebar_vue_vue_type_template_id_5b49aa22_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]!./Sidebar.vue?vue&type=template&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17850. /***/ }),
  17851. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17852. /*!************************************************************************************************************!*\
  17853. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17854. \************************************************************************************************************/
  17855. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17856. "use strict";
  17857. __webpack_require__.r(__webpack_exports__);
  17858. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17859. /* 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_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17860. /* harmony export */ });
  17861. /* 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_SubSidebar_vue_vue_type_template_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17862. /***/ }),
  17863. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17864. /*!********************************************************************************************************!*\
  17865. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17866. \********************************************************************************************************/
  17867. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17868. "use strict";
  17869. __webpack_require__.r(__webpack_exports__);
  17870. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17871. /* 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_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17872. /* harmony export */ });
  17873. /* 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_TopBar_vue_vue_type_template_id_0b7edbb0_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]!./TopBar.vue?vue&type=template&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17874. /***/ }),
  17875. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17876. /*!******************************************************************************************************!*\
  17877. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17878. \******************************************************************************************************/
  17879. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17880. "use strict";
  17881. __webpack_require__.r(__webpack_exports__);
  17882. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17883. /* 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_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17884. /* harmony export */ });
  17885. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17886. /***/ }),
  17887. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  17888. /*!******************************************************************************!*\
  17889. !*** ./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  17890. \******************************************************************************/
  17891. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17892. "use strict";
  17893. __webpack_require__.r(__webpack_exports__);
  17894. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17895. /* 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)
  17896. /* harmony export */ });
  17897. /* 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");
  17898. /***/ }),
  17899. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17900. /*!************************************************************************************************************************!*\
  17901. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17902. \************************************************************************************************************************/
  17903. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17904. "use strict";
  17905. __webpack_require__.r(__webpack_exports__);
  17906. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_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]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17907. /***/ }),
  17908. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17909. /*!***************************************************************************************************************************!*\
  17910. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17911. \***************************************************************************************************************************/
  17912. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17913. "use strict";
  17914. __webpack_require__.r(__webpack_exports__);
  17915. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17916. /***/ }),
  17917. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17918. /*!***********************************************************************************************************************!*\
  17919. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17920. \***********************************************************************************************************************/
  17921. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17922. "use strict";
  17923. __webpack_require__.r(__webpack_exports__);
  17924. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_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]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17925. /***/ }),
  17926. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17927. /*!*********************************************************************************************************************!*\
  17928. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17929. \*********************************************************************************************************************/
  17930. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17931. "use strict";
  17932. __webpack_require__.r(__webpack_exports__);
  17933. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17934. /***/ })
  17935. }]);