resources_js_pages_Suppliers_Index_vue.js 694KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Suppliers_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: String,
  21. label: String,
  22. classButton: String
  23. },
  24. setup: function setup(__props, _ref) {
  25. var expose = _ref.expose;
  26. expose();
  27. var __returned__ = {
  28. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  29. };
  30. Object.defineProperty(__returned__, '__isScriptSetup', {
  31. enumerable: false,
  32. value: true
  33. });
  34. return __returned__;
  35. }
  36. });
  37. /***/ }),
  38. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  39. /*!***************************************************************************************************************************************************************************************************************!*\
  40. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  41. \***************************************************************************************************************************************************************************************************************/
  42. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  43. "use strict";
  44. __webpack_require__.r(__webpack_exports__);
  45. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  46. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  47. /* harmony export */ });
  48. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  49. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  50. __name: 'AppMessage',
  51. setup: function setup(__props, _ref) {
  52. var expose = _ref.expose;
  53. expose();
  54. var onClose = function onClose() {
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  56. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  58. };
  59. var __returned__ = {
  60. onClose: onClose,
  61. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  62. };
  63. Object.defineProperty(__returned__, '__isScriptSetup', {
  64. enumerable: false,
  65. value: true
  66. });
  67. return __returned__;
  68. }
  69. });
  70. /***/ }),
  71. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  72. /*!******************************************************************************************************************************************************************************************************************!*\
  73. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  74. \******************************************************************************************************************************************************************************************************************/
  75. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  76. "use strict";
  77. __webpack_require__.r(__webpack_exports__);
  78. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  79. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  80. /* harmony export */ });
  81. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  82. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  83. __name: 'AppPagination',
  84. props: {
  85. links: Array
  86. },
  87. setup: function setup(__props, _ref) {
  88. var expose = _ref.expose;
  89. expose();
  90. var __returned__ = {
  91. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  92. };
  93. Object.defineProperty(__returned__, '__isScriptSetup', {
  94. enumerable: false,
  95. value: true
  96. });
  97. return __returned__;
  98. }
  99. });
  100. /***/ }),
  101. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  102. /*!***************************************************************************************************************************************************************************************************************!*\
  103. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  104. \***************************************************************************************************************************************************************************************************************/
  105. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  106. "use strict";
  107. __webpack_require__.r(__webpack_exports__);
  108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  110. /* harmony export */ });
  111. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  112. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  113. __name: 'AppSidebar',
  114. props: {
  115. menu: Array
  116. },
  117. setup: function setup(__props, _ref) {
  118. var expose = _ref.expose;
  119. expose();
  120. var __returned__ = {
  121. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  122. };
  123. Object.defineProperty(__returned__, '__isScriptSetup', {
  124. enumerable: false,
  125. value: true
  126. });
  127. return __returned__;
  128. }
  129. });
  130. /***/ }),
  131. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  132. /*!******************************************************************************************************************************************************************************************************************!*\
  133. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  134. \******************************************************************************************************************************************************************************************************************/
  135. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  136. "use strict";
  137. __webpack_require__.r(__webpack_exports__);
  138. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  139. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  140. /* harmony export */ });
  141. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  142. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  143. __name: 'AppSubSidebar',
  144. props: {
  145. items: Array,
  146. root: {
  147. type: Boolean,
  148. "default": false
  149. }
  150. },
  151. setup: function setup(__props, _ref) {
  152. var expose = _ref.expose;
  153. expose();
  154. var __returned__ = {
  155. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  156. };
  157. Object.defineProperty(__returned__, '__isScriptSetup', {
  158. enumerable: false,
  159. value: true
  160. });
  161. return __returned__;
  162. }
  163. });
  164. /***/ }),
  165. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  166. /*!**************************************************************************************************************************************************************************************************************!*\
  167. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  168. \**************************************************************************************************************************************************************************************************************/
  169. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  170. "use strict";
  171. __webpack_require__.r(__webpack_exports__);
  172. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  173. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  174. /* harmony export */ });
  175. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  177. __name: 'AppTopBar',
  178. emits: ['menu-toggle'],
  179. setup: function setup(__props, _ref) {
  180. var expose = _ref.expose;
  181. expose();
  182. var __returned__ = {
  183. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  184. };
  185. Object.defineProperty(__returned__, '__isScriptSetup', {
  186. enumerable: false,
  187. value: true
  188. });
  189. return __returned__;
  190. }
  191. });
  192. /***/ }),
  193. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  194. /*!*****************************************************************************************************************************************************************************************************************!*\
  195. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  196. \*****************************************************************************************************************************************************************************************************************/
  197. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  198. "use strict";
  199. __webpack_require__.r(__webpack_exports__);
  200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  202. /* harmony export */ });
  203. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  204. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  205. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  206. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  207. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  208. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  209. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  210. __name: 'DashboardLayout',
  211. setup: function setup(__props, _ref) {
  212. var expose = _ref.expose;
  213. expose();
  214. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  215. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var isDesktop = function isDesktop() {
  218. return window.innerWidth >= 992;
  219. };
  220. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  221. return ['layout-wrapper', {
  222. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  223. 'layout-mobile-sidebar-active': mobileMenuActive.value
  224. }];
  225. });
  226. var onWrapperClick = function onWrapperClick() {
  227. if (!menuClick.value) {
  228. mobileMenuActive.value = false;
  229. }
  230. menuClick.value = false;
  231. };
  232. var onMenuToggle = function onMenuToggle(event) {
  233. menuClick.value = true;
  234. if (isDesktop()) {
  235. staticMenuInactive.value = !staticMenuInactive.value;
  236. } else {
  237. mobileMenuActive.value = !mobileMenuActive.value;
  238. }
  239. event.preventDefault();
  240. };
  241. var __returned__ = {
  242. mobileMenuActive: mobileMenuActive,
  243. staticMenuInactive: staticMenuInactive,
  244. menuClick: menuClick,
  245. isDesktop: isDesktop,
  246. containerClass: containerClass,
  247. onWrapperClick: onWrapperClick,
  248. onMenuToggle: onMenuToggle,
  249. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  250. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  251. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  252. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  253. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  266. /*!***************************************************************************************************************************************************************************************************************!*\
  267. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  268. \***************************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/Suppliers/tableHeader.js");
  281. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  282. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  283. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  284. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  286. __name: 'Index',
  287. props: {
  288. suppliers: Object,
  289. initialSearch: String
  290. },
  291. setup: function setup(__props, _ref) {
  292. var expose = _ref.expose;
  293. expose();
  294. var props = __props;
  295. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  296. search = _useSearchText.search;
  297. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  298. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/suppliers', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var __returned__ = {
  305. props: props,
  306. search: search,
  307. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  310. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  311. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  312. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  313. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  314. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  316. };
  317. Object.defineProperty(__returned__, '__isScriptSetup', {
  318. enumerable: false,
  319. value: true
  320. });
  321. return __returned__;
  322. }
  323. });
  324. /***/ }),
  325. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  326. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  327. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  328. \***********************************************************************************************************************************************************************************************************************************************************************************/
  329. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  330. "use strict";
  331. __webpack_require__.r(__webpack_exports__);
  332. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  333. /* harmony export */ "render": () => (/* binding */ render)
  334. /* harmony export */ });
  335. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  336. var _hoisted_1 = {
  337. key: 1,
  338. "class": "p-button-label"
  339. };
  340. var _hoisted_2 = {
  341. key: 1,
  342. "class": "p-button-label"
  343. };
  344. function render(_ctx, _cache, $props, $setup, $data, $options) {
  345. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  346. key: 0,
  347. "class": "p-button p-component",
  348. as: "button",
  349. type: "button"
  350. }, {
  351. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  352. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  353. key: 0,
  354. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  355. }, null, 2
  356. /* CLASS */
  357. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  358. /* TEXT */
  359. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  360. }),
  361. _: 1
  362. /* STABLE */
  363. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  364. key: 1,
  365. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  366. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  367. key: 0,
  368. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  369. }, null, 2
  370. /* CLASS */
  371. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  372. /* TEXT */
  373. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  374. /* CLASS */
  375. ));
  376. }
  377. /***/ }),
  378. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  379. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  380. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  381. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  382. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  383. "use strict";
  384. __webpack_require__.r(__webpack_exports__);
  385. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  386. /* harmony export */ "render": () => (/* binding */ render)
  387. /* harmony export */ });
  388. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  389. var _withScopeId = function _withScopeId(n) {
  390. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  391. };
  392. var _hoisted_1 = {
  393. "class": "layout-footer"
  394. };
  395. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  396. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  397. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  398. href: "https://dijitalcode.com",
  399. target: "_blank",
  400. "class": "font-medium ml-2"
  401. }, "DijitalCODE", -1
  402. /* HOISTED */
  403. );
  404. });
  405. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  406. function render(_ctx, _cache) {
  407. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  408. }
  409. /***/ }),
  410. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  411. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  412. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  413. \********************************************************************************************************************************************************************************************************************************************************************************/
  414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  415. "use strict";
  416. __webpack_require__.r(__webpack_exports__);
  417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  418. /* harmony export */ "render": () => (/* binding */ render)
  419. /* harmony export */ });
  420. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  421. var _hoisted_1 = {
  422. key: 0
  423. };
  424. var _hoisted_2 = {
  425. key: 1
  426. };
  427. function render(_ctx, _cache, $props, $setup, $data, $options) {
  428. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  429. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  430. key: 0,
  431. severity: "success",
  432. onClose: $setup.onClose
  433. }, {
  434. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  435. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  436. /* TEXT */
  437. )];
  438. }),
  439. _: 1
  440. /* STABLE */
  441. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  442. key: 1,
  443. severity: "error",
  444. onClose: $setup.onClose
  445. }, {
  446. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  447. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  448. /* TEXT */
  449. )];
  450. }),
  451. _: 1
  452. /* STABLE */
  453. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  454. key: 2,
  455. severity: "error",
  456. onClose: $setup.onClose
  457. }, {
  458. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  459. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  460. /* TEXT */
  461. ))];
  462. }),
  463. _: 1
  464. /* STABLE */
  465. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  466. /* STABLE_FRAGMENT */
  467. );
  468. }
  469. /***/ }),
  470. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  471. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  472. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  473. \***********************************************************************************************************************************************************************************************************************************************************************************/
  474. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  475. "use strict";
  476. __webpack_require__.r(__webpack_exports__);
  477. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  478. /* harmony export */ "render": () => (/* binding */ render)
  479. /* harmony export */ });
  480. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  481. var _hoisted_1 = {
  482. key: 0,
  483. "class": "p-paginator p-component flex justify-content-start"
  484. };
  485. var _hoisted_2 = {
  486. "class": "p-paginator-pages"
  487. };
  488. var _hoisted_3 = ["innerHTML"];
  489. function render(_ctx, _cache, $props, $setup, $data, $options) {
  490. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  491. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  492. key: "link-".concat(key),
  493. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  494. 'p-disabled': link
  495. }]),
  496. innerHTML: link.label
  497. }, null, 10
  498. /* CLASS, PROPS */
  499. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  500. key: "link-".concat(key),
  501. href: link.url,
  502. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  503. 'p-highlight': link.active
  504. }, "p-paginator-page p-paginator-element p-link"]),
  505. innerHTML: link.label
  506. }, null, 8
  507. /* PROPS */
  508. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  509. /* STABLE_FRAGMENT */
  510. );
  511. }), 256
  512. /* UNKEYED_FRAGMENT */
  513. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  514. }
  515. /***/ }),
  516. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  517. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  518. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  519. \********************************************************************************************************************************************************************************************************************************************************************************************/
  520. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  521. "use strict";
  522. __webpack_require__.r(__webpack_exports__);
  523. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  524. /* harmony export */ "render": () => (/* binding */ render)
  525. /* harmony export */ });
  526. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  527. function render(_ctx, _cache, $props, $setup, $data, $options) {
  528. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  529. "class": "layout-menu",
  530. items: $props.menu,
  531. root: true
  532. }, null, 8
  533. /* PROPS */
  534. , ["items"])]);
  535. }
  536. /***/ }),
  537. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  538. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  539. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  540. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  542. "use strict";
  543. __webpack_require__.r(__webpack_exports__);
  544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  545. /* harmony export */ "render": () => (/* binding */ render)
  546. /* harmony export */ });
  547. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  548. var _withScopeId = function _withScopeId(n) {
  549. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  550. };
  551. var _hoisted_1 = {
  552. key: 0
  553. };
  554. var _hoisted_2 = ["aria-label"];
  555. var _hoisted_3 = ["aria-label"];
  556. function render(_ctx, _cache, $props, $setup, $data, $options) {
  557. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  558. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  559. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  560. key: i,
  561. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  562. 'layout-menuitem-category': $props.root
  563. }]),
  564. role: "none"
  565. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  566. key: 0
  567. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  568. "class": "layout-menuitem-root-text",
  569. "aria-label": item.label
  570. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  571. /* TEXT, PROPS */
  572. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  573. items: item.items
  574. }, null, 8
  575. /* PROPS */
  576. , ["items"])], 64
  577. /* STABLE_FRAGMENT */
  578. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  579. key: 1
  580. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  581. key: 0,
  582. role: "menuitem",
  583. href: item.to,
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  585. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  586. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  587. }]),
  588. "aria-label": item.label
  589. }, {
  590. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  591. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  593. }, null, 2
  594. /* CLASS */
  595. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  596. /* TEXT */
  597. )];
  598. }),
  599. _: 2
  600. /* DYNAMIC */
  601. }, 1032
  602. /* PROPS, DYNAMIC_SLOTS */
  603. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  604. key: 1,
  605. href: "#",
  606. role: "menuitem",
  607. "aria-label": item.label
  608. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  609. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  610. }, null, 2
  611. /* CLASS */
  612. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  613. /* TEXT */
  614. )], 8
  615. /* PROPS */
  616. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  617. items: item.items
  618. }, null, 8
  619. /* PROPS */
  620. , ["items"])], 64
  621. /* STABLE_FRAGMENT */
  622. ))], 2
  623. /* CLASS */
  624. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  625. /* STABLE_FRAGMENT */
  626. );
  627. }), 256
  628. /* UNKEYED_FRAGMENT */
  629. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  630. }
  631. /***/ }),
  632. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  633. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  634. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  635. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  637. "use strict";
  638. __webpack_require__.r(__webpack_exports__);
  639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  640. /* harmony export */ "render": () => (/* binding */ render)
  641. /* harmony export */ });
  642. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  643. var _withScopeId = function _withScopeId(n) {
  644. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  645. };
  646. var _hoisted_1 = {
  647. "class": "layout-topbar"
  648. };
  649. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  650. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  651. alt: "Brand Logo",
  652. src: "/images/logo.svg",
  653. "class": "md:mr-3"
  654. }, null, -1
  655. /* HOISTED */
  656. );
  657. });
  658. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  659. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  660. /* HOISTED */
  661. );
  662. });
  663. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  664. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  665. "class": "pi pi-bars"
  666. }, null, -1
  667. /* HOISTED */
  668. );
  669. });
  670. var _hoisted_5 = [_hoisted_4];
  671. var _hoisted_6 = {
  672. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  673. };
  674. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  675. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  676. "class": "pi pi-ellipsis-v"
  677. }, null, -1
  678. /* HOISTED */
  679. );
  680. });
  681. var _hoisted_8 = [_hoisted_7];
  682. var _hoisted_9 = {
  683. "class": "layout-topbar-menu hidden lg:flex origin-top"
  684. };
  685. var _hoisted_10 = {
  686. "class": "align-self-center"
  687. };
  688. var _hoisted_11 = {
  689. "class": "hidden lg:inline"
  690. };
  691. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  692. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  693. "class": "pi pi-user"
  694. }, null, -1
  695. /* HOISTED */
  696. );
  697. });
  698. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  699. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  700. /* HOISTED */
  701. );
  702. });
  703. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  704. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  705. "class": "pi pi-sign-out"
  706. }, null, -1
  707. /* HOISTED */
  708. );
  709. });
  710. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  711. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  712. /* HOISTED */
  713. );
  714. });
  715. function render(_ctx, _cache, $props, $setup, $data, $options) {
  716. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  717. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  718. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  719. href: "/",
  720. "class": "layout-topbar-logo"
  721. }, {
  722. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  723. return [_hoisted_2, _hoisted_3];
  724. }),
  725. _: 1
  726. /* STABLE */
  727. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  728. "class": "p-link layout-menu-button layout-topbar-button",
  729. onClick: _cache[0] || (_cache[0] = function ($event) {
  730. return _ctx.$emit('menu-toggle', $event);
  731. })
  732. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  733. selector: '@next',
  734. enterClass: 'hidden',
  735. enterActiveClass: 'scalein',
  736. leaveToClass: 'hidden',
  737. leaveActiveClass: 'fadeout',
  738. hideOnOutsideClick: true
  739. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  740. /* TEXT */
  741. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  742. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  743. "class": "p-link layout-topbar-button"
  744. }, {
  745. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  746. return [_hoisted_12, _hoisted_13];
  747. }),
  748. _: 1
  749. /* STABLE */
  750. }, 8
  751. /* PROPS */
  752. , ["href"])), [[_directive_tooltip, {
  753. value: 'Ubah Profil',
  754. "class": 'layout-topbar-menu-tooltip'
  755. }, void 0, {
  756. bottom: true
  757. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  758. href: _ctx.route('logout'),
  759. as: "button",
  760. method: "post",
  761. "class": "p-link layout-topbar-button"
  762. }, {
  763. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  764. return [_hoisted_14, _hoisted_15];
  765. }),
  766. _: 1
  767. /* STABLE */
  768. }, 8
  769. /* PROPS */
  770. , ["href"])), [[_directive_tooltip, {
  771. value: 'Keluar',
  772. "class": 'layout-topbar-menu-tooltip'
  773. }, void 0, {
  774. bottom: true
  775. }]])])])]);
  776. }
  777. /***/ }),
  778. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  779. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  780. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  781. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  783. "use strict";
  784. __webpack_require__.r(__webpack_exports__);
  785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  786. /* harmony export */ "render": () => (/* binding */ render)
  787. /* harmony export */ });
  788. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  789. var _withScopeId = function _withScopeId(n) {
  790. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  791. };
  792. var _hoisted_1 = {
  793. "class": "layout-sidebar"
  794. };
  795. var _hoisted_2 = {
  796. "class": "layout-main-container"
  797. };
  798. var _hoisted_3 = {
  799. "class": "layout-main"
  800. };
  801. var _hoisted_4 = {
  802. key: 0,
  803. "class": "layout-mask p-component-overlay"
  804. };
  805. function render(_ctx, _cache, $props, $setup, $data, $options) {
  806. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  807. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  808. onClick: $setup.onWrapperClick
  809. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  810. onMenuToggle: $setup.onMenuToggle
  811. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  812. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  813. }, null, 8
  814. /* PROPS */
  815. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  816. name: "layout-mask"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. })], 2
  824. /* CLASS */
  825. );
  826. }
  827. /***/ }),
  828. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  829. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  830. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  831. \********************************************************************************************************************************************************************************************************************************************************************************/
  832. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  833. "use strict";
  834. __webpack_require__.r(__webpack_exports__);
  835. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  836. /* harmony export */ "render": () => (/* binding */ render)
  837. /* harmony export */ });
  838. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  839. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Supplier", -1
  840. /* HOISTED */
  841. );
  842. var _hoisted_2 = {
  843. "class": "grid"
  844. };
  845. var _hoisted_3 = {
  846. "class": "col-12 md:col-8"
  847. };
  848. var _hoisted_4 = {
  849. "class": "flex align-items-center"
  850. };
  851. var _hoisted_5 = {
  852. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  853. };
  854. function render(_ctx, _cache, $props, $setup, $data, $options) {
  855. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  856. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  857. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  858. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  859. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  860. title: "Daftar Supplier"
  861. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  862. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  863. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  864. responsiveLayout: "scroll",
  865. columnResizeMode: "expand",
  866. value: $props.suppliers.data,
  867. rowHover: true,
  868. stripedRows: true
  869. }, {
  870. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  871. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  872. "class": "w-full md:w-27rem",
  873. placeholder: "cari, contoh: tina, 08xx, 0x",
  874. modelValue: $setup.search,
  875. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  876. return $setup.search = $event;
  877. })
  878. }, null, 8
  879. /* PROPS */
  880. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  881. label: "Tambah Supplier",
  882. icon: "pi pi-pencil",
  883. "class": "p-button-outlined",
  884. href: _ctx.route('suppliers.create')
  885. }, null, 8
  886. /* PROPS */
  887. , ["href"])])])];
  888. }),
  889. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  890. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  891. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  892. field: value.field,
  893. header: value.header,
  894. key: value.field
  895. }, null, 8
  896. /* PROPS */
  897. , ["field", "header"]);
  898. }), 128
  899. /* KEYED_FRAGMENT */
  900. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  901. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  902. var data = _ref.data;
  903. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  904. icon: "pi pi-pencil",
  905. "class": "p-button-icon-only p-button-rounded p-button-text",
  906. href: _ctx.route('suppliers.edit', data.id)
  907. }, null, 8
  908. /* PROPS */
  909. , ["href"]), [[_directive_tooltip, 'Ubah Supplier', void 0, {
  910. bottom: true
  911. }]])];
  912. }),
  913. _: 1
  914. /* STABLE */
  915. })];
  916. }),
  917. _: 1
  918. /* STABLE */
  919. }, 8
  920. /* PROPS */
  921. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  922. links: $props.suppliers.links
  923. }, null, 8
  924. /* PROPS */
  925. , ["links"])];
  926. }),
  927. _: 1
  928. /* STABLE */
  929. })], 64
  930. /* STABLE_FRAGMENT */
  931. );
  932. }
  933. /***/ }),
  934. /***/ "./resources/js/components/useSearchText.js":
  935. /*!**************************************************!*\
  936. !*** ./resources/js/components/useSearchText.js ***!
  937. \**************************************************/
  938. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  939. "use strict";
  940. __webpack_require__.r(__webpack_exports__);
  941. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  942. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  943. /* harmony export */ });
  944. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  945. function useSearchText(props) {
  946. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  947. return {
  948. search: search
  949. };
  950. }
  951. /***/ }),
  952. /***/ "./resources/js/pages/Suppliers/tableHeader.js":
  953. /*!*****************************************************!*\
  954. !*** ./resources/js/pages/Suppliers/tableHeader.js ***!
  955. \*****************************************************/
  956. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  957. "use strict";
  958. __webpack_require__.r(__webpack_exports__);
  959. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  960. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  961. /* harmony export */ });
  962. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  963. field: 'name',
  964. header: 'Nama'
  965. }, {
  966. field: 'address',
  967. header: 'Alamat'
  968. }, {
  969. field: 'email',
  970. header: 'Surel'
  971. }, {
  972. field: 'phone',
  973. header: 'No HP'
  974. }, {
  975. field: 'npwp',
  976. header: 'NPWP'
  977. }]);
  978. /***/ }),
  979. /***/ "./resources/js/utils/menu.js":
  980. /*!************************************!*\
  981. !*** ./resources/js/utils/menu.js ***!
  982. \************************************/
  983. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  984. "use strict";
  985. __webpack_require__.r(__webpack_exports__);
  986. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  987. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  988. /* harmony export */ });
  989. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  990. // Admin
  991. 1: [{
  992. label: 'Home',
  993. items: [{
  994. label: 'Dashboard',
  995. icon: 'pi pi-chart-bar',
  996. to: '/dashboards',
  997. component: 'Dashboards/Index'
  998. }]
  999. }, {
  1000. label: 'Laporan',
  1001. items: []
  1002. }, {
  1003. label: 'Master',
  1004. items: [{
  1005. label: 'User',
  1006. icon: 'pi pi-user',
  1007. to: '/users',
  1008. component: 'Users/Index'
  1009. }]
  1010. }],
  1011. // Supervisor
  1012. 2: [{
  1013. label: 'Home',
  1014. items: [{
  1015. label: 'Dashboard',
  1016. icon: 'pi pi-chart-bar',
  1017. to: '/dashboards',
  1018. component: 'Dashboards/Index'
  1019. }]
  1020. }, {
  1021. label: 'Master',
  1022. items: [{
  1023. label: 'Pelanggan',
  1024. icon: 'pi pi-users',
  1025. to: '/customers',
  1026. component: 'Customers/Index'
  1027. }, {
  1028. label: 'Pembelian',
  1029. icon: 'pi pi-shopping-cart',
  1030. to: '/purchases',
  1031. component: 'Purchases/Index'
  1032. }, {
  1033. label: 'Penjualan',
  1034. icon: 'pi pi-tag',
  1035. to: '/sales',
  1036. component: 'Sales/Index'
  1037. }, {
  1038. label: 'Produk',
  1039. icon: 'pi pi-th-large',
  1040. to: '/products',
  1041. component: 'Products/Index'
  1042. }]
  1043. }],
  1044. // Operator
  1045. 3: [{
  1046. label: 'Home',
  1047. items: [{
  1048. label: 'Dashboard',
  1049. icon: 'pi pi-chart-bar',
  1050. to: '/dashboards',
  1051. component: 'Dashboards/Index'
  1052. }]
  1053. }, {
  1054. label: 'Master',
  1055. items: [{
  1056. label: 'Supplier',
  1057. icon: 'pi pi-shopping-cart',
  1058. to: '/suppliers',
  1059. component: 'Suppliers/Index'
  1060. }, {
  1061. label: 'Stok Barang',
  1062. icon: 'pi pi-box',
  1063. to: '/stock-products',
  1064. component: 'StockProducts/Index'
  1065. }]
  1066. }]
  1067. });
  1068. /***/ }),
  1069. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1070. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1071. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1072. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1073. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1074. "use strict";
  1075. __webpack_require__.r(__webpack_exports__);
  1076. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1077. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1078. /* harmony export */ });
  1079. /* 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");
  1080. /* 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__);
  1081. // Imports
  1082. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1083. // Module
  1084. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1085. // Exports
  1086. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1087. /***/ }),
  1088. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1089. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1090. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1091. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1092. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1093. "use strict";
  1094. __webpack_require__.r(__webpack_exports__);
  1095. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1096. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1097. /* harmony export */ });
  1098. /* 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");
  1099. /* 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__);
  1100. // Imports
  1101. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1102. // Module
  1103. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1104. // Exports
  1105. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1106. /***/ }),
  1107. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1108. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1109. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1110. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1111. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1112. "use strict";
  1113. __webpack_require__.r(__webpack_exports__);
  1114. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1115. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1116. /* harmony export */ });
  1117. /* 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");
  1118. /* 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__);
  1119. // Imports
  1120. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1121. // Module
  1122. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1123. // Exports
  1124. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1125. /***/ }),
  1126. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1127. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1128. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1129. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1130. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1131. "use strict";
  1132. __webpack_require__.r(__webpack_exports__);
  1133. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1134. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1135. /* harmony export */ });
  1136. /* 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");
  1137. /* 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__);
  1138. // Imports
  1139. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1140. // Module
  1141. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1142. // Exports
  1143. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1144. /***/ }),
  1145. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1146. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1147. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1148. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1149. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1150. "use strict";
  1151. __webpack_require__.r(__webpack_exports__);
  1152. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1153. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1154. /* harmony export */ });
  1155. /* 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");
  1156. /* 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__);
  1157. // Imports
  1158. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1159. // Module
  1160. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1161. // Exports
  1162. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1163. /***/ }),
  1164. /***/ "./node_modules/lodash/lodash.js":
  1165. /*!***************************************!*\
  1166. !*** ./node_modules/lodash/lodash.js ***!
  1167. \***************************************/
  1168. /***/ (function(module, exports, __webpack_require__) {
  1169. /* module decorator */ module = __webpack_require__.nmd(module);
  1170. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1171. * @license
  1172. * Lodash <https://lodash.com/>
  1173. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1174. * Released under MIT license <https://lodash.com/license>
  1175. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1176. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1177. */
  1178. ;(function() {
  1179. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1180. var undefined;
  1181. /** Used as the semantic version number. */
  1182. var VERSION = '4.17.21';
  1183. /** Used as the size to enable large array optimizations. */
  1184. var LARGE_ARRAY_SIZE = 200;
  1185. /** Error message constants. */
  1186. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1187. FUNC_ERROR_TEXT = 'Expected a function',
  1188. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1189. /** Used to stand-in for `undefined` hash values. */
  1190. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1191. /** Used as the maximum memoize cache size. */
  1192. var MAX_MEMOIZE_SIZE = 500;
  1193. /** Used as the internal argument placeholder. */
  1194. var PLACEHOLDER = '__lodash_placeholder__';
  1195. /** Used to compose bitmasks for cloning. */
  1196. var CLONE_DEEP_FLAG = 1,
  1197. CLONE_FLAT_FLAG = 2,
  1198. CLONE_SYMBOLS_FLAG = 4;
  1199. /** Used to compose bitmasks for value comparisons. */
  1200. var COMPARE_PARTIAL_FLAG = 1,
  1201. COMPARE_UNORDERED_FLAG = 2;
  1202. /** Used to compose bitmasks for function metadata. */
  1203. var WRAP_BIND_FLAG = 1,
  1204. WRAP_BIND_KEY_FLAG = 2,
  1205. WRAP_CURRY_BOUND_FLAG = 4,
  1206. WRAP_CURRY_FLAG = 8,
  1207. WRAP_CURRY_RIGHT_FLAG = 16,
  1208. WRAP_PARTIAL_FLAG = 32,
  1209. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1210. WRAP_ARY_FLAG = 128,
  1211. WRAP_REARG_FLAG = 256,
  1212. WRAP_FLIP_FLAG = 512;
  1213. /** Used as default options for `_.truncate`. */
  1214. var DEFAULT_TRUNC_LENGTH = 30,
  1215. DEFAULT_TRUNC_OMISSION = '...';
  1216. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1217. var HOT_COUNT = 800,
  1218. HOT_SPAN = 16;
  1219. /** Used to indicate the type of lazy iteratees. */
  1220. var LAZY_FILTER_FLAG = 1,
  1221. LAZY_MAP_FLAG = 2,
  1222. LAZY_WHILE_FLAG = 3;
  1223. /** Used as references for various `Number` constants. */
  1224. var INFINITY = 1 / 0,
  1225. MAX_SAFE_INTEGER = 9007199254740991,
  1226. MAX_INTEGER = 1.7976931348623157e+308,
  1227. NAN = 0 / 0;
  1228. /** Used as references for the maximum length and index of an array. */
  1229. var MAX_ARRAY_LENGTH = 4294967295,
  1230. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1231. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1232. /** Used to associate wrap methods with their bit flags. */
  1233. var wrapFlags = [
  1234. ['ary', WRAP_ARY_FLAG],
  1235. ['bind', WRAP_BIND_FLAG],
  1236. ['bindKey', WRAP_BIND_KEY_FLAG],
  1237. ['curry', WRAP_CURRY_FLAG],
  1238. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1239. ['flip', WRAP_FLIP_FLAG],
  1240. ['partial', WRAP_PARTIAL_FLAG],
  1241. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1242. ['rearg', WRAP_REARG_FLAG]
  1243. ];
  1244. /** `Object#toString` result references. */
  1245. var argsTag = '[object Arguments]',
  1246. arrayTag = '[object Array]',
  1247. asyncTag = '[object AsyncFunction]',
  1248. boolTag = '[object Boolean]',
  1249. dateTag = '[object Date]',
  1250. domExcTag = '[object DOMException]',
  1251. errorTag = '[object Error]',
  1252. funcTag = '[object Function]',
  1253. genTag = '[object GeneratorFunction]',
  1254. mapTag = '[object Map]',
  1255. numberTag = '[object Number]',
  1256. nullTag = '[object Null]',
  1257. objectTag = '[object Object]',
  1258. promiseTag = '[object Promise]',
  1259. proxyTag = '[object Proxy]',
  1260. regexpTag = '[object RegExp]',
  1261. setTag = '[object Set]',
  1262. stringTag = '[object String]',
  1263. symbolTag = '[object Symbol]',
  1264. undefinedTag = '[object Undefined]',
  1265. weakMapTag = '[object WeakMap]',
  1266. weakSetTag = '[object WeakSet]';
  1267. var arrayBufferTag = '[object ArrayBuffer]',
  1268. dataViewTag = '[object DataView]',
  1269. float32Tag = '[object Float32Array]',
  1270. float64Tag = '[object Float64Array]',
  1271. int8Tag = '[object Int8Array]',
  1272. int16Tag = '[object Int16Array]',
  1273. int32Tag = '[object Int32Array]',
  1274. uint8Tag = '[object Uint8Array]',
  1275. uint8ClampedTag = '[object Uint8ClampedArray]',
  1276. uint16Tag = '[object Uint16Array]',
  1277. uint32Tag = '[object Uint32Array]';
  1278. /** Used to match empty string literals in compiled template source. */
  1279. var reEmptyStringLeading = /\b__p \+= '';/g,
  1280. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1281. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1282. /** Used to match HTML entities and HTML characters. */
  1283. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1284. reUnescapedHtml = /[&<>"']/g,
  1285. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1286. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1287. /** Used to match template delimiters. */
  1288. var reEscape = /<%-([\s\S]+?)%>/g,
  1289. reEvaluate = /<%([\s\S]+?)%>/g,
  1290. reInterpolate = /<%=([\s\S]+?)%>/g;
  1291. /** Used to match property names within property paths. */
  1292. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1293. reIsPlainProp = /^\w*$/,
  1294. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1295. /**
  1296. * Used to match `RegExp`
  1297. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1298. */
  1299. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1300. reHasRegExpChar = RegExp(reRegExpChar.source);
  1301. /** Used to match leading whitespace. */
  1302. var reTrimStart = /^\s+/;
  1303. /** Used to match a single whitespace character. */
  1304. var reWhitespace = /\s/;
  1305. /** Used to match wrap detail comments. */
  1306. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1307. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1308. reSplitDetails = /,? & /;
  1309. /** Used to match words composed of alphanumeric characters. */
  1310. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1311. /**
  1312. * Used to validate the `validate` option in `_.template` variable.
  1313. *
  1314. * Forbids characters which could potentially change the meaning of the function argument definition:
  1315. * - "()," (modification of function parameters)
  1316. * - "=" (default value)
  1317. * - "[]{}" (destructuring of function parameters)
  1318. * - "/" (beginning of a comment)
  1319. * - whitespace
  1320. */
  1321. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1322. /** Used to match backslashes in property paths. */
  1323. var reEscapeChar = /\\(\\)?/g;
  1324. /**
  1325. * Used to match
  1326. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1327. */
  1328. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1329. /** Used to match `RegExp` flags from their coerced string values. */
  1330. var reFlags = /\w*$/;
  1331. /** Used to detect bad signed hexadecimal string values. */
  1332. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1333. /** Used to detect binary string values. */
  1334. var reIsBinary = /^0b[01]+$/i;
  1335. /** Used to detect host constructors (Safari). */
  1336. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1337. /** Used to detect octal string values. */
  1338. var reIsOctal = /^0o[0-7]+$/i;
  1339. /** Used to detect unsigned integer values. */
  1340. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1341. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1342. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1343. /** Used to ensure capturing order of template delimiters. */
  1344. var reNoMatch = /($^)/;
  1345. /** Used to match unescaped characters in compiled string literals. */
  1346. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1347. /** Used to compose unicode character classes. */
  1348. var rsAstralRange = '\\ud800-\\udfff',
  1349. rsComboMarksRange = '\\u0300-\\u036f',
  1350. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1351. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1352. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1353. rsDingbatRange = '\\u2700-\\u27bf',
  1354. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1355. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1356. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1357. rsPunctuationRange = '\\u2000-\\u206f',
  1358. 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',
  1359. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1360. rsVarRange = '\\ufe0e\\ufe0f',
  1361. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1362. /** Used to compose unicode capture groups. */
  1363. var rsApos = "['\u2019]",
  1364. rsAstral = '[' + rsAstralRange + ']',
  1365. rsBreak = '[' + rsBreakRange + ']',
  1366. rsCombo = '[' + rsComboRange + ']',
  1367. rsDigits = '\\d+',
  1368. rsDingbat = '[' + rsDingbatRange + ']',
  1369. rsLower = '[' + rsLowerRange + ']',
  1370. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1371. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1372. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1373. rsNonAstral = '[^' + rsAstralRange + ']',
  1374. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1375. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1376. rsUpper = '[' + rsUpperRange + ']',
  1377. rsZWJ = '\\u200d';
  1378. /** Used to compose unicode regexes. */
  1379. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1380. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1381. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1382. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1383. reOptMod = rsModifier + '?',
  1384. rsOptVar = '[' + rsVarRange + ']?',
  1385. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1386. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1387. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1388. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1389. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1390. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1391. /** Used to match apostrophes. */
  1392. var reApos = RegExp(rsApos, 'g');
  1393. /**
  1394. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1395. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1396. */
  1397. var reComboMark = RegExp(rsCombo, 'g');
  1398. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1399. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1400. /** Used to match complex or compound words. */
  1401. var reUnicodeWord = RegExp([
  1402. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1403. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1404. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1405. rsUpper + '+' + rsOptContrUpper,
  1406. rsOrdUpper,
  1407. rsOrdLower,
  1408. rsDigits,
  1409. rsEmoji
  1410. ].join('|'), 'g');
  1411. /** 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/). */
  1412. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1413. /** Used to detect strings that need a more robust regexp to match words. */
  1414. 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 ]/;
  1415. /** Used to assign default `context` object properties. */
  1416. var contextProps = [
  1417. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1418. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1419. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1420. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1421. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1422. ];
  1423. /** Used to make template sourceURLs easier to identify. */
  1424. var templateCounter = -1;
  1425. /** Used to identify `toStringTag` values of typed arrays. */
  1426. var typedArrayTags = {};
  1427. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1428. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1429. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1430. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1431. typedArrayTags[uint32Tag] = true;
  1432. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1433. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1434. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1435. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1436. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1437. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1438. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1439. typedArrayTags[weakMapTag] = false;
  1440. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1441. var cloneableTags = {};
  1442. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1443. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1444. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1445. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1446. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1447. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1448. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1449. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1450. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1451. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1452. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1453. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1454. cloneableTags[weakMapTag] = false;
  1455. /** Used to map Latin Unicode letters to basic Latin letters. */
  1456. var deburredLetters = {
  1457. // Latin-1 Supplement block.
  1458. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1459. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1460. '\xc7': 'C', '\xe7': 'c',
  1461. '\xd0': 'D', '\xf0': 'd',
  1462. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1463. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1464. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1465. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1466. '\xd1': 'N', '\xf1': 'n',
  1467. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1468. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1469. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1470. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1471. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1472. '\xc6': 'Ae', '\xe6': 'ae',
  1473. '\xde': 'Th', '\xfe': 'th',
  1474. '\xdf': 'ss',
  1475. // Latin Extended-A block.
  1476. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1477. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1478. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1479. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1480. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1481. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1482. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1483. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1484. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1485. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1486. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1487. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1488. '\u0134': 'J', '\u0135': 'j',
  1489. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1490. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1491. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1492. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1493. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1494. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1495. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1496. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1497. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1498. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1499. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1500. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1501. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1502. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1503. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1504. '\u0174': 'W', '\u0175': 'w',
  1505. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1506. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1507. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1508. '\u0132': 'IJ', '\u0133': 'ij',
  1509. '\u0152': 'Oe', '\u0153': 'oe',
  1510. '\u0149': "'n", '\u017f': 's'
  1511. };
  1512. /** Used to map characters to HTML entities. */
  1513. var htmlEscapes = {
  1514. '&': '&amp;',
  1515. '<': '&lt;',
  1516. '>': '&gt;',
  1517. '"': '&quot;',
  1518. "'": '&#39;'
  1519. };
  1520. /** Used to map HTML entities to characters. */
  1521. var htmlUnescapes = {
  1522. '&amp;': '&',
  1523. '&lt;': '<',
  1524. '&gt;': '>',
  1525. '&quot;': '"',
  1526. '&#39;': "'"
  1527. };
  1528. /** Used to escape characters for inclusion in compiled string literals. */
  1529. var stringEscapes = {
  1530. '\\': '\\',
  1531. "'": "'",
  1532. '\n': 'n',
  1533. '\r': 'r',
  1534. '\u2028': 'u2028',
  1535. '\u2029': 'u2029'
  1536. };
  1537. /** Built-in method references without a dependency on `root`. */
  1538. var freeParseFloat = parseFloat,
  1539. freeParseInt = parseInt;
  1540. /** Detect free variable `global` from Node.js. */
  1541. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1542. /** Detect free variable `self`. */
  1543. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1544. /** Used as a reference to the global object. */
  1545. var root = freeGlobal || freeSelf || Function('return this')();
  1546. /** Detect free variable `exports`. */
  1547. var freeExports = true && exports && !exports.nodeType && exports;
  1548. /** Detect free variable `module`. */
  1549. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1550. /** Detect the popular CommonJS extension `module.exports`. */
  1551. var moduleExports = freeModule && freeModule.exports === freeExports;
  1552. /** Detect free variable `process` from Node.js. */
  1553. var freeProcess = moduleExports && freeGlobal.process;
  1554. /** Used to access faster Node.js helpers. */
  1555. var nodeUtil = (function() {
  1556. try {
  1557. // Use `util.types` for Node.js 10+.
  1558. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1559. if (types) {
  1560. return types;
  1561. }
  1562. // Legacy `process.binding('util')` for Node.js < 10.
  1563. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1564. } catch (e) {}
  1565. }());
  1566. /* Node.js helper references. */
  1567. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1568. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1569. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1570. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1571. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1572. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1573. /*--------------------------------------------------------------------------*/
  1574. /**
  1575. * A faster alternative to `Function#apply`, this function invokes `func`
  1576. * with the `this` binding of `thisArg` and the arguments of `args`.
  1577. *
  1578. * @private
  1579. * @param {Function} func The function to invoke.
  1580. * @param {*} thisArg The `this` binding of `func`.
  1581. * @param {Array} args The arguments to invoke `func` with.
  1582. * @returns {*} Returns the result of `func`.
  1583. */
  1584. function apply(func, thisArg, args) {
  1585. switch (args.length) {
  1586. case 0: return func.call(thisArg);
  1587. case 1: return func.call(thisArg, args[0]);
  1588. case 2: return func.call(thisArg, args[0], args[1]);
  1589. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1590. }
  1591. return func.apply(thisArg, args);
  1592. }
  1593. /**
  1594. * A specialized version of `baseAggregator` for arrays.
  1595. *
  1596. * @private
  1597. * @param {Array} [array] The array to iterate over.
  1598. * @param {Function} setter The function to set `accumulator` values.
  1599. * @param {Function} iteratee The iteratee to transform keys.
  1600. * @param {Object} accumulator The initial aggregated object.
  1601. * @returns {Function} Returns `accumulator`.
  1602. */
  1603. function arrayAggregator(array, setter, iteratee, accumulator) {
  1604. var index = -1,
  1605. length = array == null ? 0 : array.length;
  1606. while (++index < length) {
  1607. var value = array[index];
  1608. setter(accumulator, value, iteratee(value), array);
  1609. }
  1610. return accumulator;
  1611. }
  1612. /**
  1613. * A specialized version of `_.forEach` for arrays without support for
  1614. * iteratee shorthands.
  1615. *
  1616. * @private
  1617. * @param {Array} [array] The array to iterate over.
  1618. * @param {Function} iteratee The function invoked per iteration.
  1619. * @returns {Array} Returns `array`.
  1620. */
  1621. function arrayEach(array, iteratee) {
  1622. var index = -1,
  1623. length = array == null ? 0 : array.length;
  1624. while (++index < length) {
  1625. if (iteratee(array[index], index, array) === false) {
  1626. break;
  1627. }
  1628. }
  1629. return array;
  1630. }
  1631. /**
  1632. * A specialized version of `_.forEachRight` for arrays without support for
  1633. * iteratee shorthands.
  1634. *
  1635. * @private
  1636. * @param {Array} [array] The array to iterate over.
  1637. * @param {Function} iteratee The function invoked per iteration.
  1638. * @returns {Array} Returns `array`.
  1639. */
  1640. function arrayEachRight(array, iteratee) {
  1641. var length = array == null ? 0 : array.length;
  1642. while (length--) {
  1643. if (iteratee(array[length], length, array) === false) {
  1644. break;
  1645. }
  1646. }
  1647. return array;
  1648. }
  1649. /**
  1650. * A specialized version of `_.every` for arrays without support for
  1651. * iteratee shorthands.
  1652. *
  1653. * @private
  1654. * @param {Array} [array] The array to iterate over.
  1655. * @param {Function} predicate The function invoked per iteration.
  1656. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1657. * else `false`.
  1658. */
  1659. function arrayEvery(array, predicate) {
  1660. var index = -1,
  1661. length = array == null ? 0 : array.length;
  1662. while (++index < length) {
  1663. if (!predicate(array[index], index, array)) {
  1664. return false;
  1665. }
  1666. }
  1667. return true;
  1668. }
  1669. /**
  1670. * A specialized version of `_.filter` for arrays without support for
  1671. * iteratee shorthands.
  1672. *
  1673. * @private
  1674. * @param {Array} [array] The array to iterate over.
  1675. * @param {Function} predicate The function invoked per iteration.
  1676. * @returns {Array} Returns the new filtered array.
  1677. */
  1678. function arrayFilter(array, predicate) {
  1679. var index = -1,
  1680. length = array == null ? 0 : array.length,
  1681. resIndex = 0,
  1682. result = [];
  1683. while (++index < length) {
  1684. var value = array[index];
  1685. if (predicate(value, index, array)) {
  1686. result[resIndex++] = value;
  1687. }
  1688. }
  1689. return result;
  1690. }
  1691. /**
  1692. * A specialized version of `_.includes` for arrays without support for
  1693. * specifying an index to search from.
  1694. *
  1695. * @private
  1696. * @param {Array} [array] The array to inspect.
  1697. * @param {*} target The value to search for.
  1698. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1699. */
  1700. function arrayIncludes(array, value) {
  1701. var length = array == null ? 0 : array.length;
  1702. return !!length && baseIndexOf(array, value, 0) > -1;
  1703. }
  1704. /**
  1705. * This function is like `arrayIncludes` except that it accepts a comparator.
  1706. *
  1707. * @private
  1708. * @param {Array} [array] The array to inspect.
  1709. * @param {*} target The value to search for.
  1710. * @param {Function} comparator The comparator invoked per element.
  1711. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1712. */
  1713. function arrayIncludesWith(array, value, comparator) {
  1714. var index = -1,
  1715. length = array == null ? 0 : array.length;
  1716. while (++index < length) {
  1717. if (comparator(value, array[index])) {
  1718. return true;
  1719. }
  1720. }
  1721. return false;
  1722. }
  1723. /**
  1724. * A specialized version of `_.map` for arrays without support for iteratee
  1725. * shorthands.
  1726. *
  1727. * @private
  1728. * @param {Array} [array] The array to iterate over.
  1729. * @param {Function} iteratee The function invoked per iteration.
  1730. * @returns {Array} Returns the new mapped array.
  1731. */
  1732. function arrayMap(array, iteratee) {
  1733. var index = -1,
  1734. length = array == null ? 0 : array.length,
  1735. result = Array(length);
  1736. while (++index < length) {
  1737. result[index] = iteratee(array[index], index, array);
  1738. }
  1739. return result;
  1740. }
  1741. /**
  1742. * Appends the elements of `values` to `array`.
  1743. *
  1744. * @private
  1745. * @param {Array} array The array to modify.
  1746. * @param {Array} values The values to append.
  1747. * @returns {Array} Returns `array`.
  1748. */
  1749. function arrayPush(array, values) {
  1750. var index = -1,
  1751. length = values.length,
  1752. offset = array.length;
  1753. while (++index < length) {
  1754. array[offset + index] = values[index];
  1755. }
  1756. return array;
  1757. }
  1758. /**
  1759. * A specialized version of `_.reduce` for arrays without support for
  1760. * iteratee shorthands.
  1761. *
  1762. * @private
  1763. * @param {Array} [array] The array to iterate over.
  1764. * @param {Function} iteratee The function invoked per iteration.
  1765. * @param {*} [accumulator] The initial value.
  1766. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1767. * the initial value.
  1768. * @returns {*} Returns the accumulated value.
  1769. */
  1770. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1771. var index = -1,
  1772. length = array == null ? 0 : array.length;
  1773. if (initAccum && length) {
  1774. accumulator = array[++index];
  1775. }
  1776. while (++index < length) {
  1777. accumulator = iteratee(accumulator, array[index], index, array);
  1778. }
  1779. return accumulator;
  1780. }
  1781. /**
  1782. * A specialized version of `_.reduceRight` for arrays without support for
  1783. * iteratee shorthands.
  1784. *
  1785. * @private
  1786. * @param {Array} [array] The array to iterate over.
  1787. * @param {Function} iteratee The function invoked per iteration.
  1788. * @param {*} [accumulator] The initial value.
  1789. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1790. * the initial value.
  1791. * @returns {*} Returns the accumulated value.
  1792. */
  1793. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1794. var length = array == null ? 0 : array.length;
  1795. if (initAccum && length) {
  1796. accumulator = array[--length];
  1797. }
  1798. while (length--) {
  1799. accumulator = iteratee(accumulator, array[length], length, array);
  1800. }
  1801. return accumulator;
  1802. }
  1803. /**
  1804. * A specialized version of `_.some` for arrays without support for iteratee
  1805. * shorthands.
  1806. *
  1807. * @private
  1808. * @param {Array} [array] The array to iterate over.
  1809. * @param {Function} predicate The function invoked per iteration.
  1810. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1811. * else `false`.
  1812. */
  1813. function arraySome(array, predicate) {
  1814. var index = -1,
  1815. length = array == null ? 0 : array.length;
  1816. while (++index < length) {
  1817. if (predicate(array[index], index, array)) {
  1818. return true;
  1819. }
  1820. }
  1821. return false;
  1822. }
  1823. /**
  1824. * Gets the size of an ASCII `string`.
  1825. *
  1826. * @private
  1827. * @param {string} string The string inspect.
  1828. * @returns {number} Returns the string size.
  1829. */
  1830. var asciiSize = baseProperty('length');
  1831. /**
  1832. * Converts an ASCII `string` to an array.
  1833. *
  1834. * @private
  1835. * @param {string} string The string to convert.
  1836. * @returns {Array} Returns the converted array.
  1837. */
  1838. function asciiToArray(string) {
  1839. return string.split('');
  1840. }
  1841. /**
  1842. * Splits an ASCII `string` into an array of its words.
  1843. *
  1844. * @private
  1845. * @param {string} The string to inspect.
  1846. * @returns {Array} Returns the words of `string`.
  1847. */
  1848. function asciiWords(string) {
  1849. return string.match(reAsciiWord) || [];
  1850. }
  1851. /**
  1852. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1853. * without support for iteratee shorthands, which iterates over `collection`
  1854. * using `eachFunc`.
  1855. *
  1856. * @private
  1857. * @param {Array|Object} collection The collection to inspect.
  1858. * @param {Function} predicate The function invoked per iteration.
  1859. * @param {Function} eachFunc The function to iterate over `collection`.
  1860. * @returns {*} Returns the found element or its key, else `undefined`.
  1861. */
  1862. function baseFindKey(collection, predicate, eachFunc) {
  1863. var result;
  1864. eachFunc(collection, function(value, key, collection) {
  1865. if (predicate(value, key, collection)) {
  1866. result = key;
  1867. return false;
  1868. }
  1869. });
  1870. return result;
  1871. }
  1872. /**
  1873. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1874. * support for iteratee shorthands.
  1875. *
  1876. * @private
  1877. * @param {Array} array The array to inspect.
  1878. * @param {Function} predicate The function invoked per iteration.
  1879. * @param {number} fromIndex The index to search from.
  1880. * @param {boolean} [fromRight] Specify iterating from right to left.
  1881. * @returns {number} Returns the index of the matched value, else `-1`.
  1882. */
  1883. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1884. var length = array.length,
  1885. index = fromIndex + (fromRight ? 1 : -1);
  1886. while ((fromRight ? index-- : ++index < length)) {
  1887. if (predicate(array[index], index, array)) {
  1888. return index;
  1889. }
  1890. }
  1891. return -1;
  1892. }
  1893. /**
  1894. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1895. *
  1896. * @private
  1897. * @param {Array} array The array to inspect.
  1898. * @param {*} value The value to search for.
  1899. * @param {number} fromIndex The index to search from.
  1900. * @returns {number} Returns the index of the matched value, else `-1`.
  1901. */
  1902. function baseIndexOf(array, value, fromIndex) {
  1903. return value === value
  1904. ? strictIndexOf(array, value, fromIndex)
  1905. : baseFindIndex(array, baseIsNaN, fromIndex);
  1906. }
  1907. /**
  1908. * This function is like `baseIndexOf` except that it accepts a comparator.
  1909. *
  1910. * @private
  1911. * @param {Array} array The array to inspect.
  1912. * @param {*} value The value to search for.
  1913. * @param {number} fromIndex The index to search from.
  1914. * @param {Function} comparator The comparator invoked per element.
  1915. * @returns {number} Returns the index of the matched value, else `-1`.
  1916. */
  1917. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1918. var index = fromIndex - 1,
  1919. length = array.length;
  1920. while (++index < length) {
  1921. if (comparator(array[index], value)) {
  1922. return index;
  1923. }
  1924. }
  1925. return -1;
  1926. }
  1927. /**
  1928. * The base implementation of `_.isNaN` without support for number objects.
  1929. *
  1930. * @private
  1931. * @param {*} value The value to check.
  1932. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1933. */
  1934. function baseIsNaN(value) {
  1935. return value !== value;
  1936. }
  1937. /**
  1938. * The base implementation of `_.mean` and `_.meanBy` without support for
  1939. * iteratee shorthands.
  1940. *
  1941. * @private
  1942. * @param {Array} array The array to iterate over.
  1943. * @param {Function} iteratee The function invoked per iteration.
  1944. * @returns {number} Returns the mean.
  1945. */
  1946. function baseMean(array, iteratee) {
  1947. var length = array == null ? 0 : array.length;
  1948. return length ? (baseSum(array, iteratee) / length) : NAN;
  1949. }
  1950. /**
  1951. * The base implementation of `_.property` without support for deep paths.
  1952. *
  1953. * @private
  1954. * @param {string} key The key of the property to get.
  1955. * @returns {Function} Returns the new accessor function.
  1956. */
  1957. function baseProperty(key) {
  1958. return function(object) {
  1959. return object == null ? undefined : object[key];
  1960. };
  1961. }
  1962. /**
  1963. * The base implementation of `_.propertyOf` without support for deep paths.
  1964. *
  1965. * @private
  1966. * @param {Object} object The object to query.
  1967. * @returns {Function} Returns the new accessor function.
  1968. */
  1969. function basePropertyOf(object) {
  1970. return function(key) {
  1971. return object == null ? undefined : object[key];
  1972. };
  1973. }
  1974. /**
  1975. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1976. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1977. *
  1978. * @private
  1979. * @param {Array|Object} collection The collection to iterate over.
  1980. * @param {Function} iteratee The function invoked per iteration.
  1981. * @param {*} accumulator The initial value.
  1982. * @param {boolean} initAccum Specify using the first or last element of
  1983. * `collection` as the initial value.
  1984. * @param {Function} eachFunc The function to iterate over `collection`.
  1985. * @returns {*} Returns the accumulated value.
  1986. */
  1987. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1988. eachFunc(collection, function(value, index, collection) {
  1989. accumulator = initAccum
  1990. ? (initAccum = false, value)
  1991. : iteratee(accumulator, value, index, collection);
  1992. });
  1993. return accumulator;
  1994. }
  1995. /**
  1996. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1997. * sort order of `array` and replaces criteria objects with their corresponding
  1998. * values.
  1999. *
  2000. * @private
  2001. * @param {Array} array The array to sort.
  2002. * @param {Function} comparer The function to define sort order.
  2003. * @returns {Array} Returns `array`.
  2004. */
  2005. function baseSortBy(array, comparer) {
  2006. var length = array.length;
  2007. array.sort(comparer);
  2008. while (length--) {
  2009. array[length] = array[length].value;
  2010. }
  2011. return array;
  2012. }
  2013. /**
  2014. * The base implementation of `_.sum` and `_.sumBy` without support for
  2015. * iteratee shorthands.
  2016. *
  2017. * @private
  2018. * @param {Array} array The array to iterate over.
  2019. * @param {Function} iteratee The function invoked per iteration.
  2020. * @returns {number} Returns the sum.
  2021. */
  2022. function baseSum(array, iteratee) {
  2023. var result,
  2024. index = -1,
  2025. length = array.length;
  2026. while (++index < length) {
  2027. var current = iteratee(array[index]);
  2028. if (current !== undefined) {
  2029. result = result === undefined ? current : (result + current);
  2030. }
  2031. }
  2032. return result;
  2033. }
  2034. /**
  2035. * The base implementation of `_.times` without support for iteratee shorthands
  2036. * or max array length checks.
  2037. *
  2038. * @private
  2039. * @param {number} n The number of times to invoke `iteratee`.
  2040. * @param {Function} iteratee The function invoked per iteration.
  2041. * @returns {Array} Returns the array of results.
  2042. */
  2043. function baseTimes(n, iteratee) {
  2044. var index = -1,
  2045. result = Array(n);
  2046. while (++index < n) {
  2047. result[index] = iteratee(index);
  2048. }
  2049. return result;
  2050. }
  2051. /**
  2052. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2053. * of key-value pairs for `object` corresponding to the property names of `props`.
  2054. *
  2055. * @private
  2056. * @param {Object} object The object to query.
  2057. * @param {Array} props The property names to get values for.
  2058. * @returns {Object} Returns the key-value pairs.
  2059. */
  2060. function baseToPairs(object, props) {
  2061. return arrayMap(props, function(key) {
  2062. return [key, object[key]];
  2063. });
  2064. }
  2065. /**
  2066. * The base implementation of `_.trim`.
  2067. *
  2068. * @private
  2069. * @param {string} string The string to trim.
  2070. * @returns {string} Returns the trimmed string.
  2071. */
  2072. function baseTrim(string) {
  2073. return string
  2074. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2075. : string;
  2076. }
  2077. /**
  2078. * The base implementation of `_.unary` without support for storing metadata.
  2079. *
  2080. * @private
  2081. * @param {Function} func The function to cap arguments for.
  2082. * @returns {Function} Returns the new capped function.
  2083. */
  2084. function baseUnary(func) {
  2085. return function(value) {
  2086. return func(value);
  2087. };
  2088. }
  2089. /**
  2090. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2091. * array of `object` property values corresponding to the property names
  2092. * of `props`.
  2093. *
  2094. * @private
  2095. * @param {Object} object The object to query.
  2096. * @param {Array} props The property names to get values for.
  2097. * @returns {Object} Returns the array of property values.
  2098. */
  2099. function baseValues(object, props) {
  2100. return arrayMap(props, function(key) {
  2101. return object[key];
  2102. });
  2103. }
  2104. /**
  2105. * Checks if a `cache` value for `key` exists.
  2106. *
  2107. * @private
  2108. * @param {Object} cache The cache to query.
  2109. * @param {string} key The key of the entry to check.
  2110. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2111. */
  2112. function cacheHas(cache, key) {
  2113. return cache.has(key);
  2114. }
  2115. /**
  2116. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2117. * that is not found in the character symbols.
  2118. *
  2119. * @private
  2120. * @param {Array} strSymbols The string symbols to inspect.
  2121. * @param {Array} chrSymbols The character symbols to find.
  2122. * @returns {number} Returns the index of the first unmatched string symbol.
  2123. */
  2124. function charsStartIndex(strSymbols, chrSymbols) {
  2125. var index = -1,
  2126. length = strSymbols.length;
  2127. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2128. return index;
  2129. }
  2130. /**
  2131. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2132. * that is not found in the character symbols.
  2133. *
  2134. * @private
  2135. * @param {Array} strSymbols The string symbols to inspect.
  2136. * @param {Array} chrSymbols The character symbols to find.
  2137. * @returns {number} Returns the index of the last unmatched string symbol.
  2138. */
  2139. function charsEndIndex(strSymbols, chrSymbols) {
  2140. var index = strSymbols.length;
  2141. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2142. return index;
  2143. }
  2144. /**
  2145. * Gets the number of `placeholder` occurrences in `array`.
  2146. *
  2147. * @private
  2148. * @param {Array} array The array to inspect.
  2149. * @param {*} placeholder The placeholder to search for.
  2150. * @returns {number} Returns the placeholder count.
  2151. */
  2152. function countHolders(array, placeholder) {
  2153. var length = array.length,
  2154. result = 0;
  2155. while (length--) {
  2156. if (array[length] === placeholder) {
  2157. ++result;
  2158. }
  2159. }
  2160. return result;
  2161. }
  2162. /**
  2163. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2164. * letters to basic Latin letters.
  2165. *
  2166. * @private
  2167. * @param {string} letter The matched letter to deburr.
  2168. * @returns {string} Returns the deburred letter.
  2169. */
  2170. var deburrLetter = basePropertyOf(deburredLetters);
  2171. /**
  2172. * Used by `_.escape` to convert characters to HTML entities.
  2173. *
  2174. * @private
  2175. * @param {string} chr The matched character to escape.
  2176. * @returns {string} Returns the escaped character.
  2177. */
  2178. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2179. /**
  2180. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2181. *
  2182. * @private
  2183. * @param {string} chr The matched character to escape.
  2184. * @returns {string} Returns the escaped character.
  2185. */
  2186. function escapeStringChar(chr) {
  2187. return '\\' + stringEscapes[chr];
  2188. }
  2189. /**
  2190. * Gets the value at `key` of `object`.
  2191. *
  2192. * @private
  2193. * @param {Object} [object] The object to query.
  2194. * @param {string} key The key of the property to get.
  2195. * @returns {*} Returns the property value.
  2196. */
  2197. function getValue(object, key) {
  2198. return object == null ? undefined : object[key];
  2199. }
  2200. /**
  2201. * Checks if `string` contains Unicode symbols.
  2202. *
  2203. * @private
  2204. * @param {string} string The string to inspect.
  2205. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2206. */
  2207. function hasUnicode(string) {
  2208. return reHasUnicode.test(string);
  2209. }
  2210. /**
  2211. * Checks if `string` contains a word composed of Unicode symbols.
  2212. *
  2213. * @private
  2214. * @param {string} string The string to inspect.
  2215. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2216. */
  2217. function hasUnicodeWord(string) {
  2218. return reHasUnicodeWord.test(string);
  2219. }
  2220. /**
  2221. * Converts `iterator` to an array.
  2222. *
  2223. * @private
  2224. * @param {Object} iterator The iterator to convert.
  2225. * @returns {Array} Returns the converted array.
  2226. */
  2227. function iteratorToArray(iterator) {
  2228. var data,
  2229. result = [];
  2230. while (!(data = iterator.next()).done) {
  2231. result.push(data.value);
  2232. }
  2233. return result;
  2234. }
  2235. /**
  2236. * Converts `map` to its key-value pairs.
  2237. *
  2238. * @private
  2239. * @param {Object} map The map to convert.
  2240. * @returns {Array} Returns the key-value pairs.
  2241. */
  2242. function mapToArray(map) {
  2243. var index = -1,
  2244. result = Array(map.size);
  2245. map.forEach(function(value, key) {
  2246. result[++index] = [key, value];
  2247. });
  2248. return result;
  2249. }
  2250. /**
  2251. * Creates a unary function that invokes `func` with its argument transformed.
  2252. *
  2253. * @private
  2254. * @param {Function} func The function to wrap.
  2255. * @param {Function} transform The argument transform.
  2256. * @returns {Function} Returns the new function.
  2257. */
  2258. function overArg(func, transform) {
  2259. return function(arg) {
  2260. return func(transform(arg));
  2261. };
  2262. }
  2263. /**
  2264. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2265. * and returns an array of their indexes.
  2266. *
  2267. * @private
  2268. * @param {Array} array The array to modify.
  2269. * @param {*} placeholder The placeholder to replace.
  2270. * @returns {Array} Returns the new array of placeholder indexes.
  2271. */
  2272. function replaceHolders(array, placeholder) {
  2273. var index = -1,
  2274. length = array.length,
  2275. resIndex = 0,
  2276. result = [];
  2277. while (++index < length) {
  2278. var value = array[index];
  2279. if (value === placeholder || value === PLACEHOLDER) {
  2280. array[index] = PLACEHOLDER;
  2281. result[resIndex++] = index;
  2282. }
  2283. }
  2284. return result;
  2285. }
  2286. /**
  2287. * Converts `set` to an array of its values.
  2288. *
  2289. * @private
  2290. * @param {Object} set The set to convert.
  2291. * @returns {Array} Returns the values.
  2292. */
  2293. function setToArray(set) {
  2294. var index = -1,
  2295. result = Array(set.size);
  2296. set.forEach(function(value) {
  2297. result[++index] = value;
  2298. });
  2299. return result;
  2300. }
  2301. /**
  2302. * Converts `set` to its value-value pairs.
  2303. *
  2304. * @private
  2305. * @param {Object} set The set to convert.
  2306. * @returns {Array} Returns the value-value pairs.
  2307. */
  2308. function setToPairs(set) {
  2309. var index = -1,
  2310. result = Array(set.size);
  2311. set.forEach(function(value) {
  2312. result[++index] = [value, value];
  2313. });
  2314. return result;
  2315. }
  2316. /**
  2317. * A specialized version of `_.indexOf` which performs strict equality
  2318. * comparisons of values, i.e. `===`.
  2319. *
  2320. * @private
  2321. * @param {Array} array The array to inspect.
  2322. * @param {*} value The value to search for.
  2323. * @param {number} fromIndex The index to search from.
  2324. * @returns {number} Returns the index of the matched value, else `-1`.
  2325. */
  2326. function strictIndexOf(array, value, fromIndex) {
  2327. var index = fromIndex - 1,
  2328. length = array.length;
  2329. while (++index < length) {
  2330. if (array[index] === value) {
  2331. return index;
  2332. }
  2333. }
  2334. return -1;
  2335. }
  2336. /**
  2337. * A specialized version of `_.lastIndexOf` which performs strict equality
  2338. * comparisons of values, i.e. `===`.
  2339. *
  2340. * @private
  2341. * @param {Array} array The array to inspect.
  2342. * @param {*} value The value to search for.
  2343. * @param {number} fromIndex The index to search from.
  2344. * @returns {number} Returns the index of the matched value, else `-1`.
  2345. */
  2346. function strictLastIndexOf(array, value, fromIndex) {
  2347. var index = fromIndex + 1;
  2348. while (index--) {
  2349. if (array[index] === value) {
  2350. return index;
  2351. }
  2352. }
  2353. return index;
  2354. }
  2355. /**
  2356. * Gets the number of symbols in `string`.
  2357. *
  2358. * @private
  2359. * @param {string} string The string to inspect.
  2360. * @returns {number} Returns the string size.
  2361. */
  2362. function stringSize(string) {
  2363. return hasUnicode(string)
  2364. ? unicodeSize(string)
  2365. : asciiSize(string);
  2366. }
  2367. /**
  2368. * Converts `string` to an array.
  2369. *
  2370. * @private
  2371. * @param {string} string The string to convert.
  2372. * @returns {Array} Returns the converted array.
  2373. */
  2374. function stringToArray(string) {
  2375. return hasUnicode(string)
  2376. ? unicodeToArray(string)
  2377. : asciiToArray(string);
  2378. }
  2379. /**
  2380. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2381. * character of `string`.
  2382. *
  2383. * @private
  2384. * @param {string} string The string to inspect.
  2385. * @returns {number} Returns the index of the last non-whitespace character.
  2386. */
  2387. function trimmedEndIndex(string) {
  2388. var index = string.length;
  2389. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2390. return index;
  2391. }
  2392. /**
  2393. * Used by `_.unescape` to convert HTML entities to characters.
  2394. *
  2395. * @private
  2396. * @param {string} chr The matched character to unescape.
  2397. * @returns {string} Returns the unescaped character.
  2398. */
  2399. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2400. /**
  2401. * Gets the size of a Unicode `string`.
  2402. *
  2403. * @private
  2404. * @param {string} string The string inspect.
  2405. * @returns {number} Returns the string size.
  2406. */
  2407. function unicodeSize(string) {
  2408. var result = reUnicode.lastIndex = 0;
  2409. while (reUnicode.test(string)) {
  2410. ++result;
  2411. }
  2412. return result;
  2413. }
  2414. /**
  2415. * Converts a Unicode `string` to an array.
  2416. *
  2417. * @private
  2418. * @param {string} string The string to convert.
  2419. * @returns {Array} Returns the converted array.
  2420. */
  2421. function unicodeToArray(string) {
  2422. return string.match(reUnicode) || [];
  2423. }
  2424. /**
  2425. * Splits a Unicode `string` into an array of its words.
  2426. *
  2427. * @private
  2428. * @param {string} The string to inspect.
  2429. * @returns {Array} Returns the words of `string`.
  2430. */
  2431. function unicodeWords(string) {
  2432. return string.match(reUnicodeWord) || [];
  2433. }
  2434. /*--------------------------------------------------------------------------*/
  2435. /**
  2436. * Create a new pristine `lodash` function using the `context` object.
  2437. *
  2438. * @static
  2439. * @memberOf _
  2440. * @since 1.1.0
  2441. * @category Util
  2442. * @param {Object} [context=root] The context object.
  2443. * @returns {Function} Returns a new `lodash` function.
  2444. * @example
  2445. *
  2446. * _.mixin({ 'foo': _.constant('foo') });
  2447. *
  2448. * var lodash = _.runInContext();
  2449. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2450. *
  2451. * _.isFunction(_.foo);
  2452. * // => true
  2453. * _.isFunction(_.bar);
  2454. * // => false
  2455. *
  2456. * lodash.isFunction(lodash.foo);
  2457. * // => false
  2458. * lodash.isFunction(lodash.bar);
  2459. * // => true
  2460. *
  2461. * // Create a suped-up `defer` in Node.js.
  2462. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2463. */
  2464. var runInContext = (function runInContext(context) {
  2465. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2466. /** Built-in constructor references. */
  2467. var Array = context.Array,
  2468. Date = context.Date,
  2469. Error = context.Error,
  2470. Function = context.Function,
  2471. Math = context.Math,
  2472. Object = context.Object,
  2473. RegExp = context.RegExp,
  2474. String = context.String,
  2475. TypeError = context.TypeError;
  2476. /** Used for built-in method references. */
  2477. var arrayProto = Array.prototype,
  2478. funcProto = Function.prototype,
  2479. objectProto = Object.prototype;
  2480. /** Used to detect overreaching core-js shims. */
  2481. var coreJsData = context['__core-js_shared__'];
  2482. /** Used to resolve the decompiled source of functions. */
  2483. var funcToString = funcProto.toString;
  2484. /** Used to check objects for own properties. */
  2485. var hasOwnProperty = objectProto.hasOwnProperty;
  2486. /** Used to generate unique IDs. */
  2487. var idCounter = 0;
  2488. /** Used to detect methods masquerading as native. */
  2489. var maskSrcKey = (function() {
  2490. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2491. return uid ? ('Symbol(src)_1.' + uid) : '';
  2492. }());
  2493. /**
  2494. * Used to resolve the
  2495. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2496. * of values.
  2497. */
  2498. var nativeObjectToString = objectProto.toString;
  2499. /** Used to infer the `Object` constructor. */
  2500. var objectCtorString = funcToString.call(Object);
  2501. /** Used to restore the original `_` reference in `_.noConflict`. */
  2502. var oldDash = root._;
  2503. /** Used to detect if a method is native. */
  2504. var reIsNative = RegExp('^' +
  2505. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2506. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2507. );
  2508. /** Built-in value references. */
  2509. var Buffer = moduleExports ? context.Buffer : undefined,
  2510. Symbol = context.Symbol,
  2511. Uint8Array = context.Uint8Array,
  2512. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2513. getPrototype = overArg(Object.getPrototypeOf, Object),
  2514. objectCreate = Object.create,
  2515. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2516. splice = arrayProto.splice,
  2517. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2518. symIterator = Symbol ? Symbol.iterator : undefined,
  2519. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2520. var defineProperty = (function() {
  2521. try {
  2522. var func = getNative(Object, 'defineProperty');
  2523. func({}, '', {});
  2524. return func;
  2525. } catch (e) {}
  2526. }());
  2527. /** Mocked built-ins. */
  2528. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2529. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2530. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2531. /* Built-in method references for those with the same name as other `lodash` methods. */
  2532. var nativeCeil = Math.ceil,
  2533. nativeFloor = Math.floor,
  2534. nativeGetSymbols = Object.getOwnPropertySymbols,
  2535. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2536. nativeIsFinite = context.isFinite,
  2537. nativeJoin = arrayProto.join,
  2538. nativeKeys = overArg(Object.keys, Object),
  2539. nativeMax = Math.max,
  2540. nativeMin = Math.min,
  2541. nativeNow = Date.now,
  2542. nativeParseInt = context.parseInt,
  2543. nativeRandom = Math.random,
  2544. nativeReverse = arrayProto.reverse;
  2545. /* Built-in method references that are verified to be native. */
  2546. var DataView = getNative(context, 'DataView'),
  2547. Map = getNative(context, 'Map'),
  2548. Promise = getNative(context, 'Promise'),
  2549. Set = getNative(context, 'Set'),
  2550. WeakMap = getNative(context, 'WeakMap'),
  2551. nativeCreate = getNative(Object, 'create');
  2552. /** Used to store function metadata. */
  2553. var metaMap = WeakMap && new WeakMap;
  2554. /** Used to lookup unminified function names. */
  2555. var realNames = {};
  2556. /** Used to detect maps, sets, and weakmaps. */
  2557. var dataViewCtorString = toSource(DataView),
  2558. mapCtorString = toSource(Map),
  2559. promiseCtorString = toSource(Promise),
  2560. setCtorString = toSource(Set),
  2561. weakMapCtorString = toSource(WeakMap);
  2562. /** Used to convert symbols to primitives and strings. */
  2563. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2564. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2565. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2566. /*------------------------------------------------------------------------*/
  2567. /**
  2568. * Creates a `lodash` object which wraps `value` to enable implicit method
  2569. * chain sequences. Methods that operate on and return arrays, collections,
  2570. * and functions can be chained together. Methods that retrieve a single value
  2571. * or may return a primitive value will automatically end the chain sequence
  2572. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2573. * with `_#value`.
  2574. *
  2575. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2576. * enabled using `_.chain`.
  2577. *
  2578. * The execution of chained methods is lazy, that is, it's deferred until
  2579. * `_#value` is implicitly or explicitly called.
  2580. *
  2581. * Lazy evaluation allows several methods to support shortcut fusion.
  2582. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2583. * the creation of intermediate arrays and can greatly reduce the number of
  2584. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2585. * fusion if the section is applied to an array and iteratees accept only
  2586. * one argument. The heuristic for whether a section qualifies for shortcut
  2587. * fusion is subject to change.
  2588. *
  2589. * Chaining is supported in custom builds as long as the `_#value` method is
  2590. * directly or indirectly included in the build.
  2591. *
  2592. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2593. *
  2594. * The wrapper `Array` methods are:
  2595. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2596. *
  2597. * The wrapper `String` methods are:
  2598. * `replace` and `split`
  2599. *
  2600. * The wrapper methods that support shortcut fusion are:
  2601. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2602. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2603. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2604. *
  2605. * The chainable wrapper methods are:
  2606. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2607. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2608. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2609. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2610. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2611. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2612. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2613. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2614. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2615. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2616. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2617. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2618. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2619. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2620. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2621. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2622. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2623. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2624. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2625. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2626. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2627. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2628. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2629. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2630. *
  2631. * The wrapper methods that are **not** chainable by default are:
  2632. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2633. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2634. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2635. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2636. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2637. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2638. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2639. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2640. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2641. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2642. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2643. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2644. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2645. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2646. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2647. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2648. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2649. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2650. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2651. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2652. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2653. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2654. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2655. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2656. * `upperFirst`, `value`, and `words`
  2657. *
  2658. * @name _
  2659. * @constructor
  2660. * @category Seq
  2661. * @param {*} value The value to wrap in a `lodash` instance.
  2662. * @returns {Object} Returns the new `lodash` wrapper instance.
  2663. * @example
  2664. *
  2665. * function square(n) {
  2666. * return n * n;
  2667. * }
  2668. *
  2669. * var wrapped = _([1, 2, 3]);
  2670. *
  2671. * // Returns an unwrapped value.
  2672. * wrapped.reduce(_.add);
  2673. * // => 6
  2674. *
  2675. * // Returns a wrapped value.
  2676. * var squares = wrapped.map(square);
  2677. *
  2678. * _.isArray(squares);
  2679. * // => false
  2680. *
  2681. * _.isArray(squares.value());
  2682. * // => true
  2683. */
  2684. function lodash(value) {
  2685. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2686. if (value instanceof LodashWrapper) {
  2687. return value;
  2688. }
  2689. if (hasOwnProperty.call(value, '__wrapped__')) {
  2690. return wrapperClone(value);
  2691. }
  2692. }
  2693. return new LodashWrapper(value);
  2694. }
  2695. /**
  2696. * The base implementation of `_.create` without support for assigning
  2697. * properties to the created object.
  2698. *
  2699. * @private
  2700. * @param {Object} proto The object to inherit from.
  2701. * @returns {Object} Returns the new object.
  2702. */
  2703. var baseCreate = (function() {
  2704. function object() {}
  2705. return function(proto) {
  2706. if (!isObject(proto)) {
  2707. return {};
  2708. }
  2709. if (objectCreate) {
  2710. return objectCreate(proto);
  2711. }
  2712. object.prototype = proto;
  2713. var result = new object;
  2714. object.prototype = undefined;
  2715. return result;
  2716. };
  2717. }());
  2718. /**
  2719. * The function whose prototype chain sequence wrappers inherit from.
  2720. *
  2721. * @private
  2722. */
  2723. function baseLodash() {
  2724. // No operation performed.
  2725. }
  2726. /**
  2727. * The base constructor for creating `lodash` wrapper objects.
  2728. *
  2729. * @private
  2730. * @param {*} value The value to wrap.
  2731. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2732. */
  2733. function LodashWrapper(value, chainAll) {
  2734. this.__wrapped__ = value;
  2735. this.__actions__ = [];
  2736. this.__chain__ = !!chainAll;
  2737. this.__index__ = 0;
  2738. this.__values__ = undefined;
  2739. }
  2740. /**
  2741. * By default, the template delimiters used by lodash are like those in
  2742. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2743. * following template settings to use alternative delimiters.
  2744. *
  2745. * @static
  2746. * @memberOf _
  2747. * @type {Object}
  2748. */
  2749. lodash.templateSettings = {
  2750. /**
  2751. * Used to detect `data` property values to be HTML-escaped.
  2752. *
  2753. * @memberOf _.templateSettings
  2754. * @type {RegExp}
  2755. */
  2756. 'escape': reEscape,
  2757. /**
  2758. * Used to detect code to be evaluated.
  2759. *
  2760. * @memberOf _.templateSettings
  2761. * @type {RegExp}
  2762. */
  2763. 'evaluate': reEvaluate,
  2764. /**
  2765. * Used to detect `data` property values to inject.
  2766. *
  2767. * @memberOf _.templateSettings
  2768. * @type {RegExp}
  2769. */
  2770. 'interpolate': reInterpolate,
  2771. /**
  2772. * Used to reference the data object in the template text.
  2773. *
  2774. * @memberOf _.templateSettings
  2775. * @type {string}
  2776. */
  2777. 'variable': '',
  2778. /**
  2779. * Used to import variables into the compiled template.
  2780. *
  2781. * @memberOf _.templateSettings
  2782. * @type {Object}
  2783. */
  2784. 'imports': {
  2785. /**
  2786. * A reference to the `lodash` function.
  2787. *
  2788. * @memberOf _.templateSettings.imports
  2789. * @type {Function}
  2790. */
  2791. '_': lodash
  2792. }
  2793. };
  2794. // Ensure wrappers are instances of `baseLodash`.
  2795. lodash.prototype = baseLodash.prototype;
  2796. lodash.prototype.constructor = lodash;
  2797. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2798. LodashWrapper.prototype.constructor = LodashWrapper;
  2799. /*------------------------------------------------------------------------*/
  2800. /**
  2801. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2802. *
  2803. * @private
  2804. * @constructor
  2805. * @param {*} value The value to wrap.
  2806. */
  2807. function LazyWrapper(value) {
  2808. this.__wrapped__ = value;
  2809. this.__actions__ = [];
  2810. this.__dir__ = 1;
  2811. this.__filtered__ = false;
  2812. this.__iteratees__ = [];
  2813. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2814. this.__views__ = [];
  2815. }
  2816. /**
  2817. * Creates a clone of the lazy wrapper object.
  2818. *
  2819. * @private
  2820. * @name clone
  2821. * @memberOf LazyWrapper
  2822. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2823. */
  2824. function lazyClone() {
  2825. var result = new LazyWrapper(this.__wrapped__);
  2826. result.__actions__ = copyArray(this.__actions__);
  2827. result.__dir__ = this.__dir__;
  2828. result.__filtered__ = this.__filtered__;
  2829. result.__iteratees__ = copyArray(this.__iteratees__);
  2830. result.__takeCount__ = this.__takeCount__;
  2831. result.__views__ = copyArray(this.__views__);
  2832. return result;
  2833. }
  2834. /**
  2835. * Reverses the direction of lazy iteration.
  2836. *
  2837. * @private
  2838. * @name reverse
  2839. * @memberOf LazyWrapper
  2840. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2841. */
  2842. function lazyReverse() {
  2843. if (this.__filtered__) {
  2844. var result = new LazyWrapper(this);
  2845. result.__dir__ = -1;
  2846. result.__filtered__ = true;
  2847. } else {
  2848. result = this.clone();
  2849. result.__dir__ *= -1;
  2850. }
  2851. return result;
  2852. }
  2853. /**
  2854. * Extracts the unwrapped value from its lazy wrapper.
  2855. *
  2856. * @private
  2857. * @name value
  2858. * @memberOf LazyWrapper
  2859. * @returns {*} Returns the unwrapped value.
  2860. */
  2861. function lazyValue() {
  2862. var array = this.__wrapped__.value(),
  2863. dir = this.__dir__,
  2864. isArr = isArray(array),
  2865. isRight = dir < 0,
  2866. arrLength = isArr ? array.length : 0,
  2867. view = getView(0, arrLength, this.__views__),
  2868. start = view.start,
  2869. end = view.end,
  2870. length = end - start,
  2871. index = isRight ? end : (start - 1),
  2872. iteratees = this.__iteratees__,
  2873. iterLength = iteratees.length,
  2874. resIndex = 0,
  2875. takeCount = nativeMin(length, this.__takeCount__);
  2876. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2877. return baseWrapperValue(array, this.__actions__);
  2878. }
  2879. var result = [];
  2880. outer:
  2881. while (length-- && resIndex < takeCount) {
  2882. index += dir;
  2883. var iterIndex = -1,
  2884. value = array[index];
  2885. while (++iterIndex < iterLength) {
  2886. var data = iteratees[iterIndex],
  2887. iteratee = data.iteratee,
  2888. type = data.type,
  2889. computed = iteratee(value);
  2890. if (type == LAZY_MAP_FLAG) {
  2891. value = computed;
  2892. } else if (!computed) {
  2893. if (type == LAZY_FILTER_FLAG) {
  2894. continue outer;
  2895. } else {
  2896. break outer;
  2897. }
  2898. }
  2899. }
  2900. result[resIndex++] = value;
  2901. }
  2902. return result;
  2903. }
  2904. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2905. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2906. LazyWrapper.prototype.constructor = LazyWrapper;
  2907. /*------------------------------------------------------------------------*/
  2908. /**
  2909. * Creates a hash object.
  2910. *
  2911. * @private
  2912. * @constructor
  2913. * @param {Array} [entries] The key-value pairs to cache.
  2914. */
  2915. function Hash(entries) {
  2916. var index = -1,
  2917. length = entries == null ? 0 : entries.length;
  2918. this.clear();
  2919. while (++index < length) {
  2920. var entry = entries[index];
  2921. this.set(entry[0], entry[1]);
  2922. }
  2923. }
  2924. /**
  2925. * Removes all key-value entries from the hash.
  2926. *
  2927. * @private
  2928. * @name clear
  2929. * @memberOf Hash
  2930. */
  2931. function hashClear() {
  2932. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2933. this.size = 0;
  2934. }
  2935. /**
  2936. * Removes `key` and its value from the hash.
  2937. *
  2938. * @private
  2939. * @name delete
  2940. * @memberOf Hash
  2941. * @param {Object} hash The hash to modify.
  2942. * @param {string} key The key of the value to remove.
  2943. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2944. */
  2945. function hashDelete(key) {
  2946. var result = this.has(key) && delete this.__data__[key];
  2947. this.size -= result ? 1 : 0;
  2948. return result;
  2949. }
  2950. /**
  2951. * Gets the hash value for `key`.
  2952. *
  2953. * @private
  2954. * @name get
  2955. * @memberOf Hash
  2956. * @param {string} key The key of the value to get.
  2957. * @returns {*} Returns the entry value.
  2958. */
  2959. function hashGet(key) {
  2960. var data = this.__data__;
  2961. if (nativeCreate) {
  2962. var result = data[key];
  2963. return result === HASH_UNDEFINED ? undefined : result;
  2964. }
  2965. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2966. }
  2967. /**
  2968. * Checks if a hash value for `key` exists.
  2969. *
  2970. * @private
  2971. * @name has
  2972. * @memberOf Hash
  2973. * @param {string} key The key of the entry to check.
  2974. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2975. */
  2976. function hashHas(key) {
  2977. var data = this.__data__;
  2978. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2979. }
  2980. /**
  2981. * Sets the hash `key` to `value`.
  2982. *
  2983. * @private
  2984. * @name set
  2985. * @memberOf Hash
  2986. * @param {string} key The key of the value to set.
  2987. * @param {*} value The value to set.
  2988. * @returns {Object} Returns the hash instance.
  2989. */
  2990. function hashSet(key, value) {
  2991. var data = this.__data__;
  2992. this.size += this.has(key) ? 0 : 1;
  2993. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2994. return this;
  2995. }
  2996. // Add methods to `Hash`.
  2997. Hash.prototype.clear = hashClear;
  2998. Hash.prototype['delete'] = hashDelete;
  2999. Hash.prototype.get = hashGet;
  3000. Hash.prototype.has = hashHas;
  3001. Hash.prototype.set = hashSet;
  3002. /*------------------------------------------------------------------------*/
  3003. /**
  3004. * Creates an list cache object.
  3005. *
  3006. * @private
  3007. * @constructor
  3008. * @param {Array} [entries] The key-value pairs to cache.
  3009. */
  3010. function ListCache(entries) {
  3011. var index = -1,
  3012. length = entries == null ? 0 : entries.length;
  3013. this.clear();
  3014. while (++index < length) {
  3015. var entry = entries[index];
  3016. this.set(entry[0], entry[1]);
  3017. }
  3018. }
  3019. /**
  3020. * Removes all key-value entries from the list cache.
  3021. *
  3022. * @private
  3023. * @name clear
  3024. * @memberOf ListCache
  3025. */
  3026. function listCacheClear() {
  3027. this.__data__ = [];
  3028. this.size = 0;
  3029. }
  3030. /**
  3031. * Removes `key` and its value from the list cache.
  3032. *
  3033. * @private
  3034. * @name delete
  3035. * @memberOf ListCache
  3036. * @param {string} key The key of the value to remove.
  3037. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3038. */
  3039. function listCacheDelete(key) {
  3040. var data = this.__data__,
  3041. index = assocIndexOf(data, key);
  3042. if (index < 0) {
  3043. return false;
  3044. }
  3045. var lastIndex = data.length - 1;
  3046. if (index == lastIndex) {
  3047. data.pop();
  3048. } else {
  3049. splice.call(data, index, 1);
  3050. }
  3051. --this.size;
  3052. return true;
  3053. }
  3054. /**
  3055. * Gets the list cache value for `key`.
  3056. *
  3057. * @private
  3058. * @name get
  3059. * @memberOf ListCache
  3060. * @param {string} key The key of the value to get.
  3061. * @returns {*} Returns the entry value.
  3062. */
  3063. function listCacheGet(key) {
  3064. var data = this.__data__,
  3065. index = assocIndexOf(data, key);
  3066. return index < 0 ? undefined : data[index][1];
  3067. }
  3068. /**
  3069. * Checks if a list cache value for `key` exists.
  3070. *
  3071. * @private
  3072. * @name has
  3073. * @memberOf ListCache
  3074. * @param {string} key The key of the entry to check.
  3075. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3076. */
  3077. function listCacheHas(key) {
  3078. return assocIndexOf(this.__data__, key) > -1;
  3079. }
  3080. /**
  3081. * Sets the list cache `key` to `value`.
  3082. *
  3083. * @private
  3084. * @name set
  3085. * @memberOf ListCache
  3086. * @param {string} key The key of the value to set.
  3087. * @param {*} value The value to set.
  3088. * @returns {Object} Returns the list cache instance.
  3089. */
  3090. function listCacheSet(key, value) {
  3091. var data = this.__data__,
  3092. index = assocIndexOf(data, key);
  3093. if (index < 0) {
  3094. ++this.size;
  3095. data.push([key, value]);
  3096. } else {
  3097. data[index][1] = value;
  3098. }
  3099. return this;
  3100. }
  3101. // Add methods to `ListCache`.
  3102. ListCache.prototype.clear = listCacheClear;
  3103. ListCache.prototype['delete'] = listCacheDelete;
  3104. ListCache.prototype.get = listCacheGet;
  3105. ListCache.prototype.has = listCacheHas;
  3106. ListCache.prototype.set = listCacheSet;
  3107. /*------------------------------------------------------------------------*/
  3108. /**
  3109. * Creates a map cache object to store key-value pairs.
  3110. *
  3111. * @private
  3112. * @constructor
  3113. * @param {Array} [entries] The key-value pairs to cache.
  3114. */
  3115. function MapCache(entries) {
  3116. var index = -1,
  3117. length = entries == null ? 0 : entries.length;
  3118. this.clear();
  3119. while (++index < length) {
  3120. var entry = entries[index];
  3121. this.set(entry[0], entry[1]);
  3122. }
  3123. }
  3124. /**
  3125. * Removes all key-value entries from the map.
  3126. *
  3127. * @private
  3128. * @name clear
  3129. * @memberOf MapCache
  3130. */
  3131. function mapCacheClear() {
  3132. this.size = 0;
  3133. this.__data__ = {
  3134. 'hash': new Hash,
  3135. 'map': new (Map || ListCache),
  3136. 'string': new Hash
  3137. };
  3138. }
  3139. /**
  3140. * Removes `key` and its value from the map.
  3141. *
  3142. * @private
  3143. * @name delete
  3144. * @memberOf MapCache
  3145. * @param {string} key The key of the value to remove.
  3146. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3147. */
  3148. function mapCacheDelete(key) {
  3149. var result = getMapData(this, key)['delete'](key);
  3150. this.size -= result ? 1 : 0;
  3151. return result;
  3152. }
  3153. /**
  3154. * Gets the map value for `key`.
  3155. *
  3156. * @private
  3157. * @name get
  3158. * @memberOf MapCache
  3159. * @param {string} key The key of the value to get.
  3160. * @returns {*} Returns the entry value.
  3161. */
  3162. function mapCacheGet(key) {
  3163. return getMapData(this, key).get(key);
  3164. }
  3165. /**
  3166. * Checks if a map value for `key` exists.
  3167. *
  3168. * @private
  3169. * @name has
  3170. * @memberOf MapCache
  3171. * @param {string} key The key of the entry to check.
  3172. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3173. */
  3174. function mapCacheHas(key) {
  3175. return getMapData(this, key).has(key);
  3176. }
  3177. /**
  3178. * Sets the map `key` to `value`.
  3179. *
  3180. * @private
  3181. * @name set
  3182. * @memberOf MapCache
  3183. * @param {string} key The key of the value to set.
  3184. * @param {*} value The value to set.
  3185. * @returns {Object} Returns the map cache instance.
  3186. */
  3187. function mapCacheSet(key, value) {
  3188. var data = getMapData(this, key),
  3189. size = data.size;
  3190. data.set(key, value);
  3191. this.size += data.size == size ? 0 : 1;
  3192. return this;
  3193. }
  3194. // Add methods to `MapCache`.
  3195. MapCache.prototype.clear = mapCacheClear;
  3196. MapCache.prototype['delete'] = mapCacheDelete;
  3197. MapCache.prototype.get = mapCacheGet;
  3198. MapCache.prototype.has = mapCacheHas;
  3199. MapCache.prototype.set = mapCacheSet;
  3200. /*------------------------------------------------------------------------*/
  3201. /**
  3202. *
  3203. * Creates an array cache object to store unique values.
  3204. *
  3205. * @private
  3206. * @constructor
  3207. * @param {Array} [values] The values to cache.
  3208. */
  3209. function SetCache(values) {
  3210. var index = -1,
  3211. length = values == null ? 0 : values.length;
  3212. this.__data__ = new MapCache;
  3213. while (++index < length) {
  3214. this.add(values[index]);
  3215. }
  3216. }
  3217. /**
  3218. * Adds `value` to the array cache.
  3219. *
  3220. * @private
  3221. * @name add
  3222. * @memberOf SetCache
  3223. * @alias push
  3224. * @param {*} value The value to cache.
  3225. * @returns {Object} Returns the cache instance.
  3226. */
  3227. function setCacheAdd(value) {
  3228. this.__data__.set(value, HASH_UNDEFINED);
  3229. return this;
  3230. }
  3231. /**
  3232. * Checks if `value` is in the array cache.
  3233. *
  3234. * @private
  3235. * @name has
  3236. * @memberOf SetCache
  3237. * @param {*} value The value to search for.
  3238. * @returns {number} Returns `true` if `value` is found, else `false`.
  3239. */
  3240. function setCacheHas(value) {
  3241. return this.__data__.has(value);
  3242. }
  3243. // Add methods to `SetCache`.
  3244. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3245. SetCache.prototype.has = setCacheHas;
  3246. /*------------------------------------------------------------------------*/
  3247. /**
  3248. * Creates a stack cache object to store key-value pairs.
  3249. *
  3250. * @private
  3251. * @constructor
  3252. * @param {Array} [entries] The key-value pairs to cache.
  3253. */
  3254. function Stack(entries) {
  3255. var data = this.__data__ = new ListCache(entries);
  3256. this.size = data.size;
  3257. }
  3258. /**
  3259. * Removes all key-value entries from the stack.
  3260. *
  3261. * @private
  3262. * @name clear
  3263. * @memberOf Stack
  3264. */
  3265. function stackClear() {
  3266. this.__data__ = new ListCache;
  3267. this.size = 0;
  3268. }
  3269. /**
  3270. * Removes `key` and its value from the stack.
  3271. *
  3272. * @private
  3273. * @name delete
  3274. * @memberOf Stack
  3275. * @param {string} key The key of the value to remove.
  3276. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3277. */
  3278. function stackDelete(key) {
  3279. var data = this.__data__,
  3280. result = data['delete'](key);
  3281. this.size = data.size;
  3282. return result;
  3283. }
  3284. /**
  3285. * Gets the stack value for `key`.
  3286. *
  3287. * @private
  3288. * @name get
  3289. * @memberOf Stack
  3290. * @param {string} key The key of the value to get.
  3291. * @returns {*} Returns the entry value.
  3292. */
  3293. function stackGet(key) {
  3294. return this.__data__.get(key);
  3295. }
  3296. /**
  3297. * Checks if a stack value for `key` exists.
  3298. *
  3299. * @private
  3300. * @name has
  3301. * @memberOf Stack
  3302. * @param {string} key The key of the entry to check.
  3303. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3304. */
  3305. function stackHas(key) {
  3306. return this.__data__.has(key);
  3307. }
  3308. /**
  3309. * Sets the stack `key` to `value`.
  3310. *
  3311. * @private
  3312. * @name set
  3313. * @memberOf Stack
  3314. * @param {string} key The key of the value to set.
  3315. * @param {*} value The value to set.
  3316. * @returns {Object} Returns the stack cache instance.
  3317. */
  3318. function stackSet(key, value) {
  3319. var data = this.__data__;
  3320. if (data instanceof ListCache) {
  3321. var pairs = data.__data__;
  3322. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3323. pairs.push([key, value]);
  3324. this.size = ++data.size;
  3325. return this;
  3326. }
  3327. data = this.__data__ = new MapCache(pairs);
  3328. }
  3329. data.set(key, value);
  3330. this.size = data.size;
  3331. return this;
  3332. }
  3333. // Add methods to `Stack`.
  3334. Stack.prototype.clear = stackClear;
  3335. Stack.prototype['delete'] = stackDelete;
  3336. Stack.prototype.get = stackGet;
  3337. Stack.prototype.has = stackHas;
  3338. Stack.prototype.set = stackSet;
  3339. /*------------------------------------------------------------------------*/
  3340. /**
  3341. * Creates an array of the enumerable property names of the array-like `value`.
  3342. *
  3343. * @private
  3344. * @param {*} value The value to query.
  3345. * @param {boolean} inherited Specify returning inherited property names.
  3346. * @returns {Array} Returns the array of property names.
  3347. */
  3348. function arrayLikeKeys(value, inherited) {
  3349. var isArr = isArray(value),
  3350. isArg = !isArr && isArguments(value),
  3351. isBuff = !isArr && !isArg && isBuffer(value),
  3352. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3353. skipIndexes = isArr || isArg || isBuff || isType,
  3354. result = skipIndexes ? baseTimes(value.length, String) : [],
  3355. length = result.length;
  3356. for (var key in value) {
  3357. if ((inherited || hasOwnProperty.call(value, key)) &&
  3358. !(skipIndexes && (
  3359. // Safari 9 has enumerable `arguments.length` in strict mode.
  3360. key == 'length' ||
  3361. // Node.js 0.10 has enumerable non-index properties on buffers.
  3362. (isBuff && (key == 'offset' || key == 'parent')) ||
  3363. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3364. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3365. // Skip index properties.
  3366. isIndex(key, length)
  3367. ))) {
  3368. result.push(key);
  3369. }
  3370. }
  3371. return result;
  3372. }
  3373. /**
  3374. * A specialized version of `_.sample` for arrays.
  3375. *
  3376. * @private
  3377. * @param {Array} array The array to sample.
  3378. * @returns {*} Returns the random element.
  3379. */
  3380. function arraySample(array) {
  3381. var length = array.length;
  3382. return length ? array[baseRandom(0, length - 1)] : undefined;
  3383. }
  3384. /**
  3385. * A specialized version of `_.sampleSize` for arrays.
  3386. *
  3387. * @private
  3388. * @param {Array} array The array to sample.
  3389. * @param {number} n The number of elements to sample.
  3390. * @returns {Array} Returns the random elements.
  3391. */
  3392. function arraySampleSize(array, n) {
  3393. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3394. }
  3395. /**
  3396. * A specialized version of `_.shuffle` for arrays.
  3397. *
  3398. * @private
  3399. * @param {Array} array The array to shuffle.
  3400. * @returns {Array} Returns the new shuffled array.
  3401. */
  3402. function arrayShuffle(array) {
  3403. return shuffleSelf(copyArray(array));
  3404. }
  3405. /**
  3406. * This function is like `assignValue` except that it doesn't assign
  3407. * `undefined` values.
  3408. *
  3409. * @private
  3410. * @param {Object} object The object to modify.
  3411. * @param {string} key The key of the property to assign.
  3412. * @param {*} value The value to assign.
  3413. */
  3414. function assignMergeValue(object, key, value) {
  3415. if ((value !== undefined && !eq(object[key], value)) ||
  3416. (value === undefined && !(key in object))) {
  3417. baseAssignValue(object, key, value);
  3418. }
  3419. }
  3420. /**
  3421. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3422. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3423. * for equality comparisons.
  3424. *
  3425. * @private
  3426. * @param {Object} object The object to modify.
  3427. * @param {string} key The key of the property to assign.
  3428. * @param {*} value The value to assign.
  3429. */
  3430. function assignValue(object, key, value) {
  3431. var objValue = object[key];
  3432. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3433. (value === undefined && !(key in object))) {
  3434. baseAssignValue(object, key, value);
  3435. }
  3436. }
  3437. /**
  3438. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3439. *
  3440. * @private
  3441. * @param {Array} array The array to inspect.
  3442. * @param {*} key The key to search for.
  3443. * @returns {number} Returns the index of the matched value, else `-1`.
  3444. */
  3445. function assocIndexOf(array, key) {
  3446. var length = array.length;
  3447. while (length--) {
  3448. if (eq(array[length][0], key)) {
  3449. return length;
  3450. }
  3451. }
  3452. return -1;
  3453. }
  3454. /**
  3455. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3456. * by `iteratee` and values set by `setter`.
  3457. *
  3458. * @private
  3459. * @param {Array|Object} collection The collection to iterate over.
  3460. * @param {Function} setter The function to set `accumulator` values.
  3461. * @param {Function} iteratee The iteratee to transform keys.
  3462. * @param {Object} accumulator The initial aggregated object.
  3463. * @returns {Function} Returns `accumulator`.
  3464. */
  3465. function baseAggregator(collection, setter, iteratee, accumulator) {
  3466. baseEach(collection, function(value, key, collection) {
  3467. setter(accumulator, value, iteratee(value), collection);
  3468. });
  3469. return accumulator;
  3470. }
  3471. /**
  3472. * The base implementation of `_.assign` without support for multiple sources
  3473. * or `customizer` functions.
  3474. *
  3475. * @private
  3476. * @param {Object} object The destination object.
  3477. * @param {Object} source The source object.
  3478. * @returns {Object} Returns `object`.
  3479. */
  3480. function baseAssign(object, source) {
  3481. return object && copyObject(source, keys(source), object);
  3482. }
  3483. /**
  3484. * The base implementation of `_.assignIn` without support for multiple sources
  3485. * or `customizer` functions.
  3486. *
  3487. * @private
  3488. * @param {Object} object The destination object.
  3489. * @param {Object} source The source object.
  3490. * @returns {Object} Returns `object`.
  3491. */
  3492. function baseAssignIn(object, source) {
  3493. return object && copyObject(source, keysIn(source), object);
  3494. }
  3495. /**
  3496. * The base implementation of `assignValue` and `assignMergeValue` without
  3497. * value checks.
  3498. *
  3499. * @private
  3500. * @param {Object} object The object to modify.
  3501. * @param {string} key The key of the property to assign.
  3502. * @param {*} value The value to assign.
  3503. */
  3504. function baseAssignValue(object, key, value) {
  3505. if (key == '__proto__' && defineProperty) {
  3506. defineProperty(object, key, {
  3507. 'configurable': true,
  3508. 'enumerable': true,
  3509. 'value': value,
  3510. 'writable': true
  3511. });
  3512. } else {
  3513. object[key] = value;
  3514. }
  3515. }
  3516. /**
  3517. * The base implementation of `_.at` without support for individual paths.
  3518. *
  3519. * @private
  3520. * @param {Object} object The object to iterate over.
  3521. * @param {string[]} paths The property paths to pick.
  3522. * @returns {Array} Returns the picked elements.
  3523. */
  3524. function baseAt(object, paths) {
  3525. var index = -1,
  3526. length = paths.length,
  3527. result = Array(length),
  3528. skip = object == null;
  3529. while (++index < length) {
  3530. result[index] = skip ? undefined : get(object, paths[index]);
  3531. }
  3532. return result;
  3533. }
  3534. /**
  3535. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3536. *
  3537. * @private
  3538. * @param {number} number The number to clamp.
  3539. * @param {number} [lower] The lower bound.
  3540. * @param {number} upper The upper bound.
  3541. * @returns {number} Returns the clamped number.
  3542. */
  3543. function baseClamp(number, lower, upper) {
  3544. if (number === number) {
  3545. if (upper !== undefined) {
  3546. number = number <= upper ? number : upper;
  3547. }
  3548. if (lower !== undefined) {
  3549. number = number >= lower ? number : lower;
  3550. }
  3551. }
  3552. return number;
  3553. }
  3554. /**
  3555. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3556. * traversed objects.
  3557. *
  3558. * @private
  3559. * @param {*} value The value to clone.
  3560. * @param {boolean} bitmask The bitmask flags.
  3561. * 1 - Deep clone
  3562. * 2 - Flatten inherited properties
  3563. * 4 - Clone symbols
  3564. * @param {Function} [customizer] The function to customize cloning.
  3565. * @param {string} [key] The key of `value`.
  3566. * @param {Object} [object] The parent object of `value`.
  3567. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3568. * @returns {*} Returns the cloned value.
  3569. */
  3570. function baseClone(value, bitmask, customizer, key, object, stack) {
  3571. var result,
  3572. isDeep = bitmask & CLONE_DEEP_FLAG,
  3573. isFlat = bitmask & CLONE_FLAT_FLAG,
  3574. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3575. if (customizer) {
  3576. result = object ? customizer(value, key, object, stack) : customizer(value);
  3577. }
  3578. if (result !== undefined) {
  3579. return result;
  3580. }
  3581. if (!isObject(value)) {
  3582. return value;
  3583. }
  3584. var isArr = isArray(value);
  3585. if (isArr) {
  3586. result = initCloneArray(value);
  3587. if (!isDeep) {
  3588. return copyArray(value, result);
  3589. }
  3590. } else {
  3591. var tag = getTag(value),
  3592. isFunc = tag == funcTag || tag == genTag;
  3593. if (isBuffer(value)) {
  3594. return cloneBuffer(value, isDeep);
  3595. }
  3596. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3597. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3598. if (!isDeep) {
  3599. return isFlat
  3600. ? copySymbolsIn(value, baseAssignIn(result, value))
  3601. : copySymbols(value, baseAssign(result, value));
  3602. }
  3603. } else {
  3604. if (!cloneableTags[tag]) {
  3605. return object ? value : {};
  3606. }
  3607. result = initCloneByTag(value, tag, isDeep);
  3608. }
  3609. }
  3610. // Check for circular references and return its corresponding clone.
  3611. stack || (stack = new Stack);
  3612. var stacked = stack.get(value);
  3613. if (stacked) {
  3614. return stacked;
  3615. }
  3616. stack.set(value, result);
  3617. if (isSet(value)) {
  3618. value.forEach(function(subValue) {
  3619. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3620. });
  3621. } else if (isMap(value)) {
  3622. value.forEach(function(subValue, key) {
  3623. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3624. });
  3625. }
  3626. var keysFunc = isFull
  3627. ? (isFlat ? getAllKeysIn : getAllKeys)
  3628. : (isFlat ? keysIn : keys);
  3629. var props = isArr ? undefined : keysFunc(value);
  3630. arrayEach(props || value, function(subValue, key) {
  3631. if (props) {
  3632. key = subValue;
  3633. subValue = value[key];
  3634. }
  3635. // Recursively populate clone (susceptible to call stack limits).
  3636. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3637. });
  3638. return result;
  3639. }
  3640. /**
  3641. * The base implementation of `_.conforms` which doesn't clone `source`.
  3642. *
  3643. * @private
  3644. * @param {Object} source The object of property predicates to conform to.
  3645. * @returns {Function} Returns the new spec function.
  3646. */
  3647. function baseConforms(source) {
  3648. var props = keys(source);
  3649. return function(object) {
  3650. return baseConformsTo(object, source, props);
  3651. };
  3652. }
  3653. /**
  3654. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3655. *
  3656. * @private
  3657. * @param {Object} object The object to inspect.
  3658. * @param {Object} source The object of property predicates to conform to.
  3659. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3660. */
  3661. function baseConformsTo(object, source, props) {
  3662. var length = props.length;
  3663. if (object == null) {
  3664. return !length;
  3665. }
  3666. object = Object(object);
  3667. while (length--) {
  3668. var key = props[length],
  3669. predicate = source[key],
  3670. value = object[key];
  3671. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3672. return false;
  3673. }
  3674. }
  3675. return true;
  3676. }
  3677. /**
  3678. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3679. * to provide to `func`.
  3680. *
  3681. * @private
  3682. * @param {Function} func The function to delay.
  3683. * @param {number} wait The number of milliseconds to delay invocation.
  3684. * @param {Array} args The arguments to provide to `func`.
  3685. * @returns {number|Object} Returns the timer id or timeout object.
  3686. */
  3687. function baseDelay(func, wait, args) {
  3688. if (typeof func != 'function') {
  3689. throw new TypeError(FUNC_ERROR_TEXT);
  3690. }
  3691. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3692. }
  3693. /**
  3694. * The base implementation of methods like `_.difference` without support
  3695. * for excluding multiple arrays or iteratee shorthands.
  3696. *
  3697. * @private
  3698. * @param {Array} array The array to inspect.
  3699. * @param {Array} values The values to exclude.
  3700. * @param {Function} [iteratee] The iteratee invoked per element.
  3701. * @param {Function} [comparator] The comparator invoked per element.
  3702. * @returns {Array} Returns the new array of filtered values.
  3703. */
  3704. function baseDifference(array, values, iteratee, comparator) {
  3705. var index = -1,
  3706. includes = arrayIncludes,
  3707. isCommon = true,
  3708. length = array.length,
  3709. result = [],
  3710. valuesLength = values.length;
  3711. if (!length) {
  3712. return result;
  3713. }
  3714. if (iteratee) {
  3715. values = arrayMap(values, baseUnary(iteratee));
  3716. }
  3717. if (comparator) {
  3718. includes = arrayIncludesWith;
  3719. isCommon = false;
  3720. }
  3721. else if (values.length >= LARGE_ARRAY_SIZE) {
  3722. includes = cacheHas;
  3723. isCommon = false;
  3724. values = new SetCache(values);
  3725. }
  3726. outer:
  3727. while (++index < length) {
  3728. var value = array[index],
  3729. computed = iteratee == null ? value : iteratee(value);
  3730. value = (comparator || value !== 0) ? value : 0;
  3731. if (isCommon && computed === computed) {
  3732. var valuesIndex = valuesLength;
  3733. while (valuesIndex--) {
  3734. if (values[valuesIndex] === computed) {
  3735. continue outer;
  3736. }
  3737. }
  3738. result.push(value);
  3739. }
  3740. else if (!includes(values, computed, comparator)) {
  3741. result.push(value);
  3742. }
  3743. }
  3744. return result;
  3745. }
  3746. /**
  3747. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3748. *
  3749. * @private
  3750. * @param {Array|Object} collection The collection to iterate over.
  3751. * @param {Function} iteratee The function invoked per iteration.
  3752. * @returns {Array|Object} Returns `collection`.
  3753. */
  3754. var baseEach = createBaseEach(baseForOwn);
  3755. /**
  3756. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3757. *
  3758. * @private
  3759. * @param {Array|Object} collection The collection to iterate over.
  3760. * @param {Function} iteratee The function invoked per iteration.
  3761. * @returns {Array|Object} Returns `collection`.
  3762. */
  3763. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3764. /**
  3765. * The base implementation of `_.every` without support for iteratee shorthands.
  3766. *
  3767. * @private
  3768. * @param {Array|Object} collection The collection to iterate over.
  3769. * @param {Function} predicate The function invoked per iteration.
  3770. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3771. * else `false`
  3772. */
  3773. function baseEvery(collection, predicate) {
  3774. var result = true;
  3775. baseEach(collection, function(value, index, collection) {
  3776. result = !!predicate(value, index, collection);
  3777. return result;
  3778. });
  3779. return result;
  3780. }
  3781. /**
  3782. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3783. * `comparator` to determine the extremum value.
  3784. *
  3785. * @private
  3786. * @param {Array} array The array to iterate over.
  3787. * @param {Function} iteratee The iteratee invoked per iteration.
  3788. * @param {Function} comparator The comparator used to compare values.
  3789. * @returns {*} Returns the extremum value.
  3790. */
  3791. function baseExtremum(array, iteratee, comparator) {
  3792. var index = -1,
  3793. length = array.length;
  3794. while (++index < length) {
  3795. var value = array[index],
  3796. current = iteratee(value);
  3797. if (current != null && (computed === undefined
  3798. ? (current === current && !isSymbol(current))
  3799. : comparator(current, computed)
  3800. )) {
  3801. var computed = current,
  3802. result = value;
  3803. }
  3804. }
  3805. return result;
  3806. }
  3807. /**
  3808. * The base implementation of `_.fill` without an iteratee call guard.
  3809. *
  3810. * @private
  3811. * @param {Array} array The array to fill.
  3812. * @param {*} value The value to fill `array` with.
  3813. * @param {number} [start=0] The start position.
  3814. * @param {number} [end=array.length] The end position.
  3815. * @returns {Array} Returns `array`.
  3816. */
  3817. function baseFill(array, value, start, end) {
  3818. var length = array.length;
  3819. start = toInteger(start);
  3820. if (start < 0) {
  3821. start = -start > length ? 0 : (length + start);
  3822. }
  3823. end = (end === undefined || end > length) ? length : toInteger(end);
  3824. if (end < 0) {
  3825. end += length;
  3826. }
  3827. end = start > end ? 0 : toLength(end);
  3828. while (start < end) {
  3829. array[start++] = value;
  3830. }
  3831. return array;
  3832. }
  3833. /**
  3834. * The base implementation of `_.filter` without support for iteratee shorthands.
  3835. *
  3836. * @private
  3837. * @param {Array|Object} collection The collection to iterate over.
  3838. * @param {Function} predicate The function invoked per iteration.
  3839. * @returns {Array} Returns the new filtered array.
  3840. */
  3841. function baseFilter(collection, predicate) {
  3842. var result = [];
  3843. baseEach(collection, function(value, index, collection) {
  3844. if (predicate(value, index, collection)) {
  3845. result.push(value);
  3846. }
  3847. });
  3848. return result;
  3849. }
  3850. /**
  3851. * The base implementation of `_.flatten` with support for restricting flattening.
  3852. *
  3853. * @private
  3854. * @param {Array} array The array to flatten.
  3855. * @param {number} depth The maximum recursion depth.
  3856. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3857. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3858. * @param {Array} [result=[]] The initial result value.
  3859. * @returns {Array} Returns the new flattened array.
  3860. */
  3861. function baseFlatten(array, depth, predicate, isStrict, result) {
  3862. var index = -1,
  3863. length = array.length;
  3864. predicate || (predicate = isFlattenable);
  3865. result || (result = []);
  3866. while (++index < length) {
  3867. var value = array[index];
  3868. if (depth > 0 && predicate(value)) {
  3869. if (depth > 1) {
  3870. // Recursively flatten arrays (susceptible to call stack limits).
  3871. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3872. } else {
  3873. arrayPush(result, value);
  3874. }
  3875. } else if (!isStrict) {
  3876. result[result.length] = value;
  3877. }
  3878. }
  3879. return result;
  3880. }
  3881. /**
  3882. * The base implementation of `baseForOwn` which iterates over `object`
  3883. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3884. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3885. *
  3886. * @private
  3887. * @param {Object} object The object to iterate over.
  3888. * @param {Function} iteratee The function invoked per iteration.
  3889. * @param {Function} keysFunc The function to get the keys of `object`.
  3890. * @returns {Object} Returns `object`.
  3891. */
  3892. var baseFor = createBaseFor();
  3893. /**
  3894. * This function is like `baseFor` except that it iterates over properties
  3895. * in the opposite order.
  3896. *
  3897. * @private
  3898. * @param {Object} object The object to iterate over.
  3899. * @param {Function} iteratee The function invoked per iteration.
  3900. * @param {Function} keysFunc The function to get the keys of `object`.
  3901. * @returns {Object} Returns `object`.
  3902. */
  3903. var baseForRight = createBaseFor(true);
  3904. /**
  3905. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3906. *
  3907. * @private
  3908. * @param {Object} object The object to iterate over.
  3909. * @param {Function} iteratee The function invoked per iteration.
  3910. * @returns {Object} Returns `object`.
  3911. */
  3912. function baseForOwn(object, iteratee) {
  3913. return object && baseFor(object, iteratee, keys);
  3914. }
  3915. /**
  3916. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3917. *
  3918. * @private
  3919. * @param {Object} object The object to iterate over.
  3920. * @param {Function} iteratee The function invoked per iteration.
  3921. * @returns {Object} Returns `object`.
  3922. */
  3923. function baseForOwnRight(object, iteratee) {
  3924. return object && baseForRight(object, iteratee, keys);
  3925. }
  3926. /**
  3927. * The base implementation of `_.functions` which creates an array of
  3928. * `object` function property names filtered from `props`.
  3929. *
  3930. * @private
  3931. * @param {Object} object The object to inspect.
  3932. * @param {Array} props The property names to filter.
  3933. * @returns {Array} Returns the function names.
  3934. */
  3935. function baseFunctions(object, props) {
  3936. return arrayFilter(props, function(key) {
  3937. return isFunction(object[key]);
  3938. });
  3939. }
  3940. /**
  3941. * The base implementation of `_.get` without support for default values.
  3942. *
  3943. * @private
  3944. * @param {Object} object The object to query.
  3945. * @param {Array|string} path The path of the property to get.
  3946. * @returns {*} Returns the resolved value.
  3947. */
  3948. function baseGet(object, path) {
  3949. path = castPath(path, object);
  3950. var index = 0,
  3951. length = path.length;
  3952. while (object != null && index < length) {
  3953. object = object[toKey(path[index++])];
  3954. }
  3955. return (index && index == length) ? object : undefined;
  3956. }
  3957. /**
  3958. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3959. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3960. * symbols of `object`.
  3961. *
  3962. * @private
  3963. * @param {Object} object The object to query.
  3964. * @param {Function} keysFunc The function to get the keys of `object`.
  3965. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3966. * @returns {Array} Returns the array of property names and symbols.
  3967. */
  3968. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3969. var result = keysFunc(object);
  3970. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3971. }
  3972. /**
  3973. * The base implementation of `getTag` without fallbacks for buggy environments.
  3974. *
  3975. * @private
  3976. * @param {*} value The value to query.
  3977. * @returns {string} Returns the `toStringTag`.
  3978. */
  3979. function baseGetTag(value) {
  3980. if (value == null) {
  3981. return value === undefined ? undefinedTag : nullTag;
  3982. }
  3983. return (symToStringTag && symToStringTag in Object(value))
  3984. ? getRawTag(value)
  3985. : objectToString(value);
  3986. }
  3987. /**
  3988. * The base implementation of `_.gt` which doesn't coerce arguments.
  3989. *
  3990. * @private
  3991. * @param {*} value The value to compare.
  3992. * @param {*} other The other value to compare.
  3993. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3994. * else `false`.
  3995. */
  3996. function baseGt(value, other) {
  3997. return value > other;
  3998. }
  3999. /**
  4000. * The base implementation of `_.has` without support for deep paths.
  4001. *
  4002. * @private
  4003. * @param {Object} [object] The object to query.
  4004. * @param {Array|string} key The key to check.
  4005. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4006. */
  4007. function baseHas(object, key) {
  4008. return object != null && hasOwnProperty.call(object, key);
  4009. }
  4010. /**
  4011. * The base implementation of `_.hasIn` without support for deep paths.
  4012. *
  4013. * @private
  4014. * @param {Object} [object] The object to query.
  4015. * @param {Array|string} key The key to check.
  4016. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4017. */
  4018. function baseHasIn(object, key) {
  4019. return object != null && key in Object(object);
  4020. }
  4021. /**
  4022. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4023. *
  4024. * @private
  4025. * @param {number} number The number to check.
  4026. * @param {number} start The start of the range.
  4027. * @param {number} end The end of the range.
  4028. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4029. */
  4030. function baseInRange(number, start, end) {
  4031. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4032. }
  4033. /**
  4034. * The base implementation of methods like `_.intersection`, without support
  4035. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4036. *
  4037. * @private
  4038. * @param {Array} arrays The arrays to inspect.
  4039. * @param {Function} [iteratee] The iteratee invoked per element.
  4040. * @param {Function} [comparator] The comparator invoked per element.
  4041. * @returns {Array} Returns the new array of shared values.
  4042. */
  4043. function baseIntersection(arrays, iteratee, comparator) {
  4044. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4045. length = arrays[0].length,
  4046. othLength = arrays.length,
  4047. othIndex = othLength,
  4048. caches = Array(othLength),
  4049. maxLength = Infinity,
  4050. result = [];
  4051. while (othIndex--) {
  4052. var array = arrays[othIndex];
  4053. if (othIndex && iteratee) {
  4054. array = arrayMap(array, baseUnary(iteratee));
  4055. }
  4056. maxLength = nativeMin(array.length, maxLength);
  4057. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4058. ? new SetCache(othIndex && array)
  4059. : undefined;
  4060. }
  4061. array = arrays[0];
  4062. var index = -1,
  4063. seen = caches[0];
  4064. outer:
  4065. while (++index < length && result.length < maxLength) {
  4066. var value = array[index],
  4067. computed = iteratee ? iteratee(value) : value;
  4068. value = (comparator || value !== 0) ? value : 0;
  4069. if (!(seen
  4070. ? cacheHas(seen, computed)
  4071. : includes(result, computed, comparator)
  4072. )) {
  4073. othIndex = othLength;
  4074. while (--othIndex) {
  4075. var cache = caches[othIndex];
  4076. if (!(cache
  4077. ? cacheHas(cache, computed)
  4078. : includes(arrays[othIndex], computed, comparator))
  4079. ) {
  4080. continue outer;
  4081. }
  4082. }
  4083. if (seen) {
  4084. seen.push(computed);
  4085. }
  4086. result.push(value);
  4087. }
  4088. }
  4089. return result;
  4090. }
  4091. /**
  4092. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4093. * `object` with values transformed by `iteratee` and set by `setter`.
  4094. *
  4095. * @private
  4096. * @param {Object} object The object to iterate over.
  4097. * @param {Function} setter The function to set `accumulator` values.
  4098. * @param {Function} iteratee The iteratee to transform values.
  4099. * @param {Object} accumulator The initial inverted object.
  4100. * @returns {Function} Returns `accumulator`.
  4101. */
  4102. function baseInverter(object, setter, iteratee, accumulator) {
  4103. baseForOwn(object, function(value, key, object) {
  4104. setter(accumulator, iteratee(value), key, object);
  4105. });
  4106. return accumulator;
  4107. }
  4108. /**
  4109. * The base implementation of `_.invoke` without support for individual
  4110. * method arguments.
  4111. *
  4112. * @private
  4113. * @param {Object} object The object to query.
  4114. * @param {Array|string} path The path of the method to invoke.
  4115. * @param {Array} args The arguments to invoke the method with.
  4116. * @returns {*} Returns the result of the invoked method.
  4117. */
  4118. function baseInvoke(object, path, args) {
  4119. path = castPath(path, object);
  4120. object = parent(object, path);
  4121. var func = object == null ? object : object[toKey(last(path))];
  4122. return func == null ? undefined : apply(func, object, args);
  4123. }
  4124. /**
  4125. * The base implementation of `_.isArguments`.
  4126. *
  4127. * @private
  4128. * @param {*} value The value to check.
  4129. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4130. */
  4131. function baseIsArguments(value) {
  4132. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4133. }
  4134. /**
  4135. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4136. *
  4137. * @private
  4138. * @param {*} value The value to check.
  4139. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4140. */
  4141. function baseIsArrayBuffer(value) {
  4142. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4143. }
  4144. /**
  4145. * The base implementation of `_.isDate` without Node.js optimizations.
  4146. *
  4147. * @private
  4148. * @param {*} value The value to check.
  4149. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4150. */
  4151. function baseIsDate(value) {
  4152. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4153. }
  4154. /**
  4155. * The base implementation of `_.isEqual` which supports partial comparisons
  4156. * and tracks traversed objects.
  4157. *
  4158. * @private
  4159. * @param {*} value The value to compare.
  4160. * @param {*} other The other value to compare.
  4161. * @param {boolean} bitmask The bitmask flags.
  4162. * 1 - Unordered comparison
  4163. * 2 - Partial comparison
  4164. * @param {Function} [customizer] The function to customize comparisons.
  4165. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4166. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4167. */
  4168. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4169. if (value === other) {
  4170. return true;
  4171. }
  4172. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4173. return value !== value && other !== other;
  4174. }
  4175. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4176. }
  4177. /**
  4178. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4179. * deep comparisons and tracks traversed objects enabling objects with circular
  4180. * references to be compared.
  4181. *
  4182. * @private
  4183. * @param {Object} object The object to compare.
  4184. * @param {Object} other The other object to compare.
  4185. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4186. * @param {Function} customizer The function to customize comparisons.
  4187. * @param {Function} equalFunc The function to determine equivalents of values.
  4188. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4189. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4190. */
  4191. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4192. var objIsArr = isArray(object),
  4193. othIsArr = isArray(other),
  4194. objTag = objIsArr ? arrayTag : getTag(object),
  4195. othTag = othIsArr ? arrayTag : getTag(other);
  4196. objTag = objTag == argsTag ? objectTag : objTag;
  4197. othTag = othTag == argsTag ? objectTag : othTag;
  4198. var objIsObj = objTag == objectTag,
  4199. othIsObj = othTag == objectTag,
  4200. isSameTag = objTag == othTag;
  4201. if (isSameTag && isBuffer(object)) {
  4202. if (!isBuffer(other)) {
  4203. return false;
  4204. }
  4205. objIsArr = true;
  4206. objIsObj = false;
  4207. }
  4208. if (isSameTag && !objIsObj) {
  4209. stack || (stack = new Stack);
  4210. return (objIsArr || isTypedArray(object))
  4211. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4212. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4213. }
  4214. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4215. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4216. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4217. if (objIsWrapped || othIsWrapped) {
  4218. var objUnwrapped = objIsWrapped ? object.value() : object,
  4219. othUnwrapped = othIsWrapped ? other.value() : other;
  4220. stack || (stack = new Stack);
  4221. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4222. }
  4223. }
  4224. if (!isSameTag) {
  4225. return false;
  4226. }
  4227. stack || (stack = new Stack);
  4228. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4229. }
  4230. /**
  4231. * The base implementation of `_.isMap` without Node.js optimizations.
  4232. *
  4233. * @private
  4234. * @param {*} value The value to check.
  4235. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4236. */
  4237. function baseIsMap(value) {
  4238. return isObjectLike(value) && getTag(value) == mapTag;
  4239. }
  4240. /**
  4241. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4242. *
  4243. * @private
  4244. * @param {Object} object The object to inspect.
  4245. * @param {Object} source The object of property values to match.
  4246. * @param {Array} matchData The property names, values, and compare flags to match.
  4247. * @param {Function} [customizer] The function to customize comparisons.
  4248. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4249. */
  4250. function baseIsMatch(object, source, matchData, customizer) {
  4251. var index = matchData.length,
  4252. length = index,
  4253. noCustomizer = !customizer;
  4254. if (object == null) {
  4255. return !length;
  4256. }
  4257. object = Object(object);
  4258. while (index--) {
  4259. var data = matchData[index];
  4260. if ((noCustomizer && data[2])
  4261. ? data[1] !== object[data[0]]
  4262. : !(data[0] in object)
  4263. ) {
  4264. return false;
  4265. }
  4266. }
  4267. while (++index < length) {
  4268. data = matchData[index];
  4269. var key = data[0],
  4270. objValue = object[key],
  4271. srcValue = data[1];
  4272. if (noCustomizer && data[2]) {
  4273. if (objValue === undefined && !(key in object)) {
  4274. return false;
  4275. }
  4276. } else {
  4277. var stack = new Stack;
  4278. if (customizer) {
  4279. var result = customizer(objValue, srcValue, key, object, source, stack);
  4280. }
  4281. if (!(result === undefined
  4282. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4283. : result
  4284. )) {
  4285. return false;
  4286. }
  4287. }
  4288. }
  4289. return true;
  4290. }
  4291. /**
  4292. * The base implementation of `_.isNative` without bad shim checks.
  4293. *
  4294. * @private
  4295. * @param {*} value The value to check.
  4296. * @returns {boolean} Returns `true` if `value` is a native function,
  4297. * else `false`.
  4298. */
  4299. function baseIsNative(value) {
  4300. if (!isObject(value) || isMasked(value)) {
  4301. return false;
  4302. }
  4303. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4304. return pattern.test(toSource(value));
  4305. }
  4306. /**
  4307. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4308. *
  4309. * @private
  4310. * @param {*} value The value to check.
  4311. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4312. */
  4313. function baseIsRegExp(value) {
  4314. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4315. }
  4316. /**
  4317. * The base implementation of `_.isSet` without Node.js optimizations.
  4318. *
  4319. * @private
  4320. * @param {*} value The value to check.
  4321. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4322. */
  4323. function baseIsSet(value) {
  4324. return isObjectLike(value) && getTag(value) == setTag;
  4325. }
  4326. /**
  4327. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4328. *
  4329. * @private
  4330. * @param {*} value The value to check.
  4331. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4332. */
  4333. function baseIsTypedArray(value) {
  4334. return isObjectLike(value) &&
  4335. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4336. }
  4337. /**
  4338. * The base implementation of `_.iteratee`.
  4339. *
  4340. * @private
  4341. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4342. * @returns {Function} Returns the iteratee.
  4343. */
  4344. function baseIteratee(value) {
  4345. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4346. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4347. if (typeof value == 'function') {
  4348. return value;
  4349. }
  4350. if (value == null) {
  4351. return identity;
  4352. }
  4353. if (typeof value == 'object') {
  4354. return isArray(value)
  4355. ? baseMatchesProperty(value[0], value[1])
  4356. : baseMatches(value);
  4357. }
  4358. return property(value);
  4359. }
  4360. /**
  4361. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4362. *
  4363. * @private
  4364. * @param {Object} object The object to query.
  4365. * @returns {Array} Returns the array of property names.
  4366. */
  4367. function baseKeys(object) {
  4368. if (!isPrototype(object)) {
  4369. return nativeKeys(object);
  4370. }
  4371. var result = [];
  4372. for (var key in Object(object)) {
  4373. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4374. result.push(key);
  4375. }
  4376. }
  4377. return result;
  4378. }
  4379. /**
  4380. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4381. *
  4382. * @private
  4383. * @param {Object} object The object to query.
  4384. * @returns {Array} Returns the array of property names.
  4385. */
  4386. function baseKeysIn(object) {
  4387. if (!isObject(object)) {
  4388. return nativeKeysIn(object);
  4389. }
  4390. var isProto = isPrototype(object),
  4391. result = [];
  4392. for (var key in object) {
  4393. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4394. result.push(key);
  4395. }
  4396. }
  4397. return result;
  4398. }
  4399. /**
  4400. * The base implementation of `_.lt` which doesn't coerce arguments.
  4401. *
  4402. * @private
  4403. * @param {*} value The value to compare.
  4404. * @param {*} other The other value to compare.
  4405. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4406. * else `false`.
  4407. */
  4408. function baseLt(value, other) {
  4409. return value < other;
  4410. }
  4411. /**
  4412. * The base implementation of `_.map` without support for iteratee shorthands.
  4413. *
  4414. * @private
  4415. * @param {Array|Object} collection The collection to iterate over.
  4416. * @param {Function} iteratee The function invoked per iteration.
  4417. * @returns {Array} Returns the new mapped array.
  4418. */
  4419. function baseMap(collection, iteratee) {
  4420. var index = -1,
  4421. result = isArrayLike(collection) ? Array(collection.length) : [];
  4422. baseEach(collection, function(value, key, collection) {
  4423. result[++index] = iteratee(value, key, collection);
  4424. });
  4425. return result;
  4426. }
  4427. /**
  4428. * The base implementation of `_.matches` which doesn't clone `source`.
  4429. *
  4430. * @private
  4431. * @param {Object} source The object of property values to match.
  4432. * @returns {Function} Returns the new spec function.
  4433. */
  4434. function baseMatches(source) {
  4435. var matchData = getMatchData(source);
  4436. if (matchData.length == 1 && matchData[0][2]) {
  4437. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4438. }
  4439. return function(object) {
  4440. return object === source || baseIsMatch(object, source, matchData);
  4441. };
  4442. }
  4443. /**
  4444. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4445. *
  4446. * @private
  4447. * @param {string} path The path of the property to get.
  4448. * @param {*} srcValue The value to match.
  4449. * @returns {Function} Returns the new spec function.
  4450. */
  4451. function baseMatchesProperty(path, srcValue) {
  4452. if (isKey(path) && isStrictComparable(srcValue)) {
  4453. return matchesStrictComparable(toKey(path), srcValue);
  4454. }
  4455. return function(object) {
  4456. var objValue = get(object, path);
  4457. return (objValue === undefined && objValue === srcValue)
  4458. ? hasIn(object, path)
  4459. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4460. };
  4461. }
  4462. /**
  4463. * The base implementation of `_.merge` without support for multiple sources.
  4464. *
  4465. * @private
  4466. * @param {Object} object The destination object.
  4467. * @param {Object} source The source object.
  4468. * @param {number} srcIndex The index of `source`.
  4469. * @param {Function} [customizer] The function to customize merged values.
  4470. * @param {Object} [stack] Tracks traversed source values and their merged
  4471. * counterparts.
  4472. */
  4473. function baseMerge(object, source, srcIndex, customizer, stack) {
  4474. if (object === source) {
  4475. return;
  4476. }
  4477. baseFor(source, function(srcValue, key) {
  4478. stack || (stack = new Stack);
  4479. if (isObject(srcValue)) {
  4480. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4481. }
  4482. else {
  4483. var newValue = customizer
  4484. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4485. : undefined;
  4486. if (newValue === undefined) {
  4487. newValue = srcValue;
  4488. }
  4489. assignMergeValue(object, key, newValue);
  4490. }
  4491. }, keysIn);
  4492. }
  4493. /**
  4494. * A specialized version of `baseMerge` for arrays and objects which performs
  4495. * deep merges and tracks traversed objects enabling objects with circular
  4496. * references to be merged.
  4497. *
  4498. * @private
  4499. * @param {Object} object The destination object.
  4500. * @param {Object} source The source object.
  4501. * @param {string} key The key of the value to merge.
  4502. * @param {number} srcIndex The index of `source`.
  4503. * @param {Function} mergeFunc The function to merge values.
  4504. * @param {Function} [customizer] The function to customize assigned values.
  4505. * @param {Object} [stack] Tracks traversed source values and their merged
  4506. * counterparts.
  4507. */
  4508. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4509. var objValue = safeGet(object, key),
  4510. srcValue = safeGet(source, key),
  4511. stacked = stack.get(srcValue);
  4512. if (stacked) {
  4513. assignMergeValue(object, key, stacked);
  4514. return;
  4515. }
  4516. var newValue = customizer
  4517. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4518. : undefined;
  4519. var isCommon = newValue === undefined;
  4520. if (isCommon) {
  4521. var isArr = isArray(srcValue),
  4522. isBuff = !isArr && isBuffer(srcValue),
  4523. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4524. newValue = srcValue;
  4525. if (isArr || isBuff || isTyped) {
  4526. if (isArray(objValue)) {
  4527. newValue = objValue;
  4528. }
  4529. else if (isArrayLikeObject(objValue)) {
  4530. newValue = copyArray(objValue);
  4531. }
  4532. else if (isBuff) {
  4533. isCommon = false;
  4534. newValue = cloneBuffer(srcValue, true);
  4535. }
  4536. else if (isTyped) {
  4537. isCommon = false;
  4538. newValue = cloneTypedArray(srcValue, true);
  4539. }
  4540. else {
  4541. newValue = [];
  4542. }
  4543. }
  4544. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4545. newValue = objValue;
  4546. if (isArguments(objValue)) {
  4547. newValue = toPlainObject(objValue);
  4548. }
  4549. else if (!isObject(objValue) || isFunction(objValue)) {
  4550. newValue = initCloneObject(srcValue);
  4551. }
  4552. }
  4553. else {
  4554. isCommon = false;
  4555. }
  4556. }
  4557. if (isCommon) {
  4558. // Recursively merge objects and arrays (susceptible to call stack limits).
  4559. stack.set(srcValue, newValue);
  4560. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4561. stack['delete'](srcValue);
  4562. }
  4563. assignMergeValue(object, key, newValue);
  4564. }
  4565. /**
  4566. * The base implementation of `_.nth` which doesn't coerce arguments.
  4567. *
  4568. * @private
  4569. * @param {Array} array The array to query.
  4570. * @param {number} n The index of the element to return.
  4571. * @returns {*} Returns the nth element of `array`.
  4572. */
  4573. function baseNth(array, n) {
  4574. var length = array.length;
  4575. if (!length) {
  4576. return;
  4577. }
  4578. n += n < 0 ? length : 0;
  4579. return isIndex(n, length) ? array[n] : undefined;
  4580. }
  4581. /**
  4582. * The base implementation of `_.orderBy` without param guards.
  4583. *
  4584. * @private
  4585. * @param {Array|Object} collection The collection to iterate over.
  4586. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4587. * @param {string[]} orders The sort orders of `iteratees`.
  4588. * @returns {Array} Returns the new sorted array.
  4589. */
  4590. function baseOrderBy(collection, iteratees, orders) {
  4591. if (iteratees.length) {
  4592. iteratees = arrayMap(iteratees, function(iteratee) {
  4593. if (isArray(iteratee)) {
  4594. return function(value) {
  4595. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4596. }
  4597. }
  4598. return iteratee;
  4599. });
  4600. } else {
  4601. iteratees = [identity];
  4602. }
  4603. var index = -1;
  4604. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4605. var result = baseMap(collection, function(value, key, collection) {
  4606. var criteria = arrayMap(iteratees, function(iteratee) {
  4607. return iteratee(value);
  4608. });
  4609. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4610. });
  4611. return baseSortBy(result, function(object, other) {
  4612. return compareMultiple(object, other, orders);
  4613. });
  4614. }
  4615. /**
  4616. * The base implementation of `_.pick` without support for individual
  4617. * property identifiers.
  4618. *
  4619. * @private
  4620. * @param {Object} object The source object.
  4621. * @param {string[]} paths The property paths to pick.
  4622. * @returns {Object} Returns the new object.
  4623. */
  4624. function basePick(object, paths) {
  4625. return basePickBy(object, paths, function(value, path) {
  4626. return hasIn(object, path);
  4627. });
  4628. }
  4629. /**
  4630. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4631. *
  4632. * @private
  4633. * @param {Object} object The source object.
  4634. * @param {string[]} paths The property paths to pick.
  4635. * @param {Function} predicate The function invoked per property.
  4636. * @returns {Object} Returns the new object.
  4637. */
  4638. function basePickBy(object, paths, predicate) {
  4639. var index = -1,
  4640. length = paths.length,
  4641. result = {};
  4642. while (++index < length) {
  4643. var path = paths[index],
  4644. value = baseGet(object, path);
  4645. if (predicate(value, path)) {
  4646. baseSet(result, castPath(path, object), value);
  4647. }
  4648. }
  4649. return result;
  4650. }
  4651. /**
  4652. * A specialized version of `baseProperty` which supports deep paths.
  4653. *
  4654. * @private
  4655. * @param {Array|string} path The path of the property to get.
  4656. * @returns {Function} Returns the new accessor function.
  4657. */
  4658. function basePropertyDeep(path) {
  4659. return function(object) {
  4660. return baseGet(object, path);
  4661. };
  4662. }
  4663. /**
  4664. * The base implementation of `_.pullAllBy` without support for iteratee
  4665. * shorthands.
  4666. *
  4667. * @private
  4668. * @param {Array} array The array to modify.
  4669. * @param {Array} values The values to remove.
  4670. * @param {Function} [iteratee] The iteratee invoked per element.
  4671. * @param {Function} [comparator] The comparator invoked per element.
  4672. * @returns {Array} Returns `array`.
  4673. */
  4674. function basePullAll(array, values, iteratee, comparator) {
  4675. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4676. index = -1,
  4677. length = values.length,
  4678. seen = array;
  4679. if (array === values) {
  4680. values = copyArray(values);
  4681. }
  4682. if (iteratee) {
  4683. seen = arrayMap(array, baseUnary(iteratee));
  4684. }
  4685. while (++index < length) {
  4686. var fromIndex = 0,
  4687. value = values[index],
  4688. computed = iteratee ? iteratee(value) : value;
  4689. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4690. if (seen !== array) {
  4691. splice.call(seen, fromIndex, 1);
  4692. }
  4693. splice.call(array, fromIndex, 1);
  4694. }
  4695. }
  4696. return array;
  4697. }
  4698. /**
  4699. * The base implementation of `_.pullAt` without support for individual
  4700. * indexes or capturing the removed elements.
  4701. *
  4702. * @private
  4703. * @param {Array} array The array to modify.
  4704. * @param {number[]} indexes The indexes of elements to remove.
  4705. * @returns {Array} Returns `array`.
  4706. */
  4707. function basePullAt(array, indexes) {
  4708. var length = array ? indexes.length : 0,
  4709. lastIndex = length - 1;
  4710. while (length--) {
  4711. var index = indexes[length];
  4712. if (length == lastIndex || index !== previous) {
  4713. var previous = index;
  4714. if (isIndex(index)) {
  4715. splice.call(array, index, 1);
  4716. } else {
  4717. baseUnset(array, index);
  4718. }
  4719. }
  4720. }
  4721. return array;
  4722. }
  4723. /**
  4724. * The base implementation of `_.random` without support for returning
  4725. * floating-point numbers.
  4726. *
  4727. * @private
  4728. * @param {number} lower The lower bound.
  4729. * @param {number} upper The upper bound.
  4730. * @returns {number} Returns the random number.
  4731. */
  4732. function baseRandom(lower, upper) {
  4733. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4734. }
  4735. /**
  4736. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4737. * coerce arguments.
  4738. *
  4739. * @private
  4740. * @param {number} start The start of the range.
  4741. * @param {number} end The end of the range.
  4742. * @param {number} step The value to increment or decrement by.
  4743. * @param {boolean} [fromRight] Specify iterating from right to left.
  4744. * @returns {Array} Returns the range of numbers.
  4745. */
  4746. function baseRange(start, end, step, fromRight) {
  4747. var index = -1,
  4748. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4749. result = Array(length);
  4750. while (length--) {
  4751. result[fromRight ? length : ++index] = start;
  4752. start += step;
  4753. }
  4754. return result;
  4755. }
  4756. /**
  4757. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4758. *
  4759. * @private
  4760. * @param {string} string The string to repeat.
  4761. * @param {number} n The number of times to repeat the string.
  4762. * @returns {string} Returns the repeated string.
  4763. */
  4764. function baseRepeat(string, n) {
  4765. var result = '';
  4766. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4767. return result;
  4768. }
  4769. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4770. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4771. do {
  4772. if (n % 2) {
  4773. result += string;
  4774. }
  4775. n = nativeFloor(n / 2);
  4776. if (n) {
  4777. string += string;
  4778. }
  4779. } while (n);
  4780. return result;
  4781. }
  4782. /**
  4783. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4784. *
  4785. * @private
  4786. * @param {Function} func The function to apply a rest parameter to.
  4787. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4788. * @returns {Function} Returns the new function.
  4789. */
  4790. function baseRest(func, start) {
  4791. return setToString(overRest(func, start, identity), func + '');
  4792. }
  4793. /**
  4794. * The base implementation of `_.sample`.
  4795. *
  4796. * @private
  4797. * @param {Array|Object} collection The collection to sample.
  4798. * @returns {*} Returns the random element.
  4799. */
  4800. function baseSample(collection) {
  4801. return arraySample(values(collection));
  4802. }
  4803. /**
  4804. * The base implementation of `_.sampleSize` without param guards.
  4805. *
  4806. * @private
  4807. * @param {Array|Object} collection The collection to sample.
  4808. * @param {number} n The number of elements to sample.
  4809. * @returns {Array} Returns the random elements.
  4810. */
  4811. function baseSampleSize(collection, n) {
  4812. var array = values(collection);
  4813. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4814. }
  4815. /**
  4816. * The base implementation of `_.set`.
  4817. *
  4818. * @private
  4819. * @param {Object} object The object to modify.
  4820. * @param {Array|string} path The path of the property to set.
  4821. * @param {*} value The value to set.
  4822. * @param {Function} [customizer] The function to customize path creation.
  4823. * @returns {Object} Returns `object`.
  4824. */
  4825. function baseSet(object, path, value, customizer) {
  4826. if (!isObject(object)) {
  4827. return object;
  4828. }
  4829. path = castPath(path, object);
  4830. var index = -1,
  4831. length = path.length,
  4832. lastIndex = length - 1,
  4833. nested = object;
  4834. while (nested != null && ++index < length) {
  4835. var key = toKey(path[index]),
  4836. newValue = value;
  4837. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4838. return object;
  4839. }
  4840. if (index != lastIndex) {
  4841. var objValue = nested[key];
  4842. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4843. if (newValue === undefined) {
  4844. newValue = isObject(objValue)
  4845. ? objValue
  4846. : (isIndex(path[index + 1]) ? [] : {});
  4847. }
  4848. }
  4849. assignValue(nested, key, newValue);
  4850. nested = nested[key];
  4851. }
  4852. return object;
  4853. }
  4854. /**
  4855. * The base implementation of `setData` without support for hot loop shorting.
  4856. *
  4857. * @private
  4858. * @param {Function} func The function to associate metadata with.
  4859. * @param {*} data The metadata.
  4860. * @returns {Function} Returns `func`.
  4861. */
  4862. var baseSetData = !metaMap ? identity : function(func, data) {
  4863. metaMap.set(func, data);
  4864. return func;
  4865. };
  4866. /**
  4867. * The base implementation of `setToString` without support for hot loop shorting.
  4868. *
  4869. * @private
  4870. * @param {Function} func The function to modify.
  4871. * @param {Function} string The `toString` result.
  4872. * @returns {Function} Returns `func`.
  4873. */
  4874. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4875. return defineProperty(func, 'toString', {
  4876. 'configurable': true,
  4877. 'enumerable': false,
  4878. 'value': constant(string),
  4879. 'writable': true
  4880. });
  4881. };
  4882. /**
  4883. * The base implementation of `_.shuffle`.
  4884. *
  4885. * @private
  4886. * @param {Array|Object} collection The collection to shuffle.
  4887. * @returns {Array} Returns the new shuffled array.
  4888. */
  4889. function baseShuffle(collection) {
  4890. return shuffleSelf(values(collection));
  4891. }
  4892. /**
  4893. * The base implementation of `_.slice` without an iteratee call guard.
  4894. *
  4895. * @private
  4896. * @param {Array} array The array to slice.
  4897. * @param {number} [start=0] The start position.
  4898. * @param {number} [end=array.length] The end position.
  4899. * @returns {Array} Returns the slice of `array`.
  4900. */
  4901. function baseSlice(array, start, end) {
  4902. var index = -1,
  4903. length = array.length;
  4904. if (start < 0) {
  4905. start = -start > length ? 0 : (length + start);
  4906. }
  4907. end = end > length ? length : end;
  4908. if (end < 0) {
  4909. end += length;
  4910. }
  4911. length = start > end ? 0 : ((end - start) >>> 0);
  4912. start >>>= 0;
  4913. var result = Array(length);
  4914. while (++index < length) {
  4915. result[index] = array[index + start];
  4916. }
  4917. return result;
  4918. }
  4919. /**
  4920. * The base implementation of `_.some` without support for iteratee shorthands.
  4921. *
  4922. * @private
  4923. * @param {Array|Object} collection The collection to iterate over.
  4924. * @param {Function} predicate The function invoked per iteration.
  4925. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4926. * else `false`.
  4927. */
  4928. function baseSome(collection, predicate) {
  4929. var result;
  4930. baseEach(collection, function(value, index, collection) {
  4931. result = predicate(value, index, collection);
  4932. return !result;
  4933. });
  4934. return !!result;
  4935. }
  4936. /**
  4937. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4938. * performs a binary search of `array` to determine the index at which `value`
  4939. * should be inserted into `array` in order to maintain its sort order.
  4940. *
  4941. * @private
  4942. * @param {Array} array The sorted array to inspect.
  4943. * @param {*} value The value to evaluate.
  4944. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4945. * @returns {number} Returns the index at which `value` should be inserted
  4946. * into `array`.
  4947. */
  4948. function baseSortedIndex(array, value, retHighest) {
  4949. var low = 0,
  4950. high = array == null ? low : array.length;
  4951. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4952. while (low < high) {
  4953. var mid = (low + high) >>> 1,
  4954. computed = array[mid];
  4955. if (computed !== null && !isSymbol(computed) &&
  4956. (retHighest ? (computed <= value) : (computed < value))) {
  4957. low = mid + 1;
  4958. } else {
  4959. high = mid;
  4960. }
  4961. }
  4962. return high;
  4963. }
  4964. return baseSortedIndexBy(array, value, identity, retHighest);
  4965. }
  4966. /**
  4967. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4968. * which invokes `iteratee` for `value` and each element of `array` to compute
  4969. * their sort ranking. The iteratee is invoked with one argument; (value).
  4970. *
  4971. * @private
  4972. * @param {Array} array The sorted array to inspect.
  4973. * @param {*} value The value to evaluate.
  4974. * @param {Function} iteratee The iteratee invoked per element.
  4975. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4976. * @returns {number} Returns the index at which `value` should be inserted
  4977. * into `array`.
  4978. */
  4979. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4980. var low = 0,
  4981. high = array == null ? 0 : array.length;
  4982. if (high === 0) {
  4983. return 0;
  4984. }
  4985. value = iteratee(value);
  4986. var valIsNaN = value !== value,
  4987. valIsNull = value === null,
  4988. valIsSymbol = isSymbol(value),
  4989. valIsUndefined = value === undefined;
  4990. while (low < high) {
  4991. var mid = nativeFloor((low + high) / 2),
  4992. computed = iteratee(array[mid]),
  4993. othIsDefined = computed !== undefined,
  4994. othIsNull = computed === null,
  4995. othIsReflexive = computed === computed,
  4996. othIsSymbol = isSymbol(computed);
  4997. if (valIsNaN) {
  4998. var setLow = retHighest || othIsReflexive;
  4999. } else if (valIsUndefined) {
  5000. setLow = othIsReflexive && (retHighest || othIsDefined);
  5001. } else if (valIsNull) {
  5002. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5003. } else if (valIsSymbol) {
  5004. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5005. } else if (othIsNull || othIsSymbol) {
  5006. setLow = false;
  5007. } else {
  5008. setLow = retHighest ? (computed <= value) : (computed < value);
  5009. }
  5010. if (setLow) {
  5011. low = mid + 1;
  5012. } else {
  5013. high = mid;
  5014. }
  5015. }
  5016. return nativeMin(high, MAX_ARRAY_INDEX);
  5017. }
  5018. /**
  5019. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5020. * support for iteratee shorthands.
  5021. *
  5022. * @private
  5023. * @param {Array} array The array to inspect.
  5024. * @param {Function} [iteratee] The iteratee invoked per element.
  5025. * @returns {Array} Returns the new duplicate free array.
  5026. */
  5027. function baseSortedUniq(array, iteratee) {
  5028. var index = -1,
  5029. length = array.length,
  5030. resIndex = 0,
  5031. result = [];
  5032. while (++index < length) {
  5033. var value = array[index],
  5034. computed = iteratee ? iteratee(value) : value;
  5035. if (!index || !eq(computed, seen)) {
  5036. var seen = computed;
  5037. result[resIndex++] = value === 0 ? 0 : value;
  5038. }
  5039. }
  5040. return result;
  5041. }
  5042. /**
  5043. * The base implementation of `_.toNumber` which doesn't ensure correct
  5044. * conversions of binary, hexadecimal, or octal string values.
  5045. *
  5046. * @private
  5047. * @param {*} value The value to process.
  5048. * @returns {number} Returns the number.
  5049. */
  5050. function baseToNumber(value) {
  5051. if (typeof value == 'number') {
  5052. return value;
  5053. }
  5054. if (isSymbol(value)) {
  5055. return NAN;
  5056. }
  5057. return +value;
  5058. }
  5059. /**
  5060. * The base implementation of `_.toString` which doesn't convert nullish
  5061. * values to empty strings.
  5062. *
  5063. * @private
  5064. * @param {*} value The value to process.
  5065. * @returns {string} Returns the string.
  5066. */
  5067. function baseToString(value) {
  5068. // Exit early for strings to avoid a performance hit in some environments.
  5069. if (typeof value == 'string') {
  5070. return value;
  5071. }
  5072. if (isArray(value)) {
  5073. // Recursively convert values (susceptible to call stack limits).
  5074. return arrayMap(value, baseToString) + '';
  5075. }
  5076. if (isSymbol(value)) {
  5077. return symbolToString ? symbolToString.call(value) : '';
  5078. }
  5079. var result = (value + '');
  5080. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5081. }
  5082. /**
  5083. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5084. *
  5085. * @private
  5086. * @param {Array} array The array to inspect.
  5087. * @param {Function} [iteratee] The iteratee invoked per element.
  5088. * @param {Function} [comparator] The comparator invoked per element.
  5089. * @returns {Array} Returns the new duplicate free array.
  5090. */
  5091. function baseUniq(array, iteratee, comparator) {
  5092. var index = -1,
  5093. includes = arrayIncludes,
  5094. length = array.length,
  5095. isCommon = true,
  5096. result = [],
  5097. seen = result;
  5098. if (comparator) {
  5099. isCommon = false;
  5100. includes = arrayIncludesWith;
  5101. }
  5102. else if (length >= LARGE_ARRAY_SIZE) {
  5103. var set = iteratee ? null : createSet(array);
  5104. if (set) {
  5105. return setToArray(set);
  5106. }
  5107. isCommon = false;
  5108. includes = cacheHas;
  5109. seen = new SetCache;
  5110. }
  5111. else {
  5112. seen = iteratee ? [] : result;
  5113. }
  5114. outer:
  5115. while (++index < length) {
  5116. var value = array[index],
  5117. computed = iteratee ? iteratee(value) : value;
  5118. value = (comparator || value !== 0) ? value : 0;
  5119. if (isCommon && computed === computed) {
  5120. var seenIndex = seen.length;
  5121. while (seenIndex--) {
  5122. if (seen[seenIndex] === computed) {
  5123. continue outer;
  5124. }
  5125. }
  5126. if (iteratee) {
  5127. seen.push(computed);
  5128. }
  5129. result.push(value);
  5130. }
  5131. else if (!includes(seen, computed, comparator)) {
  5132. if (seen !== result) {
  5133. seen.push(computed);
  5134. }
  5135. result.push(value);
  5136. }
  5137. }
  5138. return result;
  5139. }
  5140. /**
  5141. * The base implementation of `_.unset`.
  5142. *
  5143. * @private
  5144. * @param {Object} object The object to modify.
  5145. * @param {Array|string} path The property path to unset.
  5146. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5147. */
  5148. function baseUnset(object, path) {
  5149. path = castPath(path, object);
  5150. object = parent(object, path);
  5151. return object == null || delete object[toKey(last(path))];
  5152. }
  5153. /**
  5154. * The base implementation of `_.update`.
  5155. *
  5156. * @private
  5157. * @param {Object} object The object to modify.
  5158. * @param {Array|string} path The path of the property to update.
  5159. * @param {Function} updater The function to produce the updated value.
  5160. * @param {Function} [customizer] The function to customize path creation.
  5161. * @returns {Object} Returns `object`.
  5162. */
  5163. function baseUpdate(object, path, updater, customizer) {
  5164. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5165. }
  5166. /**
  5167. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5168. * without support for iteratee shorthands.
  5169. *
  5170. * @private
  5171. * @param {Array} array The array to query.
  5172. * @param {Function} predicate The function invoked per iteration.
  5173. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5174. * @param {boolean} [fromRight] Specify iterating from right to left.
  5175. * @returns {Array} Returns the slice of `array`.
  5176. */
  5177. function baseWhile(array, predicate, isDrop, fromRight) {
  5178. var length = array.length,
  5179. index = fromRight ? length : -1;
  5180. while ((fromRight ? index-- : ++index < length) &&
  5181. predicate(array[index], index, array)) {}
  5182. return isDrop
  5183. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5184. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5185. }
  5186. /**
  5187. * The base implementation of `wrapperValue` which returns the result of
  5188. * performing a sequence of actions on the unwrapped `value`, where each
  5189. * successive action is supplied the return value of the previous.
  5190. *
  5191. * @private
  5192. * @param {*} value The unwrapped value.
  5193. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5194. * @returns {*} Returns the resolved value.
  5195. */
  5196. function baseWrapperValue(value, actions) {
  5197. var result = value;
  5198. if (result instanceof LazyWrapper) {
  5199. result = result.value();
  5200. }
  5201. return arrayReduce(actions, function(result, action) {
  5202. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5203. }, result);
  5204. }
  5205. /**
  5206. * The base implementation of methods like `_.xor`, without support for
  5207. * iteratee shorthands, that accepts an array of arrays to inspect.
  5208. *
  5209. * @private
  5210. * @param {Array} arrays The arrays to inspect.
  5211. * @param {Function} [iteratee] The iteratee invoked per element.
  5212. * @param {Function} [comparator] The comparator invoked per element.
  5213. * @returns {Array} Returns the new array of values.
  5214. */
  5215. function baseXor(arrays, iteratee, comparator) {
  5216. var length = arrays.length;
  5217. if (length < 2) {
  5218. return length ? baseUniq(arrays[0]) : [];
  5219. }
  5220. var index = -1,
  5221. result = Array(length);
  5222. while (++index < length) {
  5223. var array = arrays[index],
  5224. othIndex = -1;
  5225. while (++othIndex < length) {
  5226. if (othIndex != index) {
  5227. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5228. }
  5229. }
  5230. }
  5231. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5232. }
  5233. /**
  5234. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5235. *
  5236. * @private
  5237. * @param {Array} props The property identifiers.
  5238. * @param {Array} values The property values.
  5239. * @param {Function} assignFunc The function to assign values.
  5240. * @returns {Object} Returns the new object.
  5241. */
  5242. function baseZipObject(props, values, assignFunc) {
  5243. var index = -1,
  5244. length = props.length,
  5245. valsLength = values.length,
  5246. result = {};
  5247. while (++index < length) {
  5248. var value = index < valsLength ? values[index] : undefined;
  5249. assignFunc(result, props[index], value);
  5250. }
  5251. return result;
  5252. }
  5253. /**
  5254. * Casts `value` to an empty array if it's not an array like object.
  5255. *
  5256. * @private
  5257. * @param {*} value The value to inspect.
  5258. * @returns {Array|Object} Returns the cast array-like object.
  5259. */
  5260. function castArrayLikeObject(value) {
  5261. return isArrayLikeObject(value) ? value : [];
  5262. }
  5263. /**
  5264. * Casts `value` to `identity` if it's not a function.
  5265. *
  5266. * @private
  5267. * @param {*} value The value to inspect.
  5268. * @returns {Function} Returns cast function.
  5269. */
  5270. function castFunction(value) {
  5271. return typeof value == 'function' ? value : identity;
  5272. }
  5273. /**
  5274. * Casts `value` to a path array if it's not one.
  5275. *
  5276. * @private
  5277. * @param {*} value The value to inspect.
  5278. * @param {Object} [object] The object to query keys on.
  5279. * @returns {Array} Returns the cast property path array.
  5280. */
  5281. function castPath(value, object) {
  5282. if (isArray(value)) {
  5283. return value;
  5284. }
  5285. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5286. }
  5287. /**
  5288. * A `baseRest` alias which can be replaced with `identity` by module
  5289. * replacement plugins.
  5290. *
  5291. * @private
  5292. * @type {Function}
  5293. * @param {Function} func The function to apply a rest parameter to.
  5294. * @returns {Function} Returns the new function.
  5295. */
  5296. var castRest = baseRest;
  5297. /**
  5298. * Casts `array` to a slice if it's needed.
  5299. *
  5300. * @private
  5301. * @param {Array} array The array to inspect.
  5302. * @param {number} start The start position.
  5303. * @param {number} [end=array.length] The end position.
  5304. * @returns {Array} Returns the cast slice.
  5305. */
  5306. function castSlice(array, start, end) {
  5307. var length = array.length;
  5308. end = end === undefined ? length : end;
  5309. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5310. }
  5311. /**
  5312. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5313. *
  5314. * @private
  5315. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5316. */
  5317. var clearTimeout = ctxClearTimeout || function(id) {
  5318. return root.clearTimeout(id);
  5319. };
  5320. /**
  5321. * Creates a clone of `buffer`.
  5322. *
  5323. * @private
  5324. * @param {Buffer} buffer The buffer to clone.
  5325. * @param {boolean} [isDeep] Specify a deep clone.
  5326. * @returns {Buffer} Returns the cloned buffer.
  5327. */
  5328. function cloneBuffer(buffer, isDeep) {
  5329. if (isDeep) {
  5330. return buffer.slice();
  5331. }
  5332. var length = buffer.length,
  5333. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5334. buffer.copy(result);
  5335. return result;
  5336. }
  5337. /**
  5338. * Creates a clone of `arrayBuffer`.
  5339. *
  5340. * @private
  5341. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5342. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5343. */
  5344. function cloneArrayBuffer(arrayBuffer) {
  5345. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5346. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5347. return result;
  5348. }
  5349. /**
  5350. * Creates a clone of `dataView`.
  5351. *
  5352. * @private
  5353. * @param {Object} dataView The data view to clone.
  5354. * @param {boolean} [isDeep] Specify a deep clone.
  5355. * @returns {Object} Returns the cloned data view.
  5356. */
  5357. function cloneDataView(dataView, isDeep) {
  5358. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5359. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5360. }
  5361. /**
  5362. * Creates a clone of `regexp`.
  5363. *
  5364. * @private
  5365. * @param {Object} regexp The regexp to clone.
  5366. * @returns {Object} Returns the cloned regexp.
  5367. */
  5368. function cloneRegExp(regexp) {
  5369. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5370. result.lastIndex = regexp.lastIndex;
  5371. return result;
  5372. }
  5373. /**
  5374. * Creates a clone of the `symbol` object.
  5375. *
  5376. * @private
  5377. * @param {Object} symbol The symbol object to clone.
  5378. * @returns {Object} Returns the cloned symbol object.
  5379. */
  5380. function cloneSymbol(symbol) {
  5381. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5382. }
  5383. /**
  5384. * Creates a clone of `typedArray`.
  5385. *
  5386. * @private
  5387. * @param {Object} typedArray The typed array to clone.
  5388. * @param {boolean} [isDeep] Specify a deep clone.
  5389. * @returns {Object} Returns the cloned typed array.
  5390. */
  5391. function cloneTypedArray(typedArray, isDeep) {
  5392. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5393. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5394. }
  5395. /**
  5396. * Compares values to sort them in ascending order.
  5397. *
  5398. * @private
  5399. * @param {*} value The value to compare.
  5400. * @param {*} other The other value to compare.
  5401. * @returns {number} Returns the sort order indicator for `value`.
  5402. */
  5403. function compareAscending(value, other) {
  5404. if (value !== other) {
  5405. var valIsDefined = value !== undefined,
  5406. valIsNull = value === null,
  5407. valIsReflexive = value === value,
  5408. valIsSymbol = isSymbol(value);
  5409. var othIsDefined = other !== undefined,
  5410. othIsNull = other === null,
  5411. othIsReflexive = other === other,
  5412. othIsSymbol = isSymbol(other);
  5413. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5414. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5415. (valIsNull && othIsDefined && othIsReflexive) ||
  5416. (!valIsDefined && othIsReflexive) ||
  5417. !valIsReflexive) {
  5418. return 1;
  5419. }
  5420. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5421. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5422. (othIsNull && valIsDefined && valIsReflexive) ||
  5423. (!othIsDefined && valIsReflexive) ||
  5424. !othIsReflexive) {
  5425. return -1;
  5426. }
  5427. }
  5428. return 0;
  5429. }
  5430. /**
  5431. * Used by `_.orderBy` to compare multiple properties of a value to another
  5432. * and stable sort them.
  5433. *
  5434. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5435. * specify an order of "desc" for descending or "asc" for ascending sort order
  5436. * of corresponding values.
  5437. *
  5438. * @private
  5439. * @param {Object} object The object to compare.
  5440. * @param {Object} other The other object to compare.
  5441. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5442. * @returns {number} Returns the sort order indicator for `object`.
  5443. */
  5444. function compareMultiple(object, other, orders) {
  5445. var index = -1,
  5446. objCriteria = object.criteria,
  5447. othCriteria = other.criteria,
  5448. length = objCriteria.length,
  5449. ordersLength = orders.length;
  5450. while (++index < length) {
  5451. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5452. if (result) {
  5453. if (index >= ordersLength) {
  5454. return result;
  5455. }
  5456. var order = orders[index];
  5457. return result * (order == 'desc' ? -1 : 1);
  5458. }
  5459. }
  5460. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5461. // that causes it, under certain circumstances, to provide the same value for
  5462. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5463. // for more details.
  5464. //
  5465. // This also ensures a stable sort in V8 and other engines.
  5466. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5467. return object.index - other.index;
  5468. }
  5469. /**
  5470. * Creates an array that is the composition of partially applied arguments,
  5471. * placeholders, and provided arguments into a single array of arguments.
  5472. *
  5473. * @private
  5474. * @param {Array} args The provided arguments.
  5475. * @param {Array} partials The arguments to prepend to those provided.
  5476. * @param {Array} holders The `partials` placeholder indexes.
  5477. * @params {boolean} [isCurried] Specify composing for a curried function.
  5478. * @returns {Array} Returns the new array of composed arguments.
  5479. */
  5480. function composeArgs(args, partials, holders, isCurried) {
  5481. var argsIndex = -1,
  5482. argsLength = args.length,
  5483. holdersLength = holders.length,
  5484. leftIndex = -1,
  5485. leftLength = partials.length,
  5486. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5487. result = Array(leftLength + rangeLength),
  5488. isUncurried = !isCurried;
  5489. while (++leftIndex < leftLength) {
  5490. result[leftIndex] = partials[leftIndex];
  5491. }
  5492. while (++argsIndex < holdersLength) {
  5493. if (isUncurried || argsIndex < argsLength) {
  5494. result[holders[argsIndex]] = args[argsIndex];
  5495. }
  5496. }
  5497. while (rangeLength--) {
  5498. result[leftIndex++] = args[argsIndex++];
  5499. }
  5500. return result;
  5501. }
  5502. /**
  5503. * This function is like `composeArgs` except that the arguments composition
  5504. * is tailored for `_.partialRight`.
  5505. *
  5506. * @private
  5507. * @param {Array} args The provided arguments.
  5508. * @param {Array} partials The arguments to append to those provided.
  5509. * @param {Array} holders The `partials` placeholder indexes.
  5510. * @params {boolean} [isCurried] Specify composing for a curried function.
  5511. * @returns {Array} Returns the new array of composed arguments.
  5512. */
  5513. function composeArgsRight(args, partials, holders, isCurried) {
  5514. var argsIndex = -1,
  5515. argsLength = args.length,
  5516. holdersIndex = -1,
  5517. holdersLength = holders.length,
  5518. rightIndex = -1,
  5519. rightLength = partials.length,
  5520. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5521. result = Array(rangeLength + rightLength),
  5522. isUncurried = !isCurried;
  5523. while (++argsIndex < rangeLength) {
  5524. result[argsIndex] = args[argsIndex];
  5525. }
  5526. var offset = argsIndex;
  5527. while (++rightIndex < rightLength) {
  5528. result[offset + rightIndex] = partials[rightIndex];
  5529. }
  5530. while (++holdersIndex < holdersLength) {
  5531. if (isUncurried || argsIndex < argsLength) {
  5532. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5533. }
  5534. }
  5535. return result;
  5536. }
  5537. /**
  5538. * Copies the values of `source` to `array`.
  5539. *
  5540. * @private
  5541. * @param {Array} source The array to copy values from.
  5542. * @param {Array} [array=[]] The array to copy values to.
  5543. * @returns {Array} Returns `array`.
  5544. */
  5545. function copyArray(source, array) {
  5546. var index = -1,
  5547. length = source.length;
  5548. array || (array = Array(length));
  5549. while (++index < length) {
  5550. array[index] = source[index];
  5551. }
  5552. return array;
  5553. }
  5554. /**
  5555. * Copies properties of `source` to `object`.
  5556. *
  5557. * @private
  5558. * @param {Object} source The object to copy properties from.
  5559. * @param {Array} props The property identifiers to copy.
  5560. * @param {Object} [object={}] The object to copy properties to.
  5561. * @param {Function} [customizer] The function to customize copied values.
  5562. * @returns {Object} Returns `object`.
  5563. */
  5564. function copyObject(source, props, object, customizer) {
  5565. var isNew = !object;
  5566. object || (object = {});
  5567. var index = -1,
  5568. length = props.length;
  5569. while (++index < length) {
  5570. var key = props[index];
  5571. var newValue = customizer
  5572. ? customizer(object[key], source[key], key, object, source)
  5573. : undefined;
  5574. if (newValue === undefined) {
  5575. newValue = source[key];
  5576. }
  5577. if (isNew) {
  5578. baseAssignValue(object, key, newValue);
  5579. } else {
  5580. assignValue(object, key, newValue);
  5581. }
  5582. }
  5583. return object;
  5584. }
  5585. /**
  5586. * Copies own symbols of `source` to `object`.
  5587. *
  5588. * @private
  5589. * @param {Object} source The object to copy symbols from.
  5590. * @param {Object} [object={}] The object to copy symbols to.
  5591. * @returns {Object} Returns `object`.
  5592. */
  5593. function copySymbols(source, object) {
  5594. return copyObject(source, getSymbols(source), object);
  5595. }
  5596. /**
  5597. * Copies own and inherited symbols of `source` to `object`.
  5598. *
  5599. * @private
  5600. * @param {Object} source The object to copy symbols from.
  5601. * @param {Object} [object={}] The object to copy symbols to.
  5602. * @returns {Object} Returns `object`.
  5603. */
  5604. function copySymbolsIn(source, object) {
  5605. return copyObject(source, getSymbolsIn(source), object);
  5606. }
  5607. /**
  5608. * Creates a function like `_.groupBy`.
  5609. *
  5610. * @private
  5611. * @param {Function} setter The function to set accumulator values.
  5612. * @param {Function} [initializer] The accumulator object initializer.
  5613. * @returns {Function} Returns the new aggregator function.
  5614. */
  5615. function createAggregator(setter, initializer) {
  5616. return function(collection, iteratee) {
  5617. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5618. accumulator = initializer ? initializer() : {};
  5619. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5620. };
  5621. }
  5622. /**
  5623. * Creates a function like `_.assign`.
  5624. *
  5625. * @private
  5626. * @param {Function} assigner The function to assign values.
  5627. * @returns {Function} Returns the new assigner function.
  5628. */
  5629. function createAssigner(assigner) {
  5630. return baseRest(function(object, sources) {
  5631. var index = -1,
  5632. length = sources.length,
  5633. customizer = length > 1 ? sources[length - 1] : undefined,
  5634. guard = length > 2 ? sources[2] : undefined;
  5635. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5636. ? (length--, customizer)
  5637. : undefined;
  5638. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5639. customizer = length < 3 ? undefined : customizer;
  5640. length = 1;
  5641. }
  5642. object = Object(object);
  5643. while (++index < length) {
  5644. var source = sources[index];
  5645. if (source) {
  5646. assigner(object, source, index, customizer);
  5647. }
  5648. }
  5649. return object;
  5650. });
  5651. }
  5652. /**
  5653. * Creates a `baseEach` or `baseEachRight` function.
  5654. *
  5655. * @private
  5656. * @param {Function} eachFunc The function to iterate over a collection.
  5657. * @param {boolean} [fromRight] Specify iterating from right to left.
  5658. * @returns {Function} Returns the new base function.
  5659. */
  5660. function createBaseEach(eachFunc, fromRight) {
  5661. return function(collection, iteratee) {
  5662. if (collection == null) {
  5663. return collection;
  5664. }
  5665. if (!isArrayLike(collection)) {
  5666. return eachFunc(collection, iteratee);
  5667. }
  5668. var length = collection.length,
  5669. index = fromRight ? length : -1,
  5670. iterable = Object(collection);
  5671. while ((fromRight ? index-- : ++index < length)) {
  5672. if (iteratee(iterable[index], index, iterable) === false) {
  5673. break;
  5674. }
  5675. }
  5676. return collection;
  5677. };
  5678. }
  5679. /**
  5680. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5681. *
  5682. * @private
  5683. * @param {boolean} [fromRight] Specify iterating from right to left.
  5684. * @returns {Function} Returns the new base function.
  5685. */
  5686. function createBaseFor(fromRight) {
  5687. return function(object, iteratee, keysFunc) {
  5688. var index = -1,
  5689. iterable = Object(object),
  5690. props = keysFunc(object),
  5691. length = props.length;
  5692. while (length--) {
  5693. var key = props[fromRight ? length : ++index];
  5694. if (iteratee(iterable[key], key, iterable) === false) {
  5695. break;
  5696. }
  5697. }
  5698. return object;
  5699. };
  5700. }
  5701. /**
  5702. * Creates a function that wraps `func` to invoke it with the optional `this`
  5703. * binding of `thisArg`.
  5704. *
  5705. * @private
  5706. * @param {Function} func The function to wrap.
  5707. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5708. * @param {*} [thisArg] The `this` binding of `func`.
  5709. * @returns {Function} Returns the new wrapped function.
  5710. */
  5711. function createBind(func, bitmask, thisArg) {
  5712. var isBind = bitmask & WRAP_BIND_FLAG,
  5713. Ctor = createCtor(func);
  5714. function wrapper() {
  5715. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5716. return fn.apply(isBind ? thisArg : this, arguments);
  5717. }
  5718. return wrapper;
  5719. }
  5720. /**
  5721. * Creates a function like `_.lowerFirst`.
  5722. *
  5723. * @private
  5724. * @param {string} methodName The name of the `String` case method to use.
  5725. * @returns {Function} Returns the new case function.
  5726. */
  5727. function createCaseFirst(methodName) {
  5728. return function(string) {
  5729. string = toString(string);
  5730. var strSymbols = hasUnicode(string)
  5731. ? stringToArray(string)
  5732. : undefined;
  5733. var chr = strSymbols
  5734. ? strSymbols[0]
  5735. : string.charAt(0);
  5736. var trailing = strSymbols
  5737. ? castSlice(strSymbols, 1).join('')
  5738. : string.slice(1);
  5739. return chr[methodName]() + trailing;
  5740. };
  5741. }
  5742. /**
  5743. * Creates a function like `_.camelCase`.
  5744. *
  5745. * @private
  5746. * @param {Function} callback The function to combine each word.
  5747. * @returns {Function} Returns the new compounder function.
  5748. */
  5749. function createCompounder(callback) {
  5750. return function(string) {
  5751. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5752. };
  5753. }
  5754. /**
  5755. * Creates a function that produces an instance of `Ctor` regardless of
  5756. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5757. *
  5758. * @private
  5759. * @param {Function} Ctor The constructor to wrap.
  5760. * @returns {Function} Returns the new wrapped function.
  5761. */
  5762. function createCtor(Ctor) {
  5763. return function() {
  5764. // Use a `switch` statement to work with class constructors. See
  5765. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5766. // for more details.
  5767. var args = arguments;
  5768. switch (args.length) {
  5769. case 0: return new Ctor;
  5770. case 1: return new Ctor(args[0]);
  5771. case 2: return new Ctor(args[0], args[1]);
  5772. case 3: return new Ctor(args[0], args[1], args[2]);
  5773. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5774. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5775. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5776. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5777. }
  5778. var thisBinding = baseCreate(Ctor.prototype),
  5779. result = Ctor.apply(thisBinding, args);
  5780. // Mimic the constructor's `return` behavior.
  5781. // See https://es5.github.io/#x13.2.2 for more details.
  5782. return isObject(result) ? result : thisBinding;
  5783. };
  5784. }
  5785. /**
  5786. * Creates a function that wraps `func` to enable currying.
  5787. *
  5788. * @private
  5789. * @param {Function} func The function to wrap.
  5790. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5791. * @param {number} arity The arity of `func`.
  5792. * @returns {Function} Returns the new wrapped function.
  5793. */
  5794. function createCurry(func, bitmask, arity) {
  5795. var Ctor = createCtor(func);
  5796. function wrapper() {
  5797. var length = arguments.length,
  5798. args = Array(length),
  5799. index = length,
  5800. placeholder = getHolder(wrapper);
  5801. while (index--) {
  5802. args[index] = arguments[index];
  5803. }
  5804. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5805. ? []
  5806. : replaceHolders(args, placeholder);
  5807. length -= holders.length;
  5808. if (length < arity) {
  5809. return createRecurry(
  5810. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5811. args, holders, undefined, undefined, arity - length);
  5812. }
  5813. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5814. return apply(fn, this, args);
  5815. }
  5816. return wrapper;
  5817. }
  5818. /**
  5819. * Creates a `_.find` or `_.findLast` function.
  5820. *
  5821. * @private
  5822. * @param {Function} findIndexFunc The function to find the collection index.
  5823. * @returns {Function} Returns the new find function.
  5824. */
  5825. function createFind(findIndexFunc) {
  5826. return function(collection, predicate, fromIndex) {
  5827. var iterable = Object(collection);
  5828. if (!isArrayLike(collection)) {
  5829. var iteratee = getIteratee(predicate, 3);
  5830. collection = keys(collection);
  5831. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5832. }
  5833. var index = findIndexFunc(collection, predicate, fromIndex);
  5834. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5835. };
  5836. }
  5837. /**
  5838. * Creates a `_.flow` or `_.flowRight` function.
  5839. *
  5840. * @private
  5841. * @param {boolean} [fromRight] Specify iterating from right to left.
  5842. * @returns {Function} Returns the new flow function.
  5843. */
  5844. function createFlow(fromRight) {
  5845. return flatRest(function(funcs) {
  5846. var length = funcs.length,
  5847. index = length,
  5848. prereq = LodashWrapper.prototype.thru;
  5849. if (fromRight) {
  5850. funcs.reverse();
  5851. }
  5852. while (index--) {
  5853. var func = funcs[index];
  5854. if (typeof func != 'function') {
  5855. throw new TypeError(FUNC_ERROR_TEXT);
  5856. }
  5857. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5858. var wrapper = new LodashWrapper([], true);
  5859. }
  5860. }
  5861. index = wrapper ? index : length;
  5862. while (++index < length) {
  5863. func = funcs[index];
  5864. var funcName = getFuncName(func),
  5865. data = funcName == 'wrapper' ? getData(func) : undefined;
  5866. if (data && isLaziable(data[0]) &&
  5867. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5868. !data[4].length && data[9] == 1
  5869. ) {
  5870. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5871. } else {
  5872. wrapper = (func.length == 1 && isLaziable(func))
  5873. ? wrapper[funcName]()
  5874. : wrapper.thru(func);
  5875. }
  5876. }
  5877. return function() {
  5878. var args = arguments,
  5879. value = args[0];
  5880. if (wrapper && args.length == 1 && isArray(value)) {
  5881. return wrapper.plant(value).value();
  5882. }
  5883. var index = 0,
  5884. result = length ? funcs[index].apply(this, args) : value;
  5885. while (++index < length) {
  5886. result = funcs[index].call(this, result);
  5887. }
  5888. return result;
  5889. };
  5890. });
  5891. }
  5892. /**
  5893. * Creates a function that wraps `func` to invoke it with optional `this`
  5894. * binding of `thisArg`, partial application, and currying.
  5895. *
  5896. * @private
  5897. * @param {Function|string} func The function or method name to wrap.
  5898. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5899. * @param {*} [thisArg] The `this` binding of `func`.
  5900. * @param {Array} [partials] The arguments to prepend to those provided to
  5901. * the new function.
  5902. * @param {Array} [holders] The `partials` placeholder indexes.
  5903. * @param {Array} [partialsRight] The arguments to append to those provided
  5904. * to the new function.
  5905. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5906. * @param {Array} [argPos] The argument positions of the new function.
  5907. * @param {number} [ary] The arity cap of `func`.
  5908. * @param {number} [arity] The arity of `func`.
  5909. * @returns {Function} Returns the new wrapped function.
  5910. */
  5911. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5912. var isAry = bitmask & WRAP_ARY_FLAG,
  5913. isBind = bitmask & WRAP_BIND_FLAG,
  5914. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5915. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5916. isFlip = bitmask & WRAP_FLIP_FLAG,
  5917. Ctor = isBindKey ? undefined : createCtor(func);
  5918. function wrapper() {
  5919. var length = arguments.length,
  5920. args = Array(length),
  5921. index = length;
  5922. while (index--) {
  5923. args[index] = arguments[index];
  5924. }
  5925. if (isCurried) {
  5926. var placeholder = getHolder(wrapper),
  5927. holdersCount = countHolders(args, placeholder);
  5928. }
  5929. if (partials) {
  5930. args = composeArgs(args, partials, holders, isCurried);
  5931. }
  5932. if (partialsRight) {
  5933. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5934. }
  5935. length -= holdersCount;
  5936. if (isCurried && length < arity) {
  5937. var newHolders = replaceHolders(args, placeholder);
  5938. return createRecurry(
  5939. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5940. args, newHolders, argPos, ary, arity - length
  5941. );
  5942. }
  5943. var thisBinding = isBind ? thisArg : this,
  5944. fn = isBindKey ? thisBinding[func] : func;
  5945. length = args.length;
  5946. if (argPos) {
  5947. args = reorder(args, argPos);
  5948. } else if (isFlip && length > 1) {
  5949. args.reverse();
  5950. }
  5951. if (isAry && ary < length) {
  5952. args.length = ary;
  5953. }
  5954. if (this && this !== root && this instanceof wrapper) {
  5955. fn = Ctor || createCtor(fn);
  5956. }
  5957. return fn.apply(thisBinding, args);
  5958. }
  5959. return wrapper;
  5960. }
  5961. /**
  5962. * Creates a function like `_.invertBy`.
  5963. *
  5964. * @private
  5965. * @param {Function} setter The function to set accumulator values.
  5966. * @param {Function} toIteratee The function to resolve iteratees.
  5967. * @returns {Function} Returns the new inverter function.
  5968. */
  5969. function createInverter(setter, toIteratee) {
  5970. return function(object, iteratee) {
  5971. return baseInverter(object, setter, toIteratee(iteratee), {});
  5972. };
  5973. }
  5974. /**
  5975. * Creates a function that performs a mathematical operation on two values.
  5976. *
  5977. * @private
  5978. * @param {Function} operator The function to perform the operation.
  5979. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5980. * @returns {Function} Returns the new mathematical operation function.
  5981. */
  5982. function createMathOperation(operator, defaultValue) {
  5983. return function(value, other) {
  5984. var result;
  5985. if (value === undefined && other === undefined) {
  5986. return defaultValue;
  5987. }
  5988. if (value !== undefined) {
  5989. result = value;
  5990. }
  5991. if (other !== undefined) {
  5992. if (result === undefined) {
  5993. return other;
  5994. }
  5995. if (typeof value == 'string' || typeof other == 'string') {
  5996. value = baseToString(value);
  5997. other = baseToString(other);
  5998. } else {
  5999. value = baseToNumber(value);
  6000. other = baseToNumber(other);
  6001. }
  6002. result = operator(value, other);
  6003. }
  6004. return result;
  6005. };
  6006. }
  6007. /**
  6008. * Creates a function like `_.over`.
  6009. *
  6010. * @private
  6011. * @param {Function} arrayFunc The function to iterate over iteratees.
  6012. * @returns {Function} Returns the new over function.
  6013. */
  6014. function createOver(arrayFunc) {
  6015. return flatRest(function(iteratees) {
  6016. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6017. return baseRest(function(args) {
  6018. var thisArg = this;
  6019. return arrayFunc(iteratees, function(iteratee) {
  6020. return apply(iteratee, thisArg, args);
  6021. });
  6022. });
  6023. });
  6024. }
  6025. /**
  6026. * Creates the padding for `string` based on `length`. The `chars` string
  6027. * is truncated if the number of characters exceeds `length`.
  6028. *
  6029. * @private
  6030. * @param {number} length The padding length.
  6031. * @param {string} [chars=' '] The string used as padding.
  6032. * @returns {string} Returns the padding for `string`.
  6033. */
  6034. function createPadding(length, chars) {
  6035. chars = chars === undefined ? ' ' : baseToString(chars);
  6036. var charsLength = chars.length;
  6037. if (charsLength < 2) {
  6038. return charsLength ? baseRepeat(chars, length) : chars;
  6039. }
  6040. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6041. return hasUnicode(chars)
  6042. ? castSlice(stringToArray(result), 0, length).join('')
  6043. : result.slice(0, length);
  6044. }
  6045. /**
  6046. * Creates a function that wraps `func` to invoke it with the `this` binding
  6047. * of `thisArg` and `partials` prepended to the arguments it receives.
  6048. *
  6049. * @private
  6050. * @param {Function} func The function to wrap.
  6051. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6052. * @param {*} thisArg The `this` binding of `func`.
  6053. * @param {Array} partials The arguments to prepend to those provided to
  6054. * the new function.
  6055. * @returns {Function} Returns the new wrapped function.
  6056. */
  6057. function createPartial(func, bitmask, thisArg, partials) {
  6058. var isBind = bitmask & WRAP_BIND_FLAG,
  6059. Ctor = createCtor(func);
  6060. function wrapper() {
  6061. var argsIndex = -1,
  6062. argsLength = arguments.length,
  6063. leftIndex = -1,
  6064. leftLength = partials.length,
  6065. args = Array(leftLength + argsLength),
  6066. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6067. while (++leftIndex < leftLength) {
  6068. args[leftIndex] = partials[leftIndex];
  6069. }
  6070. while (argsLength--) {
  6071. args[leftIndex++] = arguments[++argsIndex];
  6072. }
  6073. return apply(fn, isBind ? thisArg : this, args);
  6074. }
  6075. return wrapper;
  6076. }
  6077. /**
  6078. * Creates a `_.range` or `_.rangeRight` function.
  6079. *
  6080. * @private
  6081. * @param {boolean} [fromRight] Specify iterating from right to left.
  6082. * @returns {Function} Returns the new range function.
  6083. */
  6084. function createRange(fromRight) {
  6085. return function(start, end, step) {
  6086. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6087. end = step = undefined;
  6088. }
  6089. // Ensure the sign of `-0` is preserved.
  6090. start = toFinite(start);
  6091. if (end === undefined) {
  6092. end = start;
  6093. start = 0;
  6094. } else {
  6095. end = toFinite(end);
  6096. }
  6097. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6098. return baseRange(start, end, step, fromRight);
  6099. };
  6100. }
  6101. /**
  6102. * Creates a function that performs a relational operation on two values.
  6103. *
  6104. * @private
  6105. * @param {Function} operator The function to perform the operation.
  6106. * @returns {Function} Returns the new relational operation function.
  6107. */
  6108. function createRelationalOperation(operator) {
  6109. return function(value, other) {
  6110. if (!(typeof value == 'string' && typeof other == 'string')) {
  6111. value = toNumber(value);
  6112. other = toNumber(other);
  6113. }
  6114. return operator(value, other);
  6115. };
  6116. }
  6117. /**
  6118. * Creates a function that wraps `func` to continue currying.
  6119. *
  6120. * @private
  6121. * @param {Function} func The function to wrap.
  6122. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6123. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6124. * @param {*} placeholder The placeholder value.
  6125. * @param {*} [thisArg] The `this` binding of `func`.
  6126. * @param {Array} [partials] The arguments to prepend to those provided to
  6127. * the new function.
  6128. * @param {Array} [holders] The `partials` placeholder indexes.
  6129. * @param {Array} [argPos] The argument positions of the new function.
  6130. * @param {number} [ary] The arity cap of `func`.
  6131. * @param {number} [arity] The arity of `func`.
  6132. * @returns {Function} Returns the new wrapped function.
  6133. */
  6134. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6135. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6136. newHolders = isCurry ? holders : undefined,
  6137. newHoldersRight = isCurry ? undefined : holders,
  6138. newPartials = isCurry ? partials : undefined,
  6139. newPartialsRight = isCurry ? undefined : partials;
  6140. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6141. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6142. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6143. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6144. }
  6145. var newData = [
  6146. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6147. newHoldersRight, argPos, ary, arity
  6148. ];
  6149. var result = wrapFunc.apply(undefined, newData);
  6150. if (isLaziable(func)) {
  6151. setData(result, newData);
  6152. }
  6153. result.placeholder = placeholder;
  6154. return setWrapToString(result, func, bitmask);
  6155. }
  6156. /**
  6157. * Creates a function like `_.round`.
  6158. *
  6159. * @private
  6160. * @param {string} methodName The name of the `Math` method to use when rounding.
  6161. * @returns {Function} Returns the new round function.
  6162. */
  6163. function createRound(methodName) {
  6164. var func = Math[methodName];
  6165. return function(number, precision) {
  6166. number = toNumber(number);
  6167. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6168. if (precision && nativeIsFinite(number)) {
  6169. // Shift with exponential notation to avoid floating-point issues.
  6170. // See [MDN](https://mdn.io/round#Examples) for more details.
  6171. var pair = (toString(number) + 'e').split('e'),
  6172. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6173. pair = (toString(value) + 'e').split('e');
  6174. return +(pair[0] + 'e' + (+pair[1] - precision));
  6175. }
  6176. return func(number);
  6177. };
  6178. }
  6179. /**
  6180. * Creates a set object of `values`.
  6181. *
  6182. * @private
  6183. * @param {Array} values The values to add to the set.
  6184. * @returns {Object} Returns the new set.
  6185. */
  6186. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6187. return new Set(values);
  6188. };
  6189. /**
  6190. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6191. *
  6192. * @private
  6193. * @param {Function} keysFunc The function to get the keys of a given object.
  6194. * @returns {Function} Returns the new pairs function.
  6195. */
  6196. function createToPairs(keysFunc) {
  6197. return function(object) {
  6198. var tag = getTag(object);
  6199. if (tag == mapTag) {
  6200. return mapToArray(object);
  6201. }
  6202. if (tag == setTag) {
  6203. return setToPairs(object);
  6204. }
  6205. return baseToPairs(object, keysFunc(object));
  6206. };
  6207. }
  6208. /**
  6209. * Creates a function that either curries or invokes `func` with optional
  6210. * `this` binding and partially applied arguments.
  6211. *
  6212. * @private
  6213. * @param {Function|string} func The function or method name to wrap.
  6214. * @param {number} bitmask The bitmask flags.
  6215. * 1 - `_.bind`
  6216. * 2 - `_.bindKey`
  6217. * 4 - `_.curry` or `_.curryRight` of a bound function
  6218. * 8 - `_.curry`
  6219. * 16 - `_.curryRight`
  6220. * 32 - `_.partial`
  6221. * 64 - `_.partialRight`
  6222. * 128 - `_.rearg`
  6223. * 256 - `_.ary`
  6224. * 512 - `_.flip`
  6225. * @param {*} [thisArg] The `this` binding of `func`.
  6226. * @param {Array} [partials] The arguments to be partially applied.
  6227. * @param {Array} [holders] The `partials` placeholder indexes.
  6228. * @param {Array} [argPos] The argument positions of the new function.
  6229. * @param {number} [ary] The arity cap of `func`.
  6230. * @param {number} [arity] The arity of `func`.
  6231. * @returns {Function} Returns the new wrapped function.
  6232. */
  6233. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6234. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6235. if (!isBindKey && typeof func != 'function') {
  6236. throw new TypeError(FUNC_ERROR_TEXT);
  6237. }
  6238. var length = partials ? partials.length : 0;
  6239. if (!length) {
  6240. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6241. partials = holders = undefined;
  6242. }
  6243. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6244. arity = arity === undefined ? arity : toInteger(arity);
  6245. length -= holders ? holders.length : 0;
  6246. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6247. var partialsRight = partials,
  6248. holdersRight = holders;
  6249. partials = holders = undefined;
  6250. }
  6251. var data = isBindKey ? undefined : getData(func);
  6252. var newData = [
  6253. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6254. argPos, ary, arity
  6255. ];
  6256. if (data) {
  6257. mergeData(newData, data);
  6258. }
  6259. func = newData[0];
  6260. bitmask = newData[1];
  6261. thisArg = newData[2];
  6262. partials = newData[3];
  6263. holders = newData[4];
  6264. arity = newData[9] = newData[9] === undefined
  6265. ? (isBindKey ? 0 : func.length)
  6266. : nativeMax(newData[9] - length, 0);
  6267. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6268. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6269. }
  6270. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6271. var result = createBind(func, bitmask, thisArg);
  6272. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6273. result = createCurry(func, bitmask, arity);
  6274. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6275. result = createPartial(func, bitmask, thisArg, partials);
  6276. } else {
  6277. result = createHybrid.apply(undefined, newData);
  6278. }
  6279. var setter = data ? baseSetData : setData;
  6280. return setWrapToString(setter(result, newData), func, bitmask);
  6281. }
  6282. /**
  6283. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6284. * of source objects to the destination object for all destination properties
  6285. * that resolve to `undefined`.
  6286. *
  6287. * @private
  6288. * @param {*} objValue The destination value.
  6289. * @param {*} srcValue The source value.
  6290. * @param {string} key The key of the property to assign.
  6291. * @param {Object} object The parent object of `objValue`.
  6292. * @returns {*} Returns the value to assign.
  6293. */
  6294. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6295. if (objValue === undefined ||
  6296. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6297. return srcValue;
  6298. }
  6299. return objValue;
  6300. }
  6301. /**
  6302. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6303. * objects into destination objects that are passed thru.
  6304. *
  6305. * @private
  6306. * @param {*} objValue The destination value.
  6307. * @param {*} srcValue The source value.
  6308. * @param {string} key The key of the property to merge.
  6309. * @param {Object} object The parent object of `objValue`.
  6310. * @param {Object} source The parent object of `srcValue`.
  6311. * @param {Object} [stack] Tracks traversed source values and their merged
  6312. * counterparts.
  6313. * @returns {*} Returns the value to assign.
  6314. */
  6315. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6316. if (isObject(objValue) && isObject(srcValue)) {
  6317. // Recursively merge objects and arrays (susceptible to call stack limits).
  6318. stack.set(srcValue, objValue);
  6319. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6320. stack['delete'](srcValue);
  6321. }
  6322. return objValue;
  6323. }
  6324. /**
  6325. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6326. * objects.
  6327. *
  6328. * @private
  6329. * @param {*} value The value to inspect.
  6330. * @param {string} key The key of the property to inspect.
  6331. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6332. */
  6333. function customOmitClone(value) {
  6334. return isPlainObject(value) ? undefined : value;
  6335. }
  6336. /**
  6337. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6338. * partial deep comparisons.
  6339. *
  6340. * @private
  6341. * @param {Array} array The array to compare.
  6342. * @param {Array} other The other array to compare.
  6343. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6344. * @param {Function} customizer The function to customize comparisons.
  6345. * @param {Function} equalFunc The function to determine equivalents of values.
  6346. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6347. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6348. */
  6349. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6350. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6351. arrLength = array.length,
  6352. othLength = other.length;
  6353. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6354. return false;
  6355. }
  6356. // Check that cyclic values are equal.
  6357. var arrStacked = stack.get(array);
  6358. var othStacked = stack.get(other);
  6359. if (arrStacked && othStacked) {
  6360. return arrStacked == other && othStacked == array;
  6361. }
  6362. var index = -1,
  6363. result = true,
  6364. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6365. stack.set(array, other);
  6366. stack.set(other, array);
  6367. // Ignore non-index properties.
  6368. while (++index < arrLength) {
  6369. var arrValue = array[index],
  6370. othValue = other[index];
  6371. if (customizer) {
  6372. var compared = isPartial
  6373. ? customizer(othValue, arrValue, index, other, array, stack)
  6374. : customizer(arrValue, othValue, index, array, other, stack);
  6375. }
  6376. if (compared !== undefined) {
  6377. if (compared) {
  6378. continue;
  6379. }
  6380. result = false;
  6381. break;
  6382. }
  6383. // Recursively compare arrays (susceptible to call stack limits).
  6384. if (seen) {
  6385. if (!arraySome(other, function(othValue, othIndex) {
  6386. if (!cacheHas(seen, othIndex) &&
  6387. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6388. return seen.push(othIndex);
  6389. }
  6390. })) {
  6391. result = false;
  6392. break;
  6393. }
  6394. } else if (!(
  6395. arrValue === othValue ||
  6396. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6397. )) {
  6398. result = false;
  6399. break;
  6400. }
  6401. }
  6402. stack['delete'](array);
  6403. stack['delete'](other);
  6404. return result;
  6405. }
  6406. /**
  6407. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6408. * the same `toStringTag`.
  6409. *
  6410. * **Note:** This function only supports comparing values with tags of
  6411. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6412. *
  6413. * @private
  6414. * @param {Object} object The object to compare.
  6415. * @param {Object} other The other object to compare.
  6416. * @param {string} tag The `toStringTag` of the objects to compare.
  6417. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6418. * @param {Function} customizer The function to customize comparisons.
  6419. * @param {Function} equalFunc The function to determine equivalents of values.
  6420. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6421. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6422. */
  6423. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6424. switch (tag) {
  6425. case dataViewTag:
  6426. if ((object.byteLength != other.byteLength) ||
  6427. (object.byteOffset != other.byteOffset)) {
  6428. return false;
  6429. }
  6430. object = object.buffer;
  6431. other = other.buffer;
  6432. case arrayBufferTag:
  6433. if ((object.byteLength != other.byteLength) ||
  6434. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6435. return false;
  6436. }
  6437. return true;
  6438. case boolTag:
  6439. case dateTag:
  6440. case numberTag:
  6441. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6442. // Invalid dates are coerced to `NaN`.
  6443. return eq(+object, +other);
  6444. case errorTag:
  6445. return object.name == other.name && object.message == other.message;
  6446. case regexpTag:
  6447. case stringTag:
  6448. // Coerce regexes to strings and treat strings, primitives and objects,
  6449. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6450. // for more details.
  6451. return object == (other + '');
  6452. case mapTag:
  6453. var convert = mapToArray;
  6454. case setTag:
  6455. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6456. convert || (convert = setToArray);
  6457. if (object.size != other.size && !isPartial) {
  6458. return false;
  6459. }
  6460. // Assume cyclic values are equal.
  6461. var stacked = stack.get(object);
  6462. if (stacked) {
  6463. return stacked == other;
  6464. }
  6465. bitmask |= COMPARE_UNORDERED_FLAG;
  6466. // Recursively compare objects (susceptible to call stack limits).
  6467. stack.set(object, other);
  6468. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6469. stack['delete'](object);
  6470. return result;
  6471. case symbolTag:
  6472. if (symbolValueOf) {
  6473. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6474. }
  6475. }
  6476. return false;
  6477. }
  6478. /**
  6479. * A specialized version of `baseIsEqualDeep` for objects with support for
  6480. * partial deep comparisons.
  6481. *
  6482. * @private
  6483. * @param {Object} object The object to compare.
  6484. * @param {Object} other The other object to compare.
  6485. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6486. * @param {Function} customizer The function to customize comparisons.
  6487. * @param {Function} equalFunc The function to determine equivalents of values.
  6488. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6489. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6490. */
  6491. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6492. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6493. objProps = getAllKeys(object),
  6494. objLength = objProps.length,
  6495. othProps = getAllKeys(other),
  6496. othLength = othProps.length;
  6497. if (objLength != othLength && !isPartial) {
  6498. return false;
  6499. }
  6500. var index = objLength;
  6501. while (index--) {
  6502. var key = objProps[index];
  6503. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6504. return false;
  6505. }
  6506. }
  6507. // Check that cyclic values are equal.
  6508. var objStacked = stack.get(object);
  6509. var othStacked = stack.get(other);
  6510. if (objStacked && othStacked) {
  6511. return objStacked == other && othStacked == object;
  6512. }
  6513. var result = true;
  6514. stack.set(object, other);
  6515. stack.set(other, object);
  6516. var skipCtor = isPartial;
  6517. while (++index < objLength) {
  6518. key = objProps[index];
  6519. var objValue = object[key],
  6520. othValue = other[key];
  6521. if (customizer) {
  6522. var compared = isPartial
  6523. ? customizer(othValue, objValue, key, other, object, stack)
  6524. : customizer(objValue, othValue, key, object, other, stack);
  6525. }
  6526. // Recursively compare objects (susceptible to call stack limits).
  6527. if (!(compared === undefined
  6528. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6529. : compared
  6530. )) {
  6531. result = false;
  6532. break;
  6533. }
  6534. skipCtor || (skipCtor = key == 'constructor');
  6535. }
  6536. if (result && !skipCtor) {
  6537. var objCtor = object.constructor,
  6538. othCtor = other.constructor;
  6539. // Non `Object` object instances with different constructors are not equal.
  6540. if (objCtor != othCtor &&
  6541. ('constructor' in object && 'constructor' in other) &&
  6542. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6543. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6544. result = false;
  6545. }
  6546. }
  6547. stack['delete'](object);
  6548. stack['delete'](other);
  6549. return result;
  6550. }
  6551. /**
  6552. * A specialized version of `baseRest` which flattens the rest array.
  6553. *
  6554. * @private
  6555. * @param {Function} func The function to apply a rest parameter to.
  6556. * @returns {Function} Returns the new function.
  6557. */
  6558. function flatRest(func) {
  6559. return setToString(overRest(func, undefined, flatten), func + '');
  6560. }
  6561. /**
  6562. * Creates an array of own enumerable property names and symbols of `object`.
  6563. *
  6564. * @private
  6565. * @param {Object} object The object to query.
  6566. * @returns {Array} Returns the array of property names and symbols.
  6567. */
  6568. function getAllKeys(object) {
  6569. return baseGetAllKeys(object, keys, getSymbols);
  6570. }
  6571. /**
  6572. * Creates an array of own and inherited enumerable property names and
  6573. * symbols of `object`.
  6574. *
  6575. * @private
  6576. * @param {Object} object The object to query.
  6577. * @returns {Array} Returns the array of property names and symbols.
  6578. */
  6579. function getAllKeysIn(object) {
  6580. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6581. }
  6582. /**
  6583. * Gets metadata for `func`.
  6584. *
  6585. * @private
  6586. * @param {Function} func The function to query.
  6587. * @returns {*} Returns the metadata for `func`.
  6588. */
  6589. var getData = !metaMap ? noop : function(func) {
  6590. return metaMap.get(func);
  6591. };
  6592. /**
  6593. * Gets the name of `func`.
  6594. *
  6595. * @private
  6596. * @param {Function} func The function to query.
  6597. * @returns {string} Returns the function name.
  6598. */
  6599. function getFuncName(func) {
  6600. var result = (func.name + ''),
  6601. array = realNames[result],
  6602. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6603. while (length--) {
  6604. var data = array[length],
  6605. otherFunc = data.func;
  6606. if (otherFunc == null || otherFunc == func) {
  6607. return data.name;
  6608. }
  6609. }
  6610. return result;
  6611. }
  6612. /**
  6613. * Gets the argument placeholder value for `func`.
  6614. *
  6615. * @private
  6616. * @param {Function} func The function to inspect.
  6617. * @returns {*} Returns the placeholder value.
  6618. */
  6619. function getHolder(func) {
  6620. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6621. return object.placeholder;
  6622. }
  6623. /**
  6624. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6625. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6626. * If arguments are provided, the chosen function is invoked with them and
  6627. * its result is returned.
  6628. *
  6629. * @private
  6630. * @param {*} [value] The value to convert to an iteratee.
  6631. * @param {number} [arity] The arity of the created iteratee.
  6632. * @returns {Function} Returns the chosen function or its result.
  6633. */
  6634. function getIteratee() {
  6635. var result = lodash.iteratee || iteratee;
  6636. result = result === iteratee ? baseIteratee : result;
  6637. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6638. }
  6639. /**
  6640. * Gets the data for `map`.
  6641. *
  6642. * @private
  6643. * @param {Object} map The map to query.
  6644. * @param {string} key The reference key.
  6645. * @returns {*} Returns the map data.
  6646. */
  6647. function getMapData(map, key) {
  6648. var data = map.__data__;
  6649. return isKeyable(key)
  6650. ? data[typeof key == 'string' ? 'string' : 'hash']
  6651. : data.map;
  6652. }
  6653. /**
  6654. * Gets the property names, values, and compare flags of `object`.
  6655. *
  6656. * @private
  6657. * @param {Object} object The object to query.
  6658. * @returns {Array} Returns the match data of `object`.
  6659. */
  6660. function getMatchData(object) {
  6661. var result = keys(object),
  6662. length = result.length;
  6663. while (length--) {
  6664. var key = result[length],
  6665. value = object[key];
  6666. result[length] = [key, value, isStrictComparable(value)];
  6667. }
  6668. return result;
  6669. }
  6670. /**
  6671. * Gets the native function at `key` of `object`.
  6672. *
  6673. * @private
  6674. * @param {Object} object The object to query.
  6675. * @param {string} key The key of the method to get.
  6676. * @returns {*} Returns the function if it's native, else `undefined`.
  6677. */
  6678. function getNative(object, key) {
  6679. var value = getValue(object, key);
  6680. return baseIsNative(value) ? value : undefined;
  6681. }
  6682. /**
  6683. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6684. *
  6685. * @private
  6686. * @param {*} value The value to query.
  6687. * @returns {string} Returns the raw `toStringTag`.
  6688. */
  6689. function getRawTag(value) {
  6690. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6691. tag = value[symToStringTag];
  6692. try {
  6693. value[symToStringTag] = undefined;
  6694. var unmasked = true;
  6695. } catch (e) {}
  6696. var result = nativeObjectToString.call(value);
  6697. if (unmasked) {
  6698. if (isOwn) {
  6699. value[symToStringTag] = tag;
  6700. } else {
  6701. delete value[symToStringTag];
  6702. }
  6703. }
  6704. return result;
  6705. }
  6706. /**
  6707. * Creates an array of the own enumerable symbols of `object`.
  6708. *
  6709. * @private
  6710. * @param {Object} object The object to query.
  6711. * @returns {Array} Returns the array of symbols.
  6712. */
  6713. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6714. if (object == null) {
  6715. return [];
  6716. }
  6717. object = Object(object);
  6718. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6719. return propertyIsEnumerable.call(object, symbol);
  6720. });
  6721. };
  6722. /**
  6723. * Creates an array of the own and inherited enumerable symbols of `object`.
  6724. *
  6725. * @private
  6726. * @param {Object} object The object to query.
  6727. * @returns {Array} Returns the array of symbols.
  6728. */
  6729. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6730. var result = [];
  6731. while (object) {
  6732. arrayPush(result, getSymbols(object));
  6733. object = getPrototype(object);
  6734. }
  6735. return result;
  6736. };
  6737. /**
  6738. * Gets the `toStringTag` of `value`.
  6739. *
  6740. * @private
  6741. * @param {*} value The value to query.
  6742. * @returns {string} Returns the `toStringTag`.
  6743. */
  6744. var getTag = baseGetTag;
  6745. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6746. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6747. (Map && getTag(new Map) != mapTag) ||
  6748. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6749. (Set && getTag(new Set) != setTag) ||
  6750. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6751. getTag = function(value) {
  6752. var result = baseGetTag(value),
  6753. Ctor = result == objectTag ? value.constructor : undefined,
  6754. ctorString = Ctor ? toSource(Ctor) : '';
  6755. if (ctorString) {
  6756. switch (ctorString) {
  6757. case dataViewCtorString: return dataViewTag;
  6758. case mapCtorString: return mapTag;
  6759. case promiseCtorString: return promiseTag;
  6760. case setCtorString: return setTag;
  6761. case weakMapCtorString: return weakMapTag;
  6762. }
  6763. }
  6764. return result;
  6765. };
  6766. }
  6767. /**
  6768. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6769. *
  6770. * @private
  6771. * @param {number} start The start of the view.
  6772. * @param {number} end The end of the view.
  6773. * @param {Array} transforms The transformations to apply to the view.
  6774. * @returns {Object} Returns an object containing the `start` and `end`
  6775. * positions of the view.
  6776. */
  6777. function getView(start, end, transforms) {
  6778. var index = -1,
  6779. length = transforms.length;
  6780. while (++index < length) {
  6781. var data = transforms[index],
  6782. size = data.size;
  6783. switch (data.type) {
  6784. case 'drop': start += size; break;
  6785. case 'dropRight': end -= size; break;
  6786. case 'take': end = nativeMin(end, start + size); break;
  6787. case 'takeRight': start = nativeMax(start, end - size); break;
  6788. }
  6789. }
  6790. return { 'start': start, 'end': end };
  6791. }
  6792. /**
  6793. * Extracts wrapper details from the `source` body comment.
  6794. *
  6795. * @private
  6796. * @param {string} source The source to inspect.
  6797. * @returns {Array} Returns the wrapper details.
  6798. */
  6799. function getWrapDetails(source) {
  6800. var match = source.match(reWrapDetails);
  6801. return match ? match[1].split(reSplitDetails) : [];
  6802. }
  6803. /**
  6804. * Checks if `path` exists on `object`.
  6805. *
  6806. * @private
  6807. * @param {Object} object The object to query.
  6808. * @param {Array|string} path The path to check.
  6809. * @param {Function} hasFunc The function to check properties.
  6810. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6811. */
  6812. function hasPath(object, path, hasFunc) {
  6813. path = castPath(path, object);
  6814. var index = -1,
  6815. length = path.length,
  6816. result = false;
  6817. while (++index < length) {
  6818. var key = toKey(path[index]);
  6819. if (!(result = object != null && hasFunc(object, key))) {
  6820. break;
  6821. }
  6822. object = object[key];
  6823. }
  6824. if (result || ++index != length) {
  6825. return result;
  6826. }
  6827. length = object == null ? 0 : object.length;
  6828. return !!length && isLength(length) && isIndex(key, length) &&
  6829. (isArray(object) || isArguments(object));
  6830. }
  6831. /**
  6832. * Initializes an array clone.
  6833. *
  6834. * @private
  6835. * @param {Array} array The array to clone.
  6836. * @returns {Array} Returns the initialized clone.
  6837. */
  6838. function initCloneArray(array) {
  6839. var length = array.length,
  6840. result = new array.constructor(length);
  6841. // Add properties assigned by `RegExp#exec`.
  6842. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6843. result.index = array.index;
  6844. result.input = array.input;
  6845. }
  6846. return result;
  6847. }
  6848. /**
  6849. * Initializes an object clone.
  6850. *
  6851. * @private
  6852. * @param {Object} object The object to clone.
  6853. * @returns {Object} Returns the initialized clone.
  6854. */
  6855. function initCloneObject(object) {
  6856. return (typeof object.constructor == 'function' && !isPrototype(object))
  6857. ? baseCreate(getPrototype(object))
  6858. : {};
  6859. }
  6860. /**
  6861. * Initializes an object clone based on its `toStringTag`.
  6862. *
  6863. * **Note:** This function only supports cloning values with tags of
  6864. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6865. *
  6866. * @private
  6867. * @param {Object} object The object to clone.
  6868. * @param {string} tag The `toStringTag` of the object to clone.
  6869. * @param {boolean} [isDeep] Specify a deep clone.
  6870. * @returns {Object} Returns the initialized clone.
  6871. */
  6872. function initCloneByTag(object, tag, isDeep) {
  6873. var Ctor = object.constructor;
  6874. switch (tag) {
  6875. case arrayBufferTag:
  6876. return cloneArrayBuffer(object);
  6877. case boolTag:
  6878. case dateTag:
  6879. return new Ctor(+object);
  6880. case dataViewTag:
  6881. return cloneDataView(object, isDeep);
  6882. case float32Tag: case float64Tag:
  6883. case int8Tag: case int16Tag: case int32Tag:
  6884. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6885. return cloneTypedArray(object, isDeep);
  6886. case mapTag:
  6887. return new Ctor;
  6888. case numberTag:
  6889. case stringTag:
  6890. return new Ctor(object);
  6891. case regexpTag:
  6892. return cloneRegExp(object);
  6893. case setTag:
  6894. return new Ctor;
  6895. case symbolTag:
  6896. return cloneSymbol(object);
  6897. }
  6898. }
  6899. /**
  6900. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6901. *
  6902. * @private
  6903. * @param {string} source The source to modify.
  6904. * @returns {Array} details The details to insert.
  6905. * @returns {string} Returns the modified source.
  6906. */
  6907. function insertWrapDetails(source, details) {
  6908. var length = details.length;
  6909. if (!length) {
  6910. return source;
  6911. }
  6912. var lastIndex = length - 1;
  6913. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6914. details = details.join(length > 2 ? ', ' : ' ');
  6915. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6916. }
  6917. /**
  6918. * Checks if `value` is a flattenable `arguments` object or array.
  6919. *
  6920. * @private
  6921. * @param {*} value The value to check.
  6922. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6923. */
  6924. function isFlattenable(value) {
  6925. return isArray(value) || isArguments(value) ||
  6926. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6927. }
  6928. /**
  6929. * Checks if `value` is a valid array-like index.
  6930. *
  6931. * @private
  6932. * @param {*} value The value to check.
  6933. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6934. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6935. */
  6936. function isIndex(value, length) {
  6937. var type = typeof value;
  6938. length = length == null ? MAX_SAFE_INTEGER : length;
  6939. return !!length &&
  6940. (type == 'number' ||
  6941. (type != 'symbol' && reIsUint.test(value))) &&
  6942. (value > -1 && value % 1 == 0 && value < length);
  6943. }
  6944. /**
  6945. * Checks if the given arguments are from an iteratee call.
  6946. *
  6947. * @private
  6948. * @param {*} value The potential iteratee value argument.
  6949. * @param {*} index The potential iteratee index or key argument.
  6950. * @param {*} object The potential iteratee object argument.
  6951. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6952. * else `false`.
  6953. */
  6954. function isIterateeCall(value, index, object) {
  6955. if (!isObject(object)) {
  6956. return false;
  6957. }
  6958. var type = typeof index;
  6959. if (type == 'number'
  6960. ? (isArrayLike(object) && isIndex(index, object.length))
  6961. : (type == 'string' && index in object)
  6962. ) {
  6963. return eq(object[index], value);
  6964. }
  6965. return false;
  6966. }
  6967. /**
  6968. * Checks if `value` is a property name and not a property path.
  6969. *
  6970. * @private
  6971. * @param {*} value The value to check.
  6972. * @param {Object} [object] The object to query keys on.
  6973. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6974. */
  6975. function isKey(value, object) {
  6976. if (isArray(value)) {
  6977. return false;
  6978. }
  6979. var type = typeof value;
  6980. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6981. value == null || isSymbol(value)) {
  6982. return true;
  6983. }
  6984. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6985. (object != null && value in Object(object));
  6986. }
  6987. /**
  6988. * Checks if `value` is suitable for use as unique object key.
  6989. *
  6990. * @private
  6991. * @param {*} value The value to check.
  6992. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6993. */
  6994. function isKeyable(value) {
  6995. var type = typeof value;
  6996. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6997. ? (value !== '__proto__')
  6998. : (value === null);
  6999. }
  7000. /**
  7001. * Checks if `func` has a lazy counterpart.
  7002. *
  7003. * @private
  7004. * @param {Function} func The function to check.
  7005. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7006. * else `false`.
  7007. */
  7008. function isLaziable(func) {
  7009. var funcName = getFuncName(func),
  7010. other = lodash[funcName];
  7011. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7012. return false;
  7013. }
  7014. if (func === other) {
  7015. return true;
  7016. }
  7017. var data = getData(other);
  7018. return !!data && func === data[0];
  7019. }
  7020. /**
  7021. * Checks if `func` has its source masked.
  7022. *
  7023. * @private
  7024. * @param {Function} func The function to check.
  7025. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7026. */
  7027. function isMasked(func) {
  7028. return !!maskSrcKey && (maskSrcKey in func);
  7029. }
  7030. /**
  7031. * Checks if `func` is capable of being masked.
  7032. *
  7033. * @private
  7034. * @param {*} value The value to check.
  7035. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7036. */
  7037. var isMaskable = coreJsData ? isFunction : stubFalse;
  7038. /**
  7039. * Checks if `value` is likely a prototype object.
  7040. *
  7041. * @private
  7042. * @param {*} value The value to check.
  7043. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7044. */
  7045. function isPrototype(value) {
  7046. var Ctor = value && value.constructor,
  7047. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7048. return value === proto;
  7049. }
  7050. /**
  7051. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7052. *
  7053. * @private
  7054. * @param {*} value The value to check.
  7055. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7056. * equality comparisons, else `false`.
  7057. */
  7058. function isStrictComparable(value) {
  7059. return value === value && !isObject(value);
  7060. }
  7061. /**
  7062. * A specialized version of `matchesProperty` for source values suitable
  7063. * for strict equality comparisons, i.e. `===`.
  7064. *
  7065. * @private
  7066. * @param {string} key The key of the property to get.
  7067. * @param {*} srcValue The value to match.
  7068. * @returns {Function} Returns the new spec function.
  7069. */
  7070. function matchesStrictComparable(key, srcValue) {
  7071. return function(object) {
  7072. if (object == null) {
  7073. return false;
  7074. }
  7075. return object[key] === srcValue &&
  7076. (srcValue !== undefined || (key in Object(object)));
  7077. };
  7078. }
  7079. /**
  7080. * A specialized version of `_.memoize` which clears the memoized function's
  7081. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7082. *
  7083. * @private
  7084. * @param {Function} func The function to have its output memoized.
  7085. * @returns {Function} Returns the new memoized function.
  7086. */
  7087. function memoizeCapped(func) {
  7088. var result = memoize(func, function(key) {
  7089. if (cache.size === MAX_MEMOIZE_SIZE) {
  7090. cache.clear();
  7091. }
  7092. return key;
  7093. });
  7094. var cache = result.cache;
  7095. return result;
  7096. }
  7097. /**
  7098. * Merges the function metadata of `source` into `data`.
  7099. *
  7100. * Merging metadata reduces the number of wrappers used to invoke a function.
  7101. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7102. * may be applied regardless of execution order. Methods like `_.ary` and
  7103. * `_.rearg` modify function arguments, making the order in which they are
  7104. * executed important, preventing the merging of metadata. However, we make
  7105. * an exception for a safe combined case where curried functions have `_.ary`
  7106. * and or `_.rearg` applied.
  7107. *
  7108. * @private
  7109. * @param {Array} data The destination metadata.
  7110. * @param {Array} source The source metadata.
  7111. * @returns {Array} Returns `data`.
  7112. */
  7113. function mergeData(data, source) {
  7114. var bitmask = data[1],
  7115. srcBitmask = source[1],
  7116. newBitmask = bitmask | srcBitmask,
  7117. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7118. var isCombo =
  7119. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7120. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7121. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7122. // Exit early if metadata can't be merged.
  7123. if (!(isCommon || isCombo)) {
  7124. return data;
  7125. }
  7126. // Use source `thisArg` if available.
  7127. if (srcBitmask & WRAP_BIND_FLAG) {
  7128. data[2] = source[2];
  7129. // Set when currying a bound function.
  7130. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7131. }
  7132. // Compose partial arguments.
  7133. var value = source[3];
  7134. if (value) {
  7135. var partials = data[3];
  7136. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7137. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7138. }
  7139. // Compose partial right arguments.
  7140. value = source[5];
  7141. if (value) {
  7142. partials = data[5];
  7143. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7144. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7145. }
  7146. // Use source `argPos` if available.
  7147. value = source[7];
  7148. if (value) {
  7149. data[7] = value;
  7150. }
  7151. // Use source `ary` if it's smaller.
  7152. if (srcBitmask & WRAP_ARY_FLAG) {
  7153. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7154. }
  7155. // Use source `arity` if one is not provided.
  7156. if (data[9] == null) {
  7157. data[9] = source[9];
  7158. }
  7159. // Use source `func` and merge bitmasks.
  7160. data[0] = source[0];
  7161. data[1] = newBitmask;
  7162. return data;
  7163. }
  7164. /**
  7165. * This function is like
  7166. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7167. * except that it includes inherited enumerable properties.
  7168. *
  7169. * @private
  7170. * @param {Object} object The object to query.
  7171. * @returns {Array} Returns the array of property names.
  7172. */
  7173. function nativeKeysIn(object) {
  7174. var result = [];
  7175. if (object != null) {
  7176. for (var key in Object(object)) {
  7177. result.push(key);
  7178. }
  7179. }
  7180. return result;
  7181. }
  7182. /**
  7183. * Converts `value` to a string using `Object.prototype.toString`.
  7184. *
  7185. * @private
  7186. * @param {*} value The value to convert.
  7187. * @returns {string} Returns the converted string.
  7188. */
  7189. function objectToString(value) {
  7190. return nativeObjectToString.call(value);
  7191. }
  7192. /**
  7193. * A specialized version of `baseRest` which transforms the rest array.
  7194. *
  7195. * @private
  7196. * @param {Function} func The function to apply a rest parameter to.
  7197. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7198. * @param {Function} transform The rest array transform.
  7199. * @returns {Function} Returns the new function.
  7200. */
  7201. function overRest(func, start, transform) {
  7202. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7203. return function() {
  7204. var args = arguments,
  7205. index = -1,
  7206. length = nativeMax(args.length - start, 0),
  7207. array = Array(length);
  7208. while (++index < length) {
  7209. array[index] = args[start + index];
  7210. }
  7211. index = -1;
  7212. var otherArgs = Array(start + 1);
  7213. while (++index < start) {
  7214. otherArgs[index] = args[index];
  7215. }
  7216. otherArgs[start] = transform(array);
  7217. return apply(func, this, otherArgs);
  7218. };
  7219. }
  7220. /**
  7221. * Gets the parent value at `path` of `object`.
  7222. *
  7223. * @private
  7224. * @param {Object} object The object to query.
  7225. * @param {Array} path The path to get the parent value of.
  7226. * @returns {*} Returns the parent value.
  7227. */
  7228. function parent(object, path) {
  7229. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7230. }
  7231. /**
  7232. * Reorder `array` according to the specified indexes where the element at
  7233. * the first index is assigned as the first element, the element at
  7234. * the second index is assigned as the second element, and so on.
  7235. *
  7236. * @private
  7237. * @param {Array} array The array to reorder.
  7238. * @param {Array} indexes The arranged array indexes.
  7239. * @returns {Array} Returns `array`.
  7240. */
  7241. function reorder(array, indexes) {
  7242. var arrLength = array.length,
  7243. length = nativeMin(indexes.length, arrLength),
  7244. oldArray = copyArray(array);
  7245. while (length--) {
  7246. var index = indexes[length];
  7247. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7248. }
  7249. return array;
  7250. }
  7251. /**
  7252. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7253. *
  7254. * @private
  7255. * @param {Object} object The object to query.
  7256. * @param {string} key The key of the property to get.
  7257. * @returns {*} Returns the property value.
  7258. */
  7259. function safeGet(object, key) {
  7260. if (key === 'constructor' && typeof object[key] === 'function') {
  7261. return;
  7262. }
  7263. if (key == '__proto__') {
  7264. return;
  7265. }
  7266. return object[key];
  7267. }
  7268. /**
  7269. * Sets metadata for `func`.
  7270. *
  7271. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7272. * period of time, it will trip its breaker and transition to an identity
  7273. * function to avoid garbage collection pauses in V8. See
  7274. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7275. * for more details.
  7276. *
  7277. * @private
  7278. * @param {Function} func The function to associate metadata with.
  7279. * @param {*} data The metadata.
  7280. * @returns {Function} Returns `func`.
  7281. */
  7282. var setData = shortOut(baseSetData);
  7283. /**
  7284. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7285. *
  7286. * @private
  7287. * @param {Function} func The function to delay.
  7288. * @param {number} wait The number of milliseconds to delay invocation.
  7289. * @returns {number|Object} Returns the timer id or timeout object.
  7290. */
  7291. var setTimeout = ctxSetTimeout || function(func, wait) {
  7292. return root.setTimeout(func, wait);
  7293. };
  7294. /**
  7295. * Sets the `toString` method of `func` to return `string`.
  7296. *
  7297. * @private
  7298. * @param {Function} func The function to modify.
  7299. * @param {Function} string The `toString` result.
  7300. * @returns {Function} Returns `func`.
  7301. */
  7302. var setToString = shortOut(baseSetToString);
  7303. /**
  7304. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7305. * with wrapper details in a comment at the top of the source body.
  7306. *
  7307. * @private
  7308. * @param {Function} wrapper The function to modify.
  7309. * @param {Function} reference The reference function.
  7310. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7311. * @returns {Function} Returns `wrapper`.
  7312. */
  7313. function setWrapToString(wrapper, reference, bitmask) {
  7314. var source = (reference + '');
  7315. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7316. }
  7317. /**
  7318. * Creates a function that'll short out and invoke `identity` instead
  7319. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7320. * milliseconds.
  7321. *
  7322. * @private
  7323. * @param {Function} func The function to restrict.
  7324. * @returns {Function} Returns the new shortable function.
  7325. */
  7326. function shortOut(func) {
  7327. var count = 0,
  7328. lastCalled = 0;
  7329. return function() {
  7330. var stamp = nativeNow(),
  7331. remaining = HOT_SPAN - (stamp - lastCalled);
  7332. lastCalled = stamp;
  7333. if (remaining > 0) {
  7334. if (++count >= HOT_COUNT) {
  7335. return arguments[0];
  7336. }
  7337. } else {
  7338. count = 0;
  7339. }
  7340. return func.apply(undefined, arguments);
  7341. };
  7342. }
  7343. /**
  7344. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7345. *
  7346. * @private
  7347. * @param {Array} array The array to shuffle.
  7348. * @param {number} [size=array.length] The size of `array`.
  7349. * @returns {Array} Returns `array`.
  7350. */
  7351. function shuffleSelf(array, size) {
  7352. var index = -1,
  7353. length = array.length,
  7354. lastIndex = length - 1;
  7355. size = size === undefined ? length : size;
  7356. while (++index < size) {
  7357. var rand = baseRandom(index, lastIndex),
  7358. value = array[rand];
  7359. array[rand] = array[index];
  7360. array[index] = value;
  7361. }
  7362. array.length = size;
  7363. return array;
  7364. }
  7365. /**
  7366. * Converts `string` to a property path array.
  7367. *
  7368. * @private
  7369. * @param {string} string The string to convert.
  7370. * @returns {Array} Returns the property path array.
  7371. */
  7372. var stringToPath = memoizeCapped(function(string) {
  7373. var result = [];
  7374. if (string.charCodeAt(0) === 46 /* . */) {
  7375. result.push('');
  7376. }
  7377. string.replace(rePropName, function(match, number, quote, subString) {
  7378. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7379. });
  7380. return result;
  7381. });
  7382. /**
  7383. * Converts `value` to a string key if it's not a string or symbol.
  7384. *
  7385. * @private
  7386. * @param {*} value The value to inspect.
  7387. * @returns {string|symbol} Returns the key.
  7388. */
  7389. function toKey(value) {
  7390. if (typeof value == 'string' || isSymbol(value)) {
  7391. return value;
  7392. }
  7393. var result = (value + '');
  7394. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7395. }
  7396. /**
  7397. * Converts `func` to its source code.
  7398. *
  7399. * @private
  7400. * @param {Function} func The function to convert.
  7401. * @returns {string} Returns the source code.
  7402. */
  7403. function toSource(func) {
  7404. if (func != null) {
  7405. try {
  7406. return funcToString.call(func);
  7407. } catch (e) {}
  7408. try {
  7409. return (func + '');
  7410. } catch (e) {}
  7411. }
  7412. return '';
  7413. }
  7414. /**
  7415. * Updates wrapper `details` based on `bitmask` flags.
  7416. *
  7417. * @private
  7418. * @returns {Array} details The details to modify.
  7419. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7420. * @returns {Array} Returns `details`.
  7421. */
  7422. function updateWrapDetails(details, bitmask) {
  7423. arrayEach(wrapFlags, function(pair) {
  7424. var value = '_.' + pair[0];
  7425. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7426. details.push(value);
  7427. }
  7428. });
  7429. return details.sort();
  7430. }
  7431. /**
  7432. * Creates a clone of `wrapper`.
  7433. *
  7434. * @private
  7435. * @param {Object} wrapper The wrapper to clone.
  7436. * @returns {Object} Returns the cloned wrapper.
  7437. */
  7438. function wrapperClone(wrapper) {
  7439. if (wrapper instanceof LazyWrapper) {
  7440. return wrapper.clone();
  7441. }
  7442. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7443. result.__actions__ = copyArray(wrapper.__actions__);
  7444. result.__index__ = wrapper.__index__;
  7445. result.__values__ = wrapper.__values__;
  7446. return result;
  7447. }
  7448. /*------------------------------------------------------------------------*/
  7449. /**
  7450. * Creates an array of elements split into groups the length of `size`.
  7451. * If `array` can't be split evenly, the final chunk will be the remaining
  7452. * elements.
  7453. *
  7454. * @static
  7455. * @memberOf _
  7456. * @since 3.0.0
  7457. * @category Array
  7458. * @param {Array} array The array to process.
  7459. * @param {number} [size=1] The length of each chunk
  7460. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7461. * @returns {Array} Returns the new array of chunks.
  7462. * @example
  7463. *
  7464. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7465. * // => [['a', 'b'], ['c', 'd']]
  7466. *
  7467. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7468. * // => [['a', 'b', 'c'], ['d']]
  7469. */
  7470. function chunk(array, size, guard) {
  7471. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7472. size = 1;
  7473. } else {
  7474. size = nativeMax(toInteger(size), 0);
  7475. }
  7476. var length = array == null ? 0 : array.length;
  7477. if (!length || size < 1) {
  7478. return [];
  7479. }
  7480. var index = 0,
  7481. resIndex = 0,
  7482. result = Array(nativeCeil(length / size));
  7483. while (index < length) {
  7484. result[resIndex++] = baseSlice(array, index, (index += size));
  7485. }
  7486. return result;
  7487. }
  7488. /**
  7489. * Creates an array with all falsey values removed. The values `false`, `null`,
  7490. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7491. *
  7492. * @static
  7493. * @memberOf _
  7494. * @since 0.1.0
  7495. * @category Array
  7496. * @param {Array} array The array to compact.
  7497. * @returns {Array} Returns the new array of filtered values.
  7498. * @example
  7499. *
  7500. * _.compact([0, 1, false, 2, '', 3]);
  7501. * // => [1, 2, 3]
  7502. */
  7503. function compact(array) {
  7504. var index = -1,
  7505. length = array == null ? 0 : array.length,
  7506. resIndex = 0,
  7507. result = [];
  7508. while (++index < length) {
  7509. var value = array[index];
  7510. if (value) {
  7511. result[resIndex++] = value;
  7512. }
  7513. }
  7514. return result;
  7515. }
  7516. /**
  7517. * Creates a new array concatenating `array` with any additional arrays
  7518. * and/or values.
  7519. *
  7520. * @static
  7521. * @memberOf _
  7522. * @since 4.0.0
  7523. * @category Array
  7524. * @param {Array} array The array to concatenate.
  7525. * @param {...*} [values] The values to concatenate.
  7526. * @returns {Array} Returns the new concatenated array.
  7527. * @example
  7528. *
  7529. * var array = [1];
  7530. * var other = _.concat(array, 2, [3], [[4]]);
  7531. *
  7532. * console.log(other);
  7533. * // => [1, 2, 3, [4]]
  7534. *
  7535. * console.log(array);
  7536. * // => [1]
  7537. */
  7538. function concat() {
  7539. var length = arguments.length;
  7540. if (!length) {
  7541. return [];
  7542. }
  7543. var args = Array(length - 1),
  7544. array = arguments[0],
  7545. index = length;
  7546. while (index--) {
  7547. args[index - 1] = arguments[index];
  7548. }
  7549. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7550. }
  7551. /**
  7552. * Creates an array of `array` values not included in the other given arrays
  7553. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7554. * for equality comparisons. The order and references of result values are
  7555. * determined by the first array.
  7556. *
  7557. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7558. *
  7559. * @static
  7560. * @memberOf _
  7561. * @since 0.1.0
  7562. * @category Array
  7563. * @param {Array} array The array to inspect.
  7564. * @param {...Array} [values] The values to exclude.
  7565. * @returns {Array} Returns the new array of filtered values.
  7566. * @see _.without, _.xor
  7567. * @example
  7568. *
  7569. * _.difference([2, 1], [2, 3]);
  7570. * // => [1]
  7571. */
  7572. var difference = baseRest(function(array, values) {
  7573. return isArrayLikeObject(array)
  7574. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7575. : [];
  7576. });
  7577. /**
  7578. * This method is like `_.difference` except that it accepts `iteratee` which
  7579. * is invoked for each element of `array` and `values` to generate the criterion
  7580. * by which they're compared. The order and references of result values are
  7581. * determined by the first array. The iteratee is invoked with one argument:
  7582. * (value).
  7583. *
  7584. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7585. *
  7586. * @static
  7587. * @memberOf _
  7588. * @since 4.0.0
  7589. * @category Array
  7590. * @param {Array} array The array to inspect.
  7591. * @param {...Array} [values] The values to exclude.
  7592. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7593. * @returns {Array} Returns the new array of filtered values.
  7594. * @example
  7595. *
  7596. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7597. * // => [1.2]
  7598. *
  7599. * // The `_.property` iteratee shorthand.
  7600. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7601. * // => [{ 'x': 2 }]
  7602. */
  7603. var differenceBy = baseRest(function(array, values) {
  7604. var iteratee = last(values);
  7605. if (isArrayLikeObject(iteratee)) {
  7606. iteratee = undefined;
  7607. }
  7608. return isArrayLikeObject(array)
  7609. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7610. : [];
  7611. });
  7612. /**
  7613. * This method is like `_.difference` except that it accepts `comparator`
  7614. * which is invoked to compare elements of `array` to `values`. The order and
  7615. * references of result values are determined by the first array. The comparator
  7616. * is invoked with two arguments: (arrVal, othVal).
  7617. *
  7618. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7619. *
  7620. * @static
  7621. * @memberOf _
  7622. * @since 4.0.0
  7623. * @category Array
  7624. * @param {Array} array The array to inspect.
  7625. * @param {...Array} [values] The values to exclude.
  7626. * @param {Function} [comparator] The comparator invoked per element.
  7627. * @returns {Array} Returns the new array of filtered values.
  7628. * @example
  7629. *
  7630. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7631. *
  7632. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7633. * // => [{ 'x': 2, 'y': 1 }]
  7634. */
  7635. var differenceWith = baseRest(function(array, values) {
  7636. var comparator = last(values);
  7637. if (isArrayLikeObject(comparator)) {
  7638. comparator = undefined;
  7639. }
  7640. return isArrayLikeObject(array)
  7641. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7642. : [];
  7643. });
  7644. /**
  7645. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7646. *
  7647. * @static
  7648. * @memberOf _
  7649. * @since 0.5.0
  7650. * @category Array
  7651. * @param {Array} array The array to query.
  7652. * @param {number} [n=1] The number of elements to drop.
  7653. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7654. * @returns {Array} Returns the slice of `array`.
  7655. * @example
  7656. *
  7657. * _.drop([1, 2, 3]);
  7658. * // => [2, 3]
  7659. *
  7660. * _.drop([1, 2, 3], 2);
  7661. * // => [3]
  7662. *
  7663. * _.drop([1, 2, 3], 5);
  7664. * // => []
  7665. *
  7666. * _.drop([1, 2, 3], 0);
  7667. * // => [1, 2, 3]
  7668. */
  7669. function drop(array, n, guard) {
  7670. var length = array == null ? 0 : array.length;
  7671. if (!length) {
  7672. return [];
  7673. }
  7674. n = (guard || n === undefined) ? 1 : toInteger(n);
  7675. return baseSlice(array, n < 0 ? 0 : n, length);
  7676. }
  7677. /**
  7678. * Creates a slice of `array` with `n` elements dropped from the end.
  7679. *
  7680. * @static
  7681. * @memberOf _
  7682. * @since 3.0.0
  7683. * @category Array
  7684. * @param {Array} array The array to query.
  7685. * @param {number} [n=1] The number of elements to drop.
  7686. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7687. * @returns {Array} Returns the slice of `array`.
  7688. * @example
  7689. *
  7690. * _.dropRight([1, 2, 3]);
  7691. * // => [1, 2]
  7692. *
  7693. * _.dropRight([1, 2, 3], 2);
  7694. * // => [1]
  7695. *
  7696. * _.dropRight([1, 2, 3], 5);
  7697. * // => []
  7698. *
  7699. * _.dropRight([1, 2, 3], 0);
  7700. * // => [1, 2, 3]
  7701. */
  7702. function dropRight(array, n, guard) {
  7703. var length = array == null ? 0 : array.length;
  7704. if (!length) {
  7705. return [];
  7706. }
  7707. n = (guard || n === undefined) ? 1 : toInteger(n);
  7708. n = length - n;
  7709. return baseSlice(array, 0, n < 0 ? 0 : n);
  7710. }
  7711. /**
  7712. * Creates a slice of `array` excluding elements dropped from the end.
  7713. * Elements are dropped until `predicate` returns falsey. The predicate is
  7714. * invoked with three arguments: (value, index, array).
  7715. *
  7716. * @static
  7717. * @memberOf _
  7718. * @since 3.0.0
  7719. * @category Array
  7720. * @param {Array} array The array to query.
  7721. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7722. * @returns {Array} Returns the slice of `array`.
  7723. * @example
  7724. *
  7725. * var users = [
  7726. * { 'user': 'barney', 'active': true },
  7727. * { 'user': 'fred', 'active': false },
  7728. * { 'user': 'pebbles', 'active': false }
  7729. * ];
  7730. *
  7731. * _.dropRightWhile(users, function(o) { return !o.active; });
  7732. * // => objects for ['barney']
  7733. *
  7734. * // The `_.matches` iteratee shorthand.
  7735. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7736. * // => objects for ['barney', 'fred']
  7737. *
  7738. * // The `_.matchesProperty` iteratee shorthand.
  7739. * _.dropRightWhile(users, ['active', false]);
  7740. * // => objects for ['barney']
  7741. *
  7742. * // The `_.property` iteratee shorthand.
  7743. * _.dropRightWhile(users, 'active');
  7744. * // => objects for ['barney', 'fred', 'pebbles']
  7745. */
  7746. function dropRightWhile(array, predicate) {
  7747. return (array && array.length)
  7748. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7749. : [];
  7750. }
  7751. /**
  7752. * Creates a slice of `array` excluding elements dropped from the beginning.
  7753. * Elements are dropped until `predicate` returns falsey. The predicate is
  7754. * invoked with three arguments: (value, index, array).
  7755. *
  7756. * @static
  7757. * @memberOf _
  7758. * @since 3.0.0
  7759. * @category Array
  7760. * @param {Array} array The array to query.
  7761. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7762. * @returns {Array} Returns the slice of `array`.
  7763. * @example
  7764. *
  7765. * var users = [
  7766. * { 'user': 'barney', 'active': false },
  7767. * { 'user': 'fred', 'active': false },
  7768. * { 'user': 'pebbles', 'active': true }
  7769. * ];
  7770. *
  7771. * _.dropWhile(users, function(o) { return !o.active; });
  7772. * // => objects for ['pebbles']
  7773. *
  7774. * // The `_.matches` iteratee shorthand.
  7775. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7776. * // => objects for ['fred', 'pebbles']
  7777. *
  7778. * // The `_.matchesProperty` iteratee shorthand.
  7779. * _.dropWhile(users, ['active', false]);
  7780. * // => objects for ['pebbles']
  7781. *
  7782. * // The `_.property` iteratee shorthand.
  7783. * _.dropWhile(users, 'active');
  7784. * // => objects for ['barney', 'fred', 'pebbles']
  7785. */
  7786. function dropWhile(array, predicate) {
  7787. return (array && array.length)
  7788. ? baseWhile(array, getIteratee(predicate, 3), true)
  7789. : [];
  7790. }
  7791. /**
  7792. * Fills elements of `array` with `value` from `start` up to, but not
  7793. * including, `end`.
  7794. *
  7795. * **Note:** This method mutates `array`.
  7796. *
  7797. * @static
  7798. * @memberOf _
  7799. * @since 3.2.0
  7800. * @category Array
  7801. * @param {Array} array The array to fill.
  7802. * @param {*} value The value to fill `array` with.
  7803. * @param {number} [start=0] The start position.
  7804. * @param {number} [end=array.length] The end position.
  7805. * @returns {Array} Returns `array`.
  7806. * @example
  7807. *
  7808. * var array = [1, 2, 3];
  7809. *
  7810. * _.fill(array, 'a');
  7811. * console.log(array);
  7812. * // => ['a', 'a', 'a']
  7813. *
  7814. * _.fill(Array(3), 2);
  7815. * // => [2, 2, 2]
  7816. *
  7817. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7818. * // => [4, '*', '*', 10]
  7819. */
  7820. function fill(array, value, start, end) {
  7821. var length = array == null ? 0 : array.length;
  7822. if (!length) {
  7823. return [];
  7824. }
  7825. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7826. start = 0;
  7827. end = length;
  7828. }
  7829. return baseFill(array, value, start, end);
  7830. }
  7831. /**
  7832. * This method is like `_.find` except that it returns the index of the first
  7833. * element `predicate` returns truthy for instead of the element itself.
  7834. *
  7835. * @static
  7836. * @memberOf _
  7837. * @since 1.1.0
  7838. * @category Array
  7839. * @param {Array} array The array to inspect.
  7840. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7841. * @param {number} [fromIndex=0] The index to search from.
  7842. * @returns {number} Returns the index of the found element, else `-1`.
  7843. * @example
  7844. *
  7845. * var users = [
  7846. * { 'user': 'barney', 'active': false },
  7847. * { 'user': 'fred', 'active': false },
  7848. * { 'user': 'pebbles', 'active': true }
  7849. * ];
  7850. *
  7851. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7852. * // => 0
  7853. *
  7854. * // The `_.matches` iteratee shorthand.
  7855. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7856. * // => 1
  7857. *
  7858. * // The `_.matchesProperty` iteratee shorthand.
  7859. * _.findIndex(users, ['active', false]);
  7860. * // => 0
  7861. *
  7862. * // The `_.property` iteratee shorthand.
  7863. * _.findIndex(users, 'active');
  7864. * // => 2
  7865. */
  7866. function findIndex(array, predicate, fromIndex) {
  7867. var length = array == null ? 0 : array.length;
  7868. if (!length) {
  7869. return -1;
  7870. }
  7871. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7872. if (index < 0) {
  7873. index = nativeMax(length + index, 0);
  7874. }
  7875. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7876. }
  7877. /**
  7878. * This method is like `_.findIndex` except that it iterates over elements
  7879. * of `collection` from right to left.
  7880. *
  7881. * @static
  7882. * @memberOf _
  7883. * @since 2.0.0
  7884. * @category Array
  7885. * @param {Array} array The array to inspect.
  7886. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7887. * @param {number} [fromIndex=array.length-1] The index to search from.
  7888. * @returns {number} Returns the index of the found element, else `-1`.
  7889. * @example
  7890. *
  7891. * var users = [
  7892. * { 'user': 'barney', 'active': true },
  7893. * { 'user': 'fred', 'active': false },
  7894. * { 'user': 'pebbles', 'active': false }
  7895. * ];
  7896. *
  7897. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7898. * // => 2
  7899. *
  7900. * // The `_.matches` iteratee shorthand.
  7901. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7902. * // => 0
  7903. *
  7904. * // The `_.matchesProperty` iteratee shorthand.
  7905. * _.findLastIndex(users, ['active', false]);
  7906. * // => 2
  7907. *
  7908. * // The `_.property` iteratee shorthand.
  7909. * _.findLastIndex(users, 'active');
  7910. * // => 0
  7911. */
  7912. function findLastIndex(array, predicate, fromIndex) {
  7913. var length = array == null ? 0 : array.length;
  7914. if (!length) {
  7915. return -1;
  7916. }
  7917. var index = length - 1;
  7918. if (fromIndex !== undefined) {
  7919. index = toInteger(fromIndex);
  7920. index = fromIndex < 0
  7921. ? nativeMax(length + index, 0)
  7922. : nativeMin(index, length - 1);
  7923. }
  7924. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7925. }
  7926. /**
  7927. * Flattens `array` a single level deep.
  7928. *
  7929. * @static
  7930. * @memberOf _
  7931. * @since 0.1.0
  7932. * @category Array
  7933. * @param {Array} array The array to flatten.
  7934. * @returns {Array} Returns the new flattened array.
  7935. * @example
  7936. *
  7937. * _.flatten([1, [2, [3, [4]], 5]]);
  7938. * // => [1, 2, [3, [4]], 5]
  7939. */
  7940. function flatten(array) {
  7941. var length = array == null ? 0 : array.length;
  7942. return length ? baseFlatten(array, 1) : [];
  7943. }
  7944. /**
  7945. * Recursively flattens `array`.
  7946. *
  7947. * @static
  7948. * @memberOf _
  7949. * @since 3.0.0
  7950. * @category Array
  7951. * @param {Array} array The array to flatten.
  7952. * @returns {Array} Returns the new flattened array.
  7953. * @example
  7954. *
  7955. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7956. * // => [1, 2, 3, 4, 5]
  7957. */
  7958. function flattenDeep(array) {
  7959. var length = array == null ? 0 : array.length;
  7960. return length ? baseFlatten(array, INFINITY) : [];
  7961. }
  7962. /**
  7963. * Recursively flatten `array` up to `depth` times.
  7964. *
  7965. * @static
  7966. * @memberOf _
  7967. * @since 4.4.0
  7968. * @category Array
  7969. * @param {Array} array The array to flatten.
  7970. * @param {number} [depth=1] The maximum recursion depth.
  7971. * @returns {Array} Returns the new flattened array.
  7972. * @example
  7973. *
  7974. * var array = [1, [2, [3, [4]], 5]];
  7975. *
  7976. * _.flattenDepth(array, 1);
  7977. * // => [1, 2, [3, [4]], 5]
  7978. *
  7979. * _.flattenDepth(array, 2);
  7980. * // => [1, 2, 3, [4], 5]
  7981. */
  7982. function flattenDepth(array, depth) {
  7983. var length = array == null ? 0 : array.length;
  7984. if (!length) {
  7985. return [];
  7986. }
  7987. depth = depth === undefined ? 1 : toInteger(depth);
  7988. return baseFlatten(array, depth);
  7989. }
  7990. /**
  7991. * The inverse of `_.toPairs`; this method returns an object composed
  7992. * from key-value `pairs`.
  7993. *
  7994. * @static
  7995. * @memberOf _
  7996. * @since 4.0.0
  7997. * @category Array
  7998. * @param {Array} pairs The key-value pairs.
  7999. * @returns {Object} Returns the new object.
  8000. * @example
  8001. *
  8002. * _.fromPairs([['a', 1], ['b', 2]]);
  8003. * // => { 'a': 1, 'b': 2 }
  8004. */
  8005. function fromPairs(pairs) {
  8006. var index = -1,
  8007. length = pairs == null ? 0 : pairs.length,
  8008. result = {};
  8009. while (++index < length) {
  8010. var pair = pairs[index];
  8011. result[pair[0]] = pair[1];
  8012. }
  8013. return result;
  8014. }
  8015. /**
  8016. * Gets the first element of `array`.
  8017. *
  8018. * @static
  8019. * @memberOf _
  8020. * @since 0.1.0
  8021. * @alias first
  8022. * @category Array
  8023. * @param {Array} array The array to query.
  8024. * @returns {*} Returns the first element of `array`.
  8025. * @example
  8026. *
  8027. * _.head([1, 2, 3]);
  8028. * // => 1
  8029. *
  8030. * _.head([]);
  8031. * // => undefined
  8032. */
  8033. function head(array) {
  8034. return (array && array.length) ? array[0] : undefined;
  8035. }
  8036. /**
  8037. * Gets the index at which the first occurrence of `value` is found in `array`
  8038. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8039. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8040. * offset from the end of `array`.
  8041. *
  8042. * @static
  8043. * @memberOf _
  8044. * @since 0.1.0
  8045. * @category Array
  8046. * @param {Array} array The array to inspect.
  8047. * @param {*} value The value to search for.
  8048. * @param {number} [fromIndex=0] The index to search from.
  8049. * @returns {number} Returns the index of the matched value, else `-1`.
  8050. * @example
  8051. *
  8052. * _.indexOf([1, 2, 1, 2], 2);
  8053. * // => 1
  8054. *
  8055. * // Search from the `fromIndex`.
  8056. * _.indexOf([1, 2, 1, 2], 2, 2);
  8057. * // => 3
  8058. */
  8059. function indexOf(array, value, fromIndex) {
  8060. var length = array == null ? 0 : array.length;
  8061. if (!length) {
  8062. return -1;
  8063. }
  8064. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8065. if (index < 0) {
  8066. index = nativeMax(length + index, 0);
  8067. }
  8068. return baseIndexOf(array, value, index);
  8069. }
  8070. /**
  8071. * Gets all but the last element of `array`.
  8072. *
  8073. * @static
  8074. * @memberOf _
  8075. * @since 0.1.0
  8076. * @category Array
  8077. * @param {Array} array The array to query.
  8078. * @returns {Array} Returns the slice of `array`.
  8079. * @example
  8080. *
  8081. * _.initial([1, 2, 3]);
  8082. * // => [1, 2]
  8083. */
  8084. function initial(array) {
  8085. var length = array == null ? 0 : array.length;
  8086. return length ? baseSlice(array, 0, -1) : [];
  8087. }
  8088. /**
  8089. * Creates an array of unique values that are included in all given arrays
  8090. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8091. * for equality comparisons. The order and references of result values are
  8092. * determined by the first array.
  8093. *
  8094. * @static
  8095. * @memberOf _
  8096. * @since 0.1.0
  8097. * @category Array
  8098. * @param {...Array} [arrays] The arrays to inspect.
  8099. * @returns {Array} Returns the new array of intersecting values.
  8100. * @example
  8101. *
  8102. * _.intersection([2, 1], [2, 3]);
  8103. * // => [2]
  8104. */
  8105. var intersection = baseRest(function(arrays) {
  8106. var mapped = arrayMap(arrays, castArrayLikeObject);
  8107. return (mapped.length && mapped[0] === arrays[0])
  8108. ? baseIntersection(mapped)
  8109. : [];
  8110. });
  8111. /**
  8112. * This method is like `_.intersection` except that it accepts `iteratee`
  8113. * which is invoked for each element of each `arrays` to generate the criterion
  8114. * by which they're compared. The order and references of result values are
  8115. * determined by the first array. The iteratee is invoked with one argument:
  8116. * (value).
  8117. *
  8118. * @static
  8119. * @memberOf _
  8120. * @since 4.0.0
  8121. * @category Array
  8122. * @param {...Array} [arrays] The arrays to inspect.
  8123. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8124. * @returns {Array} Returns the new array of intersecting values.
  8125. * @example
  8126. *
  8127. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8128. * // => [2.1]
  8129. *
  8130. * // The `_.property` iteratee shorthand.
  8131. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8132. * // => [{ 'x': 1 }]
  8133. */
  8134. var intersectionBy = baseRest(function(arrays) {
  8135. var iteratee = last(arrays),
  8136. mapped = arrayMap(arrays, castArrayLikeObject);
  8137. if (iteratee === last(mapped)) {
  8138. iteratee = undefined;
  8139. } else {
  8140. mapped.pop();
  8141. }
  8142. return (mapped.length && mapped[0] === arrays[0])
  8143. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8144. : [];
  8145. });
  8146. /**
  8147. * This method is like `_.intersection` except that it accepts `comparator`
  8148. * which is invoked to compare elements of `arrays`. The order and references
  8149. * of result values are determined by the first array. The comparator is
  8150. * invoked with two arguments: (arrVal, othVal).
  8151. *
  8152. * @static
  8153. * @memberOf _
  8154. * @since 4.0.0
  8155. * @category Array
  8156. * @param {...Array} [arrays] The arrays to inspect.
  8157. * @param {Function} [comparator] The comparator invoked per element.
  8158. * @returns {Array} Returns the new array of intersecting values.
  8159. * @example
  8160. *
  8161. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8162. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8163. *
  8164. * _.intersectionWith(objects, others, _.isEqual);
  8165. * // => [{ 'x': 1, 'y': 2 }]
  8166. */
  8167. var intersectionWith = baseRest(function(arrays) {
  8168. var comparator = last(arrays),
  8169. mapped = arrayMap(arrays, castArrayLikeObject);
  8170. comparator = typeof comparator == 'function' ? comparator : undefined;
  8171. if (comparator) {
  8172. mapped.pop();
  8173. }
  8174. return (mapped.length && mapped[0] === arrays[0])
  8175. ? baseIntersection(mapped, undefined, comparator)
  8176. : [];
  8177. });
  8178. /**
  8179. * Converts all elements in `array` into a string separated by `separator`.
  8180. *
  8181. * @static
  8182. * @memberOf _
  8183. * @since 4.0.0
  8184. * @category Array
  8185. * @param {Array} array The array to convert.
  8186. * @param {string} [separator=','] The element separator.
  8187. * @returns {string} Returns the joined string.
  8188. * @example
  8189. *
  8190. * _.join(['a', 'b', 'c'], '~');
  8191. * // => 'a~b~c'
  8192. */
  8193. function join(array, separator) {
  8194. return array == null ? '' : nativeJoin.call(array, separator);
  8195. }
  8196. /**
  8197. * Gets the last element of `array`.
  8198. *
  8199. * @static
  8200. * @memberOf _
  8201. * @since 0.1.0
  8202. * @category Array
  8203. * @param {Array} array The array to query.
  8204. * @returns {*} Returns the last element of `array`.
  8205. * @example
  8206. *
  8207. * _.last([1, 2, 3]);
  8208. * // => 3
  8209. */
  8210. function last(array) {
  8211. var length = array == null ? 0 : array.length;
  8212. return length ? array[length - 1] : undefined;
  8213. }
  8214. /**
  8215. * This method is like `_.indexOf` except that it iterates over elements of
  8216. * `array` from right to left.
  8217. *
  8218. * @static
  8219. * @memberOf _
  8220. * @since 0.1.0
  8221. * @category Array
  8222. * @param {Array} array The array to inspect.
  8223. * @param {*} value The value to search for.
  8224. * @param {number} [fromIndex=array.length-1] The index to search from.
  8225. * @returns {number} Returns the index of the matched value, else `-1`.
  8226. * @example
  8227. *
  8228. * _.lastIndexOf([1, 2, 1, 2], 2);
  8229. * // => 3
  8230. *
  8231. * // Search from the `fromIndex`.
  8232. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8233. * // => 1
  8234. */
  8235. function lastIndexOf(array, value, fromIndex) {
  8236. var length = array == null ? 0 : array.length;
  8237. if (!length) {
  8238. return -1;
  8239. }
  8240. var index = length;
  8241. if (fromIndex !== undefined) {
  8242. index = toInteger(fromIndex);
  8243. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8244. }
  8245. return value === value
  8246. ? strictLastIndexOf(array, value, index)
  8247. : baseFindIndex(array, baseIsNaN, index, true);
  8248. }
  8249. /**
  8250. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8251. * element from the end is returned.
  8252. *
  8253. * @static
  8254. * @memberOf _
  8255. * @since 4.11.0
  8256. * @category Array
  8257. * @param {Array} array The array to query.
  8258. * @param {number} [n=0] The index of the element to return.
  8259. * @returns {*} Returns the nth element of `array`.
  8260. * @example
  8261. *
  8262. * var array = ['a', 'b', 'c', 'd'];
  8263. *
  8264. * _.nth(array, 1);
  8265. * // => 'b'
  8266. *
  8267. * _.nth(array, -2);
  8268. * // => 'c';
  8269. */
  8270. function nth(array, n) {
  8271. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8272. }
  8273. /**
  8274. * Removes all given values from `array` using
  8275. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8276. * for equality comparisons.
  8277. *
  8278. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8279. * to remove elements from an array by predicate.
  8280. *
  8281. * @static
  8282. * @memberOf _
  8283. * @since 2.0.0
  8284. * @category Array
  8285. * @param {Array} array The array to modify.
  8286. * @param {...*} [values] The values to remove.
  8287. * @returns {Array} Returns `array`.
  8288. * @example
  8289. *
  8290. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8291. *
  8292. * _.pull(array, 'a', 'c');
  8293. * console.log(array);
  8294. * // => ['b', 'b']
  8295. */
  8296. var pull = baseRest(pullAll);
  8297. /**
  8298. * This method is like `_.pull` except that it accepts an array of values to remove.
  8299. *
  8300. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8301. *
  8302. * @static
  8303. * @memberOf _
  8304. * @since 4.0.0
  8305. * @category Array
  8306. * @param {Array} array The array to modify.
  8307. * @param {Array} values The values to remove.
  8308. * @returns {Array} Returns `array`.
  8309. * @example
  8310. *
  8311. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8312. *
  8313. * _.pullAll(array, ['a', 'c']);
  8314. * console.log(array);
  8315. * // => ['b', 'b']
  8316. */
  8317. function pullAll(array, values) {
  8318. return (array && array.length && values && values.length)
  8319. ? basePullAll(array, values)
  8320. : array;
  8321. }
  8322. /**
  8323. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8324. * invoked for each element of `array` and `values` to generate the criterion
  8325. * by which they're compared. The iteratee is invoked with one argument: (value).
  8326. *
  8327. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8328. *
  8329. * @static
  8330. * @memberOf _
  8331. * @since 4.0.0
  8332. * @category Array
  8333. * @param {Array} array The array to modify.
  8334. * @param {Array} values The values to remove.
  8335. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8336. * @returns {Array} Returns `array`.
  8337. * @example
  8338. *
  8339. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8340. *
  8341. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8342. * console.log(array);
  8343. * // => [{ 'x': 2 }]
  8344. */
  8345. function pullAllBy(array, values, iteratee) {
  8346. return (array && array.length && values && values.length)
  8347. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8348. : array;
  8349. }
  8350. /**
  8351. * This method is like `_.pullAll` except that it accepts `comparator` which
  8352. * is invoked to compare elements of `array` to `values`. The comparator is
  8353. * invoked with two arguments: (arrVal, othVal).
  8354. *
  8355. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8356. *
  8357. * @static
  8358. * @memberOf _
  8359. * @since 4.6.0
  8360. * @category Array
  8361. * @param {Array} array The array to modify.
  8362. * @param {Array} values The values to remove.
  8363. * @param {Function} [comparator] The comparator invoked per element.
  8364. * @returns {Array} Returns `array`.
  8365. * @example
  8366. *
  8367. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8368. *
  8369. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8370. * console.log(array);
  8371. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8372. */
  8373. function pullAllWith(array, values, comparator) {
  8374. return (array && array.length && values && values.length)
  8375. ? basePullAll(array, values, undefined, comparator)
  8376. : array;
  8377. }
  8378. /**
  8379. * Removes elements from `array` corresponding to `indexes` and returns an
  8380. * array of removed elements.
  8381. *
  8382. * **Note:** Unlike `_.at`, this method mutates `array`.
  8383. *
  8384. * @static
  8385. * @memberOf _
  8386. * @since 3.0.0
  8387. * @category Array
  8388. * @param {Array} array The array to modify.
  8389. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8390. * @returns {Array} Returns the new array of removed elements.
  8391. * @example
  8392. *
  8393. * var array = ['a', 'b', 'c', 'd'];
  8394. * var pulled = _.pullAt(array, [1, 3]);
  8395. *
  8396. * console.log(array);
  8397. * // => ['a', 'c']
  8398. *
  8399. * console.log(pulled);
  8400. * // => ['b', 'd']
  8401. */
  8402. var pullAt = flatRest(function(array, indexes) {
  8403. var length = array == null ? 0 : array.length,
  8404. result = baseAt(array, indexes);
  8405. basePullAt(array, arrayMap(indexes, function(index) {
  8406. return isIndex(index, length) ? +index : index;
  8407. }).sort(compareAscending));
  8408. return result;
  8409. });
  8410. /**
  8411. * Removes all elements from `array` that `predicate` returns truthy for
  8412. * and returns an array of the removed elements. The predicate is invoked
  8413. * with three arguments: (value, index, array).
  8414. *
  8415. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8416. * to pull elements from an array by value.
  8417. *
  8418. * @static
  8419. * @memberOf _
  8420. * @since 2.0.0
  8421. * @category Array
  8422. * @param {Array} array The array to modify.
  8423. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8424. * @returns {Array} Returns the new array of removed elements.
  8425. * @example
  8426. *
  8427. * var array = [1, 2, 3, 4];
  8428. * var evens = _.remove(array, function(n) {
  8429. * return n % 2 == 0;
  8430. * });
  8431. *
  8432. * console.log(array);
  8433. * // => [1, 3]
  8434. *
  8435. * console.log(evens);
  8436. * // => [2, 4]
  8437. */
  8438. function remove(array, predicate) {
  8439. var result = [];
  8440. if (!(array && array.length)) {
  8441. return result;
  8442. }
  8443. var index = -1,
  8444. indexes = [],
  8445. length = array.length;
  8446. predicate = getIteratee(predicate, 3);
  8447. while (++index < length) {
  8448. var value = array[index];
  8449. if (predicate(value, index, array)) {
  8450. result.push(value);
  8451. indexes.push(index);
  8452. }
  8453. }
  8454. basePullAt(array, indexes);
  8455. return result;
  8456. }
  8457. /**
  8458. * Reverses `array` so that the first element becomes the last, the second
  8459. * element becomes the second to last, and so on.
  8460. *
  8461. * **Note:** This method mutates `array` and is based on
  8462. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8463. *
  8464. * @static
  8465. * @memberOf _
  8466. * @since 4.0.0
  8467. * @category Array
  8468. * @param {Array} array The array to modify.
  8469. * @returns {Array} Returns `array`.
  8470. * @example
  8471. *
  8472. * var array = [1, 2, 3];
  8473. *
  8474. * _.reverse(array);
  8475. * // => [3, 2, 1]
  8476. *
  8477. * console.log(array);
  8478. * // => [3, 2, 1]
  8479. */
  8480. function reverse(array) {
  8481. return array == null ? array : nativeReverse.call(array);
  8482. }
  8483. /**
  8484. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8485. *
  8486. * **Note:** This method is used instead of
  8487. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8488. * returned.
  8489. *
  8490. * @static
  8491. * @memberOf _
  8492. * @since 3.0.0
  8493. * @category Array
  8494. * @param {Array} array The array to slice.
  8495. * @param {number} [start=0] The start position.
  8496. * @param {number} [end=array.length] The end position.
  8497. * @returns {Array} Returns the slice of `array`.
  8498. */
  8499. function slice(array, start, end) {
  8500. var length = array == null ? 0 : array.length;
  8501. if (!length) {
  8502. return [];
  8503. }
  8504. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8505. start = 0;
  8506. end = length;
  8507. }
  8508. else {
  8509. start = start == null ? 0 : toInteger(start);
  8510. end = end === undefined ? length : toInteger(end);
  8511. }
  8512. return baseSlice(array, start, end);
  8513. }
  8514. /**
  8515. * Uses a binary search to determine the lowest index at which `value`
  8516. * should be inserted into `array` in order to maintain its sort order.
  8517. *
  8518. * @static
  8519. * @memberOf _
  8520. * @since 0.1.0
  8521. * @category Array
  8522. * @param {Array} array The sorted array to inspect.
  8523. * @param {*} value The value to evaluate.
  8524. * @returns {number} Returns the index at which `value` should be inserted
  8525. * into `array`.
  8526. * @example
  8527. *
  8528. * _.sortedIndex([30, 50], 40);
  8529. * // => 1
  8530. */
  8531. function sortedIndex(array, value) {
  8532. return baseSortedIndex(array, value);
  8533. }
  8534. /**
  8535. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8536. * which is invoked for `value` and each element of `array` to compute their
  8537. * sort ranking. The iteratee is invoked with one argument: (value).
  8538. *
  8539. * @static
  8540. * @memberOf _
  8541. * @since 4.0.0
  8542. * @category Array
  8543. * @param {Array} array The sorted array to inspect.
  8544. * @param {*} value The value to evaluate.
  8545. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8546. * @returns {number} Returns the index at which `value` should be inserted
  8547. * into `array`.
  8548. * @example
  8549. *
  8550. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8551. *
  8552. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8553. * // => 0
  8554. *
  8555. * // The `_.property` iteratee shorthand.
  8556. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8557. * // => 0
  8558. */
  8559. function sortedIndexBy(array, value, iteratee) {
  8560. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8561. }
  8562. /**
  8563. * This method is like `_.indexOf` except that it performs a binary
  8564. * search on a sorted `array`.
  8565. *
  8566. * @static
  8567. * @memberOf _
  8568. * @since 4.0.0
  8569. * @category Array
  8570. * @param {Array} array The array to inspect.
  8571. * @param {*} value The value to search for.
  8572. * @returns {number} Returns the index of the matched value, else `-1`.
  8573. * @example
  8574. *
  8575. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8576. * // => 1
  8577. */
  8578. function sortedIndexOf(array, value) {
  8579. var length = array == null ? 0 : array.length;
  8580. if (length) {
  8581. var index = baseSortedIndex(array, value);
  8582. if (index < length && eq(array[index], value)) {
  8583. return index;
  8584. }
  8585. }
  8586. return -1;
  8587. }
  8588. /**
  8589. * This method is like `_.sortedIndex` except that it returns the highest
  8590. * index at which `value` should be inserted into `array` in order to
  8591. * maintain its sort order.
  8592. *
  8593. * @static
  8594. * @memberOf _
  8595. * @since 3.0.0
  8596. * @category Array
  8597. * @param {Array} array The sorted array to inspect.
  8598. * @param {*} value The value to evaluate.
  8599. * @returns {number} Returns the index at which `value` should be inserted
  8600. * into `array`.
  8601. * @example
  8602. *
  8603. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8604. * // => 4
  8605. */
  8606. function sortedLastIndex(array, value) {
  8607. return baseSortedIndex(array, value, true);
  8608. }
  8609. /**
  8610. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8611. * which is invoked for `value` and each element of `array` to compute their
  8612. * sort ranking. The iteratee is invoked with one argument: (value).
  8613. *
  8614. * @static
  8615. * @memberOf _
  8616. * @since 4.0.0
  8617. * @category Array
  8618. * @param {Array} array The sorted array to inspect.
  8619. * @param {*} value The value to evaluate.
  8620. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8621. * @returns {number} Returns the index at which `value` should be inserted
  8622. * into `array`.
  8623. * @example
  8624. *
  8625. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8626. *
  8627. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8628. * // => 1
  8629. *
  8630. * // The `_.property` iteratee shorthand.
  8631. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8632. * // => 1
  8633. */
  8634. function sortedLastIndexBy(array, value, iteratee) {
  8635. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8636. }
  8637. /**
  8638. * This method is like `_.lastIndexOf` except that it performs a binary
  8639. * search on a sorted `array`.
  8640. *
  8641. * @static
  8642. * @memberOf _
  8643. * @since 4.0.0
  8644. * @category Array
  8645. * @param {Array} array The array to inspect.
  8646. * @param {*} value The value to search for.
  8647. * @returns {number} Returns the index of the matched value, else `-1`.
  8648. * @example
  8649. *
  8650. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8651. * // => 3
  8652. */
  8653. function sortedLastIndexOf(array, value) {
  8654. var length = array == null ? 0 : array.length;
  8655. if (length) {
  8656. var index = baseSortedIndex(array, value, true) - 1;
  8657. if (eq(array[index], value)) {
  8658. return index;
  8659. }
  8660. }
  8661. return -1;
  8662. }
  8663. /**
  8664. * This method is like `_.uniq` except that it's designed and optimized
  8665. * for sorted arrays.
  8666. *
  8667. * @static
  8668. * @memberOf _
  8669. * @since 4.0.0
  8670. * @category Array
  8671. * @param {Array} array The array to inspect.
  8672. * @returns {Array} Returns the new duplicate free array.
  8673. * @example
  8674. *
  8675. * _.sortedUniq([1, 1, 2]);
  8676. * // => [1, 2]
  8677. */
  8678. function sortedUniq(array) {
  8679. return (array && array.length)
  8680. ? baseSortedUniq(array)
  8681. : [];
  8682. }
  8683. /**
  8684. * This method is like `_.uniqBy` except that it's designed and optimized
  8685. * for sorted arrays.
  8686. *
  8687. * @static
  8688. * @memberOf _
  8689. * @since 4.0.0
  8690. * @category Array
  8691. * @param {Array} array The array to inspect.
  8692. * @param {Function} [iteratee] The iteratee invoked per element.
  8693. * @returns {Array} Returns the new duplicate free array.
  8694. * @example
  8695. *
  8696. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8697. * // => [1.1, 2.3]
  8698. */
  8699. function sortedUniqBy(array, iteratee) {
  8700. return (array && array.length)
  8701. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8702. : [];
  8703. }
  8704. /**
  8705. * Gets all but the first element of `array`.
  8706. *
  8707. * @static
  8708. * @memberOf _
  8709. * @since 4.0.0
  8710. * @category Array
  8711. * @param {Array} array The array to query.
  8712. * @returns {Array} Returns the slice of `array`.
  8713. * @example
  8714. *
  8715. * _.tail([1, 2, 3]);
  8716. * // => [2, 3]
  8717. */
  8718. function tail(array) {
  8719. var length = array == null ? 0 : array.length;
  8720. return length ? baseSlice(array, 1, length) : [];
  8721. }
  8722. /**
  8723. * Creates a slice of `array` with `n` elements taken from the beginning.
  8724. *
  8725. * @static
  8726. * @memberOf _
  8727. * @since 0.1.0
  8728. * @category Array
  8729. * @param {Array} array The array to query.
  8730. * @param {number} [n=1] The number of elements to take.
  8731. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8732. * @returns {Array} Returns the slice of `array`.
  8733. * @example
  8734. *
  8735. * _.take([1, 2, 3]);
  8736. * // => [1]
  8737. *
  8738. * _.take([1, 2, 3], 2);
  8739. * // => [1, 2]
  8740. *
  8741. * _.take([1, 2, 3], 5);
  8742. * // => [1, 2, 3]
  8743. *
  8744. * _.take([1, 2, 3], 0);
  8745. * // => []
  8746. */
  8747. function take(array, n, guard) {
  8748. if (!(array && array.length)) {
  8749. return [];
  8750. }
  8751. n = (guard || n === undefined) ? 1 : toInteger(n);
  8752. return baseSlice(array, 0, n < 0 ? 0 : n);
  8753. }
  8754. /**
  8755. * Creates a slice of `array` with `n` elements taken from the end.
  8756. *
  8757. * @static
  8758. * @memberOf _
  8759. * @since 3.0.0
  8760. * @category Array
  8761. * @param {Array} array The array to query.
  8762. * @param {number} [n=1] The number of elements to take.
  8763. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8764. * @returns {Array} Returns the slice of `array`.
  8765. * @example
  8766. *
  8767. * _.takeRight([1, 2, 3]);
  8768. * // => [3]
  8769. *
  8770. * _.takeRight([1, 2, 3], 2);
  8771. * // => [2, 3]
  8772. *
  8773. * _.takeRight([1, 2, 3], 5);
  8774. * // => [1, 2, 3]
  8775. *
  8776. * _.takeRight([1, 2, 3], 0);
  8777. * // => []
  8778. */
  8779. function takeRight(array, n, guard) {
  8780. var length = array == null ? 0 : array.length;
  8781. if (!length) {
  8782. return [];
  8783. }
  8784. n = (guard || n === undefined) ? 1 : toInteger(n);
  8785. n = length - n;
  8786. return baseSlice(array, n < 0 ? 0 : n, length);
  8787. }
  8788. /**
  8789. * Creates a slice of `array` with elements taken from the end. Elements are
  8790. * taken until `predicate` returns falsey. The predicate is invoked with
  8791. * three arguments: (value, index, array).
  8792. *
  8793. * @static
  8794. * @memberOf _
  8795. * @since 3.0.0
  8796. * @category Array
  8797. * @param {Array} array The array to query.
  8798. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8799. * @returns {Array} Returns the slice of `array`.
  8800. * @example
  8801. *
  8802. * var users = [
  8803. * { 'user': 'barney', 'active': true },
  8804. * { 'user': 'fred', 'active': false },
  8805. * { 'user': 'pebbles', 'active': false }
  8806. * ];
  8807. *
  8808. * _.takeRightWhile(users, function(o) { return !o.active; });
  8809. * // => objects for ['fred', 'pebbles']
  8810. *
  8811. * // The `_.matches` iteratee shorthand.
  8812. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8813. * // => objects for ['pebbles']
  8814. *
  8815. * // The `_.matchesProperty` iteratee shorthand.
  8816. * _.takeRightWhile(users, ['active', false]);
  8817. * // => objects for ['fred', 'pebbles']
  8818. *
  8819. * // The `_.property` iteratee shorthand.
  8820. * _.takeRightWhile(users, 'active');
  8821. * // => []
  8822. */
  8823. function takeRightWhile(array, predicate) {
  8824. return (array && array.length)
  8825. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8826. : [];
  8827. }
  8828. /**
  8829. * Creates a slice of `array` with elements taken from the beginning. Elements
  8830. * are taken until `predicate` returns falsey. The predicate is invoked with
  8831. * three arguments: (value, index, array).
  8832. *
  8833. * @static
  8834. * @memberOf _
  8835. * @since 3.0.0
  8836. * @category Array
  8837. * @param {Array} array The array to query.
  8838. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8839. * @returns {Array} Returns the slice of `array`.
  8840. * @example
  8841. *
  8842. * var users = [
  8843. * { 'user': 'barney', 'active': false },
  8844. * { 'user': 'fred', 'active': false },
  8845. * { 'user': 'pebbles', 'active': true }
  8846. * ];
  8847. *
  8848. * _.takeWhile(users, function(o) { return !o.active; });
  8849. * // => objects for ['barney', 'fred']
  8850. *
  8851. * // The `_.matches` iteratee shorthand.
  8852. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8853. * // => objects for ['barney']
  8854. *
  8855. * // The `_.matchesProperty` iteratee shorthand.
  8856. * _.takeWhile(users, ['active', false]);
  8857. * // => objects for ['barney', 'fred']
  8858. *
  8859. * // The `_.property` iteratee shorthand.
  8860. * _.takeWhile(users, 'active');
  8861. * // => []
  8862. */
  8863. function takeWhile(array, predicate) {
  8864. return (array && array.length)
  8865. ? baseWhile(array, getIteratee(predicate, 3))
  8866. : [];
  8867. }
  8868. /**
  8869. * Creates an array of unique values, in order, from all given arrays using
  8870. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8871. * for equality comparisons.
  8872. *
  8873. * @static
  8874. * @memberOf _
  8875. * @since 0.1.0
  8876. * @category Array
  8877. * @param {...Array} [arrays] The arrays to inspect.
  8878. * @returns {Array} Returns the new array of combined values.
  8879. * @example
  8880. *
  8881. * _.union([2], [1, 2]);
  8882. * // => [2, 1]
  8883. */
  8884. var union = baseRest(function(arrays) {
  8885. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8886. });
  8887. /**
  8888. * This method is like `_.union` except that it accepts `iteratee` which is
  8889. * invoked for each element of each `arrays` to generate the criterion by
  8890. * which uniqueness is computed. Result values are chosen from the first
  8891. * array in which the value occurs. The iteratee is invoked with one argument:
  8892. * (value).
  8893. *
  8894. * @static
  8895. * @memberOf _
  8896. * @since 4.0.0
  8897. * @category Array
  8898. * @param {...Array} [arrays] The arrays to inspect.
  8899. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8900. * @returns {Array} Returns the new array of combined values.
  8901. * @example
  8902. *
  8903. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8904. * // => [2.1, 1.2]
  8905. *
  8906. * // The `_.property` iteratee shorthand.
  8907. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8908. * // => [{ 'x': 1 }, { 'x': 2 }]
  8909. */
  8910. var unionBy = baseRest(function(arrays) {
  8911. var iteratee = last(arrays);
  8912. if (isArrayLikeObject(iteratee)) {
  8913. iteratee = undefined;
  8914. }
  8915. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8916. });
  8917. /**
  8918. * This method is like `_.union` except that it accepts `comparator` which
  8919. * is invoked to compare elements of `arrays`. Result values are chosen from
  8920. * the first array in which the value occurs. The comparator is invoked
  8921. * with two arguments: (arrVal, othVal).
  8922. *
  8923. * @static
  8924. * @memberOf _
  8925. * @since 4.0.0
  8926. * @category Array
  8927. * @param {...Array} [arrays] The arrays to inspect.
  8928. * @param {Function} [comparator] The comparator invoked per element.
  8929. * @returns {Array} Returns the new array of combined values.
  8930. * @example
  8931. *
  8932. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8933. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8934. *
  8935. * _.unionWith(objects, others, _.isEqual);
  8936. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8937. */
  8938. var unionWith = baseRest(function(arrays) {
  8939. var comparator = last(arrays);
  8940. comparator = typeof comparator == 'function' ? comparator : undefined;
  8941. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8942. });
  8943. /**
  8944. * Creates a duplicate-free version of an array, using
  8945. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8946. * for equality comparisons, in which only the first occurrence of each element
  8947. * is kept. The order of result values is determined by the order they occur
  8948. * in the array.
  8949. *
  8950. * @static
  8951. * @memberOf _
  8952. * @since 0.1.0
  8953. * @category Array
  8954. * @param {Array} array The array to inspect.
  8955. * @returns {Array} Returns the new duplicate free array.
  8956. * @example
  8957. *
  8958. * _.uniq([2, 1, 2]);
  8959. * // => [2, 1]
  8960. */
  8961. function uniq(array) {
  8962. return (array && array.length) ? baseUniq(array) : [];
  8963. }
  8964. /**
  8965. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8966. * invoked for each element in `array` to generate the criterion by which
  8967. * uniqueness is computed. The order of result values is determined by the
  8968. * order they occur in the array. The iteratee is invoked with one argument:
  8969. * (value).
  8970. *
  8971. * @static
  8972. * @memberOf _
  8973. * @since 4.0.0
  8974. * @category Array
  8975. * @param {Array} array The array to inspect.
  8976. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8977. * @returns {Array} Returns the new duplicate free array.
  8978. * @example
  8979. *
  8980. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8981. * // => [2.1, 1.2]
  8982. *
  8983. * // The `_.property` iteratee shorthand.
  8984. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8985. * // => [{ 'x': 1 }, { 'x': 2 }]
  8986. */
  8987. function uniqBy(array, iteratee) {
  8988. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8989. }
  8990. /**
  8991. * This method is like `_.uniq` except that it accepts `comparator` which
  8992. * is invoked to compare elements of `array`. The order of result values is
  8993. * determined by the order they occur in the array.The comparator is invoked
  8994. * with two arguments: (arrVal, othVal).
  8995. *
  8996. * @static
  8997. * @memberOf _
  8998. * @since 4.0.0
  8999. * @category Array
  9000. * @param {Array} array The array to inspect.
  9001. * @param {Function} [comparator] The comparator invoked per element.
  9002. * @returns {Array} Returns the new duplicate free array.
  9003. * @example
  9004. *
  9005. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9006. *
  9007. * _.uniqWith(objects, _.isEqual);
  9008. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9009. */
  9010. function uniqWith(array, comparator) {
  9011. comparator = typeof comparator == 'function' ? comparator : undefined;
  9012. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9013. }
  9014. /**
  9015. * This method is like `_.zip` except that it accepts an array of grouped
  9016. * elements and creates an array regrouping the elements to their pre-zip
  9017. * configuration.
  9018. *
  9019. * @static
  9020. * @memberOf _
  9021. * @since 1.2.0
  9022. * @category Array
  9023. * @param {Array} array The array of grouped elements to process.
  9024. * @returns {Array} Returns the new array of regrouped elements.
  9025. * @example
  9026. *
  9027. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9028. * // => [['a', 1, true], ['b', 2, false]]
  9029. *
  9030. * _.unzip(zipped);
  9031. * // => [['a', 'b'], [1, 2], [true, false]]
  9032. */
  9033. function unzip(array) {
  9034. if (!(array && array.length)) {
  9035. return [];
  9036. }
  9037. var length = 0;
  9038. array = arrayFilter(array, function(group) {
  9039. if (isArrayLikeObject(group)) {
  9040. length = nativeMax(group.length, length);
  9041. return true;
  9042. }
  9043. });
  9044. return baseTimes(length, function(index) {
  9045. return arrayMap(array, baseProperty(index));
  9046. });
  9047. }
  9048. /**
  9049. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9050. * how regrouped values should be combined. The iteratee is invoked with the
  9051. * elements of each group: (...group).
  9052. *
  9053. * @static
  9054. * @memberOf _
  9055. * @since 3.8.0
  9056. * @category Array
  9057. * @param {Array} array The array of grouped elements to process.
  9058. * @param {Function} [iteratee=_.identity] The function to combine
  9059. * regrouped values.
  9060. * @returns {Array} Returns the new array of regrouped elements.
  9061. * @example
  9062. *
  9063. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9064. * // => [[1, 10, 100], [2, 20, 200]]
  9065. *
  9066. * _.unzipWith(zipped, _.add);
  9067. * // => [3, 30, 300]
  9068. */
  9069. function unzipWith(array, iteratee) {
  9070. if (!(array && array.length)) {
  9071. return [];
  9072. }
  9073. var result = unzip(array);
  9074. if (iteratee == null) {
  9075. return result;
  9076. }
  9077. return arrayMap(result, function(group) {
  9078. return apply(iteratee, undefined, group);
  9079. });
  9080. }
  9081. /**
  9082. * Creates an array excluding all given values using
  9083. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9084. * for equality comparisons.
  9085. *
  9086. * **Note:** Unlike `_.pull`, this method returns a new array.
  9087. *
  9088. * @static
  9089. * @memberOf _
  9090. * @since 0.1.0
  9091. * @category Array
  9092. * @param {Array} array The array to inspect.
  9093. * @param {...*} [values] The values to exclude.
  9094. * @returns {Array} Returns the new array of filtered values.
  9095. * @see _.difference, _.xor
  9096. * @example
  9097. *
  9098. * _.without([2, 1, 2, 3], 1, 2);
  9099. * // => [3]
  9100. */
  9101. var without = baseRest(function(array, values) {
  9102. return isArrayLikeObject(array)
  9103. ? baseDifference(array, values)
  9104. : [];
  9105. });
  9106. /**
  9107. * Creates an array of unique values that is the
  9108. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9109. * of the given arrays. The order of result values is determined by the order
  9110. * they occur in the arrays.
  9111. *
  9112. * @static
  9113. * @memberOf _
  9114. * @since 2.4.0
  9115. * @category Array
  9116. * @param {...Array} [arrays] The arrays to inspect.
  9117. * @returns {Array} Returns the new array of filtered values.
  9118. * @see _.difference, _.without
  9119. * @example
  9120. *
  9121. * _.xor([2, 1], [2, 3]);
  9122. * // => [1, 3]
  9123. */
  9124. var xor = baseRest(function(arrays) {
  9125. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9126. });
  9127. /**
  9128. * This method is like `_.xor` except that it accepts `iteratee` which is
  9129. * invoked for each element of each `arrays` to generate the criterion by
  9130. * which by which they're compared. The order of result values is determined
  9131. * by the order they occur in the arrays. The iteratee is invoked with one
  9132. * argument: (value).
  9133. *
  9134. * @static
  9135. * @memberOf _
  9136. * @since 4.0.0
  9137. * @category Array
  9138. * @param {...Array} [arrays] The arrays to inspect.
  9139. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9140. * @returns {Array} Returns the new array of filtered values.
  9141. * @example
  9142. *
  9143. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9144. * // => [1.2, 3.4]
  9145. *
  9146. * // The `_.property` iteratee shorthand.
  9147. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9148. * // => [{ 'x': 2 }]
  9149. */
  9150. var xorBy = baseRest(function(arrays) {
  9151. var iteratee = last(arrays);
  9152. if (isArrayLikeObject(iteratee)) {
  9153. iteratee = undefined;
  9154. }
  9155. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9156. });
  9157. /**
  9158. * This method is like `_.xor` except that it accepts `comparator` which is
  9159. * invoked to compare elements of `arrays`. The order of result values is
  9160. * determined by the order they occur in the arrays. The comparator is invoked
  9161. * with two arguments: (arrVal, othVal).
  9162. *
  9163. * @static
  9164. * @memberOf _
  9165. * @since 4.0.0
  9166. * @category Array
  9167. * @param {...Array} [arrays] The arrays to inspect.
  9168. * @param {Function} [comparator] The comparator invoked per element.
  9169. * @returns {Array} Returns the new array of filtered values.
  9170. * @example
  9171. *
  9172. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9173. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9174. *
  9175. * _.xorWith(objects, others, _.isEqual);
  9176. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9177. */
  9178. var xorWith = baseRest(function(arrays) {
  9179. var comparator = last(arrays);
  9180. comparator = typeof comparator == 'function' ? comparator : undefined;
  9181. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9182. });
  9183. /**
  9184. * Creates an array of grouped elements, the first of which contains the
  9185. * first elements of the given arrays, the second of which contains the
  9186. * second elements of the given arrays, and so on.
  9187. *
  9188. * @static
  9189. * @memberOf _
  9190. * @since 0.1.0
  9191. * @category Array
  9192. * @param {...Array} [arrays] The arrays to process.
  9193. * @returns {Array} Returns the new array of grouped elements.
  9194. * @example
  9195. *
  9196. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9197. * // => [['a', 1, true], ['b', 2, false]]
  9198. */
  9199. var zip = baseRest(unzip);
  9200. /**
  9201. * This method is like `_.fromPairs` except that it accepts two arrays,
  9202. * one of property identifiers and one of corresponding values.
  9203. *
  9204. * @static
  9205. * @memberOf _
  9206. * @since 0.4.0
  9207. * @category Array
  9208. * @param {Array} [props=[]] The property identifiers.
  9209. * @param {Array} [values=[]] The property values.
  9210. * @returns {Object} Returns the new object.
  9211. * @example
  9212. *
  9213. * _.zipObject(['a', 'b'], [1, 2]);
  9214. * // => { 'a': 1, 'b': 2 }
  9215. */
  9216. function zipObject(props, values) {
  9217. return baseZipObject(props || [], values || [], assignValue);
  9218. }
  9219. /**
  9220. * This method is like `_.zipObject` except that it supports property paths.
  9221. *
  9222. * @static
  9223. * @memberOf _
  9224. * @since 4.1.0
  9225. * @category Array
  9226. * @param {Array} [props=[]] The property identifiers.
  9227. * @param {Array} [values=[]] The property values.
  9228. * @returns {Object} Returns the new object.
  9229. * @example
  9230. *
  9231. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9232. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9233. */
  9234. function zipObjectDeep(props, values) {
  9235. return baseZipObject(props || [], values || [], baseSet);
  9236. }
  9237. /**
  9238. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9239. * how grouped values should be combined. The iteratee is invoked with the
  9240. * elements of each group: (...group).
  9241. *
  9242. * @static
  9243. * @memberOf _
  9244. * @since 3.8.0
  9245. * @category Array
  9246. * @param {...Array} [arrays] The arrays to process.
  9247. * @param {Function} [iteratee=_.identity] The function to combine
  9248. * grouped values.
  9249. * @returns {Array} Returns the new array of grouped elements.
  9250. * @example
  9251. *
  9252. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9253. * return a + b + c;
  9254. * });
  9255. * // => [111, 222]
  9256. */
  9257. var zipWith = baseRest(function(arrays) {
  9258. var length = arrays.length,
  9259. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9260. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9261. return unzipWith(arrays, iteratee);
  9262. });
  9263. /*------------------------------------------------------------------------*/
  9264. /**
  9265. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9266. * chain sequences enabled. The result of such sequences must be unwrapped
  9267. * with `_#value`.
  9268. *
  9269. * @static
  9270. * @memberOf _
  9271. * @since 1.3.0
  9272. * @category Seq
  9273. * @param {*} value The value to wrap.
  9274. * @returns {Object} Returns the new `lodash` wrapper instance.
  9275. * @example
  9276. *
  9277. * var users = [
  9278. * { 'user': 'barney', 'age': 36 },
  9279. * { 'user': 'fred', 'age': 40 },
  9280. * { 'user': 'pebbles', 'age': 1 }
  9281. * ];
  9282. *
  9283. * var youngest = _
  9284. * .chain(users)
  9285. * .sortBy('age')
  9286. * .map(function(o) {
  9287. * return o.user + ' is ' + o.age;
  9288. * })
  9289. * .head()
  9290. * .value();
  9291. * // => 'pebbles is 1'
  9292. */
  9293. function chain(value) {
  9294. var result = lodash(value);
  9295. result.__chain__ = true;
  9296. return result;
  9297. }
  9298. /**
  9299. * This method invokes `interceptor` and returns `value`. The interceptor
  9300. * is invoked with one argument; (value). The purpose of this method is to
  9301. * "tap into" a method chain sequence in order to modify intermediate results.
  9302. *
  9303. * @static
  9304. * @memberOf _
  9305. * @since 0.1.0
  9306. * @category Seq
  9307. * @param {*} value The value to provide to `interceptor`.
  9308. * @param {Function} interceptor The function to invoke.
  9309. * @returns {*} Returns `value`.
  9310. * @example
  9311. *
  9312. * _([1, 2, 3])
  9313. * .tap(function(array) {
  9314. * // Mutate input array.
  9315. * array.pop();
  9316. * })
  9317. * .reverse()
  9318. * .value();
  9319. * // => [2, 1]
  9320. */
  9321. function tap(value, interceptor) {
  9322. interceptor(value);
  9323. return value;
  9324. }
  9325. /**
  9326. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9327. * The purpose of this method is to "pass thru" values replacing intermediate
  9328. * results in a method chain sequence.
  9329. *
  9330. * @static
  9331. * @memberOf _
  9332. * @since 3.0.0
  9333. * @category Seq
  9334. * @param {*} value The value to provide to `interceptor`.
  9335. * @param {Function} interceptor The function to invoke.
  9336. * @returns {*} Returns the result of `interceptor`.
  9337. * @example
  9338. *
  9339. * _(' abc ')
  9340. * .chain()
  9341. * .trim()
  9342. * .thru(function(value) {
  9343. * return [value];
  9344. * })
  9345. * .value();
  9346. * // => ['abc']
  9347. */
  9348. function thru(value, interceptor) {
  9349. return interceptor(value);
  9350. }
  9351. /**
  9352. * This method is the wrapper version of `_.at`.
  9353. *
  9354. * @name at
  9355. * @memberOf _
  9356. * @since 1.0.0
  9357. * @category Seq
  9358. * @param {...(string|string[])} [paths] The property paths to pick.
  9359. * @returns {Object} Returns the new `lodash` wrapper instance.
  9360. * @example
  9361. *
  9362. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9363. *
  9364. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9365. * // => [3, 4]
  9366. */
  9367. var wrapperAt = flatRest(function(paths) {
  9368. var length = paths.length,
  9369. start = length ? paths[0] : 0,
  9370. value = this.__wrapped__,
  9371. interceptor = function(object) { return baseAt(object, paths); };
  9372. if (length > 1 || this.__actions__.length ||
  9373. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9374. return this.thru(interceptor);
  9375. }
  9376. value = value.slice(start, +start + (length ? 1 : 0));
  9377. value.__actions__.push({
  9378. 'func': thru,
  9379. 'args': [interceptor],
  9380. 'thisArg': undefined
  9381. });
  9382. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9383. if (length && !array.length) {
  9384. array.push(undefined);
  9385. }
  9386. return array;
  9387. });
  9388. });
  9389. /**
  9390. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9391. *
  9392. * @name chain
  9393. * @memberOf _
  9394. * @since 0.1.0
  9395. * @category Seq
  9396. * @returns {Object} Returns the new `lodash` wrapper instance.
  9397. * @example
  9398. *
  9399. * var users = [
  9400. * { 'user': 'barney', 'age': 36 },
  9401. * { 'user': 'fred', 'age': 40 }
  9402. * ];
  9403. *
  9404. * // A sequence without explicit chaining.
  9405. * _(users).head();
  9406. * // => { 'user': 'barney', 'age': 36 }
  9407. *
  9408. * // A sequence with explicit chaining.
  9409. * _(users)
  9410. * .chain()
  9411. * .head()
  9412. * .pick('user')
  9413. * .value();
  9414. * // => { 'user': 'barney' }
  9415. */
  9416. function wrapperChain() {
  9417. return chain(this);
  9418. }
  9419. /**
  9420. * Executes the chain sequence and returns the wrapped result.
  9421. *
  9422. * @name commit
  9423. * @memberOf _
  9424. * @since 3.2.0
  9425. * @category Seq
  9426. * @returns {Object} Returns the new `lodash` wrapper instance.
  9427. * @example
  9428. *
  9429. * var array = [1, 2];
  9430. * var wrapped = _(array).push(3);
  9431. *
  9432. * console.log(array);
  9433. * // => [1, 2]
  9434. *
  9435. * wrapped = wrapped.commit();
  9436. * console.log(array);
  9437. * // => [1, 2, 3]
  9438. *
  9439. * wrapped.last();
  9440. * // => 3
  9441. *
  9442. * console.log(array);
  9443. * // => [1, 2, 3]
  9444. */
  9445. function wrapperCommit() {
  9446. return new LodashWrapper(this.value(), this.__chain__);
  9447. }
  9448. /**
  9449. * Gets the next value on a wrapped object following the
  9450. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9451. *
  9452. * @name next
  9453. * @memberOf _
  9454. * @since 4.0.0
  9455. * @category Seq
  9456. * @returns {Object} Returns the next iterator value.
  9457. * @example
  9458. *
  9459. * var wrapped = _([1, 2]);
  9460. *
  9461. * wrapped.next();
  9462. * // => { 'done': false, 'value': 1 }
  9463. *
  9464. * wrapped.next();
  9465. * // => { 'done': false, 'value': 2 }
  9466. *
  9467. * wrapped.next();
  9468. * // => { 'done': true, 'value': undefined }
  9469. */
  9470. function wrapperNext() {
  9471. if (this.__values__ === undefined) {
  9472. this.__values__ = toArray(this.value());
  9473. }
  9474. var done = this.__index__ >= this.__values__.length,
  9475. value = done ? undefined : this.__values__[this.__index__++];
  9476. return { 'done': done, 'value': value };
  9477. }
  9478. /**
  9479. * Enables the wrapper to be iterable.
  9480. *
  9481. * @name Symbol.iterator
  9482. * @memberOf _
  9483. * @since 4.0.0
  9484. * @category Seq
  9485. * @returns {Object} Returns the wrapper object.
  9486. * @example
  9487. *
  9488. * var wrapped = _([1, 2]);
  9489. *
  9490. * wrapped[Symbol.iterator]() === wrapped;
  9491. * // => true
  9492. *
  9493. * Array.from(wrapped);
  9494. * // => [1, 2]
  9495. */
  9496. function wrapperToIterator() {
  9497. return this;
  9498. }
  9499. /**
  9500. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9501. *
  9502. * @name plant
  9503. * @memberOf _
  9504. * @since 3.2.0
  9505. * @category Seq
  9506. * @param {*} value The value to plant.
  9507. * @returns {Object} Returns the new `lodash` wrapper instance.
  9508. * @example
  9509. *
  9510. * function square(n) {
  9511. * return n * n;
  9512. * }
  9513. *
  9514. * var wrapped = _([1, 2]).map(square);
  9515. * var other = wrapped.plant([3, 4]);
  9516. *
  9517. * other.value();
  9518. * // => [9, 16]
  9519. *
  9520. * wrapped.value();
  9521. * // => [1, 4]
  9522. */
  9523. function wrapperPlant(value) {
  9524. var result,
  9525. parent = this;
  9526. while (parent instanceof baseLodash) {
  9527. var clone = wrapperClone(parent);
  9528. clone.__index__ = 0;
  9529. clone.__values__ = undefined;
  9530. if (result) {
  9531. previous.__wrapped__ = clone;
  9532. } else {
  9533. result = clone;
  9534. }
  9535. var previous = clone;
  9536. parent = parent.__wrapped__;
  9537. }
  9538. previous.__wrapped__ = value;
  9539. return result;
  9540. }
  9541. /**
  9542. * This method is the wrapper version of `_.reverse`.
  9543. *
  9544. * **Note:** This method mutates the wrapped array.
  9545. *
  9546. * @name reverse
  9547. * @memberOf _
  9548. * @since 0.1.0
  9549. * @category Seq
  9550. * @returns {Object} Returns the new `lodash` wrapper instance.
  9551. * @example
  9552. *
  9553. * var array = [1, 2, 3];
  9554. *
  9555. * _(array).reverse().value()
  9556. * // => [3, 2, 1]
  9557. *
  9558. * console.log(array);
  9559. * // => [3, 2, 1]
  9560. */
  9561. function wrapperReverse() {
  9562. var value = this.__wrapped__;
  9563. if (value instanceof LazyWrapper) {
  9564. var wrapped = value;
  9565. if (this.__actions__.length) {
  9566. wrapped = new LazyWrapper(this);
  9567. }
  9568. wrapped = wrapped.reverse();
  9569. wrapped.__actions__.push({
  9570. 'func': thru,
  9571. 'args': [reverse],
  9572. 'thisArg': undefined
  9573. });
  9574. return new LodashWrapper(wrapped, this.__chain__);
  9575. }
  9576. return this.thru(reverse);
  9577. }
  9578. /**
  9579. * Executes the chain sequence to resolve the unwrapped value.
  9580. *
  9581. * @name value
  9582. * @memberOf _
  9583. * @since 0.1.0
  9584. * @alias toJSON, valueOf
  9585. * @category Seq
  9586. * @returns {*} Returns the resolved unwrapped value.
  9587. * @example
  9588. *
  9589. * _([1, 2, 3]).value();
  9590. * // => [1, 2, 3]
  9591. */
  9592. function wrapperValue() {
  9593. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9594. }
  9595. /*------------------------------------------------------------------------*/
  9596. /**
  9597. * Creates an object composed of keys generated from the results of running
  9598. * each element of `collection` thru `iteratee`. The corresponding value of
  9599. * each key is the number of times the key was returned by `iteratee`. The
  9600. * iteratee is invoked with one argument: (value).
  9601. *
  9602. * @static
  9603. * @memberOf _
  9604. * @since 0.5.0
  9605. * @category Collection
  9606. * @param {Array|Object} collection The collection to iterate over.
  9607. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9608. * @returns {Object} Returns the composed aggregate object.
  9609. * @example
  9610. *
  9611. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9612. * // => { '4': 1, '6': 2 }
  9613. *
  9614. * // The `_.property` iteratee shorthand.
  9615. * _.countBy(['one', 'two', 'three'], 'length');
  9616. * // => { '3': 2, '5': 1 }
  9617. */
  9618. var countBy = createAggregator(function(result, value, key) {
  9619. if (hasOwnProperty.call(result, key)) {
  9620. ++result[key];
  9621. } else {
  9622. baseAssignValue(result, key, 1);
  9623. }
  9624. });
  9625. /**
  9626. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9627. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9628. * invoked with three arguments: (value, index|key, collection).
  9629. *
  9630. * **Note:** This method returns `true` for
  9631. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9632. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9633. * elements of empty collections.
  9634. *
  9635. * @static
  9636. * @memberOf _
  9637. * @since 0.1.0
  9638. * @category Collection
  9639. * @param {Array|Object} collection The collection to iterate over.
  9640. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9641. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9642. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9643. * else `false`.
  9644. * @example
  9645. *
  9646. * _.every([true, 1, null, 'yes'], Boolean);
  9647. * // => false
  9648. *
  9649. * var users = [
  9650. * { 'user': 'barney', 'age': 36, 'active': false },
  9651. * { 'user': 'fred', 'age': 40, 'active': false }
  9652. * ];
  9653. *
  9654. * // The `_.matches` iteratee shorthand.
  9655. * _.every(users, { 'user': 'barney', 'active': false });
  9656. * // => false
  9657. *
  9658. * // The `_.matchesProperty` iteratee shorthand.
  9659. * _.every(users, ['active', false]);
  9660. * // => true
  9661. *
  9662. * // The `_.property` iteratee shorthand.
  9663. * _.every(users, 'active');
  9664. * // => false
  9665. */
  9666. function every(collection, predicate, guard) {
  9667. var func = isArray(collection) ? arrayEvery : baseEvery;
  9668. if (guard && isIterateeCall(collection, predicate, guard)) {
  9669. predicate = undefined;
  9670. }
  9671. return func(collection, getIteratee(predicate, 3));
  9672. }
  9673. /**
  9674. * Iterates over elements of `collection`, returning an array of all elements
  9675. * `predicate` returns truthy for. The predicate is invoked with three
  9676. * arguments: (value, index|key, collection).
  9677. *
  9678. * **Note:** Unlike `_.remove`, this method returns a new array.
  9679. *
  9680. * @static
  9681. * @memberOf _
  9682. * @since 0.1.0
  9683. * @category Collection
  9684. * @param {Array|Object} collection The collection to iterate over.
  9685. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9686. * @returns {Array} Returns the new filtered array.
  9687. * @see _.reject
  9688. * @example
  9689. *
  9690. * var users = [
  9691. * { 'user': 'barney', 'age': 36, 'active': true },
  9692. * { 'user': 'fred', 'age': 40, 'active': false }
  9693. * ];
  9694. *
  9695. * _.filter(users, function(o) { return !o.active; });
  9696. * // => objects for ['fred']
  9697. *
  9698. * // The `_.matches` iteratee shorthand.
  9699. * _.filter(users, { 'age': 36, 'active': true });
  9700. * // => objects for ['barney']
  9701. *
  9702. * // The `_.matchesProperty` iteratee shorthand.
  9703. * _.filter(users, ['active', false]);
  9704. * // => objects for ['fred']
  9705. *
  9706. * // The `_.property` iteratee shorthand.
  9707. * _.filter(users, 'active');
  9708. * // => objects for ['barney']
  9709. *
  9710. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9711. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9712. * // => objects for ['fred', 'barney']
  9713. */
  9714. function filter(collection, predicate) {
  9715. var func = isArray(collection) ? arrayFilter : baseFilter;
  9716. return func(collection, getIteratee(predicate, 3));
  9717. }
  9718. /**
  9719. * Iterates over elements of `collection`, returning the first element
  9720. * `predicate` returns truthy for. The predicate is invoked with three
  9721. * arguments: (value, index|key, collection).
  9722. *
  9723. * @static
  9724. * @memberOf _
  9725. * @since 0.1.0
  9726. * @category Collection
  9727. * @param {Array|Object} collection The collection to inspect.
  9728. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9729. * @param {number} [fromIndex=0] The index to search from.
  9730. * @returns {*} Returns the matched element, else `undefined`.
  9731. * @example
  9732. *
  9733. * var users = [
  9734. * { 'user': 'barney', 'age': 36, 'active': true },
  9735. * { 'user': 'fred', 'age': 40, 'active': false },
  9736. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9737. * ];
  9738. *
  9739. * _.find(users, function(o) { return o.age < 40; });
  9740. * // => object for 'barney'
  9741. *
  9742. * // The `_.matches` iteratee shorthand.
  9743. * _.find(users, { 'age': 1, 'active': true });
  9744. * // => object for 'pebbles'
  9745. *
  9746. * // The `_.matchesProperty` iteratee shorthand.
  9747. * _.find(users, ['active', false]);
  9748. * // => object for 'fred'
  9749. *
  9750. * // The `_.property` iteratee shorthand.
  9751. * _.find(users, 'active');
  9752. * // => object for 'barney'
  9753. */
  9754. var find = createFind(findIndex);
  9755. /**
  9756. * This method is like `_.find` except that it iterates over elements of
  9757. * `collection` from right to left.
  9758. *
  9759. * @static
  9760. * @memberOf _
  9761. * @since 2.0.0
  9762. * @category Collection
  9763. * @param {Array|Object} collection The collection to inspect.
  9764. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9765. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9766. * @returns {*} Returns the matched element, else `undefined`.
  9767. * @example
  9768. *
  9769. * _.findLast([1, 2, 3, 4], function(n) {
  9770. * return n % 2 == 1;
  9771. * });
  9772. * // => 3
  9773. */
  9774. var findLast = createFind(findLastIndex);
  9775. /**
  9776. * Creates a flattened array of values by running each element in `collection`
  9777. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9778. * with three arguments: (value, index|key, collection).
  9779. *
  9780. * @static
  9781. * @memberOf _
  9782. * @since 4.0.0
  9783. * @category Collection
  9784. * @param {Array|Object} collection The collection to iterate over.
  9785. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9786. * @returns {Array} Returns the new flattened array.
  9787. * @example
  9788. *
  9789. * function duplicate(n) {
  9790. * return [n, n];
  9791. * }
  9792. *
  9793. * _.flatMap([1, 2], duplicate);
  9794. * // => [1, 1, 2, 2]
  9795. */
  9796. function flatMap(collection, iteratee) {
  9797. return baseFlatten(map(collection, iteratee), 1);
  9798. }
  9799. /**
  9800. * This method is like `_.flatMap` except that it recursively flattens the
  9801. * mapped results.
  9802. *
  9803. * @static
  9804. * @memberOf _
  9805. * @since 4.7.0
  9806. * @category Collection
  9807. * @param {Array|Object} collection The collection to iterate over.
  9808. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9809. * @returns {Array} Returns the new flattened array.
  9810. * @example
  9811. *
  9812. * function duplicate(n) {
  9813. * return [[[n, n]]];
  9814. * }
  9815. *
  9816. * _.flatMapDeep([1, 2], duplicate);
  9817. * // => [1, 1, 2, 2]
  9818. */
  9819. function flatMapDeep(collection, iteratee) {
  9820. return baseFlatten(map(collection, iteratee), INFINITY);
  9821. }
  9822. /**
  9823. * This method is like `_.flatMap` except that it recursively flattens the
  9824. * mapped results up to `depth` times.
  9825. *
  9826. * @static
  9827. * @memberOf _
  9828. * @since 4.7.0
  9829. * @category Collection
  9830. * @param {Array|Object} collection The collection to iterate over.
  9831. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9832. * @param {number} [depth=1] The maximum recursion depth.
  9833. * @returns {Array} Returns the new flattened array.
  9834. * @example
  9835. *
  9836. * function duplicate(n) {
  9837. * return [[[n, n]]];
  9838. * }
  9839. *
  9840. * _.flatMapDepth([1, 2], duplicate, 2);
  9841. * // => [[1, 1], [2, 2]]
  9842. */
  9843. function flatMapDepth(collection, iteratee, depth) {
  9844. depth = depth === undefined ? 1 : toInteger(depth);
  9845. return baseFlatten(map(collection, iteratee), depth);
  9846. }
  9847. /**
  9848. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9849. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9850. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9851. *
  9852. * **Note:** As with other "Collections" methods, objects with a "length"
  9853. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9854. * or `_.forOwn` for object iteration.
  9855. *
  9856. * @static
  9857. * @memberOf _
  9858. * @since 0.1.0
  9859. * @alias each
  9860. * @category Collection
  9861. * @param {Array|Object} collection The collection to iterate over.
  9862. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9863. * @returns {Array|Object} Returns `collection`.
  9864. * @see _.forEachRight
  9865. * @example
  9866. *
  9867. * _.forEach([1, 2], function(value) {
  9868. * console.log(value);
  9869. * });
  9870. * // => Logs `1` then `2`.
  9871. *
  9872. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9873. * console.log(key);
  9874. * });
  9875. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9876. */
  9877. function forEach(collection, iteratee) {
  9878. var func = isArray(collection) ? arrayEach : baseEach;
  9879. return func(collection, getIteratee(iteratee, 3));
  9880. }
  9881. /**
  9882. * This method is like `_.forEach` except that it iterates over elements of
  9883. * `collection` from right to left.
  9884. *
  9885. * @static
  9886. * @memberOf _
  9887. * @since 2.0.0
  9888. * @alias eachRight
  9889. * @category Collection
  9890. * @param {Array|Object} collection The collection to iterate over.
  9891. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9892. * @returns {Array|Object} Returns `collection`.
  9893. * @see _.forEach
  9894. * @example
  9895. *
  9896. * _.forEachRight([1, 2], function(value) {
  9897. * console.log(value);
  9898. * });
  9899. * // => Logs `2` then `1`.
  9900. */
  9901. function forEachRight(collection, iteratee) {
  9902. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9903. return func(collection, getIteratee(iteratee, 3));
  9904. }
  9905. /**
  9906. * Creates an object composed of keys generated from the results of running
  9907. * each element of `collection` thru `iteratee`. The order of grouped values
  9908. * is determined by the order they occur in `collection`. The corresponding
  9909. * value of each key is an array of elements responsible for generating the
  9910. * key. The iteratee is invoked with one argument: (value).
  9911. *
  9912. * @static
  9913. * @memberOf _
  9914. * @since 0.1.0
  9915. * @category Collection
  9916. * @param {Array|Object} collection The collection to iterate over.
  9917. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9918. * @returns {Object} Returns the composed aggregate object.
  9919. * @example
  9920. *
  9921. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9922. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9923. *
  9924. * // The `_.property` iteratee shorthand.
  9925. * _.groupBy(['one', 'two', 'three'], 'length');
  9926. * // => { '3': ['one', 'two'], '5': ['three'] }
  9927. */
  9928. var groupBy = createAggregator(function(result, value, key) {
  9929. if (hasOwnProperty.call(result, key)) {
  9930. result[key].push(value);
  9931. } else {
  9932. baseAssignValue(result, key, [value]);
  9933. }
  9934. });
  9935. /**
  9936. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9937. * checked for a substring of `value`, otherwise
  9938. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9939. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9940. * the offset from the end of `collection`.
  9941. *
  9942. * @static
  9943. * @memberOf _
  9944. * @since 0.1.0
  9945. * @category Collection
  9946. * @param {Array|Object|string} collection The collection to inspect.
  9947. * @param {*} value The value to search for.
  9948. * @param {number} [fromIndex=0] The index to search from.
  9949. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9950. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9951. * @example
  9952. *
  9953. * _.includes([1, 2, 3], 1);
  9954. * // => true
  9955. *
  9956. * _.includes([1, 2, 3], 1, 2);
  9957. * // => false
  9958. *
  9959. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9960. * // => true
  9961. *
  9962. * _.includes('abcd', 'bc');
  9963. * // => true
  9964. */
  9965. function includes(collection, value, fromIndex, guard) {
  9966. collection = isArrayLike(collection) ? collection : values(collection);
  9967. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9968. var length = collection.length;
  9969. if (fromIndex < 0) {
  9970. fromIndex = nativeMax(length + fromIndex, 0);
  9971. }
  9972. return isString(collection)
  9973. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9974. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9975. }
  9976. /**
  9977. * Invokes the method at `path` of each element in `collection`, returning
  9978. * an array of the results of each invoked method. Any additional arguments
  9979. * are provided to each invoked method. If `path` is a function, it's invoked
  9980. * for, and `this` bound to, each element in `collection`.
  9981. *
  9982. * @static
  9983. * @memberOf _
  9984. * @since 4.0.0
  9985. * @category Collection
  9986. * @param {Array|Object} collection The collection to iterate over.
  9987. * @param {Array|Function|string} path The path of the method to invoke or
  9988. * the function invoked per iteration.
  9989. * @param {...*} [args] The arguments to invoke each method with.
  9990. * @returns {Array} Returns the array of results.
  9991. * @example
  9992. *
  9993. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9994. * // => [[1, 5, 7], [1, 2, 3]]
  9995. *
  9996. * _.invokeMap([123, 456], String.prototype.split, '');
  9997. * // => [['1', '2', '3'], ['4', '5', '6']]
  9998. */
  9999. var invokeMap = baseRest(function(collection, path, args) {
  10000. var index = -1,
  10001. isFunc = typeof path == 'function',
  10002. result = isArrayLike(collection) ? Array(collection.length) : [];
  10003. baseEach(collection, function(value) {
  10004. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10005. });
  10006. return result;
  10007. });
  10008. /**
  10009. * Creates an object composed of keys generated from the results of running
  10010. * each element of `collection` thru `iteratee`. The corresponding value of
  10011. * each key is the last element responsible for generating the key. The
  10012. * iteratee is invoked with one argument: (value).
  10013. *
  10014. * @static
  10015. * @memberOf _
  10016. * @since 4.0.0
  10017. * @category Collection
  10018. * @param {Array|Object} collection The collection to iterate over.
  10019. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10020. * @returns {Object} Returns the composed aggregate object.
  10021. * @example
  10022. *
  10023. * var array = [
  10024. * { 'dir': 'left', 'code': 97 },
  10025. * { 'dir': 'right', 'code': 100 }
  10026. * ];
  10027. *
  10028. * _.keyBy(array, function(o) {
  10029. * return String.fromCharCode(o.code);
  10030. * });
  10031. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10032. *
  10033. * _.keyBy(array, 'dir');
  10034. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10035. */
  10036. var keyBy = createAggregator(function(result, value, key) {
  10037. baseAssignValue(result, key, value);
  10038. });
  10039. /**
  10040. * Creates an array of values by running each element in `collection` thru
  10041. * `iteratee`. The iteratee is invoked with three arguments:
  10042. * (value, index|key, collection).
  10043. *
  10044. * Many lodash methods are guarded to work as iteratees for methods like
  10045. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10046. *
  10047. * The guarded methods are:
  10048. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10049. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10050. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10051. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10052. *
  10053. * @static
  10054. * @memberOf _
  10055. * @since 0.1.0
  10056. * @category Collection
  10057. * @param {Array|Object} collection The collection to iterate over.
  10058. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10059. * @returns {Array} Returns the new mapped array.
  10060. * @example
  10061. *
  10062. * function square(n) {
  10063. * return n * n;
  10064. * }
  10065. *
  10066. * _.map([4, 8], square);
  10067. * // => [16, 64]
  10068. *
  10069. * _.map({ 'a': 4, 'b': 8 }, square);
  10070. * // => [16, 64] (iteration order is not guaranteed)
  10071. *
  10072. * var users = [
  10073. * { 'user': 'barney' },
  10074. * { 'user': 'fred' }
  10075. * ];
  10076. *
  10077. * // The `_.property` iteratee shorthand.
  10078. * _.map(users, 'user');
  10079. * // => ['barney', 'fred']
  10080. */
  10081. function map(collection, iteratee) {
  10082. var func = isArray(collection) ? arrayMap : baseMap;
  10083. return func(collection, getIteratee(iteratee, 3));
  10084. }
  10085. /**
  10086. * This method is like `_.sortBy` except that it allows specifying the sort
  10087. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10088. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10089. * descending or "asc" for ascending sort order of corresponding values.
  10090. *
  10091. * @static
  10092. * @memberOf _
  10093. * @since 4.0.0
  10094. * @category Collection
  10095. * @param {Array|Object} collection The collection to iterate over.
  10096. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10097. * The iteratees to sort by.
  10098. * @param {string[]} [orders] The sort orders of `iteratees`.
  10099. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10100. * @returns {Array} Returns the new sorted array.
  10101. * @example
  10102. *
  10103. * var users = [
  10104. * { 'user': 'fred', 'age': 48 },
  10105. * { 'user': 'barney', 'age': 34 },
  10106. * { 'user': 'fred', 'age': 40 },
  10107. * { 'user': 'barney', 'age': 36 }
  10108. * ];
  10109. *
  10110. * // Sort by `user` in ascending order and by `age` in descending order.
  10111. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10112. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10113. */
  10114. function orderBy(collection, iteratees, orders, guard) {
  10115. if (collection == null) {
  10116. return [];
  10117. }
  10118. if (!isArray(iteratees)) {
  10119. iteratees = iteratees == null ? [] : [iteratees];
  10120. }
  10121. orders = guard ? undefined : orders;
  10122. if (!isArray(orders)) {
  10123. orders = orders == null ? [] : [orders];
  10124. }
  10125. return baseOrderBy(collection, iteratees, orders);
  10126. }
  10127. /**
  10128. * Creates an array of elements split into two groups, the first of which
  10129. * contains elements `predicate` returns truthy for, the second of which
  10130. * contains elements `predicate` returns falsey for. The predicate is
  10131. * invoked with one argument: (value).
  10132. *
  10133. * @static
  10134. * @memberOf _
  10135. * @since 3.0.0
  10136. * @category Collection
  10137. * @param {Array|Object} collection The collection to iterate over.
  10138. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10139. * @returns {Array} Returns the array of grouped elements.
  10140. * @example
  10141. *
  10142. * var users = [
  10143. * { 'user': 'barney', 'age': 36, 'active': false },
  10144. * { 'user': 'fred', 'age': 40, 'active': true },
  10145. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10146. * ];
  10147. *
  10148. * _.partition(users, function(o) { return o.active; });
  10149. * // => objects for [['fred'], ['barney', 'pebbles']]
  10150. *
  10151. * // The `_.matches` iteratee shorthand.
  10152. * _.partition(users, { 'age': 1, 'active': false });
  10153. * // => objects for [['pebbles'], ['barney', 'fred']]
  10154. *
  10155. * // The `_.matchesProperty` iteratee shorthand.
  10156. * _.partition(users, ['active', false]);
  10157. * // => objects for [['barney', 'pebbles'], ['fred']]
  10158. *
  10159. * // The `_.property` iteratee shorthand.
  10160. * _.partition(users, 'active');
  10161. * // => objects for [['fred'], ['barney', 'pebbles']]
  10162. */
  10163. var partition = createAggregator(function(result, value, key) {
  10164. result[key ? 0 : 1].push(value);
  10165. }, function() { return [[], []]; });
  10166. /**
  10167. * Reduces `collection` to a value which is the accumulated result of running
  10168. * each element in `collection` thru `iteratee`, where each successive
  10169. * invocation is supplied the return value of the previous. If `accumulator`
  10170. * is not given, the first element of `collection` is used as the initial
  10171. * value. The iteratee is invoked with four arguments:
  10172. * (accumulator, value, index|key, collection).
  10173. *
  10174. * Many lodash methods are guarded to work as iteratees for methods like
  10175. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10176. *
  10177. * The guarded methods are:
  10178. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10179. * and `sortBy`
  10180. *
  10181. * @static
  10182. * @memberOf _
  10183. * @since 0.1.0
  10184. * @category Collection
  10185. * @param {Array|Object} collection The collection to iterate over.
  10186. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10187. * @param {*} [accumulator] The initial value.
  10188. * @returns {*} Returns the accumulated value.
  10189. * @see _.reduceRight
  10190. * @example
  10191. *
  10192. * _.reduce([1, 2], function(sum, n) {
  10193. * return sum + n;
  10194. * }, 0);
  10195. * // => 3
  10196. *
  10197. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10198. * (result[value] || (result[value] = [])).push(key);
  10199. * return result;
  10200. * }, {});
  10201. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10202. */
  10203. function reduce(collection, iteratee, accumulator) {
  10204. var func = isArray(collection) ? arrayReduce : baseReduce,
  10205. initAccum = arguments.length < 3;
  10206. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10207. }
  10208. /**
  10209. * This method is like `_.reduce` except that it iterates over elements of
  10210. * `collection` from right to left.
  10211. *
  10212. * @static
  10213. * @memberOf _
  10214. * @since 0.1.0
  10215. * @category Collection
  10216. * @param {Array|Object} collection The collection to iterate over.
  10217. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10218. * @param {*} [accumulator] The initial value.
  10219. * @returns {*} Returns the accumulated value.
  10220. * @see _.reduce
  10221. * @example
  10222. *
  10223. * var array = [[0, 1], [2, 3], [4, 5]];
  10224. *
  10225. * _.reduceRight(array, function(flattened, other) {
  10226. * return flattened.concat(other);
  10227. * }, []);
  10228. * // => [4, 5, 2, 3, 0, 1]
  10229. */
  10230. function reduceRight(collection, iteratee, accumulator) {
  10231. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10232. initAccum = arguments.length < 3;
  10233. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10234. }
  10235. /**
  10236. * The opposite of `_.filter`; this method returns the elements of `collection`
  10237. * that `predicate` does **not** return truthy for.
  10238. *
  10239. * @static
  10240. * @memberOf _
  10241. * @since 0.1.0
  10242. * @category Collection
  10243. * @param {Array|Object} collection The collection to iterate over.
  10244. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10245. * @returns {Array} Returns the new filtered array.
  10246. * @see _.filter
  10247. * @example
  10248. *
  10249. * var users = [
  10250. * { 'user': 'barney', 'age': 36, 'active': false },
  10251. * { 'user': 'fred', 'age': 40, 'active': true }
  10252. * ];
  10253. *
  10254. * _.reject(users, function(o) { return !o.active; });
  10255. * // => objects for ['fred']
  10256. *
  10257. * // The `_.matches` iteratee shorthand.
  10258. * _.reject(users, { 'age': 40, 'active': true });
  10259. * // => objects for ['barney']
  10260. *
  10261. * // The `_.matchesProperty` iteratee shorthand.
  10262. * _.reject(users, ['active', false]);
  10263. * // => objects for ['fred']
  10264. *
  10265. * // The `_.property` iteratee shorthand.
  10266. * _.reject(users, 'active');
  10267. * // => objects for ['barney']
  10268. */
  10269. function reject(collection, predicate) {
  10270. var func = isArray(collection) ? arrayFilter : baseFilter;
  10271. return func(collection, negate(getIteratee(predicate, 3)));
  10272. }
  10273. /**
  10274. * Gets a random element from `collection`.
  10275. *
  10276. * @static
  10277. * @memberOf _
  10278. * @since 2.0.0
  10279. * @category Collection
  10280. * @param {Array|Object} collection The collection to sample.
  10281. * @returns {*} Returns the random element.
  10282. * @example
  10283. *
  10284. * _.sample([1, 2, 3, 4]);
  10285. * // => 2
  10286. */
  10287. function sample(collection) {
  10288. var func = isArray(collection) ? arraySample : baseSample;
  10289. return func(collection);
  10290. }
  10291. /**
  10292. * Gets `n` random elements at unique keys from `collection` up to the
  10293. * size of `collection`.
  10294. *
  10295. * @static
  10296. * @memberOf _
  10297. * @since 4.0.0
  10298. * @category Collection
  10299. * @param {Array|Object} collection The collection to sample.
  10300. * @param {number} [n=1] The number of elements to sample.
  10301. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10302. * @returns {Array} Returns the random elements.
  10303. * @example
  10304. *
  10305. * _.sampleSize([1, 2, 3], 2);
  10306. * // => [3, 1]
  10307. *
  10308. * _.sampleSize([1, 2, 3], 4);
  10309. * // => [2, 3, 1]
  10310. */
  10311. function sampleSize(collection, n, guard) {
  10312. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10313. n = 1;
  10314. } else {
  10315. n = toInteger(n);
  10316. }
  10317. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10318. return func(collection, n);
  10319. }
  10320. /**
  10321. * Creates an array of shuffled values, using a version of the
  10322. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10323. *
  10324. * @static
  10325. * @memberOf _
  10326. * @since 0.1.0
  10327. * @category Collection
  10328. * @param {Array|Object} collection The collection to shuffle.
  10329. * @returns {Array} Returns the new shuffled array.
  10330. * @example
  10331. *
  10332. * _.shuffle([1, 2, 3, 4]);
  10333. * // => [4, 1, 3, 2]
  10334. */
  10335. function shuffle(collection) {
  10336. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10337. return func(collection);
  10338. }
  10339. /**
  10340. * Gets the size of `collection` by returning its length for array-like
  10341. * values or the number of own enumerable string keyed properties for objects.
  10342. *
  10343. * @static
  10344. * @memberOf _
  10345. * @since 0.1.0
  10346. * @category Collection
  10347. * @param {Array|Object|string} collection The collection to inspect.
  10348. * @returns {number} Returns the collection size.
  10349. * @example
  10350. *
  10351. * _.size([1, 2, 3]);
  10352. * // => 3
  10353. *
  10354. * _.size({ 'a': 1, 'b': 2 });
  10355. * // => 2
  10356. *
  10357. * _.size('pebbles');
  10358. * // => 7
  10359. */
  10360. function size(collection) {
  10361. if (collection == null) {
  10362. return 0;
  10363. }
  10364. if (isArrayLike(collection)) {
  10365. return isString(collection) ? stringSize(collection) : collection.length;
  10366. }
  10367. var tag = getTag(collection);
  10368. if (tag == mapTag || tag == setTag) {
  10369. return collection.size;
  10370. }
  10371. return baseKeys(collection).length;
  10372. }
  10373. /**
  10374. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10375. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10376. * invoked with three arguments: (value, index|key, collection).
  10377. *
  10378. * @static
  10379. * @memberOf _
  10380. * @since 0.1.0
  10381. * @category Collection
  10382. * @param {Array|Object} collection The collection to iterate over.
  10383. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10384. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10385. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10386. * else `false`.
  10387. * @example
  10388. *
  10389. * _.some([null, 0, 'yes', false], Boolean);
  10390. * // => true
  10391. *
  10392. * var users = [
  10393. * { 'user': 'barney', 'active': true },
  10394. * { 'user': 'fred', 'active': false }
  10395. * ];
  10396. *
  10397. * // The `_.matches` iteratee shorthand.
  10398. * _.some(users, { 'user': 'barney', 'active': false });
  10399. * // => false
  10400. *
  10401. * // The `_.matchesProperty` iteratee shorthand.
  10402. * _.some(users, ['active', false]);
  10403. * // => true
  10404. *
  10405. * // The `_.property` iteratee shorthand.
  10406. * _.some(users, 'active');
  10407. * // => true
  10408. */
  10409. function some(collection, predicate, guard) {
  10410. var func = isArray(collection) ? arraySome : baseSome;
  10411. if (guard && isIterateeCall(collection, predicate, guard)) {
  10412. predicate = undefined;
  10413. }
  10414. return func(collection, getIteratee(predicate, 3));
  10415. }
  10416. /**
  10417. * Creates an array of elements, sorted in ascending order by the results of
  10418. * running each element in a collection thru each iteratee. This method
  10419. * performs a stable sort, that is, it preserves the original sort order of
  10420. * equal elements. The iteratees are invoked with one argument: (value).
  10421. *
  10422. * @static
  10423. * @memberOf _
  10424. * @since 0.1.0
  10425. * @category Collection
  10426. * @param {Array|Object} collection The collection to iterate over.
  10427. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10428. * The iteratees to sort by.
  10429. * @returns {Array} Returns the new sorted array.
  10430. * @example
  10431. *
  10432. * var users = [
  10433. * { 'user': 'fred', 'age': 48 },
  10434. * { 'user': 'barney', 'age': 36 },
  10435. * { 'user': 'fred', 'age': 30 },
  10436. * { 'user': 'barney', 'age': 34 }
  10437. * ];
  10438. *
  10439. * _.sortBy(users, [function(o) { return o.user; }]);
  10440. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10441. *
  10442. * _.sortBy(users, ['user', 'age']);
  10443. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10444. */
  10445. var sortBy = baseRest(function(collection, iteratees) {
  10446. if (collection == null) {
  10447. return [];
  10448. }
  10449. var length = iteratees.length;
  10450. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10451. iteratees = [];
  10452. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10453. iteratees = [iteratees[0]];
  10454. }
  10455. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10456. });
  10457. /*------------------------------------------------------------------------*/
  10458. /**
  10459. * Gets the timestamp of the number of milliseconds that have elapsed since
  10460. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10461. *
  10462. * @static
  10463. * @memberOf _
  10464. * @since 2.4.0
  10465. * @category Date
  10466. * @returns {number} Returns the timestamp.
  10467. * @example
  10468. *
  10469. * _.defer(function(stamp) {
  10470. * console.log(_.now() - stamp);
  10471. * }, _.now());
  10472. * // => Logs the number of milliseconds it took for the deferred invocation.
  10473. */
  10474. var now = ctxNow || function() {
  10475. return root.Date.now();
  10476. };
  10477. /*------------------------------------------------------------------------*/
  10478. /**
  10479. * The opposite of `_.before`; this method creates a function that invokes
  10480. * `func` once it's called `n` or more times.
  10481. *
  10482. * @static
  10483. * @memberOf _
  10484. * @since 0.1.0
  10485. * @category Function
  10486. * @param {number} n The number of calls before `func` is invoked.
  10487. * @param {Function} func The function to restrict.
  10488. * @returns {Function} Returns the new restricted function.
  10489. * @example
  10490. *
  10491. * var saves = ['profile', 'settings'];
  10492. *
  10493. * var done = _.after(saves.length, function() {
  10494. * console.log('done saving!');
  10495. * });
  10496. *
  10497. * _.forEach(saves, function(type) {
  10498. * asyncSave({ 'type': type, 'complete': done });
  10499. * });
  10500. * // => Logs 'done saving!' after the two async saves have completed.
  10501. */
  10502. function after(n, func) {
  10503. if (typeof func != 'function') {
  10504. throw new TypeError(FUNC_ERROR_TEXT);
  10505. }
  10506. n = toInteger(n);
  10507. return function() {
  10508. if (--n < 1) {
  10509. return func.apply(this, arguments);
  10510. }
  10511. };
  10512. }
  10513. /**
  10514. * Creates a function that invokes `func`, with up to `n` arguments,
  10515. * ignoring any additional arguments.
  10516. *
  10517. * @static
  10518. * @memberOf _
  10519. * @since 3.0.0
  10520. * @category Function
  10521. * @param {Function} func The function to cap arguments for.
  10522. * @param {number} [n=func.length] The arity cap.
  10523. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10524. * @returns {Function} Returns the new capped function.
  10525. * @example
  10526. *
  10527. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10528. * // => [6, 8, 10]
  10529. */
  10530. function ary(func, n, guard) {
  10531. n = guard ? undefined : n;
  10532. n = (func && n == null) ? func.length : n;
  10533. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10534. }
  10535. /**
  10536. * Creates a function that invokes `func`, with the `this` binding and arguments
  10537. * of the created function, while it's called less than `n` times. Subsequent
  10538. * calls to the created function return the result of the last `func` invocation.
  10539. *
  10540. * @static
  10541. * @memberOf _
  10542. * @since 3.0.0
  10543. * @category Function
  10544. * @param {number} n The number of calls at which `func` is no longer invoked.
  10545. * @param {Function} func The function to restrict.
  10546. * @returns {Function} Returns the new restricted function.
  10547. * @example
  10548. *
  10549. * jQuery(element).on('click', _.before(5, addContactToList));
  10550. * // => Allows adding up to 4 contacts to the list.
  10551. */
  10552. function before(n, func) {
  10553. var result;
  10554. if (typeof func != 'function') {
  10555. throw new TypeError(FUNC_ERROR_TEXT);
  10556. }
  10557. n = toInteger(n);
  10558. return function() {
  10559. if (--n > 0) {
  10560. result = func.apply(this, arguments);
  10561. }
  10562. if (n <= 1) {
  10563. func = undefined;
  10564. }
  10565. return result;
  10566. };
  10567. }
  10568. /**
  10569. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10570. * and `partials` prepended to the arguments it receives.
  10571. *
  10572. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10573. * may be used as a placeholder for partially applied arguments.
  10574. *
  10575. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10576. * property of bound functions.
  10577. *
  10578. * @static
  10579. * @memberOf _
  10580. * @since 0.1.0
  10581. * @category Function
  10582. * @param {Function} func The function to bind.
  10583. * @param {*} thisArg The `this` binding of `func`.
  10584. * @param {...*} [partials] The arguments to be partially applied.
  10585. * @returns {Function} Returns the new bound function.
  10586. * @example
  10587. *
  10588. * function greet(greeting, punctuation) {
  10589. * return greeting + ' ' + this.user + punctuation;
  10590. * }
  10591. *
  10592. * var object = { 'user': 'fred' };
  10593. *
  10594. * var bound = _.bind(greet, object, 'hi');
  10595. * bound('!');
  10596. * // => 'hi fred!'
  10597. *
  10598. * // Bound with placeholders.
  10599. * var bound = _.bind(greet, object, _, '!');
  10600. * bound('hi');
  10601. * // => 'hi fred!'
  10602. */
  10603. var bind = baseRest(function(func, thisArg, partials) {
  10604. var bitmask = WRAP_BIND_FLAG;
  10605. if (partials.length) {
  10606. var holders = replaceHolders(partials, getHolder(bind));
  10607. bitmask |= WRAP_PARTIAL_FLAG;
  10608. }
  10609. return createWrap(func, bitmask, thisArg, partials, holders);
  10610. });
  10611. /**
  10612. * Creates a function that invokes the method at `object[key]` with `partials`
  10613. * prepended to the arguments it receives.
  10614. *
  10615. * This method differs from `_.bind` by allowing bound functions to reference
  10616. * methods that may be redefined or don't yet exist. See
  10617. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10618. * for more details.
  10619. *
  10620. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10621. * builds, may be used as a placeholder for partially applied arguments.
  10622. *
  10623. * @static
  10624. * @memberOf _
  10625. * @since 0.10.0
  10626. * @category Function
  10627. * @param {Object} object The object to invoke the method on.
  10628. * @param {string} key The key of the method.
  10629. * @param {...*} [partials] The arguments to be partially applied.
  10630. * @returns {Function} Returns the new bound function.
  10631. * @example
  10632. *
  10633. * var object = {
  10634. * 'user': 'fred',
  10635. * 'greet': function(greeting, punctuation) {
  10636. * return greeting + ' ' + this.user + punctuation;
  10637. * }
  10638. * };
  10639. *
  10640. * var bound = _.bindKey(object, 'greet', 'hi');
  10641. * bound('!');
  10642. * // => 'hi fred!'
  10643. *
  10644. * object.greet = function(greeting, punctuation) {
  10645. * return greeting + 'ya ' + this.user + punctuation;
  10646. * };
  10647. *
  10648. * bound('!');
  10649. * // => 'hiya fred!'
  10650. *
  10651. * // Bound with placeholders.
  10652. * var bound = _.bindKey(object, 'greet', _, '!');
  10653. * bound('hi');
  10654. * // => 'hiya fred!'
  10655. */
  10656. var bindKey = baseRest(function(object, key, partials) {
  10657. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10658. if (partials.length) {
  10659. var holders = replaceHolders(partials, getHolder(bindKey));
  10660. bitmask |= WRAP_PARTIAL_FLAG;
  10661. }
  10662. return createWrap(key, bitmask, object, partials, holders);
  10663. });
  10664. /**
  10665. * Creates a function that accepts arguments of `func` and either invokes
  10666. * `func` returning its result, if at least `arity` number of arguments have
  10667. * been provided, or returns a function that accepts the remaining `func`
  10668. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10669. * is not sufficient.
  10670. *
  10671. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10672. * may be used as a placeholder for provided arguments.
  10673. *
  10674. * **Note:** This method doesn't set the "length" property of curried functions.
  10675. *
  10676. * @static
  10677. * @memberOf _
  10678. * @since 2.0.0
  10679. * @category Function
  10680. * @param {Function} func The function to curry.
  10681. * @param {number} [arity=func.length] The arity of `func`.
  10682. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10683. * @returns {Function} Returns the new curried function.
  10684. * @example
  10685. *
  10686. * var abc = function(a, b, c) {
  10687. * return [a, b, c];
  10688. * };
  10689. *
  10690. * var curried = _.curry(abc);
  10691. *
  10692. * curried(1)(2)(3);
  10693. * // => [1, 2, 3]
  10694. *
  10695. * curried(1, 2)(3);
  10696. * // => [1, 2, 3]
  10697. *
  10698. * curried(1, 2, 3);
  10699. * // => [1, 2, 3]
  10700. *
  10701. * // Curried with placeholders.
  10702. * curried(1)(_, 3)(2);
  10703. * // => [1, 2, 3]
  10704. */
  10705. function curry(func, arity, guard) {
  10706. arity = guard ? undefined : arity;
  10707. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10708. result.placeholder = curry.placeholder;
  10709. return result;
  10710. }
  10711. /**
  10712. * This method is like `_.curry` except that arguments are applied to `func`
  10713. * in the manner of `_.partialRight` instead of `_.partial`.
  10714. *
  10715. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10716. * builds, may be used as a placeholder for provided arguments.
  10717. *
  10718. * **Note:** This method doesn't set the "length" property of curried functions.
  10719. *
  10720. * @static
  10721. * @memberOf _
  10722. * @since 3.0.0
  10723. * @category Function
  10724. * @param {Function} func The function to curry.
  10725. * @param {number} [arity=func.length] The arity of `func`.
  10726. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10727. * @returns {Function} Returns the new curried function.
  10728. * @example
  10729. *
  10730. * var abc = function(a, b, c) {
  10731. * return [a, b, c];
  10732. * };
  10733. *
  10734. * var curried = _.curryRight(abc);
  10735. *
  10736. * curried(3)(2)(1);
  10737. * // => [1, 2, 3]
  10738. *
  10739. * curried(2, 3)(1);
  10740. * // => [1, 2, 3]
  10741. *
  10742. * curried(1, 2, 3);
  10743. * // => [1, 2, 3]
  10744. *
  10745. * // Curried with placeholders.
  10746. * curried(3)(1, _)(2);
  10747. * // => [1, 2, 3]
  10748. */
  10749. function curryRight(func, arity, guard) {
  10750. arity = guard ? undefined : arity;
  10751. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10752. result.placeholder = curryRight.placeholder;
  10753. return result;
  10754. }
  10755. /**
  10756. * Creates a debounced function that delays invoking `func` until after `wait`
  10757. * milliseconds have elapsed since the last time the debounced function was
  10758. * invoked. The debounced function comes with a `cancel` method to cancel
  10759. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10760. * Provide `options` to indicate whether `func` should be invoked on the
  10761. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10762. * with the last arguments provided to the debounced function. Subsequent
  10763. * calls to the debounced function return the result of the last `func`
  10764. * invocation.
  10765. *
  10766. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10767. * invoked on the trailing edge of the timeout only if the debounced function
  10768. * is invoked more than once during the `wait` timeout.
  10769. *
  10770. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10771. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10772. *
  10773. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10774. * for details over the differences between `_.debounce` and `_.throttle`.
  10775. *
  10776. * @static
  10777. * @memberOf _
  10778. * @since 0.1.0
  10779. * @category Function
  10780. * @param {Function} func The function to debounce.
  10781. * @param {number} [wait=0] The number of milliseconds to delay.
  10782. * @param {Object} [options={}] The options object.
  10783. * @param {boolean} [options.leading=false]
  10784. * Specify invoking on the leading edge of the timeout.
  10785. * @param {number} [options.maxWait]
  10786. * The maximum time `func` is allowed to be delayed before it's invoked.
  10787. * @param {boolean} [options.trailing=true]
  10788. * Specify invoking on the trailing edge of the timeout.
  10789. * @returns {Function} Returns the new debounced function.
  10790. * @example
  10791. *
  10792. * // Avoid costly calculations while the window size is in flux.
  10793. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10794. *
  10795. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10796. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10797. * 'leading': true,
  10798. * 'trailing': false
  10799. * }));
  10800. *
  10801. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10802. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10803. * var source = new EventSource('/stream');
  10804. * jQuery(source).on('message', debounced);
  10805. *
  10806. * // Cancel the trailing debounced invocation.
  10807. * jQuery(window).on('popstate', debounced.cancel);
  10808. */
  10809. function debounce(func, wait, options) {
  10810. var lastArgs,
  10811. lastThis,
  10812. maxWait,
  10813. result,
  10814. timerId,
  10815. lastCallTime,
  10816. lastInvokeTime = 0,
  10817. leading = false,
  10818. maxing = false,
  10819. trailing = true;
  10820. if (typeof func != 'function') {
  10821. throw new TypeError(FUNC_ERROR_TEXT);
  10822. }
  10823. wait = toNumber(wait) || 0;
  10824. if (isObject(options)) {
  10825. leading = !!options.leading;
  10826. maxing = 'maxWait' in options;
  10827. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10828. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10829. }
  10830. function invokeFunc(time) {
  10831. var args = lastArgs,
  10832. thisArg = lastThis;
  10833. lastArgs = lastThis = undefined;
  10834. lastInvokeTime = time;
  10835. result = func.apply(thisArg, args);
  10836. return result;
  10837. }
  10838. function leadingEdge(time) {
  10839. // Reset any `maxWait` timer.
  10840. lastInvokeTime = time;
  10841. // Start the timer for the trailing edge.
  10842. timerId = setTimeout(timerExpired, wait);
  10843. // Invoke the leading edge.
  10844. return leading ? invokeFunc(time) : result;
  10845. }
  10846. function remainingWait(time) {
  10847. var timeSinceLastCall = time - lastCallTime,
  10848. timeSinceLastInvoke = time - lastInvokeTime,
  10849. timeWaiting = wait - timeSinceLastCall;
  10850. return maxing
  10851. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10852. : timeWaiting;
  10853. }
  10854. function shouldInvoke(time) {
  10855. var timeSinceLastCall = time - lastCallTime,
  10856. timeSinceLastInvoke = time - lastInvokeTime;
  10857. // Either this is the first call, activity has stopped and we're at the
  10858. // trailing edge, the system time has gone backwards and we're treating
  10859. // it as the trailing edge, or we've hit the `maxWait` limit.
  10860. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10861. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10862. }
  10863. function timerExpired() {
  10864. var time = now();
  10865. if (shouldInvoke(time)) {
  10866. return trailingEdge(time);
  10867. }
  10868. // Restart the timer.
  10869. timerId = setTimeout(timerExpired, remainingWait(time));
  10870. }
  10871. function trailingEdge(time) {
  10872. timerId = undefined;
  10873. // Only invoke if we have `lastArgs` which means `func` has been
  10874. // debounced at least once.
  10875. if (trailing && lastArgs) {
  10876. return invokeFunc(time);
  10877. }
  10878. lastArgs = lastThis = undefined;
  10879. return result;
  10880. }
  10881. function cancel() {
  10882. if (timerId !== undefined) {
  10883. clearTimeout(timerId);
  10884. }
  10885. lastInvokeTime = 0;
  10886. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10887. }
  10888. function flush() {
  10889. return timerId === undefined ? result : trailingEdge(now());
  10890. }
  10891. function debounced() {
  10892. var time = now(),
  10893. isInvoking = shouldInvoke(time);
  10894. lastArgs = arguments;
  10895. lastThis = this;
  10896. lastCallTime = time;
  10897. if (isInvoking) {
  10898. if (timerId === undefined) {
  10899. return leadingEdge(lastCallTime);
  10900. }
  10901. if (maxing) {
  10902. // Handle invocations in a tight loop.
  10903. clearTimeout(timerId);
  10904. timerId = setTimeout(timerExpired, wait);
  10905. return invokeFunc(lastCallTime);
  10906. }
  10907. }
  10908. if (timerId === undefined) {
  10909. timerId = setTimeout(timerExpired, wait);
  10910. }
  10911. return result;
  10912. }
  10913. debounced.cancel = cancel;
  10914. debounced.flush = flush;
  10915. return debounced;
  10916. }
  10917. /**
  10918. * Defers invoking the `func` until the current call stack has cleared. Any
  10919. * additional arguments are provided to `func` when it's invoked.
  10920. *
  10921. * @static
  10922. * @memberOf _
  10923. * @since 0.1.0
  10924. * @category Function
  10925. * @param {Function} func The function to defer.
  10926. * @param {...*} [args] The arguments to invoke `func` with.
  10927. * @returns {number} Returns the timer id.
  10928. * @example
  10929. *
  10930. * _.defer(function(text) {
  10931. * console.log(text);
  10932. * }, 'deferred');
  10933. * // => Logs 'deferred' after one millisecond.
  10934. */
  10935. var defer = baseRest(function(func, args) {
  10936. return baseDelay(func, 1, args);
  10937. });
  10938. /**
  10939. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10940. * provided to `func` when it's invoked.
  10941. *
  10942. * @static
  10943. * @memberOf _
  10944. * @since 0.1.0
  10945. * @category Function
  10946. * @param {Function} func The function to delay.
  10947. * @param {number} wait The number of milliseconds to delay invocation.
  10948. * @param {...*} [args] The arguments to invoke `func` with.
  10949. * @returns {number} Returns the timer id.
  10950. * @example
  10951. *
  10952. * _.delay(function(text) {
  10953. * console.log(text);
  10954. * }, 1000, 'later');
  10955. * // => Logs 'later' after one second.
  10956. */
  10957. var delay = baseRest(function(func, wait, args) {
  10958. return baseDelay(func, toNumber(wait) || 0, args);
  10959. });
  10960. /**
  10961. * Creates a function that invokes `func` with arguments reversed.
  10962. *
  10963. * @static
  10964. * @memberOf _
  10965. * @since 4.0.0
  10966. * @category Function
  10967. * @param {Function} func The function to flip arguments for.
  10968. * @returns {Function} Returns the new flipped function.
  10969. * @example
  10970. *
  10971. * var flipped = _.flip(function() {
  10972. * return _.toArray(arguments);
  10973. * });
  10974. *
  10975. * flipped('a', 'b', 'c', 'd');
  10976. * // => ['d', 'c', 'b', 'a']
  10977. */
  10978. function flip(func) {
  10979. return createWrap(func, WRAP_FLIP_FLAG);
  10980. }
  10981. /**
  10982. * Creates a function that memoizes the result of `func`. If `resolver` is
  10983. * provided, it determines the cache key for storing the result based on the
  10984. * arguments provided to the memoized function. By default, the first argument
  10985. * provided to the memoized function is used as the map cache key. The `func`
  10986. * is invoked with the `this` binding of the memoized function.
  10987. *
  10988. * **Note:** The cache is exposed as the `cache` property on the memoized
  10989. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10990. * constructor with one whose instances implement the
  10991. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10992. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10993. *
  10994. * @static
  10995. * @memberOf _
  10996. * @since 0.1.0
  10997. * @category Function
  10998. * @param {Function} func The function to have its output memoized.
  10999. * @param {Function} [resolver] The function to resolve the cache key.
  11000. * @returns {Function} Returns the new memoized function.
  11001. * @example
  11002. *
  11003. * var object = { 'a': 1, 'b': 2 };
  11004. * var other = { 'c': 3, 'd': 4 };
  11005. *
  11006. * var values = _.memoize(_.values);
  11007. * values(object);
  11008. * // => [1, 2]
  11009. *
  11010. * values(other);
  11011. * // => [3, 4]
  11012. *
  11013. * object.a = 2;
  11014. * values(object);
  11015. * // => [1, 2]
  11016. *
  11017. * // Modify the result cache.
  11018. * values.cache.set(object, ['a', 'b']);
  11019. * values(object);
  11020. * // => ['a', 'b']
  11021. *
  11022. * // Replace `_.memoize.Cache`.
  11023. * _.memoize.Cache = WeakMap;
  11024. */
  11025. function memoize(func, resolver) {
  11026. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11027. throw new TypeError(FUNC_ERROR_TEXT);
  11028. }
  11029. var memoized = function() {
  11030. var args = arguments,
  11031. key = resolver ? resolver.apply(this, args) : args[0],
  11032. cache = memoized.cache;
  11033. if (cache.has(key)) {
  11034. return cache.get(key);
  11035. }
  11036. var result = func.apply(this, args);
  11037. memoized.cache = cache.set(key, result) || cache;
  11038. return result;
  11039. };
  11040. memoized.cache = new (memoize.Cache || MapCache);
  11041. return memoized;
  11042. }
  11043. // Expose `MapCache`.
  11044. memoize.Cache = MapCache;
  11045. /**
  11046. * Creates a function that negates the result of the predicate `func`. The
  11047. * `func` predicate is invoked with the `this` binding and arguments of the
  11048. * created function.
  11049. *
  11050. * @static
  11051. * @memberOf _
  11052. * @since 3.0.0
  11053. * @category Function
  11054. * @param {Function} predicate The predicate to negate.
  11055. * @returns {Function} Returns the new negated function.
  11056. * @example
  11057. *
  11058. * function isEven(n) {
  11059. * return n % 2 == 0;
  11060. * }
  11061. *
  11062. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11063. * // => [1, 3, 5]
  11064. */
  11065. function negate(predicate) {
  11066. if (typeof predicate != 'function') {
  11067. throw new TypeError(FUNC_ERROR_TEXT);
  11068. }
  11069. return function() {
  11070. var args = arguments;
  11071. switch (args.length) {
  11072. case 0: return !predicate.call(this);
  11073. case 1: return !predicate.call(this, args[0]);
  11074. case 2: return !predicate.call(this, args[0], args[1]);
  11075. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11076. }
  11077. return !predicate.apply(this, args);
  11078. };
  11079. }
  11080. /**
  11081. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11082. * to the function return the value of the first invocation. The `func` is
  11083. * invoked with the `this` binding and arguments of the created function.
  11084. *
  11085. * @static
  11086. * @memberOf _
  11087. * @since 0.1.0
  11088. * @category Function
  11089. * @param {Function} func The function to restrict.
  11090. * @returns {Function} Returns the new restricted function.
  11091. * @example
  11092. *
  11093. * var initialize = _.once(createApplication);
  11094. * initialize();
  11095. * initialize();
  11096. * // => `createApplication` is invoked once
  11097. */
  11098. function once(func) {
  11099. return before(2, func);
  11100. }
  11101. /**
  11102. * Creates a function that invokes `func` with its arguments transformed.
  11103. *
  11104. * @static
  11105. * @since 4.0.0
  11106. * @memberOf _
  11107. * @category Function
  11108. * @param {Function} func The function to wrap.
  11109. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11110. * The argument transforms.
  11111. * @returns {Function} Returns the new function.
  11112. * @example
  11113. *
  11114. * function doubled(n) {
  11115. * return n * 2;
  11116. * }
  11117. *
  11118. * function square(n) {
  11119. * return n * n;
  11120. * }
  11121. *
  11122. * var func = _.overArgs(function(x, y) {
  11123. * return [x, y];
  11124. * }, [square, doubled]);
  11125. *
  11126. * func(9, 3);
  11127. * // => [81, 6]
  11128. *
  11129. * func(10, 5);
  11130. * // => [100, 10]
  11131. */
  11132. var overArgs = castRest(function(func, transforms) {
  11133. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11134. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11135. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11136. var funcsLength = transforms.length;
  11137. return baseRest(function(args) {
  11138. var index = -1,
  11139. length = nativeMin(args.length, funcsLength);
  11140. while (++index < length) {
  11141. args[index] = transforms[index].call(this, args[index]);
  11142. }
  11143. return apply(func, this, args);
  11144. });
  11145. });
  11146. /**
  11147. * Creates a function that invokes `func` with `partials` prepended to the
  11148. * arguments it receives. This method is like `_.bind` except it does **not**
  11149. * alter the `this` binding.
  11150. *
  11151. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11152. * builds, may be used as a placeholder for partially applied arguments.
  11153. *
  11154. * **Note:** This method doesn't set the "length" property of partially
  11155. * applied functions.
  11156. *
  11157. * @static
  11158. * @memberOf _
  11159. * @since 0.2.0
  11160. * @category Function
  11161. * @param {Function} func The function to partially apply arguments to.
  11162. * @param {...*} [partials] The arguments to be partially applied.
  11163. * @returns {Function} Returns the new partially applied function.
  11164. * @example
  11165. *
  11166. * function greet(greeting, name) {
  11167. * return greeting + ' ' + name;
  11168. * }
  11169. *
  11170. * var sayHelloTo = _.partial(greet, 'hello');
  11171. * sayHelloTo('fred');
  11172. * // => 'hello fred'
  11173. *
  11174. * // Partially applied with placeholders.
  11175. * var greetFred = _.partial(greet, _, 'fred');
  11176. * greetFred('hi');
  11177. * // => 'hi fred'
  11178. */
  11179. var partial = baseRest(function(func, partials) {
  11180. var holders = replaceHolders(partials, getHolder(partial));
  11181. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11182. });
  11183. /**
  11184. * This method is like `_.partial` except that partially applied arguments
  11185. * are appended to the arguments it receives.
  11186. *
  11187. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11188. * builds, may be used as a placeholder for partially applied arguments.
  11189. *
  11190. * **Note:** This method doesn't set the "length" property of partially
  11191. * applied functions.
  11192. *
  11193. * @static
  11194. * @memberOf _
  11195. * @since 1.0.0
  11196. * @category Function
  11197. * @param {Function} func The function to partially apply arguments to.
  11198. * @param {...*} [partials] The arguments to be partially applied.
  11199. * @returns {Function} Returns the new partially applied function.
  11200. * @example
  11201. *
  11202. * function greet(greeting, name) {
  11203. * return greeting + ' ' + name;
  11204. * }
  11205. *
  11206. * var greetFred = _.partialRight(greet, 'fred');
  11207. * greetFred('hi');
  11208. * // => 'hi fred'
  11209. *
  11210. * // Partially applied with placeholders.
  11211. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11212. * sayHelloTo('fred');
  11213. * // => 'hello fred'
  11214. */
  11215. var partialRight = baseRest(function(func, partials) {
  11216. var holders = replaceHolders(partials, getHolder(partialRight));
  11217. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11218. });
  11219. /**
  11220. * Creates a function that invokes `func` with arguments arranged according
  11221. * to the specified `indexes` where the argument value at the first index is
  11222. * provided as the first argument, the argument value at the second index is
  11223. * provided as the second argument, and so on.
  11224. *
  11225. * @static
  11226. * @memberOf _
  11227. * @since 3.0.0
  11228. * @category Function
  11229. * @param {Function} func The function to rearrange arguments for.
  11230. * @param {...(number|number[])} indexes The arranged argument indexes.
  11231. * @returns {Function} Returns the new function.
  11232. * @example
  11233. *
  11234. * var rearged = _.rearg(function(a, b, c) {
  11235. * return [a, b, c];
  11236. * }, [2, 0, 1]);
  11237. *
  11238. * rearged('b', 'c', 'a')
  11239. * // => ['a', 'b', 'c']
  11240. */
  11241. var rearg = flatRest(function(func, indexes) {
  11242. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11243. });
  11244. /**
  11245. * Creates a function that invokes `func` with the `this` binding of the
  11246. * created function and arguments from `start` and beyond provided as
  11247. * an array.
  11248. *
  11249. * **Note:** This method is based on the
  11250. * [rest parameter](https://mdn.io/rest_parameters).
  11251. *
  11252. * @static
  11253. * @memberOf _
  11254. * @since 4.0.0
  11255. * @category Function
  11256. * @param {Function} func The function to apply a rest parameter to.
  11257. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11258. * @returns {Function} Returns the new function.
  11259. * @example
  11260. *
  11261. * var say = _.rest(function(what, names) {
  11262. * return what + ' ' + _.initial(names).join(', ') +
  11263. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11264. * });
  11265. *
  11266. * say('hello', 'fred', 'barney', 'pebbles');
  11267. * // => 'hello fred, barney, & pebbles'
  11268. */
  11269. function rest(func, start) {
  11270. if (typeof func != 'function') {
  11271. throw new TypeError(FUNC_ERROR_TEXT);
  11272. }
  11273. start = start === undefined ? start : toInteger(start);
  11274. return baseRest(func, start);
  11275. }
  11276. /**
  11277. * Creates a function that invokes `func` with the `this` binding of the
  11278. * create function and an array of arguments much like
  11279. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11280. *
  11281. * **Note:** This method is based on the
  11282. * [spread operator](https://mdn.io/spread_operator).
  11283. *
  11284. * @static
  11285. * @memberOf _
  11286. * @since 3.2.0
  11287. * @category Function
  11288. * @param {Function} func The function to spread arguments over.
  11289. * @param {number} [start=0] The start position of the spread.
  11290. * @returns {Function} Returns the new function.
  11291. * @example
  11292. *
  11293. * var say = _.spread(function(who, what) {
  11294. * return who + ' says ' + what;
  11295. * });
  11296. *
  11297. * say(['fred', 'hello']);
  11298. * // => 'fred says hello'
  11299. *
  11300. * var numbers = Promise.all([
  11301. * Promise.resolve(40),
  11302. * Promise.resolve(36)
  11303. * ]);
  11304. *
  11305. * numbers.then(_.spread(function(x, y) {
  11306. * return x + y;
  11307. * }));
  11308. * // => a Promise of 76
  11309. */
  11310. function spread(func, start) {
  11311. if (typeof func != 'function') {
  11312. throw new TypeError(FUNC_ERROR_TEXT);
  11313. }
  11314. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11315. return baseRest(function(args) {
  11316. var array = args[start],
  11317. otherArgs = castSlice(args, 0, start);
  11318. if (array) {
  11319. arrayPush(otherArgs, array);
  11320. }
  11321. return apply(func, this, otherArgs);
  11322. });
  11323. }
  11324. /**
  11325. * Creates a throttled function that only invokes `func` at most once per
  11326. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11327. * method to cancel delayed `func` invocations and a `flush` method to
  11328. * immediately invoke them. Provide `options` to indicate whether `func`
  11329. * should be invoked on the leading and/or trailing edge of the `wait`
  11330. * timeout. The `func` is invoked with the last arguments provided to the
  11331. * throttled function. Subsequent calls to the throttled function return the
  11332. * result of the last `func` invocation.
  11333. *
  11334. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11335. * invoked on the trailing edge of the timeout only if the throttled function
  11336. * is invoked more than once during the `wait` timeout.
  11337. *
  11338. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11339. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11340. *
  11341. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11342. * for details over the differences between `_.throttle` and `_.debounce`.
  11343. *
  11344. * @static
  11345. * @memberOf _
  11346. * @since 0.1.0
  11347. * @category Function
  11348. * @param {Function} func The function to throttle.
  11349. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11350. * @param {Object} [options={}] The options object.
  11351. * @param {boolean} [options.leading=true]
  11352. * Specify invoking on the leading edge of the timeout.
  11353. * @param {boolean} [options.trailing=true]
  11354. * Specify invoking on the trailing edge of the timeout.
  11355. * @returns {Function} Returns the new throttled function.
  11356. * @example
  11357. *
  11358. * // Avoid excessively updating the position while scrolling.
  11359. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11360. *
  11361. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11362. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11363. * jQuery(element).on('click', throttled);
  11364. *
  11365. * // Cancel the trailing throttled invocation.
  11366. * jQuery(window).on('popstate', throttled.cancel);
  11367. */
  11368. function throttle(func, wait, options) {
  11369. var leading = true,
  11370. trailing = true;
  11371. if (typeof func != 'function') {
  11372. throw new TypeError(FUNC_ERROR_TEXT);
  11373. }
  11374. if (isObject(options)) {
  11375. leading = 'leading' in options ? !!options.leading : leading;
  11376. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11377. }
  11378. return debounce(func, wait, {
  11379. 'leading': leading,
  11380. 'maxWait': wait,
  11381. 'trailing': trailing
  11382. });
  11383. }
  11384. /**
  11385. * Creates a function that accepts up to one argument, ignoring any
  11386. * additional arguments.
  11387. *
  11388. * @static
  11389. * @memberOf _
  11390. * @since 4.0.0
  11391. * @category Function
  11392. * @param {Function} func The function to cap arguments for.
  11393. * @returns {Function} Returns the new capped function.
  11394. * @example
  11395. *
  11396. * _.map(['6', '8', '10'], _.unary(parseInt));
  11397. * // => [6, 8, 10]
  11398. */
  11399. function unary(func) {
  11400. return ary(func, 1);
  11401. }
  11402. /**
  11403. * Creates a function that provides `value` to `wrapper` as its first
  11404. * argument. Any additional arguments provided to the function are appended
  11405. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11406. * binding of the created function.
  11407. *
  11408. * @static
  11409. * @memberOf _
  11410. * @since 0.1.0
  11411. * @category Function
  11412. * @param {*} value The value to wrap.
  11413. * @param {Function} [wrapper=identity] The wrapper function.
  11414. * @returns {Function} Returns the new function.
  11415. * @example
  11416. *
  11417. * var p = _.wrap(_.escape, function(func, text) {
  11418. * return '<p>' + func(text) + '</p>';
  11419. * });
  11420. *
  11421. * p('fred, barney, & pebbles');
  11422. * // => '<p>fred, barney, &amp; pebbles</p>'
  11423. */
  11424. function wrap(value, wrapper) {
  11425. return partial(castFunction(wrapper), value);
  11426. }
  11427. /*------------------------------------------------------------------------*/
  11428. /**
  11429. * Casts `value` as an array if it's not one.
  11430. *
  11431. * @static
  11432. * @memberOf _
  11433. * @since 4.4.0
  11434. * @category Lang
  11435. * @param {*} value The value to inspect.
  11436. * @returns {Array} Returns the cast array.
  11437. * @example
  11438. *
  11439. * _.castArray(1);
  11440. * // => [1]
  11441. *
  11442. * _.castArray({ 'a': 1 });
  11443. * // => [{ 'a': 1 }]
  11444. *
  11445. * _.castArray('abc');
  11446. * // => ['abc']
  11447. *
  11448. * _.castArray(null);
  11449. * // => [null]
  11450. *
  11451. * _.castArray(undefined);
  11452. * // => [undefined]
  11453. *
  11454. * _.castArray();
  11455. * // => []
  11456. *
  11457. * var array = [1, 2, 3];
  11458. * console.log(_.castArray(array) === array);
  11459. * // => true
  11460. */
  11461. function castArray() {
  11462. if (!arguments.length) {
  11463. return [];
  11464. }
  11465. var value = arguments[0];
  11466. return isArray(value) ? value : [value];
  11467. }
  11468. /**
  11469. * Creates a shallow clone of `value`.
  11470. *
  11471. * **Note:** This method is loosely based on the
  11472. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11473. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11474. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11475. * arrays. The own enumerable properties of `arguments` objects are cloned
  11476. * as plain objects. An empty object is returned for uncloneable values such
  11477. * as error objects, functions, DOM nodes, and WeakMaps.
  11478. *
  11479. * @static
  11480. * @memberOf _
  11481. * @since 0.1.0
  11482. * @category Lang
  11483. * @param {*} value The value to clone.
  11484. * @returns {*} Returns the cloned value.
  11485. * @see _.cloneDeep
  11486. * @example
  11487. *
  11488. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11489. *
  11490. * var shallow = _.clone(objects);
  11491. * console.log(shallow[0] === objects[0]);
  11492. * // => true
  11493. */
  11494. function clone(value) {
  11495. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11496. }
  11497. /**
  11498. * This method is like `_.clone` except that it accepts `customizer` which
  11499. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11500. * cloning is handled by the method instead. The `customizer` is invoked with
  11501. * up to four arguments; (value [, index|key, object, stack]).
  11502. *
  11503. * @static
  11504. * @memberOf _
  11505. * @since 4.0.0
  11506. * @category Lang
  11507. * @param {*} value The value to clone.
  11508. * @param {Function} [customizer] The function to customize cloning.
  11509. * @returns {*} Returns the cloned value.
  11510. * @see _.cloneDeepWith
  11511. * @example
  11512. *
  11513. * function customizer(value) {
  11514. * if (_.isElement(value)) {
  11515. * return value.cloneNode(false);
  11516. * }
  11517. * }
  11518. *
  11519. * var el = _.cloneWith(document.body, customizer);
  11520. *
  11521. * console.log(el === document.body);
  11522. * // => false
  11523. * console.log(el.nodeName);
  11524. * // => 'BODY'
  11525. * console.log(el.childNodes.length);
  11526. * // => 0
  11527. */
  11528. function cloneWith(value, customizer) {
  11529. customizer = typeof customizer == 'function' ? customizer : undefined;
  11530. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11531. }
  11532. /**
  11533. * This method is like `_.clone` except that it recursively clones `value`.
  11534. *
  11535. * @static
  11536. * @memberOf _
  11537. * @since 1.0.0
  11538. * @category Lang
  11539. * @param {*} value The value to recursively clone.
  11540. * @returns {*} Returns the deep cloned value.
  11541. * @see _.clone
  11542. * @example
  11543. *
  11544. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11545. *
  11546. * var deep = _.cloneDeep(objects);
  11547. * console.log(deep[0] === objects[0]);
  11548. * // => false
  11549. */
  11550. function cloneDeep(value) {
  11551. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11552. }
  11553. /**
  11554. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11555. *
  11556. * @static
  11557. * @memberOf _
  11558. * @since 4.0.0
  11559. * @category Lang
  11560. * @param {*} value The value to recursively clone.
  11561. * @param {Function} [customizer] The function to customize cloning.
  11562. * @returns {*} Returns the deep cloned value.
  11563. * @see _.cloneWith
  11564. * @example
  11565. *
  11566. * function customizer(value) {
  11567. * if (_.isElement(value)) {
  11568. * return value.cloneNode(true);
  11569. * }
  11570. * }
  11571. *
  11572. * var el = _.cloneDeepWith(document.body, customizer);
  11573. *
  11574. * console.log(el === document.body);
  11575. * // => false
  11576. * console.log(el.nodeName);
  11577. * // => 'BODY'
  11578. * console.log(el.childNodes.length);
  11579. * // => 20
  11580. */
  11581. function cloneDeepWith(value, customizer) {
  11582. customizer = typeof customizer == 'function' ? customizer : undefined;
  11583. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11584. }
  11585. /**
  11586. * Checks if `object` conforms to `source` by invoking the predicate
  11587. * properties of `source` with the corresponding property values of `object`.
  11588. *
  11589. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11590. * partially applied.
  11591. *
  11592. * @static
  11593. * @memberOf _
  11594. * @since 4.14.0
  11595. * @category Lang
  11596. * @param {Object} object The object to inspect.
  11597. * @param {Object} source The object of property predicates to conform to.
  11598. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11599. * @example
  11600. *
  11601. * var object = { 'a': 1, 'b': 2 };
  11602. *
  11603. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11604. * // => true
  11605. *
  11606. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11607. * // => false
  11608. */
  11609. function conformsTo(object, source) {
  11610. return source == null || baseConformsTo(object, source, keys(source));
  11611. }
  11612. /**
  11613. * Performs a
  11614. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11615. * comparison between two values to determine if they are equivalent.
  11616. *
  11617. * @static
  11618. * @memberOf _
  11619. * @since 4.0.0
  11620. * @category Lang
  11621. * @param {*} value The value to compare.
  11622. * @param {*} other The other value to compare.
  11623. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11624. * @example
  11625. *
  11626. * var object = { 'a': 1 };
  11627. * var other = { 'a': 1 };
  11628. *
  11629. * _.eq(object, object);
  11630. * // => true
  11631. *
  11632. * _.eq(object, other);
  11633. * // => false
  11634. *
  11635. * _.eq('a', 'a');
  11636. * // => true
  11637. *
  11638. * _.eq('a', Object('a'));
  11639. * // => false
  11640. *
  11641. * _.eq(NaN, NaN);
  11642. * // => true
  11643. */
  11644. function eq(value, other) {
  11645. return value === other || (value !== value && other !== other);
  11646. }
  11647. /**
  11648. * Checks if `value` is greater than `other`.
  11649. *
  11650. * @static
  11651. * @memberOf _
  11652. * @since 3.9.0
  11653. * @category Lang
  11654. * @param {*} value The value to compare.
  11655. * @param {*} other The other value to compare.
  11656. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11657. * else `false`.
  11658. * @see _.lt
  11659. * @example
  11660. *
  11661. * _.gt(3, 1);
  11662. * // => true
  11663. *
  11664. * _.gt(3, 3);
  11665. * // => false
  11666. *
  11667. * _.gt(1, 3);
  11668. * // => false
  11669. */
  11670. var gt = createRelationalOperation(baseGt);
  11671. /**
  11672. * Checks if `value` is greater than or equal to `other`.
  11673. *
  11674. * @static
  11675. * @memberOf _
  11676. * @since 3.9.0
  11677. * @category Lang
  11678. * @param {*} value The value to compare.
  11679. * @param {*} other The other value to compare.
  11680. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11681. * `other`, else `false`.
  11682. * @see _.lte
  11683. * @example
  11684. *
  11685. * _.gte(3, 1);
  11686. * // => true
  11687. *
  11688. * _.gte(3, 3);
  11689. * // => true
  11690. *
  11691. * _.gte(1, 3);
  11692. * // => false
  11693. */
  11694. var gte = createRelationalOperation(function(value, other) {
  11695. return value >= other;
  11696. });
  11697. /**
  11698. * Checks if `value` is likely an `arguments` object.
  11699. *
  11700. * @static
  11701. * @memberOf _
  11702. * @since 0.1.0
  11703. * @category Lang
  11704. * @param {*} value The value to check.
  11705. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11706. * else `false`.
  11707. * @example
  11708. *
  11709. * _.isArguments(function() { return arguments; }());
  11710. * // => true
  11711. *
  11712. * _.isArguments([1, 2, 3]);
  11713. * // => false
  11714. */
  11715. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11716. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11717. !propertyIsEnumerable.call(value, 'callee');
  11718. };
  11719. /**
  11720. * Checks if `value` is classified as an `Array` object.
  11721. *
  11722. * @static
  11723. * @memberOf _
  11724. * @since 0.1.0
  11725. * @category Lang
  11726. * @param {*} value The value to check.
  11727. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11728. * @example
  11729. *
  11730. * _.isArray([1, 2, 3]);
  11731. * // => true
  11732. *
  11733. * _.isArray(document.body.children);
  11734. * // => false
  11735. *
  11736. * _.isArray('abc');
  11737. * // => false
  11738. *
  11739. * _.isArray(_.noop);
  11740. * // => false
  11741. */
  11742. var isArray = Array.isArray;
  11743. /**
  11744. * Checks if `value` is classified as an `ArrayBuffer` object.
  11745. *
  11746. * @static
  11747. * @memberOf _
  11748. * @since 4.3.0
  11749. * @category Lang
  11750. * @param {*} value The value to check.
  11751. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11752. * @example
  11753. *
  11754. * _.isArrayBuffer(new ArrayBuffer(2));
  11755. * // => true
  11756. *
  11757. * _.isArrayBuffer(new Array(2));
  11758. * // => false
  11759. */
  11760. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11761. /**
  11762. * Checks if `value` is array-like. A value is considered array-like if it's
  11763. * not a function and has a `value.length` that's an integer greater than or
  11764. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11765. *
  11766. * @static
  11767. * @memberOf _
  11768. * @since 4.0.0
  11769. * @category Lang
  11770. * @param {*} value The value to check.
  11771. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11772. * @example
  11773. *
  11774. * _.isArrayLike([1, 2, 3]);
  11775. * // => true
  11776. *
  11777. * _.isArrayLike(document.body.children);
  11778. * // => true
  11779. *
  11780. * _.isArrayLike('abc');
  11781. * // => true
  11782. *
  11783. * _.isArrayLike(_.noop);
  11784. * // => false
  11785. */
  11786. function isArrayLike(value) {
  11787. return value != null && isLength(value.length) && !isFunction(value);
  11788. }
  11789. /**
  11790. * This method is like `_.isArrayLike` except that it also checks if `value`
  11791. * is an object.
  11792. *
  11793. * @static
  11794. * @memberOf _
  11795. * @since 4.0.0
  11796. * @category Lang
  11797. * @param {*} value The value to check.
  11798. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11799. * else `false`.
  11800. * @example
  11801. *
  11802. * _.isArrayLikeObject([1, 2, 3]);
  11803. * // => true
  11804. *
  11805. * _.isArrayLikeObject(document.body.children);
  11806. * // => true
  11807. *
  11808. * _.isArrayLikeObject('abc');
  11809. * // => false
  11810. *
  11811. * _.isArrayLikeObject(_.noop);
  11812. * // => false
  11813. */
  11814. function isArrayLikeObject(value) {
  11815. return isObjectLike(value) && isArrayLike(value);
  11816. }
  11817. /**
  11818. * Checks if `value` is classified as a boolean primitive or object.
  11819. *
  11820. * @static
  11821. * @memberOf _
  11822. * @since 0.1.0
  11823. * @category Lang
  11824. * @param {*} value The value to check.
  11825. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11826. * @example
  11827. *
  11828. * _.isBoolean(false);
  11829. * // => true
  11830. *
  11831. * _.isBoolean(null);
  11832. * // => false
  11833. */
  11834. function isBoolean(value) {
  11835. return value === true || value === false ||
  11836. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11837. }
  11838. /**
  11839. * Checks if `value` is a buffer.
  11840. *
  11841. * @static
  11842. * @memberOf _
  11843. * @since 4.3.0
  11844. * @category Lang
  11845. * @param {*} value The value to check.
  11846. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11847. * @example
  11848. *
  11849. * _.isBuffer(new Buffer(2));
  11850. * // => true
  11851. *
  11852. * _.isBuffer(new Uint8Array(2));
  11853. * // => false
  11854. */
  11855. var isBuffer = nativeIsBuffer || stubFalse;
  11856. /**
  11857. * Checks if `value` is classified as a `Date` object.
  11858. *
  11859. * @static
  11860. * @memberOf _
  11861. * @since 0.1.0
  11862. * @category Lang
  11863. * @param {*} value The value to check.
  11864. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11865. * @example
  11866. *
  11867. * _.isDate(new Date);
  11868. * // => true
  11869. *
  11870. * _.isDate('Mon April 23 2012');
  11871. * // => false
  11872. */
  11873. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11874. /**
  11875. * Checks if `value` is likely a DOM element.
  11876. *
  11877. * @static
  11878. * @memberOf _
  11879. * @since 0.1.0
  11880. * @category Lang
  11881. * @param {*} value The value to check.
  11882. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11883. * @example
  11884. *
  11885. * _.isElement(document.body);
  11886. * // => true
  11887. *
  11888. * _.isElement('<body>');
  11889. * // => false
  11890. */
  11891. function isElement(value) {
  11892. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11893. }
  11894. /**
  11895. * Checks if `value` is an empty object, collection, map, or set.
  11896. *
  11897. * Objects are considered empty if they have no own enumerable string keyed
  11898. * properties.
  11899. *
  11900. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11901. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11902. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11903. *
  11904. * @static
  11905. * @memberOf _
  11906. * @since 0.1.0
  11907. * @category Lang
  11908. * @param {*} value The value to check.
  11909. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11910. * @example
  11911. *
  11912. * _.isEmpty(null);
  11913. * // => true
  11914. *
  11915. * _.isEmpty(true);
  11916. * // => true
  11917. *
  11918. * _.isEmpty(1);
  11919. * // => true
  11920. *
  11921. * _.isEmpty([1, 2, 3]);
  11922. * // => false
  11923. *
  11924. * _.isEmpty({ 'a': 1 });
  11925. * // => false
  11926. */
  11927. function isEmpty(value) {
  11928. if (value == null) {
  11929. return true;
  11930. }
  11931. if (isArrayLike(value) &&
  11932. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11933. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11934. return !value.length;
  11935. }
  11936. var tag = getTag(value);
  11937. if (tag == mapTag || tag == setTag) {
  11938. return !value.size;
  11939. }
  11940. if (isPrototype(value)) {
  11941. return !baseKeys(value).length;
  11942. }
  11943. for (var key in value) {
  11944. if (hasOwnProperty.call(value, key)) {
  11945. return false;
  11946. }
  11947. }
  11948. return true;
  11949. }
  11950. /**
  11951. * Performs a deep comparison between two values to determine if they are
  11952. * equivalent.
  11953. *
  11954. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11955. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11956. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11957. * by their own, not inherited, enumerable properties. Functions and DOM
  11958. * nodes are compared by strict equality, i.e. `===`.
  11959. *
  11960. * @static
  11961. * @memberOf _
  11962. * @since 0.1.0
  11963. * @category Lang
  11964. * @param {*} value The value to compare.
  11965. * @param {*} other The other value to compare.
  11966. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11967. * @example
  11968. *
  11969. * var object = { 'a': 1 };
  11970. * var other = { 'a': 1 };
  11971. *
  11972. * _.isEqual(object, other);
  11973. * // => true
  11974. *
  11975. * object === other;
  11976. * // => false
  11977. */
  11978. function isEqual(value, other) {
  11979. return baseIsEqual(value, other);
  11980. }
  11981. /**
  11982. * This method is like `_.isEqual` except that it accepts `customizer` which
  11983. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11984. * are handled by the method instead. The `customizer` is invoked with up to
  11985. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11986. *
  11987. * @static
  11988. * @memberOf _
  11989. * @since 4.0.0
  11990. * @category Lang
  11991. * @param {*} value The value to compare.
  11992. * @param {*} other The other value to compare.
  11993. * @param {Function} [customizer] The function to customize comparisons.
  11994. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11995. * @example
  11996. *
  11997. * function isGreeting(value) {
  11998. * return /^h(?:i|ello)$/.test(value);
  11999. * }
  12000. *
  12001. * function customizer(objValue, othValue) {
  12002. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12003. * return true;
  12004. * }
  12005. * }
  12006. *
  12007. * var array = ['hello', 'goodbye'];
  12008. * var other = ['hi', 'goodbye'];
  12009. *
  12010. * _.isEqualWith(array, other, customizer);
  12011. * // => true
  12012. */
  12013. function isEqualWith(value, other, customizer) {
  12014. customizer = typeof customizer == 'function' ? customizer : undefined;
  12015. var result = customizer ? customizer(value, other) : undefined;
  12016. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12017. }
  12018. /**
  12019. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12020. * `SyntaxError`, `TypeError`, or `URIError` object.
  12021. *
  12022. * @static
  12023. * @memberOf _
  12024. * @since 3.0.0
  12025. * @category Lang
  12026. * @param {*} value The value to check.
  12027. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12028. * @example
  12029. *
  12030. * _.isError(new Error);
  12031. * // => true
  12032. *
  12033. * _.isError(Error);
  12034. * // => false
  12035. */
  12036. function isError(value) {
  12037. if (!isObjectLike(value)) {
  12038. return false;
  12039. }
  12040. var tag = baseGetTag(value);
  12041. return tag == errorTag || tag == domExcTag ||
  12042. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12043. }
  12044. /**
  12045. * Checks if `value` is a finite primitive number.
  12046. *
  12047. * **Note:** This method is based on
  12048. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12049. *
  12050. * @static
  12051. * @memberOf _
  12052. * @since 0.1.0
  12053. * @category Lang
  12054. * @param {*} value The value to check.
  12055. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12056. * @example
  12057. *
  12058. * _.isFinite(3);
  12059. * // => true
  12060. *
  12061. * _.isFinite(Number.MIN_VALUE);
  12062. * // => true
  12063. *
  12064. * _.isFinite(Infinity);
  12065. * // => false
  12066. *
  12067. * _.isFinite('3');
  12068. * // => false
  12069. */
  12070. function isFinite(value) {
  12071. return typeof value == 'number' && nativeIsFinite(value);
  12072. }
  12073. /**
  12074. * Checks if `value` is classified as a `Function` object.
  12075. *
  12076. * @static
  12077. * @memberOf _
  12078. * @since 0.1.0
  12079. * @category Lang
  12080. * @param {*} value The value to check.
  12081. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12082. * @example
  12083. *
  12084. * _.isFunction(_);
  12085. * // => true
  12086. *
  12087. * _.isFunction(/abc/);
  12088. * // => false
  12089. */
  12090. function isFunction(value) {
  12091. if (!isObject(value)) {
  12092. return false;
  12093. }
  12094. // The use of `Object#toString` avoids issues with the `typeof` operator
  12095. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12096. var tag = baseGetTag(value);
  12097. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12098. }
  12099. /**
  12100. * Checks if `value` is an integer.
  12101. *
  12102. * **Note:** This method is based on
  12103. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12104. *
  12105. * @static
  12106. * @memberOf _
  12107. * @since 4.0.0
  12108. * @category Lang
  12109. * @param {*} value The value to check.
  12110. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12111. * @example
  12112. *
  12113. * _.isInteger(3);
  12114. * // => true
  12115. *
  12116. * _.isInteger(Number.MIN_VALUE);
  12117. * // => false
  12118. *
  12119. * _.isInteger(Infinity);
  12120. * // => false
  12121. *
  12122. * _.isInteger('3');
  12123. * // => false
  12124. */
  12125. function isInteger(value) {
  12126. return typeof value == 'number' && value == toInteger(value);
  12127. }
  12128. /**
  12129. * Checks if `value` is a valid array-like length.
  12130. *
  12131. * **Note:** This method is loosely based on
  12132. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12133. *
  12134. * @static
  12135. * @memberOf _
  12136. * @since 4.0.0
  12137. * @category Lang
  12138. * @param {*} value The value to check.
  12139. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12140. * @example
  12141. *
  12142. * _.isLength(3);
  12143. * // => true
  12144. *
  12145. * _.isLength(Number.MIN_VALUE);
  12146. * // => false
  12147. *
  12148. * _.isLength(Infinity);
  12149. * // => false
  12150. *
  12151. * _.isLength('3');
  12152. * // => false
  12153. */
  12154. function isLength(value) {
  12155. return typeof value == 'number' &&
  12156. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12157. }
  12158. /**
  12159. * Checks if `value` is the
  12160. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12161. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12162. *
  12163. * @static
  12164. * @memberOf _
  12165. * @since 0.1.0
  12166. * @category Lang
  12167. * @param {*} value The value to check.
  12168. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12169. * @example
  12170. *
  12171. * _.isObject({});
  12172. * // => true
  12173. *
  12174. * _.isObject([1, 2, 3]);
  12175. * // => true
  12176. *
  12177. * _.isObject(_.noop);
  12178. * // => true
  12179. *
  12180. * _.isObject(null);
  12181. * // => false
  12182. */
  12183. function isObject(value) {
  12184. var type = typeof value;
  12185. return value != null && (type == 'object' || type == 'function');
  12186. }
  12187. /**
  12188. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12189. * and has a `typeof` result of "object".
  12190. *
  12191. * @static
  12192. * @memberOf _
  12193. * @since 4.0.0
  12194. * @category Lang
  12195. * @param {*} value The value to check.
  12196. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12197. * @example
  12198. *
  12199. * _.isObjectLike({});
  12200. * // => true
  12201. *
  12202. * _.isObjectLike([1, 2, 3]);
  12203. * // => true
  12204. *
  12205. * _.isObjectLike(_.noop);
  12206. * // => false
  12207. *
  12208. * _.isObjectLike(null);
  12209. * // => false
  12210. */
  12211. function isObjectLike(value) {
  12212. return value != null && typeof value == 'object';
  12213. }
  12214. /**
  12215. * Checks if `value` is classified as a `Map` object.
  12216. *
  12217. * @static
  12218. * @memberOf _
  12219. * @since 4.3.0
  12220. * @category Lang
  12221. * @param {*} value The value to check.
  12222. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12223. * @example
  12224. *
  12225. * _.isMap(new Map);
  12226. * // => true
  12227. *
  12228. * _.isMap(new WeakMap);
  12229. * // => false
  12230. */
  12231. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12232. /**
  12233. * Performs a partial deep comparison between `object` and `source` to
  12234. * determine if `object` contains equivalent property values.
  12235. *
  12236. * **Note:** This method is equivalent to `_.matches` when `source` is
  12237. * partially applied.
  12238. *
  12239. * Partial comparisons will match empty array and empty object `source`
  12240. * values against any array or object value, respectively. See `_.isEqual`
  12241. * for a list of supported value comparisons.
  12242. *
  12243. * @static
  12244. * @memberOf _
  12245. * @since 3.0.0
  12246. * @category Lang
  12247. * @param {Object} object The object to inspect.
  12248. * @param {Object} source The object of property values to match.
  12249. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12250. * @example
  12251. *
  12252. * var object = { 'a': 1, 'b': 2 };
  12253. *
  12254. * _.isMatch(object, { 'b': 2 });
  12255. * // => true
  12256. *
  12257. * _.isMatch(object, { 'b': 1 });
  12258. * // => false
  12259. */
  12260. function isMatch(object, source) {
  12261. return object === source || baseIsMatch(object, source, getMatchData(source));
  12262. }
  12263. /**
  12264. * This method is like `_.isMatch` except that it accepts `customizer` which
  12265. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12266. * are handled by the method instead. The `customizer` is invoked with five
  12267. * arguments: (objValue, srcValue, index|key, object, source).
  12268. *
  12269. * @static
  12270. * @memberOf _
  12271. * @since 4.0.0
  12272. * @category Lang
  12273. * @param {Object} object The object to inspect.
  12274. * @param {Object} source The object of property values to match.
  12275. * @param {Function} [customizer] The function to customize comparisons.
  12276. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12277. * @example
  12278. *
  12279. * function isGreeting(value) {
  12280. * return /^h(?:i|ello)$/.test(value);
  12281. * }
  12282. *
  12283. * function customizer(objValue, srcValue) {
  12284. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12285. * return true;
  12286. * }
  12287. * }
  12288. *
  12289. * var object = { 'greeting': 'hello' };
  12290. * var source = { 'greeting': 'hi' };
  12291. *
  12292. * _.isMatchWith(object, source, customizer);
  12293. * // => true
  12294. */
  12295. function isMatchWith(object, source, customizer) {
  12296. customizer = typeof customizer == 'function' ? customizer : undefined;
  12297. return baseIsMatch(object, source, getMatchData(source), customizer);
  12298. }
  12299. /**
  12300. * Checks if `value` is `NaN`.
  12301. *
  12302. * **Note:** This method is based on
  12303. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12304. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12305. * `undefined` and other non-number values.
  12306. *
  12307. * @static
  12308. * @memberOf _
  12309. * @since 0.1.0
  12310. * @category Lang
  12311. * @param {*} value The value to check.
  12312. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12313. * @example
  12314. *
  12315. * _.isNaN(NaN);
  12316. * // => true
  12317. *
  12318. * _.isNaN(new Number(NaN));
  12319. * // => true
  12320. *
  12321. * isNaN(undefined);
  12322. * // => true
  12323. *
  12324. * _.isNaN(undefined);
  12325. * // => false
  12326. */
  12327. function isNaN(value) {
  12328. // An `NaN` primitive is the only value that is not equal to itself.
  12329. // Perform the `toStringTag` check first to avoid errors with some
  12330. // ActiveX objects in IE.
  12331. return isNumber(value) && value != +value;
  12332. }
  12333. /**
  12334. * Checks if `value` is a pristine native function.
  12335. *
  12336. * **Note:** This method can't reliably detect native functions in the presence
  12337. * of the core-js package because core-js circumvents this kind of detection.
  12338. * Despite multiple requests, the core-js maintainer has made it clear: any
  12339. * attempt to fix the detection will be obstructed. As a result, we're left
  12340. * with little choice but to throw an error. Unfortunately, this also affects
  12341. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12342. * which rely on core-js.
  12343. *
  12344. * @static
  12345. * @memberOf _
  12346. * @since 3.0.0
  12347. * @category Lang
  12348. * @param {*} value The value to check.
  12349. * @returns {boolean} Returns `true` if `value` is a native function,
  12350. * else `false`.
  12351. * @example
  12352. *
  12353. * _.isNative(Array.prototype.push);
  12354. * // => true
  12355. *
  12356. * _.isNative(_);
  12357. * // => false
  12358. */
  12359. function isNative(value) {
  12360. if (isMaskable(value)) {
  12361. throw new Error(CORE_ERROR_TEXT);
  12362. }
  12363. return baseIsNative(value);
  12364. }
  12365. /**
  12366. * Checks if `value` is `null`.
  12367. *
  12368. * @static
  12369. * @memberOf _
  12370. * @since 0.1.0
  12371. * @category Lang
  12372. * @param {*} value The value to check.
  12373. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12374. * @example
  12375. *
  12376. * _.isNull(null);
  12377. * // => true
  12378. *
  12379. * _.isNull(void 0);
  12380. * // => false
  12381. */
  12382. function isNull(value) {
  12383. return value === null;
  12384. }
  12385. /**
  12386. * Checks if `value` is `null` or `undefined`.
  12387. *
  12388. * @static
  12389. * @memberOf _
  12390. * @since 4.0.0
  12391. * @category Lang
  12392. * @param {*} value The value to check.
  12393. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12394. * @example
  12395. *
  12396. * _.isNil(null);
  12397. * // => true
  12398. *
  12399. * _.isNil(void 0);
  12400. * // => true
  12401. *
  12402. * _.isNil(NaN);
  12403. * // => false
  12404. */
  12405. function isNil(value) {
  12406. return value == null;
  12407. }
  12408. /**
  12409. * Checks if `value` is classified as a `Number` primitive or object.
  12410. *
  12411. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12412. * classified as numbers, use the `_.isFinite` method.
  12413. *
  12414. * @static
  12415. * @memberOf _
  12416. * @since 0.1.0
  12417. * @category Lang
  12418. * @param {*} value The value to check.
  12419. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12420. * @example
  12421. *
  12422. * _.isNumber(3);
  12423. * // => true
  12424. *
  12425. * _.isNumber(Number.MIN_VALUE);
  12426. * // => true
  12427. *
  12428. * _.isNumber(Infinity);
  12429. * // => true
  12430. *
  12431. * _.isNumber('3');
  12432. * // => false
  12433. */
  12434. function isNumber(value) {
  12435. return typeof value == 'number' ||
  12436. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12437. }
  12438. /**
  12439. * Checks if `value` is a plain object, that is, an object created by the
  12440. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12441. *
  12442. * @static
  12443. * @memberOf _
  12444. * @since 0.8.0
  12445. * @category Lang
  12446. * @param {*} value The value to check.
  12447. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12448. * @example
  12449. *
  12450. * function Foo() {
  12451. * this.a = 1;
  12452. * }
  12453. *
  12454. * _.isPlainObject(new Foo);
  12455. * // => false
  12456. *
  12457. * _.isPlainObject([1, 2, 3]);
  12458. * // => false
  12459. *
  12460. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12461. * // => true
  12462. *
  12463. * _.isPlainObject(Object.create(null));
  12464. * // => true
  12465. */
  12466. function isPlainObject(value) {
  12467. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12468. return false;
  12469. }
  12470. var proto = getPrototype(value);
  12471. if (proto === null) {
  12472. return true;
  12473. }
  12474. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12475. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12476. funcToString.call(Ctor) == objectCtorString;
  12477. }
  12478. /**
  12479. * Checks if `value` is classified as a `RegExp` object.
  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 regexp, else `false`.
  12487. * @example
  12488. *
  12489. * _.isRegExp(/abc/);
  12490. * // => true
  12491. *
  12492. * _.isRegExp('/abc/');
  12493. * // => false
  12494. */
  12495. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12496. /**
  12497. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12498. * double precision number which isn't the result of a rounded unsafe integer.
  12499. *
  12500. * **Note:** This method is based on
  12501. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12502. *
  12503. * @static
  12504. * @memberOf _
  12505. * @since 4.0.0
  12506. * @category Lang
  12507. * @param {*} value The value to check.
  12508. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12509. * @example
  12510. *
  12511. * _.isSafeInteger(3);
  12512. * // => true
  12513. *
  12514. * _.isSafeInteger(Number.MIN_VALUE);
  12515. * // => false
  12516. *
  12517. * _.isSafeInteger(Infinity);
  12518. * // => false
  12519. *
  12520. * _.isSafeInteger('3');
  12521. * // => false
  12522. */
  12523. function isSafeInteger(value) {
  12524. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12525. }
  12526. /**
  12527. * Checks if `value` is classified as a `Set` object.
  12528. *
  12529. * @static
  12530. * @memberOf _
  12531. * @since 4.3.0
  12532. * @category Lang
  12533. * @param {*} value The value to check.
  12534. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12535. * @example
  12536. *
  12537. * _.isSet(new Set);
  12538. * // => true
  12539. *
  12540. * _.isSet(new WeakSet);
  12541. * // => false
  12542. */
  12543. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12544. /**
  12545. * Checks if `value` is classified as a `String` primitive or object.
  12546. *
  12547. * @static
  12548. * @since 0.1.0
  12549. * @memberOf _
  12550. * @category Lang
  12551. * @param {*} value The value to check.
  12552. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12553. * @example
  12554. *
  12555. * _.isString('abc');
  12556. * // => true
  12557. *
  12558. * _.isString(1);
  12559. * // => false
  12560. */
  12561. function isString(value) {
  12562. return typeof value == 'string' ||
  12563. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12564. }
  12565. /**
  12566. * Checks if `value` is classified as a `Symbol` primitive or object.
  12567. *
  12568. * @static
  12569. * @memberOf _
  12570. * @since 4.0.0
  12571. * @category Lang
  12572. * @param {*} value The value to check.
  12573. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12574. * @example
  12575. *
  12576. * _.isSymbol(Symbol.iterator);
  12577. * // => true
  12578. *
  12579. * _.isSymbol('abc');
  12580. * // => false
  12581. */
  12582. function isSymbol(value) {
  12583. return typeof value == 'symbol' ||
  12584. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12585. }
  12586. /**
  12587. * Checks if `value` is classified as a typed array.
  12588. *
  12589. * @static
  12590. * @memberOf _
  12591. * @since 3.0.0
  12592. * @category Lang
  12593. * @param {*} value The value to check.
  12594. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12595. * @example
  12596. *
  12597. * _.isTypedArray(new Uint8Array);
  12598. * // => true
  12599. *
  12600. * _.isTypedArray([]);
  12601. * // => false
  12602. */
  12603. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12604. /**
  12605. * Checks if `value` is `undefined`.
  12606. *
  12607. * @static
  12608. * @since 0.1.0
  12609. * @memberOf _
  12610. * @category Lang
  12611. * @param {*} value The value to check.
  12612. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12613. * @example
  12614. *
  12615. * _.isUndefined(void 0);
  12616. * // => true
  12617. *
  12618. * _.isUndefined(null);
  12619. * // => false
  12620. */
  12621. function isUndefined(value) {
  12622. return value === undefined;
  12623. }
  12624. /**
  12625. * Checks if `value` is classified as a `WeakMap` object.
  12626. *
  12627. * @static
  12628. * @memberOf _
  12629. * @since 4.3.0
  12630. * @category Lang
  12631. * @param {*} value The value to check.
  12632. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12633. * @example
  12634. *
  12635. * _.isWeakMap(new WeakMap);
  12636. * // => true
  12637. *
  12638. * _.isWeakMap(new Map);
  12639. * // => false
  12640. */
  12641. function isWeakMap(value) {
  12642. return isObjectLike(value) && getTag(value) == weakMapTag;
  12643. }
  12644. /**
  12645. * Checks if `value` is classified as a `WeakSet` object.
  12646. *
  12647. * @static
  12648. * @memberOf _
  12649. * @since 4.3.0
  12650. * @category Lang
  12651. * @param {*} value The value to check.
  12652. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12653. * @example
  12654. *
  12655. * _.isWeakSet(new WeakSet);
  12656. * // => true
  12657. *
  12658. * _.isWeakSet(new Set);
  12659. * // => false
  12660. */
  12661. function isWeakSet(value) {
  12662. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12663. }
  12664. /**
  12665. * Checks if `value` is less than `other`.
  12666. *
  12667. * @static
  12668. * @memberOf _
  12669. * @since 3.9.0
  12670. * @category Lang
  12671. * @param {*} value The value to compare.
  12672. * @param {*} other The other value to compare.
  12673. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12674. * else `false`.
  12675. * @see _.gt
  12676. * @example
  12677. *
  12678. * _.lt(1, 3);
  12679. * // => true
  12680. *
  12681. * _.lt(3, 3);
  12682. * // => false
  12683. *
  12684. * _.lt(3, 1);
  12685. * // => false
  12686. */
  12687. var lt = createRelationalOperation(baseLt);
  12688. /**
  12689. * Checks if `value` is less than or equal to `other`.
  12690. *
  12691. * @static
  12692. * @memberOf _
  12693. * @since 3.9.0
  12694. * @category Lang
  12695. * @param {*} value The value to compare.
  12696. * @param {*} other The other value to compare.
  12697. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12698. * `other`, else `false`.
  12699. * @see _.gte
  12700. * @example
  12701. *
  12702. * _.lte(1, 3);
  12703. * // => true
  12704. *
  12705. * _.lte(3, 3);
  12706. * // => true
  12707. *
  12708. * _.lte(3, 1);
  12709. * // => false
  12710. */
  12711. var lte = createRelationalOperation(function(value, other) {
  12712. return value <= other;
  12713. });
  12714. /**
  12715. * Converts `value` to an array.
  12716. *
  12717. * @static
  12718. * @since 0.1.0
  12719. * @memberOf _
  12720. * @category Lang
  12721. * @param {*} value The value to convert.
  12722. * @returns {Array} Returns the converted array.
  12723. * @example
  12724. *
  12725. * _.toArray({ 'a': 1, 'b': 2 });
  12726. * // => [1, 2]
  12727. *
  12728. * _.toArray('abc');
  12729. * // => ['a', 'b', 'c']
  12730. *
  12731. * _.toArray(1);
  12732. * // => []
  12733. *
  12734. * _.toArray(null);
  12735. * // => []
  12736. */
  12737. function toArray(value) {
  12738. if (!value) {
  12739. return [];
  12740. }
  12741. if (isArrayLike(value)) {
  12742. return isString(value) ? stringToArray(value) : copyArray(value);
  12743. }
  12744. if (symIterator && value[symIterator]) {
  12745. return iteratorToArray(value[symIterator]());
  12746. }
  12747. var tag = getTag(value),
  12748. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12749. return func(value);
  12750. }
  12751. /**
  12752. * Converts `value` to a finite number.
  12753. *
  12754. * @static
  12755. * @memberOf _
  12756. * @since 4.12.0
  12757. * @category Lang
  12758. * @param {*} value The value to convert.
  12759. * @returns {number} Returns the converted number.
  12760. * @example
  12761. *
  12762. * _.toFinite(3.2);
  12763. * // => 3.2
  12764. *
  12765. * _.toFinite(Number.MIN_VALUE);
  12766. * // => 5e-324
  12767. *
  12768. * _.toFinite(Infinity);
  12769. * // => 1.7976931348623157e+308
  12770. *
  12771. * _.toFinite('3.2');
  12772. * // => 3.2
  12773. */
  12774. function toFinite(value) {
  12775. if (!value) {
  12776. return value === 0 ? value : 0;
  12777. }
  12778. value = toNumber(value);
  12779. if (value === INFINITY || value === -INFINITY) {
  12780. var sign = (value < 0 ? -1 : 1);
  12781. return sign * MAX_INTEGER;
  12782. }
  12783. return value === value ? value : 0;
  12784. }
  12785. /**
  12786. * Converts `value` to an integer.
  12787. *
  12788. * **Note:** This method is loosely based on
  12789. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12790. *
  12791. * @static
  12792. * @memberOf _
  12793. * @since 4.0.0
  12794. * @category Lang
  12795. * @param {*} value The value to convert.
  12796. * @returns {number} Returns the converted integer.
  12797. * @example
  12798. *
  12799. * _.toInteger(3.2);
  12800. * // => 3
  12801. *
  12802. * _.toInteger(Number.MIN_VALUE);
  12803. * // => 0
  12804. *
  12805. * _.toInteger(Infinity);
  12806. * // => 1.7976931348623157e+308
  12807. *
  12808. * _.toInteger('3.2');
  12809. * // => 3
  12810. */
  12811. function toInteger(value) {
  12812. var result = toFinite(value),
  12813. remainder = result % 1;
  12814. return result === result ? (remainder ? result - remainder : result) : 0;
  12815. }
  12816. /**
  12817. * Converts `value` to an integer suitable for use as the length of an
  12818. * array-like object.
  12819. *
  12820. * **Note:** This method is based on
  12821. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12822. *
  12823. * @static
  12824. * @memberOf _
  12825. * @since 4.0.0
  12826. * @category Lang
  12827. * @param {*} value The value to convert.
  12828. * @returns {number} Returns the converted integer.
  12829. * @example
  12830. *
  12831. * _.toLength(3.2);
  12832. * // => 3
  12833. *
  12834. * _.toLength(Number.MIN_VALUE);
  12835. * // => 0
  12836. *
  12837. * _.toLength(Infinity);
  12838. * // => 4294967295
  12839. *
  12840. * _.toLength('3.2');
  12841. * // => 3
  12842. */
  12843. function toLength(value) {
  12844. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12845. }
  12846. /**
  12847. * Converts `value` to a number.
  12848. *
  12849. * @static
  12850. * @memberOf _
  12851. * @since 4.0.0
  12852. * @category Lang
  12853. * @param {*} value The value to process.
  12854. * @returns {number} Returns the number.
  12855. * @example
  12856. *
  12857. * _.toNumber(3.2);
  12858. * // => 3.2
  12859. *
  12860. * _.toNumber(Number.MIN_VALUE);
  12861. * // => 5e-324
  12862. *
  12863. * _.toNumber(Infinity);
  12864. * // => Infinity
  12865. *
  12866. * _.toNumber('3.2');
  12867. * // => 3.2
  12868. */
  12869. function toNumber(value) {
  12870. if (typeof value == 'number') {
  12871. return value;
  12872. }
  12873. if (isSymbol(value)) {
  12874. return NAN;
  12875. }
  12876. if (isObject(value)) {
  12877. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12878. value = isObject(other) ? (other + '') : other;
  12879. }
  12880. if (typeof value != 'string') {
  12881. return value === 0 ? value : +value;
  12882. }
  12883. value = baseTrim(value);
  12884. var isBinary = reIsBinary.test(value);
  12885. return (isBinary || reIsOctal.test(value))
  12886. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12887. : (reIsBadHex.test(value) ? NAN : +value);
  12888. }
  12889. /**
  12890. * Converts `value` to a plain object flattening inherited enumerable string
  12891. * keyed properties of `value` to own properties of the plain object.
  12892. *
  12893. * @static
  12894. * @memberOf _
  12895. * @since 3.0.0
  12896. * @category Lang
  12897. * @param {*} value The value to convert.
  12898. * @returns {Object} Returns the converted plain object.
  12899. * @example
  12900. *
  12901. * function Foo() {
  12902. * this.b = 2;
  12903. * }
  12904. *
  12905. * Foo.prototype.c = 3;
  12906. *
  12907. * _.assign({ 'a': 1 }, new Foo);
  12908. * // => { 'a': 1, 'b': 2 }
  12909. *
  12910. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12911. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12912. */
  12913. function toPlainObject(value) {
  12914. return copyObject(value, keysIn(value));
  12915. }
  12916. /**
  12917. * Converts `value` to a safe integer. A safe integer can be compared and
  12918. * represented correctly.
  12919. *
  12920. * @static
  12921. * @memberOf _
  12922. * @since 4.0.0
  12923. * @category Lang
  12924. * @param {*} value The value to convert.
  12925. * @returns {number} Returns the converted integer.
  12926. * @example
  12927. *
  12928. * _.toSafeInteger(3.2);
  12929. * // => 3
  12930. *
  12931. * _.toSafeInteger(Number.MIN_VALUE);
  12932. * // => 0
  12933. *
  12934. * _.toSafeInteger(Infinity);
  12935. * // => 9007199254740991
  12936. *
  12937. * _.toSafeInteger('3.2');
  12938. * // => 3
  12939. */
  12940. function toSafeInteger(value) {
  12941. return value
  12942. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12943. : (value === 0 ? value : 0);
  12944. }
  12945. /**
  12946. * Converts `value` to a string. An empty string is returned for `null`
  12947. * and `undefined` values. The sign of `-0` is preserved.
  12948. *
  12949. * @static
  12950. * @memberOf _
  12951. * @since 4.0.0
  12952. * @category Lang
  12953. * @param {*} value The value to convert.
  12954. * @returns {string} Returns the converted string.
  12955. * @example
  12956. *
  12957. * _.toString(null);
  12958. * // => ''
  12959. *
  12960. * _.toString(-0);
  12961. * // => '-0'
  12962. *
  12963. * _.toString([1, 2, 3]);
  12964. * // => '1,2,3'
  12965. */
  12966. function toString(value) {
  12967. return value == null ? '' : baseToString(value);
  12968. }
  12969. /*------------------------------------------------------------------------*/
  12970. /**
  12971. * Assigns own enumerable string keyed properties of source objects to the
  12972. * destination object. Source objects are applied from left to right.
  12973. * Subsequent sources overwrite property assignments of previous sources.
  12974. *
  12975. * **Note:** This method mutates `object` and is loosely based on
  12976. * [`Object.assign`](https://mdn.io/Object/assign).
  12977. *
  12978. * @static
  12979. * @memberOf _
  12980. * @since 0.10.0
  12981. * @category Object
  12982. * @param {Object} object The destination object.
  12983. * @param {...Object} [sources] The source objects.
  12984. * @returns {Object} Returns `object`.
  12985. * @see _.assignIn
  12986. * @example
  12987. *
  12988. * function Foo() {
  12989. * this.a = 1;
  12990. * }
  12991. *
  12992. * function Bar() {
  12993. * this.c = 3;
  12994. * }
  12995. *
  12996. * Foo.prototype.b = 2;
  12997. * Bar.prototype.d = 4;
  12998. *
  12999. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13000. * // => { 'a': 1, 'c': 3 }
  13001. */
  13002. var assign = createAssigner(function(object, source) {
  13003. if (isPrototype(source) || isArrayLike(source)) {
  13004. copyObject(source, keys(source), object);
  13005. return;
  13006. }
  13007. for (var key in source) {
  13008. if (hasOwnProperty.call(source, key)) {
  13009. assignValue(object, key, source[key]);
  13010. }
  13011. }
  13012. });
  13013. /**
  13014. * This method is like `_.assign` except that it iterates over own and
  13015. * inherited source properties.
  13016. *
  13017. * **Note:** This method mutates `object`.
  13018. *
  13019. * @static
  13020. * @memberOf _
  13021. * @since 4.0.0
  13022. * @alias extend
  13023. * @category Object
  13024. * @param {Object} object The destination object.
  13025. * @param {...Object} [sources] The source objects.
  13026. * @returns {Object} Returns `object`.
  13027. * @see _.assign
  13028. * @example
  13029. *
  13030. * function Foo() {
  13031. * this.a = 1;
  13032. * }
  13033. *
  13034. * function Bar() {
  13035. * this.c = 3;
  13036. * }
  13037. *
  13038. * Foo.prototype.b = 2;
  13039. * Bar.prototype.d = 4;
  13040. *
  13041. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13042. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13043. */
  13044. var assignIn = createAssigner(function(object, source) {
  13045. copyObject(source, keysIn(source), object);
  13046. });
  13047. /**
  13048. * This method is like `_.assignIn` except that it accepts `customizer`
  13049. * which is invoked to produce the assigned values. If `customizer` returns
  13050. * `undefined`, assignment is handled by the method instead. The `customizer`
  13051. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13052. *
  13053. * **Note:** This method mutates `object`.
  13054. *
  13055. * @static
  13056. * @memberOf _
  13057. * @since 4.0.0
  13058. * @alias extendWith
  13059. * @category Object
  13060. * @param {Object} object The destination object.
  13061. * @param {...Object} sources The source objects.
  13062. * @param {Function} [customizer] The function to customize assigned values.
  13063. * @returns {Object} Returns `object`.
  13064. * @see _.assignWith
  13065. * @example
  13066. *
  13067. * function customizer(objValue, srcValue) {
  13068. * return _.isUndefined(objValue) ? srcValue : objValue;
  13069. * }
  13070. *
  13071. * var defaults = _.partialRight(_.assignInWith, customizer);
  13072. *
  13073. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13074. * // => { 'a': 1, 'b': 2 }
  13075. */
  13076. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13077. copyObject(source, keysIn(source), object, customizer);
  13078. });
  13079. /**
  13080. * This method is like `_.assign` except that it accepts `customizer`
  13081. * which is invoked to produce the assigned values. If `customizer` returns
  13082. * `undefined`, assignment is handled by the method instead. The `customizer`
  13083. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13084. *
  13085. * **Note:** This method mutates `object`.
  13086. *
  13087. * @static
  13088. * @memberOf _
  13089. * @since 4.0.0
  13090. * @category Object
  13091. * @param {Object} object The destination object.
  13092. * @param {...Object} sources The source objects.
  13093. * @param {Function} [customizer] The function to customize assigned values.
  13094. * @returns {Object} Returns `object`.
  13095. * @see _.assignInWith
  13096. * @example
  13097. *
  13098. * function customizer(objValue, srcValue) {
  13099. * return _.isUndefined(objValue) ? srcValue : objValue;
  13100. * }
  13101. *
  13102. * var defaults = _.partialRight(_.assignWith, customizer);
  13103. *
  13104. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13105. * // => { 'a': 1, 'b': 2 }
  13106. */
  13107. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13108. copyObject(source, keys(source), object, customizer);
  13109. });
  13110. /**
  13111. * Creates an array of values corresponding to `paths` of `object`.
  13112. *
  13113. * @static
  13114. * @memberOf _
  13115. * @since 1.0.0
  13116. * @category Object
  13117. * @param {Object} object The object to iterate over.
  13118. * @param {...(string|string[])} [paths] The property paths to pick.
  13119. * @returns {Array} Returns the picked values.
  13120. * @example
  13121. *
  13122. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13123. *
  13124. * _.at(object, ['a[0].b.c', 'a[1]']);
  13125. * // => [3, 4]
  13126. */
  13127. var at = flatRest(baseAt);
  13128. /**
  13129. * Creates an object that inherits from the `prototype` object. If a
  13130. * `properties` object is given, its own enumerable string keyed properties
  13131. * are assigned to the created object.
  13132. *
  13133. * @static
  13134. * @memberOf _
  13135. * @since 2.3.0
  13136. * @category Object
  13137. * @param {Object} prototype The object to inherit from.
  13138. * @param {Object} [properties] The properties to assign to the object.
  13139. * @returns {Object} Returns the new object.
  13140. * @example
  13141. *
  13142. * function Shape() {
  13143. * this.x = 0;
  13144. * this.y = 0;
  13145. * }
  13146. *
  13147. * function Circle() {
  13148. * Shape.call(this);
  13149. * }
  13150. *
  13151. * Circle.prototype = _.create(Shape.prototype, {
  13152. * 'constructor': Circle
  13153. * });
  13154. *
  13155. * var circle = new Circle;
  13156. * circle instanceof Circle;
  13157. * // => true
  13158. *
  13159. * circle instanceof Shape;
  13160. * // => true
  13161. */
  13162. function create(prototype, properties) {
  13163. var result = baseCreate(prototype);
  13164. return properties == null ? result : baseAssign(result, properties);
  13165. }
  13166. /**
  13167. * Assigns own and inherited enumerable string keyed properties of source
  13168. * objects to the destination object for all destination properties that
  13169. * resolve to `undefined`. Source objects are applied from left to right.
  13170. * Once a property is set, additional values of the same property are ignored.
  13171. *
  13172. * **Note:** This method mutates `object`.
  13173. *
  13174. * @static
  13175. * @since 0.1.0
  13176. * @memberOf _
  13177. * @category Object
  13178. * @param {Object} object The destination object.
  13179. * @param {...Object} [sources] The source objects.
  13180. * @returns {Object} Returns `object`.
  13181. * @see _.defaultsDeep
  13182. * @example
  13183. *
  13184. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13185. * // => { 'a': 1, 'b': 2 }
  13186. */
  13187. var defaults = baseRest(function(object, sources) {
  13188. object = Object(object);
  13189. var index = -1;
  13190. var length = sources.length;
  13191. var guard = length > 2 ? sources[2] : undefined;
  13192. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13193. length = 1;
  13194. }
  13195. while (++index < length) {
  13196. var source = sources[index];
  13197. var props = keysIn(source);
  13198. var propsIndex = -1;
  13199. var propsLength = props.length;
  13200. while (++propsIndex < propsLength) {
  13201. var key = props[propsIndex];
  13202. var value = object[key];
  13203. if (value === undefined ||
  13204. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13205. object[key] = source[key];
  13206. }
  13207. }
  13208. }
  13209. return object;
  13210. });
  13211. /**
  13212. * This method is like `_.defaults` except that it recursively assigns
  13213. * default properties.
  13214. *
  13215. * **Note:** This method mutates `object`.
  13216. *
  13217. * @static
  13218. * @memberOf _
  13219. * @since 3.10.0
  13220. * @category Object
  13221. * @param {Object} object The destination object.
  13222. * @param {...Object} [sources] The source objects.
  13223. * @returns {Object} Returns `object`.
  13224. * @see _.defaults
  13225. * @example
  13226. *
  13227. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13228. * // => { 'a': { 'b': 2, 'c': 3 } }
  13229. */
  13230. var defaultsDeep = baseRest(function(args) {
  13231. args.push(undefined, customDefaultsMerge);
  13232. return apply(mergeWith, undefined, args);
  13233. });
  13234. /**
  13235. * This method is like `_.find` except that it returns the key of the first
  13236. * element `predicate` returns truthy for instead of the element itself.
  13237. *
  13238. * @static
  13239. * @memberOf _
  13240. * @since 1.1.0
  13241. * @category Object
  13242. * @param {Object} object The object to inspect.
  13243. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13244. * @returns {string|undefined} Returns the key of the matched element,
  13245. * else `undefined`.
  13246. * @example
  13247. *
  13248. * var users = {
  13249. * 'barney': { 'age': 36, 'active': true },
  13250. * 'fred': { 'age': 40, 'active': false },
  13251. * 'pebbles': { 'age': 1, 'active': true }
  13252. * };
  13253. *
  13254. * _.findKey(users, function(o) { return o.age < 40; });
  13255. * // => 'barney' (iteration order is not guaranteed)
  13256. *
  13257. * // The `_.matches` iteratee shorthand.
  13258. * _.findKey(users, { 'age': 1, 'active': true });
  13259. * // => 'pebbles'
  13260. *
  13261. * // The `_.matchesProperty` iteratee shorthand.
  13262. * _.findKey(users, ['active', false]);
  13263. * // => 'fred'
  13264. *
  13265. * // The `_.property` iteratee shorthand.
  13266. * _.findKey(users, 'active');
  13267. * // => 'barney'
  13268. */
  13269. function findKey(object, predicate) {
  13270. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13271. }
  13272. /**
  13273. * This method is like `_.findKey` except that it iterates over elements of
  13274. * a collection in the opposite order.
  13275. *
  13276. * @static
  13277. * @memberOf _
  13278. * @since 2.0.0
  13279. * @category Object
  13280. * @param {Object} object The object to inspect.
  13281. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13282. * @returns {string|undefined} Returns the key of the matched element,
  13283. * else `undefined`.
  13284. * @example
  13285. *
  13286. * var users = {
  13287. * 'barney': { 'age': 36, 'active': true },
  13288. * 'fred': { 'age': 40, 'active': false },
  13289. * 'pebbles': { 'age': 1, 'active': true }
  13290. * };
  13291. *
  13292. * _.findLastKey(users, function(o) { return o.age < 40; });
  13293. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13294. *
  13295. * // The `_.matches` iteratee shorthand.
  13296. * _.findLastKey(users, { 'age': 36, 'active': true });
  13297. * // => 'barney'
  13298. *
  13299. * // The `_.matchesProperty` iteratee shorthand.
  13300. * _.findLastKey(users, ['active', false]);
  13301. * // => 'fred'
  13302. *
  13303. * // The `_.property` iteratee shorthand.
  13304. * _.findLastKey(users, 'active');
  13305. * // => 'pebbles'
  13306. */
  13307. function findLastKey(object, predicate) {
  13308. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13309. }
  13310. /**
  13311. * Iterates over own and inherited enumerable string keyed properties of an
  13312. * object and invokes `iteratee` for each property. The iteratee is invoked
  13313. * with three arguments: (value, key, object). Iteratee functions may exit
  13314. * iteration early by explicitly returning `false`.
  13315. *
  13316. * @static
  13317. * @memberOf _
  13318. * @since 0.3.0
  13319. * @category Object
  13320. * @param {Object} object The object to iterate over.
  13321. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13322. * @returns {Object} Returns `object`.
  13323. * @see _.forInRight
  13324. * @example
  13325. *
  13326. * function Foo() {
  13327. * this.a = 1;
  13328. * this.b = 2;
  13329. * }
  13330. *
  13331. * Foo.prototype.c = 3;
  13332. *
  13333. * _.forIn(new Foo, function(value, key) {
  13334. * console.log(key);
  13335. * });
  13336. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13337. */
  13338. function forIn(object, iteratee) {
  13339. return object == null
  13340. ? object
  13341. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13342. }
  13343. /**
  13344. * This method is like `_.forIn` except that it iterates over properties of
  13345. * `object` in the opposite order.
  13346. *
  13347. * @static
  13348. * @memberOf _
  13349. * @since 2.0.0
  13350. * @category Object
  13351. * @param {Object} object The object to iterate over.
  13352. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13353. * @returns {Object} Returns `object`.
  13354. * @see _.forIn
  13355. * @example
  13356. *
  13357. * function Foo() {
  13358. * this.a = 1;
  13359. * this.b = 2;
  13360. * }
  13361. *
  13362. * Foo.prototype.c = 3;
  13363. *
  13364. * _.forInRight(new Foo, function(value, key) {
  13365. * console.log(key);
  13366. * });
  13367. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13368. */
  13369. function forInRight(object, iteratee) {
  13370. return object == null
  13371. ? object
  13372. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13373. }
  13374. /**
  13375. * Iterates over own enumerable string keyed properties of an object and
  13376. * invokes `iteratee` for each property. The iteratee is invoked with three
  13377. * arguments: (value, key, object). Iteratee functions may exit iteration
  13378. * early by explicitly returning `false`.
  13379. *
  13380. * @static
  13381. * @memberOf _
  13382. * @since 0.3.0
  13383. * @category Object
  13384. * @param {Object} object The object to iterate over.
  13385. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13386. * @returns {Object} Returns `object`.
  13387. * @see _.forOwnRight
  13388. * @example
  13389. *
  13390. * function Foo() {
  13391. * this.a = 1;
  13392. * this.b = 2;
  13393. * }
  13394. *
  13395. * Foo.prototype.c = 3;
  13396. *
  13397. * _.forOwn(new Foo, function(value, key) {
  13398. * console.log(key);
  13399. * });
  13400. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13401. */
  13402. function forOwn(object, iteratee) {
  13403. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13404. }
  13405. /**
  13406. * This method is like `_.forOwn` except that it iterates over properties of
  13407. * `object` in the opposite order.
  13408. *
  13409. * @static
  13410. * @memberOf _
  13411. * @since 2.0.0
  13412. * @category Object
  13413. * @param {Object} object The object to iterate over.
  13414. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13415. * @returns {Object} Returns `object`.
  13416. * @see _.forOwn
  13417. * @example
  13418. *
  13419. * function Foo() {
  13420. * this.a = 1;
  13421. * this.b = 2;
  13422. * }
  13423. *
  13424. * Foo.prototype.c = 3;
  13425. *
  13426. * _.forOwnRight(new Foo, function(value, key) {
  13427. * console.log(key);
  13428. * });
  13429. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13430. */
  13431. function forOwnRight(object, iteratee) {
  13432. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13433. }
  13434. /**
  13435. * Creates an array of function property names from own enumerable properties
  13436. * of `object`.
  13437. *
  13438. * @static
  13439. * @since 0.1.0
  13440. * @memberOf _
  13441. * @category Object
  13442. * @param {Object} object The object to inspect.
  13443. * @returns {Array} Returns the function names.
  13444. * @see _.functionsIn
  13445. * @example
  13446. *
  13447. * function Foo() {
  13448. * this.a = _.constant('a');
  13449. * this.b = _.constant('b');
  13450. * }
  13451. *
  13452. * Foo.prototype.c = _.constant('c');
  13453. *
  13454. * _.functions(new Foo);
  13455. * // => ['a', 'b']
  13456. */
  13457. function functions(object) {
  13458. return object == null ? [] : baseFunctions(object, keys(object));
  13459. }
  13460. /**
  13461. * Creates an array of function property names from own and inherited
  13462. * enumerable properties of `object`.
  13463. *
  13464. * @static
  13465. * @memberOf _
  13466. * @since 4.0.0
  13467. * @category Object
  13468. * @param {Object} object The object to inspect.
  13469. * @returns {Array} Returns the function names.
  13470. * @see _.functions
  13471. * @example
  13472. *
  13473. * function Foo() {
  13474. * this.a = _.constant('a');
  13475. * this.b = _.constant('b');
  13476. * }
  13477. *
  13478. * Foo.prototype.c = _.constant('c');
  13479. *
  13480. * _.functionsIn(new Foo);
  13481. * // => ['a', 'b', 'c']
  13482. */
  13483. function functionsIn(object) {
  13484. return object == null ? [] : baseFunctions(object, keysIn(object));
  13485. }
  13486. /**
  13487. * Gets the value at `path` of `object`. If the resolved value is
  13488. * `undefined`, the `defaultValue` is returned in its place.
  13489. *
  13490. * @static
  13491. * @memberOf _
  13492. * @since 3.7.0
  13493. * @category Object
  13494. * @param {Object} object The object to query.
  13495. * @param {Array|string} path The path of the property to get.
  13496. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13497. * @returns {*} Returns the resolved value.
  13498. * @example
  13499. *
  13500. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13501. *
  13502. * _.get(object, 'a[0].b.c');
  13503. * // => 3
  13504. *
  13505. * _.get(object, ['a', '0', 'b', 'c']);
  13506. * // => 3
  13507. *
  13508. * _.get(object, 'a.b.c', 'default');
  13509. * // => 'default'
  13510. */
  13511. function get(object, path, defaultValue) {
  13512. var result = object == null ? undefined : baseGet(object, path);
  13513. return result === undefined ? defaultValue : result;
  13514. }
  13515. /**
  13516. * Checks if `path` is a direct property of `object`.
  13517. *
  13518. * @static
  13519. * @since 0.1.0
  13520. * @memberOf _
  13521. * @category Object
  13522. * @param {Object} object The object to query.
  13523. * @param {Array|string} path The path to check.
  13524. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13525. * @example
  13526. *
  13527. * var object = { 'a': { 'b': 2 } };
  13528. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13529. *
  13530. * _.has(object, 'a');
  13531. * // => true
  13532. *
  13533. * _.has(object, 'a.b');
  13534. * // => true
  13535. *
  13536. * _.has(object, ['a', 'b']);
  13537. * // => true
  13538. *
  13539. * _.has(other, 'a');
  13540. * // => false
  13541. */
  13542. function has(object, path) {
  13543. return object != null && hasPath(object, path, baseHas);
  13544. }
  13545. /**
  13546. * Checks if `path` is a direct or inherited property of `object`.
  13547. *
  13548. * @static
  13549. * @memberOf _
  13550. * @since 4.0.0
  13551. * @category Object
  13552. * @param {Object} object The object to query.
  13553. * @param {Array|string} path The path to check.
  13554. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13555. * @example
  13556. *
  13557. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13558. *
  13559. * _.hasIn(object, 'a');
  13560. * // => true
  13561. *
  13562. * _.hasIn(object, 'a.b');
  13563. * // => true
  13564. *
  13565. * _.hasIn(object, ['a', 'b']);
  13566. * // => true
  13567. *
  13568. * _.hasIn(object, 'b');
  13569. * // => false
  13570. */
  13571. function hasIn(object, path) {
  13572. return object != null && hasPath(object, path, baseHasIn);
  13573. }
  13574. /**
  13575. * Creates an object composed of the inverted keys and values of `object`.
  13576. * If `object` contains duplicate values, subsequent values overwrite
  13577. * property assignments of previous values.
  13578. *
  13579. * @static
  13580. * @memberOf _
  13581. * @since 0.7.0
  13582. * @category Object
  13583. * @param {Object} object The object to invert.
  13584. * @returns {Object} Returns the new inverted object.
  13585. * @example
  13586. *
  13587. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13588. *
  13589. * _.invert(object);
  13590. * // => { '1': 'c', '2': 'b' }
  13591. */
  13592. var invert = createInverter(function(result, value, key) {
  13593. if (value != null &&
  13594. typeof value.toString != 'function') {
  13595. value = nativeObjectToString.call(value);
  13596. }
  13597. result[value] = key;
  13598. }, constant(identity));
  13599. /**
  13600. * This method is like `_.invert` except that the inverted object is generated
  13601. * from the results of running each element of `object` thru `iteratee`. The
  13602. * corresponding inverted value of each inverted key is an array of keys
  13603. * responsible for generating the inverted value. The iteratee is invoked
  13604. * with one argument: (value).
  13605. *
  13606. * @static
  13607. * @memberOf _
  13608. * @since 4.1.0
  13609. * @category Object
  13610. * @param {Object} object The object to invert.
  13611. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13612. * @returns {Object} Returns the new inverted object.
  13613. * @example
  13614. *
  13615. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13616. *
  13617. * _.invertBy(object);
  13618. * // => { '1': ['a', 'c'], '2': ['b'] }
  13619. *
  13620. * _.invertBy(object, function(value) {
  13621. * return 'group' + value;
  13622. * });
  13623. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13624. */
  13625. var invertBy = createInverter(function(result, value, key) {
  13626. if (value != null &&
  13627. typeof value.toString != 'function') {
  13628. value = nativeObjectToString.call(value);
  13629. }
  13630. if (hasOwnProperty.call(result, value)) {
  13631. result[value].push(key);
  13632. } else {
  13633. result[value] = [key];
  13634. }
  13635. }, getIteratee);
  13636. /**
  13637. * Invokes the method at `path` of `object`.
  13638. *
  13639. * @static
  13640. * @memberOf _
  13641. * @since 4.0.0
  13642. * @category Object
  13643. * @param {Object} object The object to query.
  13644. * @param {Array|string} path The path of the method to invoke.
  13645. * @param {...*} [args] The arguments to invoke the method with.
  13646. * @returns {*} Returns the result of the invoked method.
  13647. * @example
  13648. *
  13649. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13650. *
  13651. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13652. * // => [2, 3]
  13653. */
  13654. var invoke = baseRest(baseInvoke);
  13655. /**
  13656. * Creates an array of the own enumerable property names of `object`.
  13657. *
  13658. * **Note:** Non-object values are coerced to objects. See the
  13659. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13660. * for more details.
  13661. *
  13662. * @static
  13663. * @since 0.1.0
  13664. * @memberOf _
  13665. * @category Object
  13666. * @param {Object} object The object to query.
  13667. * @returns {Array} Returns the array of property names.
  13668. * @example
  13669. *
  13670. * function Foo() {
  13671. * this.a = 1;
  13672. * this.b = 2;
  13673. * }
  13674. *
  13675. * Foo.prototype.c = 3;
  13676. *
  13677. * _.keys(new Foo);
  13678. * // => ['a', 'b'] (iteration order is not guaranteed)
  13679. *
  13680. * _.keys('hi');
  13681. * // => ['0', '1']
  13682. */
  13683. function keys(object) {
  13684. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13685. }
  13686. /**
  13687. * Creates an array of the own and inherited enumerable property names of `object`.
  13688. *
  13689. * **Note:** Non-object values are coerced to objects.
  13690. *
  13691. * @static
  13692. * @memberOf _
  13693. * @since 3.0.0
  13694. * @category Object
  13695. * @param {Object} object The object to query.
  13696. * @returns {Array} Returns the array of property names.
  13697. * @example
  13698. *
  13699. * function Foo() {
  13700. * this.a = 1;
  13701. * this.b = 2;
  13702. * }
  13703. *
  13704. * Foo.prototype.c = 3;
  13705. *
  13706. * _.keysIn(new Foo);
  13707. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13708. */
  13709. function keysIn(object) {
  13710. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13711. }
  13712. /**
  13713. * The opposite of `_.mapValues`; this method creates an object with the
  13714. * same values as `object` and keys generated by running each own enumerable
  13715. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13716. * with three arguments: (value, key, object).
  13717. *
  13718. * @static
  13719. * @memberOf _
  13720. * @since 3.8.0
  13721. * @category Object
  13722. * @param {Object} object The object to iterate over.
  13723. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13724. * @returns {Object} Returns the new mapped object.
  13725. * @see _.mapValues
  13726. * @example
  13727. *
  13728. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13729. * return key + value;
  13730. * });
  13731. * // => { 'a1': 1, 'b2': 2 }
  13732. */
  13733. function mapKeys(object, iteratee) {
  13734. var result = {};
  13735. iteratee = getIteratee(iteratee, 3);
  13736. baseForOwn(object, function(value, key, object) {
  13737. baseAssignValue(result, iteratee(value, key, object), value);
  13738. });
  13739. return result;
  13740. }
  13741. /**
  13742. * Creates an object with the same keys as `object` and values generated
  13743. * by running each own enumerable string keyed property of `object` thru
  13744. * `iteratee`. The iteratee is invoked with three arguments:
  13745. * (value, key, object).
  13746. *
  13747. * @static
  13748. * @memberOf _
  13749. * @since 2.4.0
  13750. * @category Object
  13751. * @param {Object} object The object to iterate over.
  13752. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13753. * @returns {Object} Returns the new mapped object.
  13754. * @see _.mapKeys
  13755. * @example
  13756. *
  13757. * var users = {
  13758. * 'fred': { 'user': 'fred', 'age': 40 },
  13759. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13760. * };
  13761. *
  13762. * _.mapValues(users, function(o) { return o.age; });
  13763. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13764. *
  13765. * // The `_.property` iteratee shorthand.
  13766. * _.mapValues(users, 'age');
  13767. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13768. */
  13769. function mapValues(object, iteratee) {
  13770. var result = {};
  13771. iteratee = getIteratee(iteratee, 3);
  13772. baseForOwn(object, function(value, key, object) {
  13773. baseAssignValue(result, key, iteratee(value, key, object));
  13774. });
  13775. return result;
  13776. }
  13777. /**
  13778. * This method is like `_.assign` except that it recursively merges own and
  13779. * inherited enumerable string keyed properties of source objects into the
  13780. * destination object. Source properties that resolve to `undefined` are
  13781. * skipped if a destination value exists. Array and plain object properties
  13782. * are merged recursively. Other objects and value types are overridden by
  13783. * assignment. Source objects are applied from left to right. Subsequent
  13784. * sources overwrite property assignments of previous sources.
  13785. *
  13786. * **Note:** This method mutates `object`.
  13787. *
  13788. * @static
  13789. * @memberOf _
  13790. * @since 0.5.0
  13791. * @category Object
  13792. * @param {Object} object The destination object.
  13793. * @param {...Object} [sources] The source objects.
  13794. * @returns {Object} Returns `object`.
  13795. * @example
  13796. *
  13797. * var object = {
  13798. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13799. * };
  13800. *
  13801. * var other = {
  13802. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13803. * };
  13804. *
  13805. * _.merge(object, other);
  13806. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13807. */
  13808. var merge = createAssigner(function(object, source, srcIndex) {
  13809. baseMerge(object, source, srcIndex);
  13810. });
  13811. /**
  13812. * This method is like `_.merge` except that it accepts `customizer` which
  13813. * is invoked to produce the merged values of the destination and source
  13814. * properties. If `customizer` returns `undefined`, merging is handled by the
  13815. * method instead. The `customizer` is invoked with six arguments:
  13816. * (objValue, srcValue, key, object, source, stack).
  13817. *
  13818. * **Note:** This method mutates `object`.
  13819. *
  13820. * @static
  13821. * @memberOf _
  13822. * @since 4.0.0
  13823. * @category Object
  13824. * @param {Object} object The destination object.
  13825. * @param {...Object} sources The source objects.
  13826. * @param {Function} customizer The function to customize assigned values.
  13827. * @returns {Object} Returns `object`.
  13828. * @example
  13829. *
  13830. * function customizer(objValue, srcValue) {
  13831. * if (_.isArray(objValue)) {
  13832. * return objValue.concat(srcValue);
  13833. * }
  13834. * }
  13835. *
  13836. * var object = { 'a': [1], 'b': [2] };
  13837. * var other = { 'a': [3], 'b': [4] };
  13838. *
  13839. * _.mergeWith(object, other, customizer);
  13840. * // => { 'a': [1, 3], 'b': [2, 4] }
  13841. */
  13842. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13843. baseMerge(object, source, srcIndex, customizer);
  13844. });
  13845. /**
  13846. * The opposite of `_.pick`; this method creates an object composed of the
  13847. * own and inherited enumerable property paths of `object` that are not omitted.
  13848. *
  13849. * **Note:** This method is considerably slower than `_.pick`.
  13850. *
  13851. * @static
  13852. * @since 0.1.0
  13853. * @memberOf _
  13854. * @category Object
  13855. * @param {Object} object The source object.
  13856. * @param {...(string|string[])} [paths] The property paths to omit.
  13857. * @returns {Object} Returns the new object.
  13858. * @example
  13859. *
  13860. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13861. *
  13862. * _.omit(object, ['a', 'c']);
  13863. * // => { 'b': '2' }
  13864. */
  13865. var omit = flatRest(function(object, paths) {
  13866. var result = {};
  13867. if (object == null) {
  13868. return result;
  13869. }
  13870. var isDeep = false;
  13871. paths = arrayMap(paths, function(path) {
  13872. path = castPath(path, object);
  13873. isDeep || (isDeep = path.length > 1);
  13874. return path;
  13875. });
  13876. copyObject(object, getAllKeysIn(object), result);
  13877. if (isDeep) {
  13878. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13879. }
  13880. var length = paths.length;
  13881. while (length--) {
  13882. baseUnset(result, paths[length]);
  13883. }
  13884. return result;
  13885. });
  13886. /**
  13887. * The opposite of `_.pickBy`; this method creates an object composed of
  13888. * the own and inherited enumerable string keyed properties of `object` that
  13889. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13890. * arguments: (value, key).
  13891. *
  13892. * @static
  13893. * @memberOf _
  13894. * @since 4.0.0
  13895. * @category Object
  13896. * @param {Object} object The source object.
  13897. * @param {Function} [predicate=_.identity] The function invoked per property.
  13898. * @returns {Object} Returns the new object.
  13899. * @example
  13900. *
  13901. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13902. *
  13903. * _.omitBy(object, _.isNumber);
  13904. * // => { 'b': '2' }
  13905. */
  13906. function omitBy(object, predicate) {
  13907. return pickBy(object, negate(getIteratee(predicate)));
  13908. }
  13909. /**
  13910. * Creates an object composed of the picked `object` properties.
  13911. *
  13912. * @static
  13913. * @since 0.1.0
  13914. * @memberOf _
  13915. * @category Object
  13916. * @param {Object} object The source object.
  13917. * @param {...(string|string[])} [paths] The property paths to pick.
  13918. * @returns {Object} Returns the new object.
  13919. * @example
  13920. *
  13921. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13922. *
  13923. * _.pick(object, ['a', 'c']);
  13924. * // => { 'a': 1, 'c': 3 }
  13925. */
  13926. var pick = flatRest(function(object, paths) {
  13927. return object == null ? {} : basePick(object, paths);
  13928. });
  13929. /**
  13930. * Creates an object composed of the `object` properties `predicate` returns
  13931. * truthy for. The predicate is invoked with two arguments: (value, key).
  13932. *
  13933. * @static
  13934. * @memberOf _
  13935. * @since 4.0.0
  13936. * @category Object
  13937. * @param {Object} object The source object.
  13938. * @param {Function} [predicate=_.identity] The function invoked per property.
  13939. * @returns {Object} Returns the new object.
  13940. * @example
  13941. *
  13942. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13943. *
  13944. * _.pickBy(object, _.isNumber);
  13945. * // => { 'a': 1, 'c': 3 }
  13946. */
  13947. function pickBy(object, predicate) {
  13948. if (object == null) {
  13949. return {};
  13950. }
  13951. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13952. return [prop];
  13953. });
  13954. predicate = getIteratee(predicate);
  13955. return basePickBy(object, props, function(value, path) {
  13956. return predicate(value, path[0]);
  13957. });
  13958. }
  13959. /**
  13960. * This method is like `_.get` except that if the resolved value is a
  13961. * function it's invoked with the `this` binding of its parent object and
  13962. * its result is returned.
  13963. *
  13964. * @static
  13965. * @since 0.1.0
  13966. * @memberOf _
  13967. * @category Object
  13968. * @param {Object} object The object to query.
  13969. * @param {Array|string} path The path of the property to resolve.
  13970. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13971. * @returns {*} Returns the resolved value.
  13972. * @example
  13973. *
  13974. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13975. *
  13976. * _.result(object, 'a[0].b.c1');
  13977. * // => 3
  13978. *
  13979. * _.result(object, 'a[0].b.c2');
  13980. * // => 4
  13981. *
  13982. * _.result(object, 'a[0].b.c3', 'default');
  13983. * // => 'default'
  13984. *
  13985. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13986. * // => 'default'
  13987. */
  13988. function result(object, path, defaultValue) {
  13989. path = castPath(path, object);
  13990. var index = -1,
  13991. length = path.length;
  13992. // Ensure the loop is entered when path is empty.
  13993. if (!length) {
  13994. length = 1;
  13995. object = undefined;
  13996. }
  13997. while (++index < length) {
  13998. var value = object == null ? undefined : object[toKey(path[index])];
  13999. if (value === undefined) {
  14000. index = length;
  14001. value = defaultValue;
  14002. }
  14003. object = isFunction(value) ? value.call(object) : value;
  14004. }
  14005. return object;
  14006. }
  14007. /**
  14008. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14009. * it's created. Arrays are created for missing index properties while objects
  14010. * are created for all other missing properties. Use `_.setWith` to customize
  14011. * `path` creation.
  14012. *
  14013. * **Note:** This method mutates `object`.
  14014. *
  14015. * @static
  14016. * @memberOf _
  14017. * @since 3.7.0
  14018. * @category Object
  14019. * @param {Object} object The object to modify.
  14020. * @param {Array|string} path The path of the property to set.
  14021. * @param {*} value The value to set.
  14022. * @returns {Object} Returns `object`.
  14023. * @example
  14024. *
  14025. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14026. *
  14027. * _.set(object, 'a[0].b.c', 4);
  14028. * console.log(object.a[0].b.c);
  14029. * // => 4
  14030. *
  14031. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14032. * console.log(object.x[0].y.z);
  14033. * // => 5
  14034. */
  14035. function set(object, path, value) {
  14036. return object == null ? object : baseSet(object, path, value);
  14037. }
  14038. /**
  14039. * This method is like `_.set` except that it accepts `customizer` which is
  14040. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14041. * path creation is handled by the method instead. The `customizer` is invoked
  14042. * with three arguments: (nsValue, key, nsObject).
  14043. *
  14044. * **Note:** This method mutates `object`.
  14045. *
  14046. * @static
  14047. * @memberOf _
  14048. * @since 4.0.0
  14049. * @category Object
  14050. * @param {Object} object The object to modify.
  14051. * @param {Array|string} path The path of the property to set.
  14052. * @param {*} value The value to set.
  14053. * @param {Function} [customizer] The function to customize assigned values.
  14054. * @returns {Object} Returns `object`.
  14055. * @example
  14056. *
  14057. * var object = {};
  14058. *
  14059. * _.setWith(object, '[0][1]', 'a', Object);
  14060. * // => { '0': { '1': 'a' } }
  14061. */
  14062. function setWith(object, path, value, customizer) {
  14063. customizer = typeof customizer == 'function' ? customizer : undefined;
  14064. return object == null ? object : baseSet(object, path, value, customizer);
  14065. }
  14066. /**
  14067. * Creates an array of own enumerable string keyed-value pairs for `object`
  14068. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14069. * entries are returned.
  14070. *
  14071. * @static
  14072. * @memberOf _
  14073. * @since 4.0.0
  14074. * @alias entries
  14075. * @category Object
  14076. * @param {Object} object The object to query.
  14077. * @returns {Array} Returns the key-value pairs.
  14078. * @example
  14079. *
  14080. * function Foo() {
  14081. * this.a = 1;
  14082. * this.b = 2;
  14083. * }
  14084. *
  14085. * Foo.prototype.c = 3;
  14086. *
  14087. * _.toPairs(new Foo);
  14088. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14089. */
  14090. var toPairs = createToPairs(keys);
  14091. /**
  14092. * Creates an array of own and inherited enumerable string keyed-value pairs
  14093. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14094. * or set, its entries are returned.
  14095. *
  14096. * @static
  14097. * @memberOf _
  14098. * @since 4.0.0
  14099. * @alias entriesIn
  14100. * @category Object
  14101. * @param {Object} object The object to query.
  14102. * @returns {Array} Returns the key-value pairs.
  14103. * @example
  14104. *
  14105. * function Foo() {
  14106. * this.a = 1;
  14107. * this.b = 2;
  14108. * }
  14109. *
  14110. * Foo.prototype.c = 3;
  14111. *
  14112. * _.toPairsIn(new Foo);
  14113. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14114. */
  14115. var toPairsIn = createToPairs(keysIn);
  14116. /**
  14117. * An alternative to `_.reduce`; this method transforms `object` to a new
  14118. * `accumulator` object which is the result of running each of its own
  14119. * enumerable string keyed properties thru `iteratee`, with each invocation
  14120. * potentially mutating the `accumulator` object. If `accumulator` is not
  14121. * provided, a new object with the same `[[Prototype]]` will be used. The
  14122. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14123. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14124. *
  14125. * @static
  14126. * @memberOf _
  14127. * @since 1.3.0
  14128. * @category Object
  14129. * @param {Object} object The object to iterate over.
  14130. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14131. * @param {*} [accumulator] The custom accumulator value.
  14132. * @returns {*} Returns the accumulated value.
  14133. * @example
  14134. *
  14135. * _.transform([2, 3, 4], function(result, n) {
  14136. * result.push(n *= n);
  14137. * return n % 2 == 0;
  14138. * }, []);
  14139. * // => [4, 9]
  14140. *
  14141. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14142. * (result[value] || (result[value] = [])).push(key);
  14143. * }, {});
  14144. * // => { '1': ['a', 'c'], '2': ['b'] }
  14145. */
  14146. function transform(object, iteratee, accumulator) {
  14147. var isArr = isArray(object),
  14148. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14149. iteratee = getIteratee(iteratee, 4);
  14150. if (accumulator == null) {
  14151. var Ctor = object && object.constructor;
  14152. if (isArrLike) {
  14153. accumulator = isArr ? new Ctor : [];
  14154. }
  14155. else if (isObject(object)) {
  14156. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14157. }
  14158. else {
  14159. accumulator = {};
  14160. }
  14161. }
  14162. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14163. return iteratee(accumulator, value, index, object);
  14164. });
  14165. return accumulator;
  14166. }
  14167. /**
  14168. * Removes the property at `path` of `object`.
  14169. *
  14170. * **Note:** This method mutates `object`.
  14171. *
  14172. * @static
  14173. * @memberOf _
  14174. * @since 4.0.0
  14175. * @category Object
  14176. * @param {Object} object The object to modify.
  14177. * @param {Array|string} path The path of the property to unset.
  14178. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14179. * @example
  14180. *
  14181. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14182. * _.unset(object, 'a[0].b.c');
  14183. * // => true
  14184. *
  14185. * console.log(object);
  14186. * // => { 'a': [{ 'b': {} }] };
  14187. *
  14188. * _.unset(object, ['a', '0', 'b', 'c']);
  14189. * // => true
  14190. *
  14191. * console.log(object);
  14192. * // => { 'a': [{ 'b': {} }] };
  14193. */
  14194. function unset(object, path) {
  14195. return object == null ? true : baseUnset(object, path);
  14196. }
  14197. /**
  14198. * This method is like `_.set` except that accepts `updater` to produce the
  14199. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14200. * is invoked with one argument: (value).
  14201. *
  14202. * **Note:** This method mutates `object`.
  14203. *
  14204. * @static
  14205. * @memberOf _
  14206. * @since 4.6.0
  14207. * @category Object
  14208. * @param {Object} object The object to modify.
  14209. * @param {Array|string} path The path of the property to set.
  14210. * @param {Function} updater The function to produce the updated value.
  14211. * @returns {Object} Returns `object`.
  14212. * @example
  14213. *
  14214. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14215. *
  14216. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14217. * console.log(object.a[0].b.c);
  14218. * // => 9
  14219. *
  14220. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14221. * console.log(object.x[0].y.z);
  14222. * // => 0
  14223. */
  14224. function update(object, path, updater) {
  14225. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14226. }
  14227. /**
  14228. * This method is like `_.update` except that it accepts `customizer` which is
  14229. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14230. * path creation is handled by the method instead. The `customizer` is invoked
  14231. * with three arguments: (nsValue, key, nsObject).
  14232. *
  14233. * **Note:** This method mutates `object`.
  14234. *
  14235. * @static
  14236. * @memberOf _
  14237. * @since 4.6.0
  14238. * @category Object
  14239. * @param {Object} object The object to modify.
  14240. * @param {Array|string} path The path of the property to set.
  14241. * @param {Function} updater The function to produce the updated value.
  14242. * @param {Function} [customizer] The function to customize assigned values.
  14243. * @returns {Object} Returns `object`.
  14244. * @example
  14245. *
  14246. * var object = {};
  14247. *
  14248. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14249. * // => { '0': { '1': 'a' } }
  14250. */
  14251. function updateWith(object, path, updater, customizer) {
  14252. customizer = typeof customizer == 'function' ? customizer : undefined;
  14253. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14254. }
  14255. /**
  14256. * Creates an array of the own enumerable string keyed property values of `object`.
  14257. *
  14258. * **Note:** Non-object values are coerced to objects.
  14259. *
  14260. * @static
  14261. * @since 0.1.0
  14262. * @memberOf _
  14263. * @category Object
  14264. * @param {Object} object The object to query.
  14265. * @returns {Array} Returns the array of property values.
  14266. * @example
  14267. *
  14268. * function Foo() {
  14269. * this.a = 1;
  14270. * this.b = 2;
  14271. * }
  14272. *
  14273. * Foo.prototype.c = 3;
  14274. *
  14275. * _.values(new Foo);
  14276. * // => [1, 2] (iteration order is not guaranteed)
  14277. *
  14278. * _.values('hi');
  14279. * // => ['h', 'i']
  14280. */
  14281. function values(object) {
  14282. return object == null ? [] : baseValues(object, keys(object));
  14283. }
  14284. /**
  14285. * Creates an array of the own and inherited enumerable string keyed property
  14286. * values of `object`.
  14287. *
  14288. * **Note:** Non-object values are coerced to objects.
  14289. *
  14290. * @static
  14291. * @memberOf _
  14292. * @since 3.0.0
  14293. * @category Object
  14294. * @param {Object} object The object to query.
  14295. * @returns {Array} Returns the array of property values.
  14296. * @example
  14297. *
  14298. * function Foo() {
  14299. * this.a = 1;
  14300. * this.b = 2;
  14301. * }
  14302. *
  14303. * Foo.prototype.c = 3;
  14304. *
  14305. * _.valuesIn(new Foo);
  14306. * // => [1, 2, 3] (iteration order is not guaranteed)
  14307. */
  14308. function valuesIn(object) {
  14309. return object == null ? [] : baseValues(object, keysIn(object));
  14310. }
  14311. /*------------------------------------------------------------------------*/
  14312. /**
  14313. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14314. *
  14315. * @static
  14316. * @memberOf _
  14317. * @since 4.0.0
  14318. * @category Number
  14319. * @param {number} number The number to clamp.
  14320. * @param {number} [lower] The lower bound.
  14321. * @param {number} upper The upper bound.
  14322. * @returns {number} Returns the clamped number.
  14323. * @example
  14324. *
  14325. * _.clamp(-10, -5, 5);
  14326. * // => -5
  14327. *
  14328. * _.clamp(10, -5, 5);
  14329. * // => 5
  14330. */
  14331. function clamp(number, lower, upper) {
  14332. if (upper === undefined) {
  14333. upper = lower;
  14334. lower = undefined;
  14335. }
  14336. if (upper !== undefined) {
  14337. upper = toNumber(upper);
  14338. upper = upper === upper ? upper : 0;
  14339. }
  14340. if (lower !== undefined) {
  14341. lower = toNumber(lower);
  14342. lower = lower === lower ? lower : 0;
  14343. }
  14344. return baseClamp(toNumber(number), lower, upper);
  14345. }
  14346. /**
  14347. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14348. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14349. * If `start` is greater than `end` the params are swapped to support
  14350. * negative ranges.
  14351. *
  14352. * @static
  14353. * @memberOf _
  14354. * @since 3.3.0
  14355. * @category Number
  14356. * @param {number} number The number to check.
  14357. * @param {number} [start=0] The start of the range.
  14358. * @param {number} end The end of the range.
  14359. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14360. * @see _.range, _.rangeRight
  14361. * @example
  14362. *
  14363. * _.inRange(3, 2, 4);
  14364. * // => true
  14365. *
  14366. * _.inRange(4, 8);
  14367. * // => true
  14368. *
  14369. * _.inRange(4, 2);
  14370. * // => false
  14371. *
  14372. * _.inRange(2, 2);
  14373. * // => false
  14374. *
  14375. * _.inRange(1.2, 2);
  14376. * // => true
  14377. *
  14378. * _.inRange(5.2, 4);
  14379. * // => false
  14380. *
  14381. * _.inRange(-3, -2, -6);
  14382. * // => true
  14383. */
  14384. function inRange(number, start, end) {
  14385. start = toFinite(start);
  14386. if (end === undefined) {
  14387. end = start;
  14388. start = 0;
  14389. } else {
  14390. end = toFinite(end);
  14391. }
  14392. number = toNumber(number);
  14393. return baseInRange(number, start, end);
  14394. }
  14395. /**
  14396. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14397. * If only one argument is provided a number between `0` and the given number
  14398. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14399. * floats, a floating-point number is returned instead of an integer.
  14400. *
  14401. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14402. * floating-point values which can produce unexpected results.
  14403. *
  14404. * @static
  14405. * @memberOf _
  14406. * @since 0.7.0
  14407. * @category Number
  14408. * @param {number} [lower=0] The lower bound.
  14409. * @param {number} [upper=1] The upper bound.
  14410. * @param {boolean} [floating] Specify returning a floating-point number.
  14411. * @returns {number} Returns the random number.
  14412. * @example
  14413. *
  14414. * _.random(0, 5);
  14415. * // => an integer between 0 and 5
  14416. *
  14417. * _.random(5);
  14418. * // => also an integer between 0 and 5
  14419. *
  14420. * _.random(5, true);
  14421. * // => a floating-point number between 0 and 5
  14422. *
  14423. * _.random(1.2, 5.2);
  14424. * // => a floating-point number between 1.2 and 5.2
  14425. */
  14426. function random(lower, upper, floating) {
  14427. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14428. upper = floating = undefined;
  14429. }
  14430. if (floating === undefined) {
  14431. if (typeof upper == 'boolean') {
  14432. floating = upper;
  14433. upper = undefined;
  14434. }
  14435. else if (typeof lower == 'boolean') {
  14436. floating = lower;
  14437. lower = undefined;
  14438. }
  14439. }
  14440. if (lower === undefined && upper === undefined) {
  14441. lower = 0;
  14442. upper = 1;
  14443. }
  14444. else {
  14445. lower = toFinite(lower);
  14446. if (upper === undefined) {
  14447. upper = lower;
  14448. lower = 0;
  14449. } else {
  14450. upper = toFinite(upper);
  14451. }
  14452. }
  14453. if (lower > upper) {
  14454. var temp = lower;
  14455. lower = upper;
  14456. upper = temp;
  14457. }
  14458. if (floating || lower % 1 || upper % 1) {
  14459. var rand = nativeRandom();
  14460. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14461. }
  14462. return baseRandom(lower, upper);
  14463. }
  14464. /*------------------------------------------------------------------------*/
  14465. /**
  14466. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14467. *
  14468. * @static
  14469. * @memberOf _
  14470. * @since 3.0.0
  14471. * @category String
  14472. * @param {string} [string=''] The string to convert.
  14473. * @returns {string} Returns the camel cased string.
  14474. * @example
  14475. *
  14476. * _.camelCase('Foo Bar');
  14477. * // => 'fooBar'
  14478. *
  14479. * _.camelCase('--foo-bar--');
  14480. * // => 'fooBar'
  14481. *
  14482. * _.camelCase('__FOO_BAR__');
  14483. * // => 'fooBar'
  14484. */
  14485. var camelCase = createCompounder(function(result, word, index) {
  14486. word = word.toLowerCase();
  14487. return result + (index ? capitalize(word) : word);
  14488. });
  14489. /**
  14490. * Converts the first character of `string` to upper case and the remaining
  14491. * to lower case.
  14492. *
  14493. * @static
  14494. * @memberOf _
  14495. * @since 3.0.0
  14496. * @category String
  14497. * @param {string} [string=''] The string to capitalize.
  14498. * @returns {string} Returns the capitalized string.
  14499. * @example
  14500. *
  14501. * _.capitalize('FRED');
  14502. * // => 'Fred'
  14503. */
  14504. function capitalize(string) {
  14505. return upperFirst(toString(string).toLowerCase());
  14506. }
  14507. /**
  14508. * Deburrs `string` by converting
  14509. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14510. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14511. * letters to basic Latin letters and removing
  14512. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14513. *
  14514. * @static
  14515. * @memberOf _
  14516. * @since 3.0.0
  14517. * @category String
  14518. * @param {string} [string=''] The string to deburr.
  14519. * @returns {string} Returns the deburred string.
  14520. * @example
  14521. *
  14522. * _.deburr('déjà vu');
  14523. * // => 'deja vu'
  14524. */
  14525. function deburr(string) {
  14526. string = toString(string);
  14527. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14528. }
  14529. /**
  14530. * Checks if `string` ends with the given target string.
  14531. *
  14532. * @static
  14533. * @memberOf _
  14534. * @since 3.0.0
  14535. * @category String
  14536. * @param {string} [string=''] The string to inspect.
  14537. * @param {string} [target] The string to search for.
  14538. * @param {number} [position=string.length] The position to search up to.
  14539. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14540. * else `false`.
  14541. * @example
  14542. *
  14543. * _.endsWith('abc', 'c');
  14544. * // => true
  14545. *
  14546. * _.endsWith('abc', 'b');
  14547. * // => false
  14548. *
  14549. * _.endsWith('abc', 'b', 2);
  14550. * // => true
  14551. */
  14552. function endsWith(string, target, position) {
  14553. string = toString(string);
  14554. target = baseToString(target);
  14555. var length = string.length;
  14556. position = position === undefined
  14557. ? length
  14558. : baseClamp(toInteger(position), 0, length);
  14559. var end = position;
  14560. position -= target.length;
  14561. return position >= 0 && string.slice(position, end) == target;
  14562. }
  14563. /**
  14564. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14565. * corresponding HTML entities.
  14566. *
  14567. * **Note:** No other characters are escaped. To escape additional
  14568. * characters use a third-party library like [_he_](https://mths.be/he).
  14569. *
  14570. * Though the ">" character is escaped for symmetry, characters like
  14571. * ">" and "/" don't need escaping in HTML and have no special meaning
  14572. * unless they're part of a tag or unquoted attribute value. See
  14573. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14574. * (under "semi-related fun fact") for more details.
  14575. *
  14576. * When working with HTML you should always
  14577. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14578. * XSS vectors.
  14579. *
  14580. * @static
  14581. * @since 0.1.0
  14582. * @memberOf _
  14583. * @category String
  14584. * @param {string} [string=''] The string to escape.
  14585. * @returns {string} Returns the escaped string.
  14586. * @example
  14587. *
  14588. * _.escape('fred, barney, & pebbles');
  14589. * // => 'fred, barney, &amp; pebbles'
  14590. */
  14591. function escape(string) {
  14592. string = toString(string);
  14593. return (string && reHasUnescapedHtml.test(string))
  14594. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14595. : string;
  14596. }
  14597. /**
  14598. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14599. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14600. *
  14601. * @static
  14602. * @memberOf _
  14603. * @since 3.0.0
  14604. * @category String
  14605. * @param {string} [string=''] The string to escape.
  14606. * @returns {string} Returns the escaped string.
  14607. * @example
  14608. *
  14609. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14610. * // => '\[lodash\]\(https://lodash\.com/\)'
  14611. */
  14612. function escapeRegExp(string) {
  14613. string = toString(string);
  14614. return (string && reHasRegExpChar.test(string))
  14615. ? string.replace(reRegExpChar, '\\$&')
  14616. : string;
  14617. }
  14618. /**
  14619. * Converts `string` to
  14620. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14621. *
  14622. * @static
  14623. * @memberOf _
  14624. * @since 3.0.0
  14625. * @category String
  14626. * @param {string} [string=''] The string to convert.
  14627. * @returns {string} Returns the kebab cased string.
  14628. * @example
  14629. *
  14630. * _.kebabCase('Foo Bar');
  14631. * // => 'foo-bar'
  14632. *
  14633. * _.kebabCase('fooBar');
  14634. * // => 'foo-bar'
  14635. *
  14636. * _.kebabCase('__FOO_BAR__');
  14637. * // => 'foo-bar'
  14638. */
  14639. var kebabCase = createCompounder(function(result, word, index) {
  14640. return result + (index ? '-' : '') + word.toLowerCase();
  14641. });
  14642. /**
  14643. * Converts `string`, as space separated words, to lower case.
  14644. *
  14645. * @static
  14646. * @memberOf _
  14647. * @since 4.0.0
  14648. * @category String
  14649. * @param {string} [string=''] The string to convert.
  14650. * @returns {string} Returns the lower cased string.
  14651. * @example
  14652. *
  14653. * _.lowerCase('--Foo-Bar--');
  14654. * // => 'foo bar'
  14655. *
  14656. * _.lowerCase('fooBar');
  14657. * // => 'foo bar'
  14658. *
  14659. * _.lowerCase('__FOO_BAR__');
  14660. * // => 'foo bar'
  14661. */
  14662. var lowerCase = createCompounder(function(result, word, index) {
  14663. return result + (index ? ' ' : '') + word.toLowerCase();
  14664. });
  14665. /**
  14666. * Converts the first character of `string` to lower case.
  14667. *
  14668. * @static
  14669. * @memberOf _
  14670. * @since 4.0.0
  14671. * @category String
  14672. * @param {string} [string=''] The string to convert.
  14673. * @returns {string} Returns the converted string.
  14674. * @example
  14675. *
  14676. * _.lowerFirst('Fred');
  14677. * // => 'fred'
  14678. *
  14679. * _.lowerFirst('FRED');
  14680. * // => 'fRED'
  14681. */
  14682. var lowerFirst = createCaseFirst('toLowerCase');
  14683. /**
  14684. * Pads `string` on the left and right sides if it's shorter than `length`.
  14685. * Padding characters are truncated if they can't be evenly divided by `length`.
  14686. *
  14687. * @static
  14688. * @memberOf _
  14689. * @since 3.0.0
  14690. * @category String
  14691. * @param {string} [string=''] The string to pad.
  14692. * @param {number} [length=0] The padding length.
  14693. * @param {string} [chars=' '] The string used as padding.
  14694. * @returns {string} Returns the padded string.
  14695. * @example
  14696. *
  14697. * _.pad('abc', 8);
  14698. * // => ' abc '
  14699. *
  14700. * _.pad('abc', 8, '_-');
  14701. * // => '_-abc_-_'
  14702. *
  14703. * _.pad('abc', 3);
  14704. * // => 'abc'
  14705. */
  14706. function pad(string, length, chars) {
  14707. string = toString(string);
  14708. length = toInteger(length);
  14709. var strLength = length ? stringSize(string) : 0;
  14710. if (!length || strLength >= length) {
  14711. return string;
  14712. }
  14713. var mid = (length - strLength) / 2;
  14714. return (
  14715. createPadding(nativeFloor(mid), chars) +
  14716. string +
  14717. createPadding(nativeCeil(mid), chars)
  14718. );
  14719. }
  14720. /**
  14721. * Pads `string` on the right side if it's shorter than `length`. Padding
  14722. * characters are truncated if they exceed `length`.
  14723. *
  14724. * @static
  14725. * @memberOf _
  14726. * @since 4.0.0
  14727. * @category String
  14728. * @param {string} [string=''] The string to pad.
  14729. * @param {number} [length=0] The padding length.
  14730. * @param {string} [chars=' '] The string used as padding.
  14731. * @returns {string} Returns the padded string.
  14732. * @example
  14733. *
  14734. * _.padEnd('abc', 6);
  14735. * // => 'abc '
  14736. *
  14737. * _.padEnd('abc', 6, '_-');
  14738. * // => 'abc_-_'
  14739. *
  14740. * _.padEnd('abc', 3);
  14741. * // => 'abc'
  14742. */
  14743. function padEnd(string, length, chars) {
  14744. string = toString(string);
  14745. length = toInteger(length);
  14746. var strLength = length ? stringSize(string) : 0;
  14747. return (length && strLength < length)
  14748. ? (string + createPadding(length - strLength, chars))
  14749. : string;
  14750. }
  14751. /**
  14752. * Pads `string` on the left side if it's shorter than `length`. Padding
  14753. * characters are truncated if they exceed `length`.
  14754. *
  14755. * @static
  14756. * @memberOf _
  14757. * @since 4.0.0
  14758. * @category String
  14759. * @param {string} [string=''] The string to pad.
  14760. * @param {number} [length=0] The padding length.
  14761. * @param {string} [chars=' '] The string used as padding.
  14762. * @returns {string} Returns the padded string.
  14763. * @example
  14764. *
  14765. * _.padStart('abc', 6);
  14766. * // => ' abc'
  14767. *
  14768. * _.padStart('abc', 6, '_-');
  14769. * // => '_-_abc'
  14770. *
  14771. * _.padStart('abc', 3);
  14772. * // => 'abc'
  14773. */
  14774. function padStart(string, length, chars) {
  14775. string = toString(string);
  14776. length = toInteger(length);
  14777. var strLength = length ? stringSize(string) : 0;
  14778. return (length && strLength < length)
  14779. ? (createPadding(length - strLength, chars) + string)
  14780. : string;
  14781. }
  14782. /**
  14783. * Converts `string` to an integer of the specified radix. If `radix` is
  14784. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14785. * hexadecimal, in which case a `radix` of `16` is used.
  14786. *
  14787. * **Note:** This method aligns with the
  14788. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 1.1.0
  14793. * @category String
  14794. * @param {string} string The string to convert.
  14795. * @param {number} [radix=10] The radix to interpret `value` by.
  14796. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14797. * @returns {number} Returns the converted integer.
  14798. * @example
  14799. *
  14800. * _.parseInt('08');
  14801. * // => 8
  14802. *
  14803. * _.map(['6', '08', '10'], _.parseInt);
  14804. * // => [6, 8, 10]
  14805. */
  14806. function parseInt(string, radix, guard) {
  14807. if (guard || radix == null) {
  14808. radix = 0;
  14809. } else if (radix) {
  14810. radix = +radix;
  14811. }
  14812. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14813. }
  14814. /**
  14815. * Repeats the given string `n` times.
  14816. *
  14817. * @static
  14818. * @memberOf _
  14819. * @since 3.0.0
  14820. * @category String
  14821. * @param {string} [string=''] The string to repeat.
  14822. * @param {number} [n=1] The number of times to repeat the string.
  14823. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14824. * @returns {string} Returns the repeated string.
  14825. * @example
  14826. *
  14827. * _.repeat('*', 3);
  14828. * // => '***'
  14829. *
  14830. * _.repeat('abc', 2);
  14831. * // => 'abcabc'
  14832. *
  14833. * _.repeat('abc', 0);
  14834. * // => ''
  14835. */
  14836. function repeat(string, n, guard) {
  14837. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14838. n = 1;
  14839. } else {
  14840. n = toInteger(n);
  14841. }
  14842. return baseRepeat(toString(string), n);
  14843. }
  14844. /**
  14845. * Replaces matches for `pattern` in `string` with `replacement`.
  14846. *
  14847. * **Note:** This method is based on
  14848. * [`String#replace`](https://mdn.io/String/replace).
  14849. *
  14850. * @static
  14851. * @memberOf _
  14852. * @since 4.0.0
  14853. * @category String
  14854. * @param {string} [string=''] The string to modify.
  14855. * @param {RegExp|string} pattern The pattern to replace.
  14856. * @param {Function|string} replacement The match replacement.
  14857. * @returns {string} Returns the modified string.
  14858. * @example
  14859. *
  14860. * _.replace('Hi Fred', 'Fred', 'Barney');
  14861. * // => 'Hi Barney'
  14862. */
  14863. function replace() {
  14864. var args = arguments,
  14865. string = toString(args[0]);
  14866. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14867. }
  14868. /**
  14869. * Converts `string` to
  14870. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14871. *
  14872. * @static
  14873. * @memberOf _
  14874. * @since 3.0.0
  14875. * @category String
  14876. * @param {string} [string=''] The string to convert.
  14877. * @returns {string} Returns the snake cased string.
  14878. * @example
  14879. *
  14880. * _.snakeCase('Foo Bar');
  14881. * // => 'foo_bar'
  14882. *
  14883. * _.snakeCase('fooBar');
  14884. * // => 'foo_bar'
  14885. *
  14886. * _.snakeCase('--FOO-BAR--');
  14887. * // => 'foo_bar'
  14888. */
  14889. var snakeCase = createCompounder(function(result, word, index) {
  14890. return result + (index ? '_' : '') + word.toLowerCase();
  14891. });
  14892. /**
  14893. * Splits `string` by `separator`.
  14894. *
  14895. * **Note:** This method is based on
  14896. * [`String#split`](https://mdn.io/String/split).
  14897. *
  14898. * @static
  14899. * @memberOf _
  14900. * @since 4.0.0
  14901. * @category String
  14902. * @param {string} [string=''] The string to split.
  14903. * @param {RegExp|string} separator The separator pattern to split by.
  14904. * @param {number} [limit] The length to truncate results to.
  14905. * @returns {Array} Returns the string segments.
  14906. * @example
  14907. *
  14908. * _.split('a-b-c', '-', 2);
  14909. * // => ['a', 'b']
  14910. */
  14911. function split(string, separator, limit) {
  14912. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14913. separator = limit = undefined;
  14914. }
  14915. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14916. if (!limit) {
  14917. return [];
  14918. }
  14919. string = toString(string);
  14920. if (string && (
  14921. typeof separator == 'string' ||
  14922. (separator != null && !isRegExp(separator))
  14923. )) {
  14924. separator = baseToString(separator);
  14925. if (!separator && hasUnicode(string)) {
  14926. return castSlice(stringToArray(string), 0, limit);
  14927. }
  14928. }
  14929. return string.split(separator, limit);
  14930. }
  14931. /**
  14932. * Converts `string` to
  14933. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14934. *
  14935. * @static
  14936. * @memberOf _
  14937. * @since 3.1.0
  14938. * @category String
  14939. * @param {string} [string=''] The string to convert.
  14940. * @returns {string} Returns the start cased string.
  14941. * @example
  14942. *
  14943. * _.startCase('--foo-bar--');
  14944. * // => 'Foo Bar'
  14945. *
  14946. * _.startCase('fooBar');
  14947. * // => 'Foo Bar'
  14948. *
  14949. * _.startCase('__FOO_BAR__');
  14950. * // => 'FOO BAR'
  14951. */
  14952. var startCase = createCompounder(function(result, word, index) {
  14953. return result + (index ? ' ' : '') + upperFirst(word);
  14954. });
  14955. /**
  14956. * Checks if `string` starts with the given target string.
  14957. *
  14958. * @static
  14959. * @memberOf _
  14960. * @since 3.0.0
  14961. * @category String
  14962. * @param {string} [string=''] The string to inspect.
  14963. * @param {string} [target] The string to search for.
  14964. * @param {number} [position=0] The position to search from.
  14965. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14966. * else `false`.
  14967. * @example
  14968. *
  14969. * _.startsWith('abc', 'a');
  14970. * // => true
  14971. *
  14972. * _.startsWith('abc', 'b');
  14973. * // => false
  14974. *
  14975. * _.startsWith('abc', 'b', 1);
  14976. * // => true
  14977. */
  14978. function startsWith(string, target, position) {
  14979. string = toString(string);
  14980. position = position == null
  14981. ? 0
  14982. : baseClamp(toInteger(position), 0, string.length);
  14983. target = baseToString(target);
  14984. return string.slice(position, position + target.length) == target;
  14985. }
  14986. /**
  14987. * Creates a compiled template function that can interpolate data properties
  14988. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14989. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14990. * properties may be accessed as free variables in the template. If a setting
  14991. * object is given, it takes precedence over `_.templateSettings` values.
  14992. *
  14993. * **Note:** In the development build `_.template` utilizes
  14994. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14995. * for easier debugging.
  14996. *
  14997. * For more information on precompiling templates see
  14998. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14999. *
  15000. * For more information on Chrome extension sandboxes see
  15001. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15002. *
  15003. * @static
  15004. * @since 0.1.0
  15005. * @memberOf _
  15006. * @category String
  15007. * @param {string} [string=''] The template string.
  15008. * @param {Object} [options={}] The options object.
  15009. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15010. * The HTML "escape" delimiter.
  15011. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15012. * The "evaluate" delimiter.
  15013. * @param {Object} [options.imports=_.templateSettings.imports]
  15014. * An object to import into the template as free variables.
  15015. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15016. * The "interpolate" delimiter.
  15017. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15018. * The sourceURL of the compiled template.
  15019. * @param {string} [options.variable='obj']
  15020. * The data object variable name.
  15021. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15022. * @returns {Function} Returns the compiled template function.
  15023. * @example
  15024. *
  15025. * // Use the "interpolate" delimiter to create a compiled template.
  15026. * var compiled = _.template('hello <%= user %>!');
  15027. * compiled({ 'user': 'fred' });
  15028. * // => 'hello fred!'
  15029. *
  15030. * // Use the HTML "escape" delimiter to escape data property values.
  15031. * var compiled = _.template('<b><%- value %></b>');
  15032. * compiled({ 'value': '<script>' });
  15033. * // => '<b>&lt;script&gt;</b>'
  15034. *
  15035. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15036. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15037. * compiled({ 'users': ['fred', 'barney'] });
  15038. * // => '<li>fred</li><li>barney</li>'
  15039. *
  15040. * // Use the internal `print` function in "evaluate" delimiters.
  15041. * var compiled = _.template('<% print("hello " + user); %>!');
  15042. * compiled({ 'user': 'barney' });
  15043. * // => 'hello barney!'
  15044. *
  15045. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15046. * // Disable support by replacing the "interpolate" delimiter.
  15047. * var compiled = _.template('hello ${ user }!');
  15048. * compiled({ 'user': 'pebbles' });
  15049. * // => 'hello pebbles!'
  15050. *
  15051. * // Use backslashes to treat delimiters as plain text.
  15052. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15053. * compiled({ 'value': 'ignored' });
  15054. * // => '<%- value %>'
  15055. *
  15056. * // Use the `imports` option to import `jQuery` as `jq`.
  15057. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15058. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15059. * compiled({ 'users': ['fred', 'barney'] });
  15060. * // => '<li>fred</li><li>barney</li>'
  15061. *
  15062. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15063. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15064. * compiled(data);
  15065. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15066. *
  15067. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15068. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15069. * compiled.source;
  15070. * // => function(data) {
  15071. * // var __t, __p = '';
  15072. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15073. * // return __p;
  15074. * // }
  15075. *
  15076. * // Use custom template delimiters.
  15077. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15078. * var compiled = _.template('hello {{ user }}!');
  15079. * compiled({ 'user': 'mustache' });
  15080. * // => 'hello mustache!'
  15081. *
  15082. * // Use the `source` property to inline compiled templates for meaningful
  15083. * // line numbers in error messages and stack traces.
  15084. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15085. * var JST = {\
  15086. * "main": ' + _.template(mainText).source + '\
  15087. * };\
  15088. * ');
  15089. */
  15090. function template(string, options, guard) {
  15091. // Based on John Resig's `tmpl` implementation
  15092. // (http://ejohn.org/blog/javascript-micro-templating/)
  15093. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15094. var settings = lodash.templateSettings;
  15095. if (guard && isIterateeCall(string, options, guard)) {
  15096. options = undefined;
  15097. }
  15098. string = toString(string);
  15099. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15100. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15101. importsKeys = keys(imports),
  15102. importsValues = baseValues(imports, importsKeys);
  15103. var isEscaping,
  15104. isEvaluating,
  15105. index = 0,
  15106. interpolate = options.interpolate || reNoMatch,
  15107. source = "__p += '";
  15108. // Compile the regexp to match each delimiter.
  15109. var reDelimiters = RegExp(
  15110. (options.escape || reNoMatch).source + '|' +
  15111. interpolate.source + '|' +
  15112. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15113. (options.evaluate || reNoMatch).source + '|$'
  15114. , 'g');
  15115. // Use a sourceURL for easier debugging.
  15116. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15117. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15118. // and escape the comment, thus injecting code that gets evaled.
  15119. var sourceURL = '//# sourceURL=' +
  15120. (hasOwnProperty.call(options, 'sourceURL')
  15121. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15122. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15123. ) + '\n';
  15124. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15125. interpolateValue || (interpolateValue = esTemplateValue);
  15126. // Escape characters that can't be included in string literals.
  15127. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15128. // Replace delimiters with snippets.
  15129. if (escapeValue) {
  15130. isEscaping = true;
  15131. source += "' +\n__e(" + escapeValue + ") +\n'";
  15132. }
  15133. if (evaluateValue) {
  15134. isEvaluating = true;
  15135. source += "';\n" + evaluateValue + ";\n__p += '";
  15136. }
  15137. if (interpolateValue) {
  15138. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15139. }
  15140. index = offset + match.length;
  15141. // The JS engine embedded in Adobe products needs `match` returned in
  15142. // order to produce the correct `offset` value.
  15143. return match;
  15144. });
  15145. source += "';\n";
  15146. // If `variable` is not specified wrap a with-statement around the generated
  15147. // code to add the data object to the top of the scope chain.
  15148. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15149. if (!variable) {
  15150. source = 'with (obj) {\n' + source + '\n}\n';
  15151. }
  15152. // Throw an error if a forbidden character was found in `variable`, to prevent
  15153. // potential command injection attacks.
  15154. else if (reForbiddenIdentifierChars.test(variable)) {
  15155. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15156. }
  15157. // Cleanup code by stripping empty strings.
  15158. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15159. .replace(reEmptyStringMiddle, '$1')
  15160. .replace(reEmptyStringTrailing, '$1;');
  15161. // Frame code as the function body.
  15162. source = 'function(' + (variable || 'obj') + ') {\n' +
  15163. (variable
  15164. ? ''
  15165. : 'obj || (obj = {});\n'
  15166. ) +
  15167. "var __t, __p = ''" +
  15168. (isEscaping
  15169. ? ', __e = _.escape'
  15170. : ''
  15171. ) +
  15172. (isEvaluating
  15173. ? ', __j = Array.prototype.join;\n' +
  15174. "function print() { __p += __j.call(arguments, '') }\n"
  15175. : ';\n'
  15176. ) +
  15177. source +
  15178. 'return __p\n}';
  15179. var result = attempt(function() {
  15180. return Function(importsKeys, sourceURL + 'return ' + source)
  15181. .apply(undefined, importsValues);
  15182. });
  15183. // Provide the compiled function's source by its `toString` method or
  15184. // the `source` property as a convenience for inlining compiled templates.
  15185. result.source = source;
  15186. if (isError(result)) {
  15187. throw result;
  15188. }
  15189. return result;
  15190. }
  15191. /**
  15192. * Converts `string`, as a whole, to lower case just like
  15193. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15194. *
  15195. * @static
  15196. * @memberOf _
  15197. * @since 4.0.0
  15198. * @category String
  15199. * @param {string} [string=''] The string to convert.
  15200. * @returns {string} Returns the lower cased string.
  15201. * @example
  15202. *
  15203. * _.toLower('--Foo-Bar--');
  15204. * // => '--foo-bar--'
  15205. *
  15206. * _.toLower('fooBar');
  15207. * // => 'foobar'
  15208. *
  15209. * _.toLower('__FOO_BAR__');
  15210. * // => '__foo_bar__'
  15211. */
  15212. function toLower(value) {
  15213. return toString(value).toLowerCase();
  15214. }
  15215. /**
  15216. * Converts `string`, as a whole, to upper case just like
  15217. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15218. *
  15219. * @static
  15220. * @memberOf _
  15221. * @since 4.0.0
  15222. * @category String
  15223. * @param {string} [string=''] The string to convert.
  15224. * @returns {string} Returns the upper cased string.
  15225. * @example
  15226. *
  15227. * _.toUpper('--foo-bar--');
  15228. * // => '--FOO-BAR--'
  15229. *
  15230. * _.toUpper('fooBar');
  15231. * // => 'FOOBAR'
  15232. *
  15233. * _.toUpper('__foo_bar__');
  15234. * // => '__FOO_BAR__'
  15235. */
  15236. function toUpper(value) {
  15237. return toString(value).toUpperCase();
  15238. }
  15239. /**
  15240. * Removes leading and trailing whitespace or specified characters from `string`.
  15241. *
  15242. * @static
  15243. * @memberOf _
  15244. * @since 3.0.0
  15245. * @category String
  15246. * @param {string} [string=''] The string to trim.
  15247. * @param {string} [chars=whitespace] The characters to trim.
  15248. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15249. * @returns {string} Returns the trimmed string.
  15250. * @example
  15251. *
  15252. * _.trim(' abc ');
  15253. * // => 'abc'
  15254. *
  15255. * _.trim('-_-abc-_-', '_-');
  15256. * // => 'abc'
  15257. *
  15258. * _.map([' foo ', ' bar '], _.trim);
  15259. * // => ['foo', 'bar']
  15260. */
  15261. function trim(string, chars, guard) {
  15262. string = toString(string);
  15263. if (string && (guard || chars === undefined)) {
  15264. return baseTrim(string);
  15265. }
  15266. if (!string || !(chars = baseToString(chars))) {
  15267. return string;
  15268. }
  15269. var strSymbols = stringToArray(string),
  15270. chrSymbols = stringToArray(chars),
  15271. start = charsStartIndex(strSymbols, chrSymbols),
  15272. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15273. return castSlice(strSymbols, start, end).join('');
  15274. }
  15275. /**
  15276. * Removes trailing whitespace or specified characters from `string`.
  15277. *
  15278. * @static
  15279. * @memberOf _
  15280. * @since 4.0.0
  15281. * @category String
  15282. * @param {string} [string=''] The string to trim.
  15283. * @param {string} [chars=whitespace] The characters to trim.
  15284. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15285. * @returns {string} Returns the trimmed string.
  15286. * @example
  15287. *
  15288. * _.trimEnd(' abc ');
  15289. * // => ' abc'
  15290. *
  15291. * _.trimEnd('-_-abc-_-', '_-');
  15292. * // => '-_-abc'
  15293. */
  15294. function trimEnd(string, chars, guard) {
  15295. string = toString(string);
  15296. if (string && (guard || chars === undefined)) {
  15297. return string.slice(0, trimmedEndIndex(string) + 1);
  15298. }
  15299. if (!string || !(chars = baseToString(chars))) {
  15300. return string;
  15301. }
  15302. var strSymbols = stringToArray(string),
  15303. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15304. return castSlice(strSymbols, 0, end).join('');
  15305. }
  15306. /**
  15307. * Removes leading whitespace or specified characters from `string`.
  15308. *
  15309. * @static
  15310. * @memberOf _
  15311. * @since 4.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. * _.trimStart(' abc ');
  15320. * // => 'abc '
  15321. *
  15322. * _.trimStart('-_-abc-_-', '_-');
  15323. * // => 'abc-_-'
  15324. */
  15325. function trimStart(string, chars, guard) {
  15326. string = toString(string);
  15327. if (string && (guard || chars === undefined)) {
  15328. return string.replace(reTrimStart, '');
  15329. }
  15330. if (!string || !(chars = baseToString(chars))) {
  15331. return string;
  15332. }
  15333. var strSymbols = stringToArray(string),
  15334. start = charsStartIndex(strSymbols, stringToArray(chars));
  15335. return castSlice(strSymbols, start).join('');
  15336. }
  15337. /**
  15338. * Truncates `string` if it's longer than the given maximum string length.
  15339. * The last characters of the truncated string are replaced with the omission
  15340. * string which defaults to "...".
  15341. *
  15342. * @static
  15343. * @memberOf _
  15344. * @since 4.0.0
  15345. * @category String
  15346. * @param {string} [string=''] The string to truncate.
  15347. * @param {Object} [options={}] The options object.
  15348. * @param {number} [options.length=30] The maximum string length.
  15349. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15350. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15351. * @returns {string} Returns the truncated string.
  15352. * @example
  15353. *
  15354. * _.truncate('hi-diddly-ho there, neighborino');
  15355. * // => 'hi-diddly-ho there, neighbo...'
  15356. *
  15357. * _.truncate('hi-diddly-ho there, neighborino', {
  15358. * 'length': 24,
  15359. * 'separator': ' '
  15360. * });
  15361. * // => 'hi-diddly-ho there,...'
  15362. *
  15363. * _.truncate('hi-diddly-ho there, neighborino', {
  15364. * 'length': 24,
  15365. * 'separator': /,? +/
  15366. * });
  15367. * // => 'hi-diddly-ho there...'
  15368. *
  15369. * _.truncate('hi-diddly-ho there, neighborino', {
  15370. * 'omission': ' [...]'
  15371. * });
  15372. * // => 'hi-diddly-ho there, neig [...]'
  15373. */
  15374. function truncate(string, options) {
  15375. var length = DEFAULT_TRUNC_LENGTH,
  15376. omission = DEFAULT_TRUNC_OMISSION;
  15377. if (isObject(options)) {
  15378. var separator = 'separator' in options ? options.separator : separator;
  15379. length = 'length' in options ? toInteger(options.length) : length;
  15380. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15381. }
  15382. string = toString(string);
  15383. var strLength = string.length;
  15384. if (hasUnicode(string)) {
  15385. var strSymbols = stringToArray(string);
  15386. strLength = strSymbols.length;
  15387. }
  15388. if (length >= strLength) {
  15389. return string;
  15390. }
  15391. var end = length - stringSize(omission);
  15392. if (end < 1) {
  15393. return omission;
  15394. }
  15395. var result = strSymbols
  15396. ? castSlice(strSymbols, 0, end).join('')
  15397. : string.slice(0, end);
  15398. if (separator === undefined) {
  15399. return result + omission;
  15400. }
  15401. if (strSymbols) {
  15402. end += (result.length - end);
  15403. }
  15404. if (isRegExp(separator)) {
  15405. if (string.slice(end).search(separator)) {
  15406. var match,
  15407. substring = result;
  15408. if (!separator.global) {
  15409. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15410. }
  15411. separator.lastIndex = 0;
  15412. while ((match = separator.exec(substring))) {
  15413. var newEnd = match.index;
  15414. }
  15415. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15416. }
  15417. } else if (string.indexOf(baseToString(separator), end) != end) {
  15418. var index = result.lastIndexOf(separator);
  15419. if (index > -1) {
  15420. result = result.slice(0, index);
  15421. }
  15422. }
  15423. return result + omission;
  15424. }
  15425. /**
  15426. * The inverse of `_.escape`; this method converts the HTML entities
  15427. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15428. * their corresponding characters.
  15429. *
  15430. * **Note:** No other HTML entities are unescaped. To unescape additional
  15431. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15432. *
  15433. * @static
  15434. * @memberOf _
  15435. * @since 0.6.0
  15436. * @category String
  15437. * @param {string} [string=''] The string to unescape.
  15438. * @returns {string} Returns the unescaped string.
  15439. * @example
  15440. *
  15441. * _.unescape('fred, barney, &amp; pebbles');
  15442. * // => 'fred, barney, & pebbles'
  15443. */
  15444. function unescape(string) {
  15445. string = toString(string);
  15446. return (string && reHasEscapedHtml.test(string))
  15447. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15448. : string;
  15449. }
  15450. /**
  15451. * Converts `string`, as space separated words, to upper case.
  15452. *
  15453. * @static
  15454. * @memberOf _
  15455. * @since 4.0.0
  15456. * @category String
  15457. * @param {string} [string=''] The string to convert.
  15458. * @returns {string} Returns the upper cased string.
  15459. * @example
  15460. *
  15461. * _.upperCase('--foo-bar');
  15462. * // => 'FOO BAR'
  15463. *
  15464. * _.upperCase('fooBar');
  15465. * // => 'FOO BAR'
  15466. *
  15467. * _.upperCase('__foo_bar__');
  15468. * // => 'FOO BAR'
  15469. */
  15470. var upperCase = createCompounder(function(result, word, index) {
  15471. return result + (index ? ' ' : '') + word.toUpperCase();
  15472. });
  15473. /**
  15474. * Converts the first character of `string` to upper case.
  15475. *
  15476. * @static
  15477. * @memberOf _
  15478. * @since 4.0.0
  15479. * @category String
  15480. * @param {string} [string=''] The string to convert.
  15481. * @returns {string} Returns the converted string.
  15482. * @example
  15483. *
  15484. * _.upperFirst('fred');
  15485. * // => 'Fred'
  15486. *
  15487. * _.upperFirst('FRED');
  15488. * // => 'FRED'
  15489. */
  15490. var upperFirst = createCaseFirst('toUpperCase');
  15491. /**
  15492. * Splits `string` into an array of its words.
  15493. *
  15494. * @static
  15495. * @memberOf _
  15496. * @since 3.0.0
  15497. * @category String
  15498. * @param {string} [string=''] The string to inspect.
  15499. * @param {RegExp|string} [pattern] The pattern to match words.
  15500. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15501. * @returns {Array} Returns the words of `string`.
  15502. * @example
  15503. *
  15504. * _.words('fred, barney, & pebbles');
  15505. * // => ['fred', 'barney', 'pebbles']
  15506. *
  15507. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15508. * // => ['fred', 'barney', '&', 'pebbles']
  15509. */
  15510. function words(string, pattern, guard) {
  15511. string = toString(string);
  15512. pattern = guard ? undefined : pattern;
  15513. if (pattern === undefined) {
  15514. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15515. }
  15516. return string.match(pattern) || [];
  15517. }
  15518. /*------------------------------------------------------------------------*/
  15519. /**
  15520. * Attempts to invoke `func`, returning either the result or the caught error
  15521. * object. Any additional arguments are provided to `func` when it's invoked.
  15522. *
  15523. * @static
  15524. * @memberOf _
  15525. * @since 3.0.0
  15526. * @category Util
  15527. * @param {Function} func The function to attempt.
  15528. * @param {...*} [args] The arguments to invoke `func` with.
  15529. * @returns {*} Returns the `func` result or error object.
  15530. * @example
  15531. *
  15532. * // Avoid throwing errors for invalid selectors.
  15533. * var elements = _.attempt(function(selector) {
  15534. * return document.querySelectorAll(selector);
  15535. * }, '>_>');
  15536. *
  15537. * if (_.isError(elements)) {
  15538. * elements = [];
  15539. * }
  15540. */
  15541. var attempt = baseRest(function(func, args) {
  15542. try {
  15543. return apply(func, undefined, args);
  15544. } catch (e) {
  15545. return isError(e) ? e : new Error(e);
  15546. }
  15547. });
  15548. /**
  15549. * Binds methods of an object to the object itself, overwriting the existing
  15550. * method.
  15551. *
  15552. * **Note:** This method doesn't set the "length" property of bound functions.
  15553. *
  15554. * @static
  15555. * @since 0.1.0
  15556. * @memberOf _
  15557. * @category Util
  15558. * @param {Object} object The object to bind and assign the bound methods to.
  15559. * @param {...(string|string[])} methodNames The object method names to bind.
  15560. * @returns {Object} Returns `object`.
  15561. * @example
  15562. *
  15563. * var view = {
  15564. * 'label': 'docs',
  15565. * 'click': function() {
  15566. * console.log('clicked ' + this.label);
  15567. * }
  15568. * };
  15569. *
  15570. * _.bindAll(view, ['click']);
  15571. * jQuery(element).on('click', view.click);
  15572. * // => Logs 'clicked docs' when clicked.
  15573. */
  15574. var bindAll = flatRest(function(object, methodNames) {
  15575. arrayEach(methodNames, function(key) {
  15576. key = toKey(key);
  15577. baseAssignValue(object, key, bind(object[key], object));
  15578. });
  15579. return object;
  15580. });
  15581. /**
  15582. * Creates a function that iterates over `pairs` and invokes the corresponding
  15583. * function of the first predicate to return truthy. The predicate-function
  15584. * pairs are invoked with the `this` binding and arguments of the created
  15585. * function.
  15586. *
  15587. * @static
  15588. * @memberOf _
  15589. * @since 4.0.0
  15590. * @category Util
  15591. * @param {Array} pairs The predicate-function pairs.
  15592. * @returns {Function} Returns the new composite function.
  15593. * @example
  15594. *
  15595. * var func = _.cond([
  15596. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15597. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15598. * [_.stubTrue, _.constant('no match')]
  15599. * ]);
  15600. *
  15601. * func({ 'a': 1, 'b': 2 });
  15602. * // => 'matches A'
  15603. *
  15604. * func({ 'a': 0, 'b': 1 });
  15605. * // => 'matches B'
  15606. *
  15607. * func({ 'a': '1', 'b': '2' });
  15608. * // => 'no match'
  15609. */
  15610. function cond(pairs) {
  15611. var length = pairs == null ? 0 : pairs.length,
  15612. toIteratee = getIteratee();
  15613. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15614. if (typeof pair[1] != 'function') {
  15615. throw new TypeError(FUNC_ERROR_TEXT);
  15616. }
  15617. return [toIteratee(pair[0]), pair[1]];
  15618. });
  15619. return baseRest(function(args) {
  15620. var index = -1;
  15621. while (++index < length) {
  15622. var pair = pairs[index];
  15623. if (apply(pair[0], this, args)) {
  15624. return apply(pair[1], this, args);
  15625. }
  15626. }
  15627. });
  15628. }
  15629. /**
  15630. * Creates a function that invokes the predicate properties of `source` with
  15631. * the corresponding property values of a given object, returning `true` if
  15632. * all predicates return truthy, else `false`.
  15633. *
  15634. * **Note:** The created function is equivalent to `_.conformsTo` with
  15635. * `source` partially applied.
  15636. *
  15637. * @static
  15638. * @memberOf _
  15639. * @since 4.0.0
  15640. * @category Util
  15641. * @param {Object} source The object of property predicates to conform to.
  15642. * @returns {Function} Returns the new spec function.
  15643. * @example
  15644. *
  15645. * var objects = [
  15646. * { 'a': 2, 'b': 1 },
  15647. * { 'a': 1, 'b': 2 }
  15648. * ];
  15649. *
  15650. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15651. * // => [{ 'a': 1, 'b': 2 }]
  15652. */
  15653. function conforms(source) {
  15654. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15655. }
  15656. /**
  15657. * Creates a function that returns `value`.
  15658. *
  15659. * @static
  15660. * @memberOf _
  15661. * @since 2.4.0
  15662. * @category Util
  15663. * @param {*} value The value to return from the new function.
  15664. * @returns {Function} Returns the new constant function.
  15665. * @example
  15666. *
  15667. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15668. *
  15669. * console.log(objects);
  15670. * // => [{ 'a': 1 }, { 'a': 1 }]
  15671. *
  15672. * console.log(objects[0] === objects[1]);
  15673. * // => true
  15674. */
  15675. function constant(value) {
  15676. return function() {
  15677. return value;
  15678. };
  15679. }
  15680. /**
  15681. * Checks `value` to determine whether a default value should be returned in
  15682. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15683. * or `undefined`.
  15684. *
  15685. * @static
  15686. * @memberOf _
  15687. * @since 4.14.0
  15688. * @category Util
  15689. * @param {*} value The value to check.
  15690. * @param {*} defaultValue The default value.
  15691. * @returns {*} Returns the resolved value.
  15692. * @example
  15693. *
  15694. * _.defaultTo(1, 10);
  15695. * // => 1
  15696. *
  15697. * _.defaultTo(undefined, 10);
  15698. * // => 10
  15699. */
  15700. function defaultTo(value, defaultValue) {
  15701. return (value == null || value !== value) ? defaultValue : value;
  15702. }
  15703. /**
  15704. * Creates a function that returns the result of invoking the given functions
  15705. * with the `this` binding of the created function, where each successive
  15706. * invocation is supplied the return value of the previous.
  15707. *
  15708. * @static
  15709. * @memberOf _
  15710. * @since 3.0.0
  15711. * @category Util
  15712. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15713. * @returns {Function} Returns the new composite function.
  15714. * @see _.flowRight
  15715. * @example
  15716. *
  15717. * function square(n) {
  15718. * return n * n;
  15719. * }
  15720. *
  15721. * var addSquare = _.flow([_.add, square]);
  15722. * addSquare(1, 2);
  15723. * // => 9
  15724. */
  15725. var flow = createFlow();
  15726. /**
  15727. * This method is like `_.flow` except that it creates a function that
  15728. * invokes the given functions from right to left.
  15729. *
  15730. * @static
  15731. * @since 3.0.0
  15732. * @memberOf _
  15733. * @category Util
  15734. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15735. * @returns {Function} Returns the new composite function.
  15736. * @see _.flow
  15737. * @example
  15738. *
  15739. * function square(n) {
  15740. * return n * n;
  15741. * }
  15742. *
  15743. * var addSquare = _.flowRight([square, _.add]);
  15744. * addSquare(1, 2);
  15745. * // => 9
  15746. */
  15747. var flowRight = createFlow(true);
  15748. /**
  15749. * This method returns the first argument it receives.
  15750. *
  15751. * @static
  15752. * @since 0.1.0
  15753. * @memberOf _
  15754. * @category Util
  15755. * @param {*} value Any value.
  15756. * @returns {*} Returns `value`.
  15757. * @example
  15758. *
  15759. * var object = { 'a': 1 };
  15760. *
  15761. * console.log(_.identity(object) === object);
  15762. * // => true
  15763. */
  15764. function identity(value) {
  15765. return value;
  15766. }
  15767. /**
  15768. * Creates a function that invokes `func` with the arguments of the created
  15769. * function. If `func` is a property name, the created function returns the
  15770. * property value for a given element. If `func` is an array or object, the
  15771. * created function returns `true` for elements that contain the equivalent
  15772. * source properties, otherwise it returns `false`.
  15773. *
  15774. * @static
  15775. * @since 4.0.0
  15776. * @memberOf _
  15777. * @category Util
  15778. * @param {*} [func=_.identity] The value to convert to a callback.
  15779. * @returns {Function} Returns the callback.
  15780. * @example
  15781. *
  15782. * var users = [
  15783. * { 'user': 'barney', 'age': 36, 'active': true },
  15784. * { 'user': 'fred', 'age': 40, 'active': false }
  15785. * ];
  15786. *
  15787. * // The `_.matches` iteratee shorthand.
  15788. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15789. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15790. *
  15791. * // The `_.matchesProperty` iteratee shorthand.
  15792. * _.filter(users, _.iteratee(['user', 'fred']));
  15793. * // => [{ 'user': 'fred', 'age': 40 }]
  15794. *
  15795. * // The `_.property` iteratee shorthand.
  15796. * _.map(users, _.iteratee('user'));
  15797. * // => ['barney', 'fred']
  15798. *
  15799. * // Create custom iteratee shorthands.
  15800. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15801. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15802. * return func.test(string);
  15803. * };
  15804. * });
  15805. *
  15806. * _.filter(['abc', 'def'], /ef/);
  15807. * // => ['def']
  15808. */
  15809. function iteratee(func) {
  15810. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15811. }
  15812. /**
  15813. * Creates a function that performs a partial deep comparison between a given
  15814. * object and `source`, returning `true` if the given object has equivalent
  15815. * property values, else `false`.
  15816. *
  15817. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15818. * partially applied.
  15819. *
  15820. * Partial comparisons will match empty array and empty object `source`
  15821. * values against any array or object value, respectively. See `_.isEqual`
  15822. * for a list of supported value comparisons.
  15823. *
  15824. * **Note:** Multiple values can be checked by combining several matchers
  15825. * using `_.overSome`
  15826. *
  15827. * @static
  15828. * @memberOf _
  15829. * @since 3.0.0
  15830. * @category Util
  15831. * @param {Object} source The object of property values to match.
  15832. * @returns {Function} Returns the new spec function.
  15833. * @example
  15834. *
  15835. * var objects = [
  15836. * { 'a': 1, 'b': 2, 'c': 3 },
  15837. * { 'a': 4, 'b': 5, 'c': 6 }
  15838. * ];
  15839. *
  15840. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15841. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15842. *
  15843. * // Checking for several possible values
  15844. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15845. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15846. */
  15847. function matches(source) {
  15848. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15849. }
  15850. /**
  15851. * Creates a function that performs a partial deep comparison between the
  15852. * value at `path` of a given object to `srcValue`, returning `true` if the
  15853. * object value is equivalent, else `false`.
  15854. *
  15855. * **Note:** Partial comparisons will match empty array and empty object
  15856. * `srcValue` values against any array or object value, respectively. See
  15857. * `_.isEqual` for a list of supported value comparisons.
  15858. *
  15859. * **Note:** Multiple values can be checked by combining several matchers
  15860. * using `_.overSome`
  15861. *
  15862. * @static
  15863. * @memberOf _
  15864. * @since 3.2.0
  15865. * @category Util
  15866. * @param {Array|string} path The path of the property to get.
  15867. * @param {*} srcValue The value to match.
  15868. * @returns {Function} Returns the new spec function.
  15869. * @example
  15870. *
  15871. * var objects = [
  15872. * { 'a': 1, 'b': 2, 'c': 3 },
  15873. * { 'a': 4, 'b': 5, 'c': 6 }
  15874. * ];
  15875. *
  15876. * _.find(objects, _.matchesProperty('a', 4));
  15877. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15878. *
  15879. * // Checking for several possible values
  15880. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15881. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15882. */
  15883. function matchesProperty(path, srcValue) {
  15884. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15885. }
  15886. /**
  15887. * Creates a function that invokes the method at `path` of a given object.
  15888. * Any additional arguments are provided to the invoked method.
  15889. *
  15890. * @static
  15891. * @memberOf _
  15892. * @since 3.7.0
  15893. * @category Util
  15894. * @param {Array|string} path The path of the method to invoke.
  15895. * @param {...*} [args] The arguments to invoke the method with.
  15896. * @returns {Function} Returns the new invoker function.
  15897. * @example
  15898. *
  15899. * var objects = [
  15900. * { 'a': { 'b': _.constant(2) } },
  15901. * { 'a': { 'b': _.constant(1) } }
  15902. * ];
  15903. *
  15904. * _.map(objects, _.method('a.b'));
  15905. * // => [2, 1]
  15906. *
  15907. * _.map(objects, _.method(['a', 'b']));
  15908. * // => [2, 1]
  15909. */
  15910. var method = baseRest(function(path, args) {
  15911. return function(object) {
  15912. return baseInvoke(object, path, args);
  15913. };
  15914. });
  15915. /**
  15916. * The opposite of `_.method`; this method creates a function that invokes
  15917. * the method at a given path of `object`. Any additional arguments are
  15918. * provided to the invoked method.
  15919. *
  15920. * @static
  15921. * @memberOf _
  15922. * @since 3.7.0
  15923. * @category Util
  15924. * @param {Object} object The object to query.
  15925. * @param {...*} [args] The arguments to invoke the method with.
  15926. * @returns {Function} Returns the new invoker function.
  15927. * @example
  15928. *
  15929. * var array = _.times(3, _.constant),
  15930. * object = { 'a': array, 'b': array, 'c': array };
  15931. *
  15932. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15933. * // => [2, 0]
  15934. *
  15935. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15936. * // => [2, 0]
  15937. */
  15938. var methodOf = baseRest(function(object, args) {
  15939. return function(path) {
  15940. return baseInvoke(object, path, args);
  15941. };
  15942. });
  15943. /**
  15944. * Adds all own enumerable string keyed function properties of a source
  15945. * object to the destination object. If `object` is a function, then methods
  15946. * are added to its prototype as well.
  15947. *
  15948. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15949. * avoid conflicts caused by modifying the original.
  15950. *
  15951. * @static
  15952. * @since 0.1.0
  15953. * @memberOf _
  15954. * @category Util
  15955. * @param {Function|Object} [object=lodash] The destination object.
  15956. * @param {Object} source The object of functions to add.
  15957. * @param {Object} [options={}] The options object.
  15958. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15959. * @returns {Function|Object} Returns `object`.
  15960. * @example
  15961. *
  15962. * function vowels(string) {
  15963. * return _.filter(string, function(v) {
  15964. * return /[aeiou]/i.test(v);
  15965. * });
  15966. * }
  15967. *
  15968. * _.mixin({ 'vowels': vowels });
  15969. * _.vowels('fred');
  15970. * // => ['e']
  15971. *
  15972. * _('fred').vowels().value();
  15973. * // => ['e']
  15974. *
  15975. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15976. * _('fred').vowels();
  15977. * // => ['e']
  15978. */
  15979. function mixin(object, source, options) {
  15980. var props = keys(source),
  15981. methodNames = baseFunctions(source, props);
  15982. if (options == null &&
  15983. !(isObject(source) && (methodNames.length || !props.length))) {
  15984. options = source;
  15985. source = object;
  15986. object = this;
  15987. methodNames = baseFunctions(source, keys(source));
  15988. }
  15989. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15990. isFunc = isFunction(object);
  15991. arrayEach(methodNames, function(methodName) {
  15992. var func = source[methodName];
  15993. object[methodName] = func;
  15994. if (isFunc) {
  15995. object.prototype[methodName] = function() {
  15996. var chainAll = this.__chain__;
  15997. if (chain || chainAll) {
  15998. var result = object(this.__wrapped__),
  15999. actions = result.__actions__ = copyArray(this.__actions__);
  16000. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16001. result.__chain__ = chainAll;
  16002. return result;
  16003. }
  16004. return func.apply(object, arrayPush([this.value()], arguments));
  16005. };
  16006. }
  16007. });
  16008. return object;
  16009. }
  16010. /**
  16011. * Reverts the `_` variable to its previous value and returns a reference to
  16012. * the `lodash` function.
  16013. *
  16014. * @static
  16015. * @since 0.1.0
  16016. * @memberOf _
  16017. * @category Util
  16018. * @returns {Function} Returns the `lodash` function.
  16019. * @example
  16020. *
  16021. * var lodash = _.noConflict();
  16022. */
  16023. function noConflict() {
  16024. if (root._ === this) {
  16025. root._ = oldDash;
  16026. }
  16027. return this;
  16028. }
  16029. /**
  16030. * This method returns `undefined`.
  16031. *
  16032. * @static
  16033. * @memberOf _
  16034. * @since 2.3.0
  16035. * @category Util
  16036. * @example
  16037. *
  16038. * _.times(2, _.noop);
  16039. * // => [undefined, undefined]
  16040. */
  16041. function noop() {
  16042. // No operation performed.
  16043. }
  16044. /**
  16045. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16046. * the nth argument from the end is returned.
  16047. *
  16048. * @static
  16049. * @memberOf _
  16050. * @since 4.0.0
  16051. * @category Util
  16052. * @param {number} [n=0] The index of the argument to return.
  16053. * @returns {Function} Returns the new pass-thru function.
  16054. * @example
  16055. *
  16056. * var func = _.nthArg(1);
  16057. * func('a', 'b', 'c', 'd');
  16058. * // => 'b'
  16059. *
  16060. * var func = _.nthArg(-2);
  16061. * func('a', 'b', 'c', 'd');
  16062. * // => 'c'
  16063. */
  16064. function nthArg(n) {
  16065. n = toInteger(n);
  16066. return baseRest(function(args) {
  16067. return baseNth(args, n);
  16068. });
  16069. }
  16070. /**
  16071. * Creates a function that invokes `iteratees` with the arguments it receives
  16072. * and returns their results.
  16073. *
  16074. * @static
  16075. * @memberOf _
  16076. * @since 4.0.0
  16077. * @category Util
  16078. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16079. * The iteratees to invoke.
  16080. * @returns {Function} Returns the new function.
  16081. * @example
  16082. *
  16083. * var func = _.over([Math.max, Math.min]);
  16084. *
  16085. * func(1, 2, 3, 4);
  16086. * // => [4, 1]
  16087. */
  16088. var over = createOver(arrayMap);
  16089. /**
  16090. * Creates a function that checks if **all** of the `predicates` return
  16091. * truthy when invoked with the arguments it receives.
  16092. *
  16093. * Following shorthands are possible for providing predicates.
  16094. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16095. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16096. *
  16097. * @static
  16098. * @memberOf _
  16099. * @since 4.0.0
  16100. * @category Util
  16101. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16102. * The predicates to check.
  16103. * @returns {Function} Returns the new function.
  16104. * @example
  16105. *
  16106. * var func = _.overEvery([Boolean, isFinite]);
  16107. *
  16108. * func('1');
  16109. * // => true
  16110. *
  16111. * func(null);
  16112. * // => false
  16113. *
  16114. * func(NaN);
  16115. * // => false
  16116. */
  16117. var overEvery = createOver(arrayEvery);
  16118. /**
  16119. * Creates a function that checks if **any** of the `predicates` return
  16120. * truthy when invoked with the arguments it receives.
  16121. *
  16122. * Following shorthands are possible for providing predicates.
  16123. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16124. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16125. *
  16126. * @static
  16127. * @memberOf _
  16128. * @since 4.0.0
  16129. * @category Util
  16130. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16131. * The predicates to check.
  16132. * @returns {Function} Returns the new function.
  16133. * @example
  16134. *
  16135. * var func = _.overSome([Boolean, isFinite]);
  16136. *
  16137. * func('1');
  16138. * // => true
  16139. *
  16140. * func(null);
  16141. * // => true
  16142. *
  16143. * func(NaN);
  16144. * // => false
  16145. *
  16146. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16147. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16148. */
  16149. var overSome = createOver(arraySome);
  16150. /**
  16151. * Creates a function that returns the value at `path` of a given object.
  16152. *
  16153. * @static
  16154. * @memberOf _
  16155. * @since 2.4.0
  16156. * @category Util
  16157. * @param {Array|string} path The path of the property to get.
  16158. * @returns {Function} Returns the new accessor function.
  16159. * @example
  16160. *
  16161. * var objects = [
  16162. * { 'a': { 'b': 2 } },
  16163. * { 'a': { 'b': 1 } }
  16164. * ];
  16165. *
  16166. * _.map(objects, _.property('a.b'));
  16167. * // => [2, 1]
  16168. *
  16169. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16170. * // => [1, 2]
  16171. */
  16172. function property(path) {
  16173. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16174. }
  16175. /**
  16176. * The opposite of `_.property`; this method creates a function that returns
  16177. * the value at a given path of `object`.
  16178. *
  16179. * @static
  16180. * @memberOf _
  16181. * @since 3.0.0
  16182. * @category Util
  16183. * @param {Object} object The object to query.
  16184. * @returns {Function} Returns the new accessor function.
  16185. * @example
  16186. *
  16187. * var array = [0, 1, 2],
  16188. * object = { 'a': array, 'b': array, 'c': array };
  16189. *
  16190. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16191. * // => [2, 0]
  16192. *
  16193. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16194. * // => [2, 0]
  16195. */
  16196. function propertyOf(object) {
  16197. return function(path) {
  16198. return object == null ? undefined : baseGet(object, path);
  16199. };
  16200. }
  16201. /**
  16202. * Creates an array of numbers (positive and/or negative) progressing from
  16203. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16204. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16205. * it's set to `start` with `start` then set to `0`.
  16206. *
  16207. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16208. * floating-point values which can produce unexpected results.
  16209. *
  16210. * @static
  16211. * @since 0.1.0
  16212. * @memberOf _
  16213. * @category Util
  16214. * @param {number} [start=0] The start of the range.
  16215. * @param {number} end The end of the range.
  16216. * @param {number} [step=1] The value to increment or decrement by.
  16217. * @returns {Array} Returns the range of numbers.
  16218. * @see _.inRange, _.rangeRight
  16219. * @example
  16220. *
  16221. * _.range(4);
  16222. * // => [0, 1, 2, 3]
  16223. *
  16224. * _.range(-4);
  16225. * // => [0, -1, -2, -3]
  16226. *
  16227. * _.range(1, 5);
  16228. * // => [1, 2, 3, 4]
  16229. *
  16230. * _.range(0, 20, 5);
  16231. * // => [0, 5, 10, 15]
  16232. *
  16233. * _.range(0, -4, -1);
  16234. * // => [0, -1, -2, -3]
  16235. *
  16236. * _.range(1, 4, 0);
  16237. * // => [1, 1, 1]
  16238. *
  16239. * _.range(0);
  16240. * // => []
  16241. */
  16242. var range = createRange();
  16243. /**
  16244. * This method is like `_.range` except that it populates values in
  16245. * descending order.
  16246. *
  16247. * @static
  16248. * @memberOf _
  16249. * @since 4.0.0
  16250. * @category Util
  16251. * @param {number} [start=0] The start of the range.
  16252. * @param {number} end The end of the range.
  16253. * @param {number} [step=1] The value to increment or decrement by.
  16254. * @returns {Array} Returns the range of numbers.
  16255. * @see _.inRange, _.range
  16256. * @example
  16257. *
  16258. * _.rangeRight(4);
  16259. * // => [3, 2, 1, 0]
  16260. *
  16261. * _.rangeRight(-4);
  16262. * // => [-3, -2, -1, 0]
  16263. *
  16264. * _.rangeRight(1, 5);
  16265. * // => [4, 3, 2, 1]
  16266. *
  16267. * _.rangeRight(0, 20, 5);
  16268. * // => [15, 10, 5, 0]
  16269. *
  16270. * _.rangeRight(0, -4, -1);
  16271. * // => [-3, -2, -1, 0]
  16272. *
  16273. * _.rangeRight(1, 4, 0);
  16274. * // => [1, 1, 1]
  16275. *
  16276. * _.rangeRight(0);
  16277. * // => []
  16278. */
  16279. var rangeRight = createRange(true);
  16280. /**
  16281. * This method returns a new empty array.
  16282. *
  16283. * @static
  16284. * @memberOf _
  16285. * @since 4.13.0
  16286. * @category Util
  16287. * @returns {Array} Returns the new empty array.
  16288. * @example
  16289. *
  16290. * var arrays = _.times(2, _.stubArray);
  16291. *
  16292. * console.log(arrays);
  16293. * // => [[], []]
  16294. *
  16295. * console.log(arrays[0] === arrays[1]);
  16296. * // => false
  16297. */
  16298. function stubArray() {
  16299. return [];
  16300. }
  16301. /**
  16302. * This method returns `false`.
  16303. *
  16304. * @static
  16305. * @memberOf _
  16306. * @since 4.13.0
  16307. * @category Util
  16308. * @returns {boolean} Returns `false`.
  16309. * @example
  16310. *
  16311. * _.times(2, _.stubFalse);
  16312. * // => [false, false]
  16313. */
  16314. function stubFalse() {
  16315. return false;
  16316. }
  16317. /**
  16318. * This method returns a new empty object.
  16319. *
  16320. * @static
  16321. * @memberOf _
  16322. * @since 4.13.0
  16323. * @category Util
  16324. * @returns {Object} Returns the new empty object.
  16325. * @example
  16326. *
  16327. * var objects = _.times(2, _.stubObject);
  16328. *
  16329. * console.log(objects);
  16330. * // => [{}, {}]
  16331. *
  16332. * console.log(objects[0] === objects[1]);
  16333. * // => false
  16334. */
  16335. function stubObject() {
  16336. return {};
  16337. }
  16338. /**
  16339. * This method returns an empty string.
  16340. *
  16341. * @static
  16342. * @memberOf _
  16343. * @since 4.13.0
  16344. * @category Util
  16345. * @returns {string} Returns the empty string.
  16346. * @example
  16347. *
  16348. * _.times(2, _.stubString);
  16349. * // => ['', '']
  16350. */
  16351. function stubString() {
  16352. return '';
  16353. }
  16354. /**
  16355. * This method returns `true`.
  16356. *
  16357. * @static
  16358. * @memberOf _
  16359. * @since 4.13.0
  16360. * @category Util
  16361. * @returns {boolean} Returns `true`.
  16362. * @example
  16363. *
  16364. * _.times(2, _.stubTrue);
  16365. * // => [true, true]
  16366. */
  16367. function stubTrue() {
  16368. return true;
  16369. }
  16370. /**
  16371. * Invokes the iteratee `n` times, returning an array of the results of
  16372. * each invocation. The iteratee is invoked with one argument; (index).
  16373. *
  16374. * @static
  16375. * @since 0.1.0
  16376. * @memberOf _
  16377. * @category Util
  16378. * @param {number} n The number of times to invoke `iteratee`.
  16379. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16380. * @returns {Array} Returns the array of results.
  16381. * @example
  16382. *
  16383. * _.times(3, String);
  16384. * // => ['0', '1', '2']
  16385. *
  16386. * _.times(4, _.constant(0));
  16387. * // => [0, 0, 0, 0]
  16388. */
  16389. function times(n, iteratee) {
  16390. n = toInteger(n);
  16391. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16392. return [];
  16393. }
  16394. var index = MAX_ARRAY_LENGTH,
  16395. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16396. iteratee = getIteratee(iteratee);
  16397. n -= MAX_ARRAY_LENGTH;
  16398. var result = baseTimes(length, iteratee);
  16399. while (++index < n) {
  16400. iteratee(index);
  16401. }
  16402. return result;
  16403. }
  16404. /**
  16405. * Converts `value` to a property path array.
  16406. *
  16407. * @static
  16408. * @memberOf _
  16409. * @since 4.0.0
  16410. * @category Util
  16411. * @param {*} value The value to convert.
  16412. * @returns {Array} Returns the new property path array.
  16413. * @example
  16414. *
  16415. * _.toPath('a.b.c');
  16416. * // => ['a', 'b', 'c']
  16417. *
  16418. * _.toPath('a[0].b.c');
  16419. * // => ['a', '0', 'b', 'c']
  16420. */
  16421. function toPath(value) {
  16422. if (isArray(value)) {
  16423. return arrayMap(value, toKey);
  16424. }
  16425. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16426. }
  16427. /**
  16428. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16429. *
  16430. * @static
  16431. * @since 0.1.0
  16432. * @memberOf _
  16433. * @category Util
  16434. * @param {string} [prefix=''] The value to prefix the ID with.
  16435. * @returns {string} Returns the unique ID.
  16436. * @example
  16437. *
  16438. * _.uniqueId('contact_');
  16439. * // => 'contact_104'
  16440. *
  16441. * _.uniqueId();
  16442. * // => '105'
  16443. */
  16444. function uniqueId(prefix) {
  16445. var id = ++idCounter;
  16446. return toString(prefix) + id;
  16447. }
  16448. /*------------------------------------------------------------------------*/
  16449. /**
  16450. * Adds two numbers.
  16451. *
  16452. * @static
  16453. * @memberOf _
  16454. * @since 3.4.0
  16455. * @category Math
  16456. * @param {number} augend The first number in an addition.
  16457. * @param {number} addend The second number in an addition.
  16458. * @returns {number} Returns the total.
  16459. * @example
  16460. *
  16461. * _.add(6, 4);
  16462. * // => 10
  16463. */
  16464. var add = createMathOperation(function(augend, addend) {
  16465. return augend + addend;
  16466. }, 0);
  16467. /**
  16468. * Computes `number` rounded up to `precision`.
  16469. *
  16470. * @static
  16471. * @memberOf _
  16472. * @since 3.10.0
  16473. * @category Math
  16474. * @param {number} number The number to round up.
  16475. * @param {number} [precision=0] The precision to round up to.
  16476. * @returns {number} Returns the rounded up number.
  16477. * @example
  16478. *
  16479. * _.ceil(4.006);
  16480. * // => 5
  16481. *
  16482. * _.ceil(6.004, 2);
  16483. * // => 6.01
  16484. *
  16485. * _.ceil(6040, -2);
  16486. * // => 6100
  16487. */
  16488. var ceil = createRound('ceil');
  16489. /**
  16490. * Divide two numbers.
  16491. *
  16492. * @static
  16493. * @memberOf _
  16494. * @since 4.7.0
  16495. * @category Math
  16496. * @param {number} dividend The first number in a division.
  16497. * @param {number} divisor The second number in a division.
  16498. * @returns {number} Returns the quotient.
  16499. * @example
  16500. *
  16501. * _.divide(6, 4);
  16502. * // => 1.5
  16503. */
  16504. var divide = createMathOperation(function(dividend, divisor) {
  16505. return dividend / divisor;
  16506. }, 1);
  16507. /**
  16508. * Computes `number` rounded down to `precision`.
  16509. *
  16510. * @static
  16511. * @memberOf _
  16512. * @since 3.10.0
  16513. * @category Math
  16514. * @param {number} number The number to round down.
  16515. * @param {number} [precision=0] The precision to round down to.
  16516. * @returns {number} Returns the rounded down number.
  16517. * @example
  16518. *
  16519. * _.floor(4.006);
  16520. * // => 4
  16521. *
  16522. * _.floor(0.046, 2);
  16523. * // => 0.04
  16524. *
  16525. * _.floor(4060, -2);
  16526. * // => 4000
  16527. */
  16528. var floor = createRound('floor');
  16529. /**
  16530. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16531. * `undefined` is returned.
  16532. *
  16533. * @static
  16534. * @since 0.1.0
  16535. * @memberOf _
  16536. * @category Math
  16537. * @param {Array} array The array to iterate over.
  16538. * @returns {*} Returns the maximum value.
  16539. * @example
  16540. *
  16541. * _.max([4, 2, 8, 6]);
  16542. * // => 8
  16543. *
  16544. * _.max([]);
  16545. * // => undefined
  16546. */
  16547. function max(array) {
  16548. return (array && array.length)
  16549. ? baseExtremum(array, identity, baseGt)
  16550. : undefined;
  16551. }
  16552. /**
  16553. * This method is like `_.max` except that it accepts `iteratee` which is
  16554. * invoked for each element in `array` to generate the criterion by which
  16555. * the value is ranked. The iteratee is invoked with one argument: (value).
  16556. *
  16557. * @static
  16558. * @memberOf _
  16559. * @since 4.0.0
  16560. * @category Math
  16561. * @param {Array} array The array to iterate over.
  16562. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16563. * @returns {*} Returns the maximum value.
  16564. * @example
  16565. *
  16566. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16567. *
  16568. * _.maxBy(objects, function(o) { return o.n; });
  16569. * // => { 'n': 2 }
  16570. *
  16571. * // The `_.property` iteratee shorthand.
  16572. * _.maxBy(objects, 'n');
  16573. * // => { 'n': 2 }
  16574. */
  16575. function maxBy(array, iteratee) {
  16576. return (array && array.length)
  16577. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16578. : undefined;
  16579. }
  16580. /**
  16581. * Computes the mean of the values in `array`.
  16582. *
  16583. * @static
  16584. * @memberOf _
  16585. * @since 4.0.0
  16586. * @category Math
  16587. * @param {Array} array The array to iterate over.
  16588. * @returns {number} Returns the mean.
  16589. * @example
  16590. *
  16591. * _.mean([4, 2, 8, 6]);
  16592. * // => 5
  16593. */
  16594. function mean(array) {
  16595. return baseMean(array, identity);
  16596. }
  16597. /**
  16598. * This method is like `_.mean` except that it accepts `iteratee` which is
  16599. * invoked for each element in `array` to generate the value to be averaged.
  16600. * The iteratee is invoked with one argument: (value).
  16601. *
  16602. * @static
  16603. * @memberOf _
  16604. * @since 4.7.0
  16605. * @category Math
  16606. * @param {Array} array The array to iterate over.
  16607. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16608. * @returns {number} Returns the mean.
  16609. * @example
  16610. *
  16611. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16612. *
  16613. * _.meanBy(objects, function(o) { return o.n; });
  16614. * // => 5
  16615. *
  16616. * // The `_.property` iteratee shorthand.
  16617. * _.meanBy(objects, 'n');
  16618. * // => 5
  16619. */
  16620. function meanBy(array, iteratee) {
  16621. return baseMean(array, getIteratee(iteratee, 2));
  16622. }
  16623. /**
  16624. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16625. * `undefined` is returned.
  16626. *
  16627. * @static
  16628. * @since 0.1.0
  16629. * @memberOf _
  16630. * @category Math
  16631. * @param {Array} array The array to iterate over.
  16632. * @returns {*} Returns the minimum value.
  16633. * @example
  16634. *
  16635. * _.min([4, 2, 8, 6]);
  16636. * // => 2
  16637. *
  16638. * _.min([]);
  16639. * // => undefined
  16640. */
  16641. function min(array) {
  16642. return (array && array.length)
  16643. ? baseExtremum(array, identity, baseLt)
  16644. : undefined;
  16645. }
  16646. /**
  16647. * This method is like `_.min` except that it accepts `iteratee` which is
  16648. * invoked for each element in `array` to generate the criterion by which
  16649. * the value is ranked. The iteratee is invoked with one argument: (value).
  16650. *
  16651. * @static
  16652. * @memberOf _
  16653. * @since 4.0.0
  16654. * @category Math
  16655. * @param {Array} array The array to iterate over.
  16656. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16657. * @returns {*} Returns the minimum value.
  16658. * @example
  16659. *
  16660. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16661. *
  16662. * _.minBy(objects, function(o) { return o.n; });
  16663. * // => { 'n': 1 }
  16664. *
  16665. * // The `_.property` iteratee shorthand.
  16666. * _.minBy(objects, 'n');
  16667. * // => { 'n': 1 }
  16668. */
  16669. function minBy(array, iteratee) {
  16670. return (array && array.length)
  16671. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16672. : undefined;
  16673. }
  16674. /**
  16675. * Multiply two numbers.
  16676. *
  16677. * @static
  16678. * @memberOf _
  16679. * @since 4.7.0
  16680. * @category Math
  16681. * @param {number} multiplier The first number in a multiplication.
  16682. * @param {number} multiplicand The second number in a multiplication.
  16683. * @returns {number} Returns the product.
  16684. * @example
  16685. *
  16686. * _.multiply(6, 4);
  16687. * // => 24
  16688. */
  16689. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16690. return multiplier * multiplicand;
  16691. }, 1);
  16692. /**
  16693. * Computes `number` rounded to `precision`.
  16694. *
  16695. * @static
  16696. * @memberOf _
  16697. * @since 3.10.0
  16698. * @category Math
  16699. * @param {number} number The number to round.
  16700. * @param {number} [precision=0] The precision to round to.
  16701. * @returns {number} Returns the rounded number.
  16702. * @example
  16703. *
  16704. * _.round(4.006);
  16705. * // => 4
  16706. *
  16707. * _.round(4.006, 2);
  16708. * // => 4.01
  16709. *
  16710. * _.round(4060, -2);
  16711. * // => 4100
  16712. */
  16713. var round = createRound('round');
  16714. /**
  16715. * Subtract two numbers.
  16716. *
  16717. * @static
  16718. * @memberOf _
  16719. * @since 4.0.0
  16720. * @category Math
  16721. * @param {number} minuend The first number in a subtraction.
  16722. * @param {number} subtrahend The second number in a subtraction.
  16723. * @returns {number} Returns the difference.
  16724. * @example
  16725. *
  16726. * _.subtract(6, 4);
  16727. * // => 2
  16728. */
  16729. var subtract = createMathOperation(function(minuend, subtrahend) {
  16730. return minuend - subtrahend;
  16731. }, 0);
  16732. /**
  16733. * Computes the sum of the values in `array`.
  16734. *
  16735. * @static
  16736. * @memberOf _
  16737. * @since 3.4.0
  16738. * @category Math
  16739. * @param {Array} array The array to iterate over.
  16740. * @returns {number} Returns the sum.
  16741. * @example
  16742. *
  16743. * _.sum([4, 2, 8, 6]);
  16744. * // => 20
  16745. */
  16746. function sum(array) {
  16747. return (array && array.length)
  16748. ? baseSum(array, identity)
  16749. : 0;
  16750. }
  16751. /**
  16752. * This method is like `_.sum` except that it accepts `iteratee` which is
  16753. * invoked for each element in `array` to generate the value to be summed.
  16754. * The iteratee is invoked with one argument: (value).
  16755. *
  16756. * @static
  16757. * @memberOf _
  16758. * @since 4.0.0
  16759. * @category Math
  16760. * @param {Array} array The array to iterate over.
  16761. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16762. * @returns {number} Returns the sum.
  16763. * @example
  16764. *
  16765. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16766. *
  16767. * _.sumBy(objects, function(o) { return o.n; });
  16768. * // => 20
  16769. *
  16770. * // The `_.property` iteratee shorthand.
  16771. * _.sumBy(objects, 'n');
  16772. * // => 20
  16773. */
  16774. function sumBy(array, iteratee) {
  16775. return (array && array.length)
  16776. ? baseSum(array, getIteratee(iteratee, 2))
  16777. : 0;
  16778. }
  16779. /*------------------------------------------------------------------------*/
  16780. // Add methods that return wrapped values in chain sequences.
  16781. lodash.after = after;
  16782. lodash.ary = ary;
  16783. lodash.assign = assign;
  16784. lodash.assignIn = assignIn;
  16785. lodash.assignInWith = assignInWith;
  16786. lodash.assignWith = assignWith;
  16787. lodash.at = at;
  16788. lodash.before = before;
  16789. lodash.bind = bind;
  16790. lodash.bindAll = bindAll;
  16791. lodash.bindKey = bindKey;
  16792. lodash.castArray = castArray;
  16793. lodash.chain = chain;
  16794. lodash.chunk = chunk;
  16795. lodash.compact = compact;
  16796. lodash.concat = concat;
  16797. lodash.cond = cond;
  16798. lodash.conforms = conforms;
  16799. lodash.constant = constant;
  16800. lodash.countBy = countBy;
  16801. lodash.create = create;
  16802. lodash.curry = curry;
  16803. lodash.curryRight = curryRight;
  16804. lodash.debounce = debounce;
  16805. lodash.defaults = defaults;
  16806. lodash.defaultsDeep = defaultsDeep;
  16807. lodash.defer = defer;
  16808. lodash.delay = delay;
  16809. lodash.difference = difference;
  16810. lodash.differenceBy = differenceBy;
  16811. lodash.differenceWith = differenceWith;
  16812. lodash.drop = drop;
  16813. lodash.dropRight = dropRight;
  16814. lodash.dropRightWhile = dropRightWhile;
  16815. lodash.dropWhile = dropWhile;
  16816. lodash.fill = fill;
  16817. lodash.filter = filter;
  16818. lodash.flatMap = flatMap;
  16819. lodash.flatMapDeep = flatMapDeep;
  16820. lodash.flatMapDepth = flatMapDepth;
  16821. lodash.flatten = flatten;
  16822. lodash.flattenDeep = flattenDeep;
  16823. lodash.flattenDepth = flattenDepth;
  16824. lodash.flip = flip;
  16825. lodash.flow = flow;
  16826. lodash.flowRight = flowRight;
  16827. lodash.fromPairs = fromPairs;
  16828. lodash.functions = functions;
  16829. lodash.functionsIn = functionsIn;
  16830. lodash.groupBy = groupBy;
  16831. lodash.initial = initial;
  16832. lodash.intersection = intersection;
  16833. lodash.intersectionBy = intersectionBy;
  16834. lodash.intersectionWith = intersectionWith;
  16835. lodash.invert = invert;
  16836. lodash.invertBy = invertBy;
  16837. lodash.invokeMap = invokeMap;
  16838. lodash.iteratee = iteratee;
  16839. lodash.keyBy = keyBy;
  16840. lodash.keys = keys;
  16841. lodash.keysIn = keysIn;
  16842. lodash.map = map;
  16843. lodash.mapKeys = mapKeys;
  16844. lodash.mapValues = mapValues;
  16845. lodash.matches = matches;
  16846. lodash.matchesProperty = matchesProperty;
  16847. lodash.memoize = memoize;
  16848. lodash.merge = merge;
  16849. lodash.mergeWith = mergeWith;
  16850. lodash.method = method;
  16851. lodash.methodOf = methodOf;
  16852. lodash.mixin = mixin;
  16853. lodash.negate = negate;
  16854. lodash.nthArg = nthArg;
  16855. lodash.omit = omit;
  16856. lodash.omitBy = omitBy;
  16857. lodash.once = once;
  16858. lodash.orderBy = orderBy;
  16859. lodash.over = over;
  16860. lodash.overArgs = overArgs;
  16861. lodash.overEvery = overEvery;
  16862. lodash.overSome = overSome;
  16863. lodash.partial = partial;
  16864. lodash.partialRight = partialRight;
  16865. lodash.partition = partition;
  16866. lodash.pick = pick;
  16867. lodash.pickBy = pickBy;
  16868. lodash.property = property;
  16869. lodash.propertyOf = propertyOf;
  16870. lodash.pull = pull;
  16871. lodash.pullAll = pullAll;
  16872. lodash.pullAllBy = pullAllBy;
  16873. lodash.pullAllWith = pullAllWith;
  16874. lodash.pullAt = pullAt;
  16875. lodash.range = range;
  16876. lodash.rangeRight = rangeRight;
  16877. lodash.rearg = rearg;
  16878. lodash.reject = reject;
  16879. lodash.remove = remove;
  16880. lodash.rest = rest;
  16881. lodash.reverse = reverse;
  16882. lodash.sampleSize = sampleSize;
  16883. lodash.set = set;
  16884. lodash.setWith = setWith;
  16885. lodash.shuffle = shuffle;
  16886. lodash.slice = slice;
  16887. lodash.sortBy = sortBy;
  16888. lodash.sortedUniq = sortedUniq;
  16889. lodash.sortedUniqBy = sortedUniqBy;
  16890. lodash.split = split;
  16891. lodash.spread = spread;
  16892. lodash.tail = tail;
  16893. lodash.take = take;
  16894. lodash.takeRight = takeRight;
  16895. lodash.takeRightWhile = takeRightWhile;
  16896. lodash.takeWhile = takeWhile;
  16897. lodash.tap = tap;
  16898. lodash.throttle = throttle;
  16899. lodash.thru = thru;
  16900. lodash.toArray = toArray;
  16901. lodash.toPairs = toPairs;
  16902. lodash.toPairsIn = toPairsIn;
  16903. lodash.toPath = toPath;
  16904. lodash.toPlainObject = toPlainObject;
  16905. lodash.transform = transform;
  16906. lodash.unary = unary;
  16907. lodash.union = union;
  16908. lodash.unionBy = unionBy;
  16909. lodash.unionWith = unionWith;
  16910. lodash.uniq = uniq;
  16911. lodash.uniqBy = uniqBy;
  16912. lodash.uniqWith = uniqWith;
  16913. lodash.unset = unset;
  16914. lodash.unzip = unzip;
  16915. lodash.unzipWith = unzipWith;
  16916. lodash.update = update;
  16917. lodash.updateWith = updateWith;
  16918. lodash.values = values;
  16919. lodash.valuesIn = valuesIn;
  16920. lodash.without = without;
  16921. lodash.words = words;
  16922. lodash.wrap = wrap;
  16923. lodash.xor = xor;
  16924. lodash.xorBy = xorBy;
  16925. lodash.xorWith = xorWith;
  16926. lodash.zip = zip;
  16927. lodash.zipObject = zipObject;
  16928. lodash.zipObjectDeep = zipObjectDeep;
  16929. lodash.zipWith = zipWith;
  16930. // Add aliases.
  16931. lodash.entries = toPairs;
  16932. lodash.entriesIn = toPairsIn;
  16933. lodash.extend = assignIn;
  16934. lodash.extendWith = assignInWith;
  16935. // Add methods to `lodash.prototype`.
  16936. mixin(lodash, lodash);
  16937. /*------------------------------------------------------------------------*/
  16938. // Add methods that return unwrapped values in chain sequences.
  16939. lodash.add = add;
  16940. lodash.attempt = attempt;
  16941. lodash.camelCase = camelCase;
  16942. lodash.capitalize = capitalize;
  16943. lodash.ceil = ceil;
  16944. lodash.clamp = clamp;
  16945. lodash.clone = clone;
  16946. lodash.cloneDeep = cloneDeep;
  16947. lodash.cloneDeepWith = cloneDeepWith;
  16948. lodash.cloneWith = cloneWith;
  16949. lodash.conformsTo = conformsTo;
  16950. lodash.deburr = deburr;
  16951. lodash.defaultTo = defaultTo;
  16952. lodash.divide = divide;
  16953. lodash.endsWith = endsWith;
  16954. lodash.eq = eq;
  16955. lodash.escape = escape;
  16956. lodash.escapeRegExp = escapeRegExp;
  16957. lodash.every = every;
  16958. lodash.find = find;
  16959. lodash.findIndex = findIndex;
  16960. lodash.findKey = findKey;
  16961. lodash.findLast = findLast;
  16962. lodash.findLastIndex = findLastIndex;
  16963. lodash.findLastKey = findLastKey;
  16964. lodash.floor = floor;
  16965. lodash.forEach = forEach;
  16966. lodash.forEachRight = forEachRight;
  16967. lodash.forIn = forIn;
  16968. lodash.forInRight = forInRight;
  16969. lodash.forOwn = forOwn;
  16970. lodash.forOwnRight = forOwnRight;
  16971. lodash.get = get;
  16972. lodash.gt = gt;
  16973. lodash.gte = gte;
  16974. lodash.has = has;
  16975. lodash.hasIn = hasIn;
  16976. lodash.head = head;
  16977. lodash.identity = identity;
  16978. lodash.includes = includes;
  16979. lodash.indexOf = indexOf;
  16980. lodash.inRange = inRange;
  16981. lodash.invoke = invoke;
  16982. lodash.isArguments = isArguments;
  16983. lodash.isArray = isArray;
  16984. lodash.isArrayBuffer = isArrayBuffer;
  16985. lodash.isArrayLike = isArrayLike;
  16986. lodash.isArrayLikeObject = isArrayLikeObject;
  16987. lodash.isBoolean = isBoolean;
  16988. lodash.isBuffer = isBuffer;
  16989. lodash.isDate = isDate;
  16990. lodash.isElement = isElement;
  16991. lodash.isEmpty = isEmpty;
  16992. lodash.isEqual = isEqual;
  16993. lodash.isEqualWith = isEqualWith;
  16994. lodash.isError = isError;
  16995. lodash.isFinite = isFinite;
  16996. lodash.isFunction = isFunction;
  16997. lodash.isInteger = isInteger;
  16998. lodash.isLength = isLength;
  16999. lodash.isMap = isMap;
  17000. lodash.isMatch = isMatch;
  17001. lodash.isMatchWith = isMatchWith;
  17002. lodash.isNaN = isNaN;
  17003. lodash.isNative = isNative;
  17004. lodash.isNil = isNil;
  17005. lodash.isNull = isNull;
  17006. lodash.isNumber = isNumber;
  17007. lodash.isObject = isObject;
  17008. lodash.isObjectLike = isObjectLike;
  17009. lodash.isPlainObject = isPlainObject;
  17010. lodash.isRegExp = isRegExp;
  17011. lodash.isSafeInteger = isSafeInteger;
  17012. lodash.isSet = isSet;
  17013. lodash.isString = isString;
  17014. lodash.isSymbol = isSymbol;
  17015. lodash.isTypedArray = isTypedArray;
  17016. lodash.isUndefined = isUndefined;
  17017. lodash.isWeakMap = isWeakMap;
  17018. lodash.isWeakSet = isWeakSet;
  17019. lodash.join = join;
  17020. lodash.kebabCase = kebabCase;
  17021. lodash.last = last;
  17022. lodash.lastIndexOf = lastIndexOf;
  17023. lodash.lowerCase = lowerCase;
  17024. lodash.lowerFirst = lowerFirst;
  17025. lodash.lt = lt;
  17026. lodash.lte = lte;
  17027. lodash.max = max;
  17028. lodash.maxBy = maxBy;
  17029. lodash.mean = mean;
  17030. lodash.meanBy = meanBy;
  17031. lodash.min = min;
  17032. lodash.minBy = minBy;
  17033. lodash.stubArray = stubArray;
  17034. lodash.stubFalse = stubFalse;
  17035. lodash.stubObject = stubObject;
  17036. lodash.stubString = stubString;
  17037. lodash.stubTrue = stubTrue;
  17038. lodash.multiply = multiply;
  17039. lodash.nth = nth;
  17040. lodash.noConflict = noConflict;
  17041. lodash.noop = noop;
  17042. lodash.now = now;
  17043. lodash.pad = pad;
  17044. lodash.padEnd = padEnd;
  17045. lodash.padStart = padStart;
  17046. lodash.parseInt = parseInt;
  17047. lodash.random = random;
  17048. lodash.reduce = reduce;
  17049. lodash.reduceRight = reduceRight;
  17050. lodash.repeat = repeat;
  17051. lodash.replace = replace;
  17052. lodash.result = result;
  17053. lodash.round = round;
  17054. lodash.runInContext = runInContext;
  17055. lodash.sample = sample;
  17056. lodash.size = size;
  17057. lodash.snakeCase = snakeCase;
  17058. lodash.some = some;
  17059. lodash.sortedIndex = sortedIndex;
  17060. lodash.sortedIndexBy = sortedIndexBy;
  17061. lodash.sortedIndexOf = sortedIndexOf;
  17062. lodash.sortedLastIndex = sortedLastIndex;
  17063. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17064. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17065. lodash.startCase = startCase;
  17066. lodash.startsWith = startsWith;
  17067. lodash.subtract = subtract;
  17068. lodash.sum = sum;
  17069. lodash.sumBy = sumBy;
  17070. lodash.template = template;
  17071. lodash.times = times;
  17072. lodash.toFinite = toFinite;
  17073. lodash.toInteger = toInteger;
  17074. lodash.toLength = toLength;
  17075. lodash.toLower = toLower;
  17076. lodash.toNumber = toNumber;
  17077. lodash.toSafeInteger = toSafeInteger;
  17078. lodash.toString = toString;
  17079. lodash.toUpper = toUpper;
  17080. lodash.trim = trim;
  17081. lodash.trimEnd = trimEnd;
  17082. lodash.trimStart = trimStart;
  17083. lodash.truncate = truncate;
  17084. lodash.unescape = unescape;
  17085. lodash.uniqueId = uniqueId;
  17086. lodash.upperCase = upperCase;
  17087. lodash.upperFirst = upperFirst;
  17088. // Add aliases.
  17089. lodash.each = forEach;
  17090. lodash.eachRight = forEachRight;
  17091. lodash.first = head;
  17092. mixin(lodash, (function() {
  17093. var source = {};
  17094. baseForOwn(lodash, function(func, methodName) {
  17095. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17096. source[methodName] = func;
  17097. }
  17098. });
  17099. return source;
  17100. }()), { 'chain': false });
  17101. /*------------------------------------------------------------------------*/
  17102. /**
  17103. * The semantic version number.
  17104. *
  17105. * @static
  17106. * @memberOf _
  17107. * @type {string}
  17108. */
  17109. lodash.VERSION = VERSION;
  17110. // Assign default placeholders.
  17111. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17112. lodash[methodName].placeholder = lodash;
  17113. });
  17114. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17115. arrayEach(['drop', 'take'], function(methodName, index) {
  17116. LazyWrapper.prototype[methodName] = function(n) {
  17117. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17118. var result = (this.__filtered__ && !index)
  17119. ? new LazyWrapper(this)
  17120. : this.clone();
  17121. if (result.__filtered__) {
  17122. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17123. } else {
  17124. result.__views__.push({
  17125. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17126. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17127. });
  17128. }
  17129. return result;
  17130. };
  17131. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17132. return this.reverse()[methodName](n).reverse();
  17133. };
  17134. });
  17135. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17136. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17137. var type = index + 1,
  17138. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17139. LazyWrapper.prototype[methodName] = function(iteratee) {
  17140. var result = this.clone();
  17141. result.__iteratees__.push({
  17142. 'iteratee': getIteratee(iteratee, 3),
  17143. 'type': type
  17144. });
  17145. result.__filtered__ = result.__filtered__ || isFilter;
  17146. return result;
  17147. };
  17148. });
  17149. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17150. arrayEach(['head', 'last'], function(methodName, index) {
  17151. var takeName = 'take' + (index ? 'Right' : '');
  17152. LazyWrapper.prototype[methodName] = function() {
  17153. return this[takeName](1).value()[0];
  17154. };
  17155. });
  17156. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17157. arrayEach(['initial', 'tail'], function(methodName, index) {
  17158. var dropName = 'drop' + (index ? '' : 'Right');
  17159. LazyWrapper.prototype[methodName] = function() {
  17160. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17161. };
  17162. });
  17163. LazyWrapper.prototype.compact = function() {
  17164. return this.filter(identity);
  17165. };
  17166. LazyWrapper.prototype.find = function(predicate) {
  17167. return this.filter(predicate).head();
  17168. };
  17169. LazyWrapper.prototype.findLast = function(predicate) {
  17170. return this.reverse().find(predicate);
  17171. };
  17172. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17173. if (typeof path == 'function') {
  17174. return new LazyWrapper(this);
  17175. }
  17176. return this.map(function(value) {
  17177. return baseInvoke(value, path, args);
  17178. });
  17179. });
  17180. LazyWrapper.prototype.reject = function(predicate) {
  17181. return this.filter(negate(getIteratee(predicate)));
  17182. };
  17183. LazyWrapper.prototype.slice = function(start, end) {
  17184. start = toInteger(start);
  17185. var result = this;
  17186. if (result.__filtered__ && (start > 0 || end < 0)) {
  17187. return new LazyWrapper(result);
  17188. }
  17189. if (start < 0) {
  17190. result = result.takeRight(-start);
  17191. } else if (start) {
  17192. result = result.drop(start);
  17193. }
  17194. if (end !== undefined) {
  17195. end = toInteger(end);
  17196. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17197. }
  17198. return result;
  17199. };
  17200. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17201. return this.reverse().takeWhile(predicate).reverse();
  17202. };
  17203. LazyWrapper.prototype.toArray = function() {
  17204. return this.take(MAX_ARRAY_LENGTH);
  17205. };
  17206. // Add `LazyWrapper` methods to `lodash.prototype`.
  17207. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17208. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17209. isTaker = /^(?:head|last)$/.test(methodName),
  17210. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17211. retUnwrapped = isTaker || /^find/.test(methodName);
  17212. if (!lodashFunc) {
  17213. return;
  17214. }
  17215. lodash.prototype[methodName] = function() {
  17216. var value = this.__wrapped__,
  17217. args = isTaker ? [1] : arguments,
  17218. isLazy = value instanceof LazyWrapper,
  17219. iteratee = args[0],
  17220. useLazy = isLazy || isArray(value);
  17221. var interceptor = function(value) {
  17222. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17223. return (isTaker && chainAll) ? result[0] : result;
  17224. };
  17225. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17226. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17227. isLazy = useLazy = false;
  17228. }
  17229. var chainAll = this.__chain__,
  17230. isHybrid = !!this.__actions__.length,
  17231. isUnwrapped = retUnwrapped && !chainAll,
  17232. onlyLazy = isLazy && !isHybrid;
  17233. if (!retUnwrapped && useLazy) {
  17234. value = onlyLazy ? value : new LazyWrapper(this);
  17235. var result = func.apply(value, args);
  17236. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17237. return new LodashWrapper(result, chainAll);
  17238. }
  17239. if (isUnwrapped && onlyLazy) {
  17240. return func.apply(this, args);
  17241. }
  17242. result = this.thru(interceptor);
  17243. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17244. };
  17245. });
  17246. // Add `Array` methods to `lodash.prototype`.
  17247. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17248. var func = arrayProto[methodName],
  17249. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17250. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17251. lodash.prototype[methodName] = function() {
  17252. var args = arguments;
  17253. if (retUnwrapped && !this.__chain__) {
  17254. var value = this.value();
  17255. return func.apply(isArray(value) ? value : [], args);
  17256. }
  17257. return this[chainName](function(value) {
  17258. return func.apply(isArray(value) ? value : [], args);
  17259. });
  17260. };
  17261. });
  17262. // Map minified method names to their real names.
  17263. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17264. var lodashFunc = lodash[methodName];
  17265. if (lodashFunc) {
  17266. var key = lodashFunc.name + '';
  17267. if (!hasOwnProperty.call(realNames, key)) {
  17268. realNames[key] = [];
  17269. }
  17270. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17271. }
  17272. });
  17273. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17274. 'name': 'wrapper',
  17275. 'func': undefined
  17276. }];
  17277. // Add methods to `LazyWrapper`.
  17278. LazyWrapper.prototype.clone = lazyClone;
  17279. LazyWrapper.prototype.reverse = lazyReverse;
  17280. LazyWrapper.prototype.value = lazyValue;
  17281. // Add chain sequence methods to the `lodash` wrapper.
  17282. lodash.prototype.at = wrapperAt;
  17283. lodash.prototype.chain = wrapperChain;
  17284. lodash.prototype.commit = wrapperCommit;
  17285. lodash.prototype.next = wrapperNext;
  17286. lodash.prototype.plant = wrapperPlant;
  17287. lodash.prototype.reverse = wrapperReverse;
  17288. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17289. // Add lazy aliases.
  17290. lodash.prototype.first = lodash.prototype.head;
  17291. if (symIterator) {
  17292. lodash.prototype[symIterator] = wrapperToIterator;
  17293. }
  17294. return lodash;
  17295. });
  17296. /*--------------------------------------------------------------------------*/
  17297. // Export lodash.
  17298. var _ = runInContext();
  17299. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17300. if (true) {
  17301. // Expose Lodash on the global object to prevent errors when Lodash is
  17302. // loaded by a script tag in the presence of an AMD loader.
  17303. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17304. // Use `_.noConflict` to remove Lodash from the global object.
  17305. root._ = _;
  17306. // Define as an anonymous module so, through path mapping, it can be
  17307. // referenced as the "underscore" module.
  17308. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17309. return _;
  17310. }).call(exports, __webpack_require__, exports, module),
  17311. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17312. }
  17313. // Check for `exports` after `define` in case a build optimizer adds it.
  17314. else {}
  17315. }.call(this));
  17316. /***/ }),
  17317. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17318. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17319. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17320. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17322. "use strict";
  17323. __webpack_require__.r(__webpack_exports__);
  17324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17325. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17326. /* harmony export */ });
  17327. /* 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");
  17328. /* 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__);
  17329. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17330. var options = {};
  17331. options.insert = "head";
  17332. options.singleton = false;
  17333. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17334. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17335. /***/ }),
  17336. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17337. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17338. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17339. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17340. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17341. "use strict";
  17342. __webpack_require__.r(__webpack_exports__);
  17343. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17344. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17345. /* harmony export */ });
  17346. /* 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");
  17347. /* 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__);
  17348. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17349. var options = {};
  17350. options.insert = "head";
  17351. options.singleton = false;
  17352. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17353. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17354. /***/ }),
  17355. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17356. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17357. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17358. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17359. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17360. "use strict";
  17361. __webpack_require__.r(__webpack_exports__);
  17362. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17363. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17364. /* harmony export */ });
  17365. /* 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");
  17366. /* 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__);
  17367. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17368. var options = {};
  17369. options.insert = "head";
  17370. options.singleton = false;
  17371. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17372. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17373. /***/ }),
  17374. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17375. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17376. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17377. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17378. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17379. "use strict";
  17380. __webpack_require__.r(__webpack_exports__);
  17381. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17382. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17383. /* harmony export */ });
  17384. /* 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");
  17385. /* 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__);
  17386. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17387. var options = {};
  17388. options.insert = "head";
  17389. options.singleton = false;
  17390. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17391. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17392. /***/ }),
  17393. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17394. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17395. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17396. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17397. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17398. "use strict";
  17399. __webpack_require__.r(__webpack_exports__);
  17400. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17401. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17402. /* harmony export */ });
  17403. /* 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");
  17404. /* 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__);
  17405. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17406. var options = {};
  17407. options.insert = "head";
  17408. options.singleton = false;
  17409. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17410. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17411. /***/ }),
  17412. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17413. /*!******************************************************!*\
  17414. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17415. \******************************************************/
  17416. /***/ ((__unused_webpack_module, exports) => {
  17417. "use strict";
  17418. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17419. // runtime helper for setting properties on components
  17420. // in a tree-shakable way
  17421. exports["default"] = (sfc, props) => {
  17422. const target = sfc.__vccOpts || sfc;
  17423. for (const [key, val] of props) {
  17424. target[key] = val;
  17425. }
  17426. return target;
  17427. };
  17428. /***/ }),
  17429. /***/ "./resources/js/components/AppButtonLink.vue":
  17430. /*!***************************************************!*\
  17431. !*** ./resources/js/components/AppButtonLink.vue ***!
  17432. \***************************************************/
  17433. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17434. "use strict";
  17435. __webpack_require__.r(__webpack_exports__);
  17436. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17437. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17438. /* harmony export */ });
  17439. /* 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");
  17440. /* 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");
  17441. /* 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");
  17442. ;
  17443. 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"]])
  17444. /* hot reload */
  17445. if (false) {}
  17446. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17447. /***/ }),
  17448. /***/ "./resources/js/components/AppFooter.vue":
  17449. /*!***********************************************!*\
  17450. !*** ./resources/js/components/AppFooter.vue ***!
  17451. \***********************************************/
  17452. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17453. "use strict";
  17454. __webpack_require__.r(__webpack_exports__);
  17455. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17456. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17457. /* harmony export */ });
  17458. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17459. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17460. /* 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");
  17461. const script = {}
  17462. ;
  17463. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17464. /* hot reload */
  17465. if (false) {}
  17466. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17467. /***/ }),
  17468. /***/ "./resources/js/components/AppMessage.vue":
  17469. /*!************************************************!*\
  17470. !*** ./resources/js/components/AppMessage.vue ***!
  17471. \************************************************/
  17472. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17473. "use strict";
  17474. __webpack_require__.r(__webpack_exports__);
  17475. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17476. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17477. /* harmony export */ });
  17478. /* 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");
  17479. /* 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");
  17480. /* 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");
  17481. ;
  17482. 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"]])
  17483. /* hot reload */
  17484. if (false) {}
  17485. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17486. /***/ }),
  17487. /***/ "./resources/js/components/AppPagination.vue":
  17488. /*!***************************************************!*\
  17489. !*** ./resources/js/components/AppPagination.vue ***!
  17490. \***************************************************/
  17491. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17492. "use strict";
  17493. __webpack_require__.r(__webpack_exports__);
  17494. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17495. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17496. /* harmony export */ });
  17497. /* 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");
  17498. /* 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");
  17499. /* 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");
  17500. ;
  17501. 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"]])
  17502. /* hot reload */
  17503. if (false) {}
  17504. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17505. /***/ }),
  17506. /***/ "./resources/js/components/AppSidebar.vue":
  17507. /*!************************************************!*\
  17508. !*** ./resources/js/components/AppSidebar.vue ***!
  17509. \************************************************/
  17510. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17511. "use strict";
  17512. __webpack_require__.r(__webpack_exports__);
  17513. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17514. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17515. /* harmony export */ });
  17516. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17517. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17518. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17519. /* 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");
  17520. ;
  17521. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17522. /* hot reload */
  17523. if (false) {}
  17524. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17525. /***/ }),
  17526. /***/ "./resources/js/components/AppSubSidebar.vue":
  17527. /*!***************************************************!*\
  17528. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17529. \***************************************************/
  17530. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17531. "use strict";
  17532. __webpack_require__.r(__webpack_exports__);
  17533. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17534. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17535. /* harmony export */ });
  17536. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17537. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17538. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17539. /* 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");
  17540. ;
  17541. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17542. /* hot reload */
  17543. if (false) {}
  17544. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17545. /***/ }),
  17546. /***/ "./resources/js/components/AppTopBar.vue":
  17547. /*!***********************************************!*\
  17548. !*** ./resources/js/components/AppTopBar.vue ***!
  17549. \***********************************************/
  17550. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17551. "use strict";
  17552. __webpack_require__.r(__webpack_exports__);
  17553. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17554. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17555. /* harmony export */ });
  17556. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17557. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17558. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17559. /* 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");
  17560. ;
  17561. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17562. /* hot reload */
  17563. if (false) {}
  17564. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17565. /***/ }),
  17566. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17567. /*!**************************************************!*\
  17568. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17569. \**************************************************/
  17570. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17571. "use strict";
  17572. __webpack_require__.r(__webpack_exports__);
  17573. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17574. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17575. /* harmony export */ });
  17576. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17577. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17578. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17579. /* 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");
  17580. ;
  17581. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17582. /* hot reload */
  17583. if (false) {}
  17584. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17585. /***/ }),
  17586. /***/ "./resources/js/pages/Suppliers/Index.vue":
  17587. /*!************************************************!*\
  17588. !*** ./resources/js/pages/Suppliers/Index.vue ***!
  17589. \************************************************/
  17590. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17591. "use strict";
  17592. __webpack_require__.r(__webpack_exports__);
  17593. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17594. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17595. /* harmony export */ });
  17596. /* harmony import */ var _Index_vue_vue_type_template_id_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=06c8ed5e */ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e");
  17597. /* 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/Suppliers/Index.vue?vue&type=script&setup=true&lang=js");
  17598. /* 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");
  17599. ;
  17600. 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_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Suppliers/Index.vue"]])
  17601. /* hot reload */
  17602. if (false) {}
  17603. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17604. /***/ }),
  17605. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17606. /*!**************************************************************************************!*\
  17607. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17608. \**************************************************************************************/
  17609. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17610. "use strict";
  17611. __webpack_require__.r(__webpack_exports__);
  17612. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17613. /* 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"])
  17614. /* harmony export */ });
  17615. /* 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");
  17616. /***/ }),
  17617. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17618. /*!***********************************************************************************!*\
  17619. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17620. \***********************************************************************************/
  17621. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17622. "use strict";
  17623. __webpack_require__.r(__webpack_exports__);
  17624. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17625. /* 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"])
  17626. /* harmony export */ });
  17627. /* 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");
  17628. /***/ }),
  17629. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17630. /*!**************************************************************************************!*\
  17631. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17632. \**************************************************************************************/
  17633. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17634. "use strict";
  17635. __webpack_require__.r(__webpack_exports__);
  17636. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17637. /* 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"])
  17638. /* harmony export */ });
  17639. /* 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");
  17640. /***/ }),
  17641. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17642. /*!***********************************************************************************!*\
  17643. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17644. \***********************************************************************************/
  17645. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17646. "use strict";
  17647. __webpack_require__.r(__webpack_exports__);
  17648. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17649. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17650. /* harmony export */ });
  17651. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17652. /***/ }),
  17653. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17654. /*!**************************************************************************************!*\
  17655. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17656. \**************************************************************************************/
  17657. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17658. "use strict";
  17659. __webpack_require__.r(__webpack_exports__);
  17660. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17661. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17662. /* harmony export */ });
  17663. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17664. /***/ }),
  17665. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17666. /*!**********************************************************************************!*\
  17667. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17668. \**********************************************************************************/
  17669. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17670. "use strict";
  17671. __webpack_require__.r(__webpack_exports__);
  17672. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17673. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17674. /* harmony export */ });
  17675. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17676. /***/ }),
  17677. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17678. /*!*************************************************************************************!*\
  17679. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17680. \*************************************************************************************/
  17681. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17682. "use strict";
  17683. __webpack_require__.r(__webpack_exports__);
  17684. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17685. /* 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"])
  17686. /* harmony export */ });
  17687. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17688. /***/ }),
  17689. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  17690. /*!***********************************************************************************!*\
  17691. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17692. \***********************************************************************************/
  17693. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17694. "use strict";
  17695. __webpack_require__.r(__webpack_exports__);
  17696. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17697. /* 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"])
  17698. /* harmony export */ });
  17699. /* 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/Suppliers/Index.vue?vue&type=script&setup=true&lang=js");
  17700. /***/ }),
  17701. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17702. /*!*********************************************************************************!*\
  17703. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17704. \*********************************************************************************/
  17705. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17706. "use strict";
  17707. __webpack_require__.r(__webpack_exports__);
  17708. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17709. /* 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)
  17710. /* harmony export */ });
  17711. /* 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");
  17712. /***/ }),
  17713. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17714. /*!*****************************************************************************************!*\
  17715. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17716. \*****************************************************************************************/
  17717. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17718. "use strict";
  17719. __webpack_require__.r(__webpack_exports__);
  17720. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17721. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17722. /* harmony export */ });
  17723. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17724. /***/ }),
  17725. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17726. /*!******************************************************************************!*\
  17727. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17728. \******************************************************************************/
  17729. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17730. "use strict";
  17731. __webpack_require__.r(__webpack_exports__);
  17732. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17733. /* 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)
  17734. /* harmony export */ });
  17735. /* 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");
  17736. /***/ }),
  17737. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17738. /*!*********************************************************************************!*\
  17739. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17740. \*********************************************************************************/
  17741. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17742. "use strict";
  17743. __webpack_require__.r(__webpack_exports__);
  17744. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17745. /* 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)
  17746. /* harmony export */ });
  17747. /* 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");
  17748. /***/ }),
  17749. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17750. /*!******************************************************************************************!*\
  17751. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17752. \******************************************************************************************/
  17753. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17754. "use strict";
  17755. __webpack_require__.r(__webpack_exports__);
  17756. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17757. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17758. /* harmony export */ });
  17759. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17760. /***/ }),
  17761. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17762. /*!*********************************************************************************************!*\
  17763. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17764. \*********************************************************************************************/
  17765. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17766. "use strict";
  17767. __webpack_require__.r(__webpack_exports__);
  17768. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17769. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17770. /* harmony export */ });
  17771. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17772. /***/ }),
  17773. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17774. /*!*****************************************************************************************!*\
  17775. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17776. \*****************************************************************************************/
  17777. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17778. "use strict";
  17779. __webpack_require__.r(__webpack_exports__);
  17780. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17781. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17782. /* harmony export */ });
  17783. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17784. /***/ }),
  17785. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17786. /*!********************************************************************************************!*\
  17787. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17788. \********************************************************************************************/
  17789. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17790. "use strict";
  17791. __webpack_require__.r(__webpack_exports__);
  17792. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17793. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17794. /* harmony export */ });
  17795. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17796. /***/ }),
  17797. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  17798. /*!******************************************************************************!*\
  17799. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  17800. \******************************************************************************/
  17801. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17802. "use strict";
  17803. __webpack_require__.r(__webpack_exports__);
  17804. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17805. /* 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_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__.render)
  17806. /* harmony export */ });
  17807. /* 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_06c8ed5e__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=06c8ed5e */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e");
  17808. /***/ }),
  17809. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17810. /*!********************************************************************************************************!*\
  17811. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17812. \********************************************************************************************************/
  17813. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17814. "use strict";
  17815. __webpack_require__.r(__webpack_exports__);
  17816. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17817. /***/ }),
  17818. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17819. /*!*********************************************************************************************************!*\
  17820. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17821. \*********************************************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17826. /***/ }),
  17827. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17828. /*!************************************************************************************************************!*\
  17829. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17830. \************************************************************************************************************/
  17831. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17832. "use strict";
  17833. __webpack_require__.r(__webpack_exports__);
  17834. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17835. /***/ }),
  17836. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17837. /*!********************************************************************************************************!*\
  17838. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17839. \********************************************************************************************************/
  17840. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17841. "use strict";
  17842. __webpack_require__.r(__webpack_exports__);
  17843. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17844. /***/ }),
  17845. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17846. /*!***********************************************************************************************************!*\
  17847. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17848. \***********************************************************************************************************/
  17849. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17850. "use strict";
  17851. __webpack_require__.r(__webpack_exports__);
  17852. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17853. /***/ })
  17854. }]);