resources_js_pages_Suppliers_Index_vue.js 696KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400
  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: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***************************************************************************************************************************************************************************************************************!*\
  326. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***************************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  335. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  336. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Suppliers/config.js");
  337. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  338. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  339. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  340. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  342. __name: 'Index',
  343. props: {
  344. suppliers: Object,
  345. initialSearch: String
  346. },
  347. setup: function setup(__props, _ref) {
  348. var expose = _ref.expose;
  349. expose();
  350. var deleteConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm)();
  351. var onDelete = function onDelete(data) {
  352. deleteConfirm.require({
  353. message: "Yakin akan menghapus data (".concat(data.name, ") ?"),
  354. header: 'Hapus Supplier',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia["delete"](route('suppliers.destroy', data.id));
  359. },
  360. reject: function reject() {
  361. deleteConfirm.close();
  362. }
  363. });
  364. };
  365. var __returned__ = {
  366. deleteConfirm: deleteConfirm,
  367. onDelete: onDelete,
  368. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  369. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm,
  370. indexTable: _config__WEBPACK_IMPORTED_MODULE_2__.indexTable,
  371. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  372. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  373. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  374. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  375. };
  376. Object.defineProperty(__returned__, '__isScriptSetup', {
  377. enumerable: false,
  378. value: true
  379. });
  380. return __returned__;
  381. }
  382. });
  383. /***/ }),
  384. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  385. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  386. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  387. \***********************************************************************************************************************************************************************************************************************************************************************************/
  388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  389. "use strict";
  390. __webpack_require__.r(__webpack_exports__);
  391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  392. /* harmony export */ "render": () => (/* binding */ render)
  393. /* harmony export */ });
  394. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  395. var _hoisted_1 = {
  396. key: 1,
  397. "class": "p-button-label"
  398. };
  399. var _hoisted_2 = {
  400. key: 1,
  401. "class": "p-button p-component"
  402. };
  403. var _hoisted_3 = {
  404. key: 1,
  405. "class": "p-button-label"
  406. };
  407. function render(_ctx, _cache, $props, $setup, $data, $options) {
  408. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  409. key: 0,
  410. "class": "p-button p-component",
  411. as: "button",
  412. type: "button"
  413. }, {
  414. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  415. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  416. key: 0,
  417. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  418. }, null, 2
  419. /* CLASS */
  420. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  421. /* TEXT */
  422. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  423. }),
  424. _: 1
  425. /* STABLE */
  426. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  427. key: 0,
  428. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  429. }, null, 2
  430. /* CLASS */
  431. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  432. /* TEXT */
  433. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  434. }
  435. /***/ }),
  436. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  517. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  543. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  545. \*******************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  555. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  556. modelValue: $setup.search,
  557. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  558. return $setup.search = $event;
  559. })
  560. }, null, 8
  561. /* PROPS */
  562. , ["modelValue"]);
  563. }
  564. /***/ }),
  565. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  566. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  567. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  568. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  570. "use strict";
  571. __webpack_require__.r(__webpack_exports__);
  572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  573. /* harmony export */ "render": () => (/* binding */ render)
  574. /* harmony export */ });
  575. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  576. var _hoisted_1 = {
  577. "class": "layout-footer"
  578. };
  579. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  580. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  581. href: "https://dijitalcode.com",
  582. target: "_blank",
  583. "class": "font-medium ml-2"
  584. }, " DijitalCODE ", -1
  585. /* HOISTED */
  586. );
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  595. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. function render(_ctx, _cache, $props, $setup, $data, $options) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["SubSidebar"], {
  605. "class": "layout-menu",
  606. items: $props.menu,
  607. root: true
  608. }, null, 8
  609. /* PROPS */
  610. , ["items"])]);
  611. }
  612. /***/ }),
  613. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  614. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  615. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  616. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  618. "use strict";
  619. __webpack_require__.r(__webpack_exports__);
  620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  621. /* harmony export */ "render": () => (/* binding */ render)
  622. /* harmony export */ });
  623. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  624. var _withScopeId = function _withScopeId(n) {
  625. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  626. };
  627. var _hoisted_1 = {
  628. key: 0
  629. };
  630. var _hoisted_2 = ["aria-label"];
  631. var _hoisted_3 = ["aria-label"];
  632. function render(_ctx, _cache, $props, $setup, $data, $options) {
  633. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  634. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  635. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  636. key: i,
  637. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  638. 'layout-menuitem-category': $props.root
  639. }]),
  640. role: "none"
  641. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  642. key: 0
  643. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  644. "class": "layout-menuitem-root-text",
  645. "aria-label": item.label
  646. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  647. /* TEXT, PROPS */
  648. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  649. items: item.items
  650. }, null, 8
  651. /* PROPS */
  652. , ["items"])], 64
  653. /* STABLE_FRAGMENT */
  654. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  655. key: 1
  656. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  657. key: 0,
  658. role: "menuitem",
  659. href: item.to,
  660. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  661. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  662. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  663. }]),
  664. "aria-label": item.label
  665. }, {
  666. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  667. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  669. }, null, 2
  670. /* CLASS */
  671. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  672. /* TEXT */
  673. )];
  674. }),
  675. _: 2
  676. /* DYNAMIC */
  677. }, 1032
  678. /* PROPS, DYNAMIC_SLOTS */
  679. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  680. key: 1,
  681. href: "#",
  682. role: "menuitem",
  683. "aria-label": item.label
  684. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  686. }, null, 2
  687. /* CLASS */
  688. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  689. /* TEXT */
  690. )], 8
  691. /* PROPS */
  692. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  693. items: item.items
  694. }, null, 8
  695. /* PROPS */
  696. , ["items"])], 64
  697. /* STABLE_FRAGMENT */
  698. ))], 2
  699. /* CLASS */
  700. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  701. /* STABLE_FRAGMENT */
  702. );
  703. }), 256
  704. /* UNKEYED_FRAGMENT */
  705. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  706. }
  707. /***/ }),
  708. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  709. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  710. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  711. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  713. "use strict";
  714. __webpack_require__.r(__webpack_exports__);
  715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  716. /* harmony export */ "render": () => (/* binding */ render)
  717. /* harmony export */ });
  718. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  719. var _withScopeId = function _withScopeId(n) {
  720. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  721. };
  722. var _hoisted_1 = {
  723. "class": "layout-topbar"
  724. };
  725. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  726. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  727. alt: "Brand Logo",
  728. src: "/images/logo.svg",
  729. "class": "md:mr-3"
  730. }, null, -1
  731. /* HOISTED */
  732. );
  733. });
  734. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  735. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  736. /* HOISTED */
  737. );
  738. });
  739. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  740. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  741. "class": "pi pi-bars"
  742. }, null, -1
  743. /* HOISTED */
  744. );
  745. });
  746. var _hoisted_5 = [_hoisted_4];
  747. var _hoisted_6 = {
  748. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  749. };
  750. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  751. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  752. "class": "pi pi-ellipsis-v"
  753. }, null, -1
  754. /* HOISTED */
  755. );
  756. });
  757. var _hoisted_8 = [_hoisted_7];
  758. var _hoisted_9 = {
  759. "class": "layout-topbar-menu hidden lg:flex origin-top"
  760. };
  761. var _hoisted_10 = {
  762. "class": "align-self-center"
  763. };
  764. var _hoisted_11 = {
  765. "class": "hidden lg:inline"
  766. };
  767. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  768. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  769. "class": "pi pi-user"
  770. }, null, -1
  771. /* HOISTED */
  772. );
  773. });
  774. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  775. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  780. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  781. "class": "pi pi-sign-out"
  782. }, null, -1
  783. /* HOISTED */
  784. );
  785. });
  786. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  787. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  788. /* HOISTED */
  789. );
  790. });
  791. function render(_ctx, _cache, $props, $setup, $data, $options) {
  792. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  793. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  794. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  795. href: "/",
  796. "class": "layout-topbar-logo"
  797. }, {
  798. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  799. return [_hoisted_2, _hoisted_3];
  800. }),
  801. _: 1
  802. /* STABLE */
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  804. "class": "p-link layout-menu-button layout-topbar-button",
  805. onClick: _cache[0] || (_cache[0] = function ($event) {
  806. return _ctx.$emit('menu-toggle', $event);
  807. })
  808. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  809. selector: '@next',
  810. enterClass: 'hidden',
  811. enterActiveClass: 'scalein',
  812. leaveToClass: 'hidden',
  813. leaveActiveClass: 'fadeout',
  814. hideOnOutsideClick: true
  815. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  816. /* TEXT */
  817. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  818. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  819. "class": "p-link layout-topbar-button"
  820. }, {
  821. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [_hoisted_12, _hoisted_13];
  823. }),
  824. _: 1
  825. /* STABLE */
  826. }, 8
  827. /* PROPS */
  828. , ["href"])), [[_directive_tooltip, {
  829. value: 'Ubah Profil',
  830. "class": 'layout-topbar-menu-tooltip'
  831. }, void 0, {
  832. bottom: true
  833. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  834. href: _ctx.route('logout'),
  835. as: "button",
  836. method: "post",
  837. "class": "p-link layout-topbar-button"
  838. }, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [_hoisted_14, _hoisted_15];
  841. }),
  842. _: 1
  843. /* STABLE */
  844. }, 8
  845. /* PROPS */
  846. , ["href"])), [[_directive_tooltip, {
  847. value: 'Keluar',
  848. "class": 'layout-topbar-menu-tooltip'
  849. }, void 0, {
  850. bottom: true
  851. }]])])])]);
  852. }
  853. /***/ }),
  854. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _withScopeId = function _withScopeId(n) {
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  867. };
  868. var _hoisted_1 = {
  869. "class": "layout-sidebar"
  870. };
  871. var _hoisted_2 = {
  872. "class": "layout-main-container"
  873. };
  874. var _hoisted_3 = {
  875. "class": "layout-main"
  876. };
  877. var _hoisted_4 = {
  878. key: 0,
  879. "class": "layout-mask p-component-overlay"
  880. };
  881. function render(_ctx, _cache, $props, $setup, $data, $options) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  883. title: $props.title
  884. }, null, 8
  885. /* PROPS */
  886. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  887. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  888. onClick: $setup.onWrapperClick
  889. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  890. onMenuToggle: $setup.onMenuToggle
  891. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  892. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  893. }, null, 8
  894. /* PROPS */
  895. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  896. name: "layout-mask"
  897. }, {
  898. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  899. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  900. }),
  901. _: 1
  902. /* STABLE */
  903. })], 2
  904. /* CLASS */
  905. )], 64
  906. /* STABLE_FRAGMENT */
  907. );
  908. }
  909. /***/ }),
  910. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  911. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  912. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  913. \********************************************************************************************************************************************************************************************************************************************************************************/
  914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  915. "use strict";
  916. __webpack_require__.r(__webpack_exports__);
  917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  918. /* harmony export */ "render": () => (/* binding */ render)
  919. /* harmony export */ });
  920. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  921. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Supplier", -1
  922. /* HOISTED */
  923. );
  924. var _hoisted_2 = {
  925. "class": "grid"
  926. };
  927. var _hoisted_3 = {
  928. "class": "col-12 md:col-8"
  929. };
  930. var _hoisted_4 = {
  931. "class": "flex align-items-center"
  932. };
  933. var _hoisted_5 = {
  934. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  935. };
  936. function render(_ctx, _cache, $props, $setup, $data, $options) {
  937. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  938. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  939. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  940. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  941. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  942. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], {
  943. title: "Daftar Supplier"
  944. }, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  947. responsiveLayout: "scroll",
  948. columnResizeMode: "expand",
  949. value: $props.suppliers.data,
  950. rowHover: true,
  951. stripedRows: true
  952. }, {
  953. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  954. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSearch"], {
  955. "class": "w-full md:w-27rem",
  956. placeholder: "cari, contoh: tina, 08xx, 0x",
  957. url: "/suppliers",
  958. "initial-search": $props.initialSearch
  959. }, null, 8
  960. /* PROPS */
  961. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. label: "Tambah Supplier",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('suppliers.create')
  966. }, null, 8
  967. /* PROPS */
  968. , ["href"])])])];
  969. }),
  970. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  971. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  972. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  973. field: value.field,
  974. header: value.header,
  975. key: value.field
  976. }, null, 8
  977. /* PROPS */
  978. , ["field", "header"]);
  979. }), 128
  980. /* KEYED_FRAGMENT */
  981. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  982. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  983. var data = _ref.data;
  984. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  985. icon: "pi pi-pencil",
  986. "class": "p-button-icon-only p-button-rounded p-button-text",
  987. href: _ctx.route('suppliers.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah Supplier', void 0, {
  991. bottom: true
  992. }]])];
  993. }),
  994. _: 1
  995. /* STABLE */
  996. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  997. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  998. var data = _ref2.data;
  999. return [!data.isUsed ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Button, {
  1000. key: 0,
  1001. icon: "pi pi-trash",
  1002. "class": "p-button-icon-only p-button-rounded p-button-text",
  1003. onClick: function onClick($event) {
  1004. return $setup.onDelete(data);
  1005. }
  1006. }, null, 8
  1007. /* PROPS */
  1008. , ["onClick"])), [[_directive_tooltip, 'Hapus Supplier', void 0, {
  1009. bottom: true
  1010. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1011. }),
  1012. _: 1
  1013. /* STABLE */
  1014. })];
  1015. }),
  1016. _: 1
  1017. /* STABLE */
  1018. }, 8
  1019. /* PROPS */
  1020. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1021. links: $props.suppliers.links
  1022. }, null, 8
  1023. /* PROPS */
  1024. , ["links"])];
  1025. }),
  1026. _: 1
  1027. /* STABLE */
  1028. })], 64
  1029. /* STABLE_FRAGMENT */
  1030. );
  1031. }
  1032. /***/ }),
  1033. /***/ "./resources/js/pages/Suppliers/config.js":
  1034. /*!************************************************!*\
  1035. !*** ./resources/js/pages/Suppliers/config.js ***!
  1036. \************************************************/
  1037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1038. "use strict";
  1039. __webpack_require__.r(__webpack_exports__);
  1040. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1041. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  1042. /* harmony export */ });
  1043. var indexTable = [{
  1044. field: 'name',
  1045. header: 'Nama'
  1046. }, {
  1047. field: 'address',
  1048. header: 'Alamat'
  1049. }, {
  1050. field: 'email',
  1051. header: 'Surel'
  1052. }, {
  1053. field: 'phone',
  1054. header: 'No HP'
  1055. }, {
  1056. field: 'npwp',
  1057. header: 'NPWP'
  1058. }];
  1059. /***/ }),
  1060. /***/ "./resources/js/utils/menu.js":
  1061. /*!************************************!*\
  1062. !*** ./resources/js/utils/menu.js ***!
  1063. \************************************/
  1064. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1065. "use strict";
  1066. __webpack_require__.r(__webpack_exports__);
  1067. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1068. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1069. /* harmony export */ });
  1070. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1071. // Admin
  1072. 1: [{
  1073. label: 'Home',
  1074. items: [{
  1075. label: 'Dashboard',
  1076. icon: 'pi pi-chart-bar',
  1077. to: '/dashboards',
  1078. component: 'Dashboards/Index'
  1079. }]
  1080. }, {
  1081. label: 'Laporan',
  1082. items: []
  1083. }, {
  1084. label: 'Master',
  1085. items: [{
  1086. label: 'User',
  1087. icon: 'pi pi-user',
  1088. to: '/users',
  1089. component: 'Users/Index'
  1090. }]
  1091. }],
  1092. // Supervisor
  1093. 2: [{
  1094. label: 'Home',
  1095. items: [{
  1096. label: 'Dashboard',
  1097. icon: 'pi pi-chart-bar',
  1098. to: '/dashboards',
  1099. component: 'Dashboards/Index'
  1100. }]
  1101. }, {
  1102. label: 'Master',
  1103. items: [{
  1104. label: 'Pelanggan',
  1105. icon: 'pi pi-users',
  1106. to: '/customers',
  1107. component: 'Customers/Index'
  1108. }, {
  1109. label: 'Pembelian',
  1110. icon: 'pi pi-shopping-cart',
  1111. to: '/purchases',
  1112. component: 'Purchases/Index'
  1113. }, {
  1114. label: 'Penjualan',
  1115. icon: 'pi pi-tag',
  1116. to: '/sales',
  1117. component: 'Sales/Index'
  1118. }, {
  1119. label: 'Produk',
  1120. icon: 'pi pi-th-large',
  1121. to: '/products',
  1122. component: 'Products/Index'
  1123. }]
  1124. }],
  1125. // Operator
  1126. 3: [{
  1127. label: 'Home',
  1128. items: [{
  1129. label: 'Dashboard',
  1130. icon: 'pi pi-chart-bar',
  1131. to: '/dashboards',
  1132. component: 'Dashboards/Index'
  1133. }]
  1134. }, {
  1135. label: 'Master',
  1136. items: [{
  1137. label: 'Supplier',
  1138. icon: 'pi pi-shopping-cart',
  1139. to: '/suppliers',
  1140. component: 'Suppliers/Index'
  1141. }, {
  1142. label: 'Stok Barang',
  1143. icon: 'pi pi-box',
  1144. to: '/stock-products',
  1145. component: 'StockProducts/Index'
  1146. }]
  1147. }]
  1148. });
  1149. /***/ }),
  1150. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1151. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1152. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1153. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1154. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1155. "use strict";
  1156. __webpack_require__.r(__webpack_exports__);
  1157. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1158. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1159. /* harmony export */ });
  1160. /* 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");
  1161. /* 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__);
  1162. // Imports
  1163. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1164. // Module
  1165. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1166. // Exports
  1167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1168. /***/ }),
  1169. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1170. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1171. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1172. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1173. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1174. "use strict";
  1175. __webpack_require__.r(__webpack_exports__);
  1176. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1177. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1178. /* harmony export */ });
  1179. /* 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");
  1180. /* 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__);
  1181. // Imports
  1182. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1183. // Module
  1184. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-b1b23eb4] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1185. // Exports
  1186. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1187. /***/ }),
  1188. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1189. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1190. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1191. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1192. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1193. "use strict";
  1194. __webpack_require__.r(__webpack_exports__);
  1195. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1196. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1197. /* harmony export */ });
  1198. /* 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");
  1199. /* 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__);
  1200. // Imports
  1201. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1202. // Module
  1203. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1204. // Exports
  1205. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1206. /***/ }),
  1207. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1208. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1209. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1210. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1211. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1212. "use strict";
  1213. __webpack_require__.r(__webpack_exports__);
  1214. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1215. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1216. /* harmony export */ });
  1217. /* 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");
  1218. /* 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__);
  1219. // Imports
  1220. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1221. // Module
  1222. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-1d279fe2] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1223. // Exports
  1224. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1225. /***/ }),
  1226. /***/ "./node_modules/lodash/lodash.js":
  1227. /*!***************************************!*\
  1228. !*** ./node_modules/lodash/lodash.js ***!
  1229. \***************************************/
  1230. /***/ (function(module, exports, __webpack_require__) {
  1231. /* module decorator */ module = __webpack_require__.nmd(module);
  1232. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1233. * @license
  1234. * Lodash <https://lodash.com/>
  1235. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1236. * Released under MIT license <https://lodash.com/license>
  1237. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1238. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1239. */
  1240. ;(function() {
  1241. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1242. var undefined;
  1243. /** Used as the semantic version number. */
  1244. var VERSION = '4.17.21';
  1245. /** Used as the size to enable large array optimizations. */
  1246. var LARGE_ARRAY_SIZE = 200;
  1247. /** Error message constants. */
  1248. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1249. FUNC_ERROR_TEXT = 'Expected a function',
  1250. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1251. /** Used to stand-in for `undefined` hash values. */
  1252. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1253. /** Used as the maximum memoize cache size. */
  1254. var MAX_MEMOIZE_SIZE = 500;
  1255. /** Used as the internal argument placeholder. */
  1256. var PLACEHOLDER = '__lodash_placeholder__';
  1257. /** Used to compose bitmasks for cloning. */
  1258. var CLONE_DEEP_FLAG = 1,
  1259. CLONE_FLAT_FLAG = 2,
  1260. CLONE_SYMBOLS_FLAG = 4;
  1261. /** Used to compose bitmasks for value comparisons. */
  1262. var COMPARE_PARTIAL_FLAG = 1,
  1263. COMPARE_UNORDERED_FLAG = 2;
  1264. /** Used to compose bitmasks for function metadata. */
  1265. var WRAP_BIND_FLAG = 1,
  1266. WRAP_BIND_KEY_FLAG = 2,
  1267. WRAP_CURRY_BOUND_FLAG = 4,
  1268. WRAP_CURRY_FLAG = 8,
  1269. WRAP_CURRY_RIGHT_FLAG = 16,
  1270. WRAP_PARTIAL_FLAG = 32,
  1271. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1272. WRAP_ARY_FLAG = 128,
  1273. WRAP_REARG_FLAG = 256,
  1274. WRAP_FLIP_FLAG = 512;
  1275. /** Used as default options for `_.truncate`. */
  1276. var DEFAULT_TRUNC_LENGTH = 30,
  1277. DEFAULT_TRUNC_OMISSION = '...';
  1278. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1279. var HOT_COUNT = 800,
  1280. HOT_SPAN = 16;
  1281. /** Used to indicate the type of lazy iteratees. */
  1282. var LAZY_FILTER_FLAG = 1,
  1283. LAZY_MAP_FLAG = 2,
  1284. LAZY_WHILE_FLAG = 3;
  1285. /** Used as references for various `Number` constants. */
  1286. var INFINITY = 1 / 0,
  1287. MAX_SAFE_INTEGER = 9007199254740991,
  1288. MAX_INTEGER = 1.7976931348623157e+308,
  1289. NAN = 0 / 0;
  1290. /** Used as references for the maximum length and index of an array. */
  1291. var MAX_ARRAY_LENGTH = 4294967295,
  1292. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1293. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1294. /** Used to associate wrap methods with their bit flags. */
  1295. var wrapFlags = [
  1296. ['ary', WRAP_ARY_FLAG],
  1297. ['bind', WRAP_BIND_FLAG],
  1298. ['bindKey', WRAP_BIND_KEY_FLAG],
  1299. ['curry', WRAP_CURRY_FLAG],
  1300. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1301. ['flip', WRAP_FLIP_FLAG],
  1302. ['partial', WRAP_PARTIAL_FLAG],
  1303. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1304. ['rearg', WRAP_REARG_FLAG]
  1305. ];
  1306. /** `Object#toString` result references. */
  1307. var argsTag = '[object Arguments]',
  1308. arrayTag = '[object Array]',
  1309. asyncTag = '[object AsyncFunction]',
  1310. boolTag = '[object Boolean]',
  1311. dateTag = '[object Date]',
  1312. domExcTag = '[object DOMException]',
  1313. errorTag = '[object Error]',
  1314. funcTag = '[object Function]',
  1315. genTag = '[object GeneratorFunction]',
  1316. mapTag = '[object Map]',
  1317. numberTag = '[object Number]',
  1318. nullTag = '[object Null]',
  1319. objectTag = '[object Object]',
  1320. promiseTag = '[object Promise]',
  1321. proxyTag = '[object Proxy]',
  1322. regexpTag = '[object RegExp]',
  1323. setTag = '[object Set]',
  1324. stringTag = '[object String]',
  1325. symbolTag = '[object Symbol]',
  1326. undefinedTag = '[object Undefined]',
  1327. weakMapTag = '[object WeakMap]',
  1328. weakSetTag = '[object WeakSet]';
  1329. var arrayBufferTag = '[object ArrayBuffer]',
  1330. dataViewTag = '[object DataView]',
  1331. float32Tag = '[object Float32Array]',
  1332. float64Tag = '[object Float64Array]',
  1333. int8Tag = '[object Int8Array]',
  1334. int16Tag = '[object Int16Array]',
  1335. int32Tag = '[object Int32Array]',
  1336. uint8Tag = '[object Uint8Array]',
  1337. uint8ClampedTag = '[object Uint8ClampedArray]',
  1338. uint16Tag = '[object Uint16Array]',
  1339. uint32Tag = '[object Uint32Array]';
  1340. /** Used to match empty string literals in compiled template source. */
  1341. var reEmptyStringLeading = /\b__p \+= '';/g,
  1342. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1343. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1344. /** Used to match HTML entities and HTML characters. */
  1345. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1346. reUnescapedHtml = /[&<>"']/g,
  1347. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1348. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1349. /** Used to match template delimiters. */
  1350. var reEscape = /<%-([\s\S]+?)%>/g,
  1351. reEvaluate = /<%([\s\S]+?)%>/g,
  1352. reInterpolate = /<%=([\s\S]+?)%>/g;
  1353. /** Used to match property names within property paths. */
  1354. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1355. reIsPlainProp = /^\w*$/,
  1356. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1357. /**
  1358. * Used to match `RegExp`
  1359. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1360. */
  1361. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1362. reHasRegExpChar = RegExp(reRegExpChar.source);
  1363. /** Used to match leading whitespace. */
  1364. var reTrimStart = /^\s+/;
  1365. /** Used to match a single whitespace character. */
  1366. var reWhitespace = /\s/;
  1367. /** Used to match wrap detail comments. */
  1368. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1369. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1370. reSplitDetails = /,? & /;
  1371. /** Used to match words composed of alphanumeric characters. */
  1372. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1373. /**
  1374. * Used to validate the `validate` option in `_.template` variable.
  1375. *
  1376. * Forbids characters which could potentially change the meaning of the function argument definition:
  1377. * - "()," (modification of function parameters)
  1378. * - "=" (default value)
  1379. * - "[]{}" (destructuring of function parameters)
  1380. * - "/" (beginning of a comment)
  1381. * - whitespace
  1382. */
  1383. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1384. /** Used to match backslashes in property paths. */
  1385. var reEscapeChar = /\\(\\)?/g;
  1386. /**
  1387. * Used to match
  1388. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1389. */
  1390. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1391. /** Used to match `RegExp` flags from their coerced string values. */
  1392. var reFlags = /\w*$/;
  1393. /** Used to detect bad signed hexadecimal string values. */
  1394. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1395. /** Used to detect binary string values. */
  1396. var reIsBinary = /^0b[01]+$/i;
  1397. /** Used to detect host constructors (Safari). */
  1398. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1399. /** Used to detect octal string values. */
  1400. var reIsOctal = /^0o[0-7]+$/i;
  1401. /** Used to detect unsigned integer values. */
  1402. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1403. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1404. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1405. /** Used to ensure capturing order of template delimiters. */
  1406. var reNoMatch = /($^)/;
  1407. /** Used to match unescaped characters in compiled string literals. */
  1408. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1409. /** Used to compose unicode character classes. */
  1410. var rsAstralRange = '\\ud800-\\udfff',
  1411. rsComboMarksRange = '\\u0300-\\u036f',
  1412. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1413. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1414. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1415. rsDingbatRange = '\\u2700-\\u27bf',
  1416. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1417. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1418. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1419. rsPunctuationRange = '\\u2000-\\u206f',
  1420. 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',
  1421. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1422. rsVarRange = '\\ufe0e\\ufe0f',
  1423. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1424. /** Used to compose unicode capture groups. */
  1425. var rsApos = "['\u2019]",
  1426. rsAstral = '[' + rsAstralRange + ']',
  1427. rsBreak = '[' + rsBreakRange + ']',
  1428. rsCombo = '[' + rsComboRange + ']',
  1429. rsDigits = '\\d+',
  1430. rsDingbat = '[' + rsDingbatRange + ']',
  1431. rsLower = '[' + rsLowerRange + ']',
  1432. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1433. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1434. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1435. rsNonAstral = '[^' + rsAstralRange + ']',
  1436. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1437. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1438. rsUpper = '[' + rsUpperRange + ']',
  1439. rsZWJ = '\\u200d';
  1440. /** Used to compose unicode regexes. */
  1441. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1442. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1443. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1444. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1445. reOptMod = rsModifier + '?',
  1446. rsOptVar = '[' + rsVarRange + ']?',
  1447. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1448. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1449. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1450. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1451. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1452. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1453. /** Used to match apostrophes. */
  1454. var reApos = RegExp(rsApos, 'g');
  1455. /**
  1456. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1457. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1458. */
  1459. var reComboMark = RegExp(rsCombo, 'g');
  1460. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1461. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1462. /** Used to match complex or compound words. */
  1463. var reUnicodeWord = RegExp([
  1464. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1465. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1466. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1467. rsUpper + '+' + rsOptContrUpper,
  1468. rsOrdUpper,
  1469. rsOrdLower,
  1470. rsDigits,
  1471. rsEmoji
  1472. ].join('|'), 'g');
  1473. /** 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/). */
  1474. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1475. /** Used to detect strings that need a more robust regexp to match words. */
  1476. 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 ]/;
  1477. /** Used to assign default `context` object properties. */
  1478. var contextProps = [
  1479. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1480. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1481. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1482. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1483. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1484. ];
  1485. /** Used to make template sourceURLs easier to identify. */
  1486. var templateCounter = -1;
  1487. /** Used to identify `toStringTag` values of typed arrays. */
  1488. var typedArrayTags = {};
  1489. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1490. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1491. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1492. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1493. typedArrayTags[uint32Tag] = true;
  1494. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1495. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1496. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1497. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1498. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1499. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1500. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1501. typedArrayTags[weakMapTag] = false;
  1502. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1503. var cloneableTags = {};
  1504. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1505. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1506. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1507. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1508. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1509. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1510. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1511. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1512. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1513. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1514. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1515. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1516. cloneableTags[weakMapTag] = false;
  1517. /** Used to map Latin Unicode letters to basic Latin letters. */
  1518. var deburredLetters = {
  1519. // Latin-1 Supplement block.
  1520. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1521. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1522. '\xc7': 'C', '\xe7': 'c',
  1523. '\xd0': 'D', '\xf0': 'd',
  1524. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1525. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1526. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1527. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1528. '\xd1': 'N', '\xf1': 'n',
  1529. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1530. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1531. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1532. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1533. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1534. '\xc6': 'Ae', '\xe6': 'ae',
  1535. '\xde': 'Th', '\xfe': 'th',
  1536. '\xdf': 'ss',
  1537. // Latin Extended-A block.
  1538. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1539. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1540. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1541. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1542. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1543. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1544. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1545. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1546. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1547. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1548. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1549. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1550. '\u0134': 'J', '\u0135': 'j',
  1551. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1552. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1553. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1554. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1555. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1556. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1557. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1558. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1559. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1560. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1561. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1562. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1563. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1564. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1565. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1566. '\u0174': 'W', '\u0175': 'w',
  1567. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1568. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1569. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1570. '\u0132': 'IJ', '\u0133': 'ij',
  1571. '\u0152': 'Oe', '\u0153': 'oe',
  1572. '\u0149': "'n", '\u017f': 's'
  1573. };
  1574. /** Used to map characters to HTML entities. */
  1575. var htmlEscapes = {
  1576. '&': '&amp;',
  1577. '<': '&lt;',
  1578. '>': '&gt;',
  1579. '"': '&quot;',
  1580. "'": '&#39;'
  1581. };
  1582. /** Used to map HTML entities to characters. */
  1583. var htmlUnescapes = {
  1584. '&amp;': '&',
  1585. '&lt;': '<',
  1586. '&gt;': '>',
  1587. '&quot;': '"',
  1588. '&#39;': "'"
  1589. };
  1590. /** Used to escape characters for inclusion in compiled string literals. */
  1591. var stringEscapes = {
  1592. '\\': '\\',
  1593. "'": "'",
  1594. '\n': 'n',
  1595. '\r': 'r',
  1596. '\u2028': 'u2028',
  1597. '\u2029': 'u2029'
  1598. };
  1599. /** Built-in method references without a dependency on `root`. */
  1600. var freeParseFloat = parseFloat,
  1601. freeParseInt = parseInt;
  1602. /** Detect free variable `global` from Node.js. */
  1603. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1604. /** Detect free variable `self`. */
  1605. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1606. /** Used as a reference to the global object. */
  1607. var root = freeGlobal || freeSelf || Function('return this')();
  1608. /** Detect free variable `exports`. */
  1609. var freeExports = true && exports && !exports.nodeType && exports;
  1610. /** Detect free variable `module`. */
  1611. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1612. /** Detect the popular CommonJS extension `module.exports`. */
  1613. var moduleExports = freeModule && freeModule.exports === freeExports;
  1614. /** Detect free variable `process` from Node.js. */
  1615. var freeProcess = moduleExports && freeGlobal.process;
  1616. /** Used to access faster Node.js helpers. */
  1617. var nodeUtil = (function() {
  1618. try {
  1619. // Use `util.types` for Node.js 10+.
  1620. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1621. if (types) {
  1622. return types;
  1623. }
  1624. // Legacy `process.binding('util')` for Node.js < 10.
  1625. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1626. } catch (e) {}
  1627. }());
  1628. /* Node.js helper references. */
  1629. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1630. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1631. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1632. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1633. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1634. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1635. /*--------------------------------------------------------------------------*/
  1636. /**
  1637. * A faster alternative to `Function#apply`, this function invokes `func`
  1638. * with the `this` binding of `thisArg` and the arguments of `args`.
  1639. *
  1640. * @private
  1641. * @param {Function} func The function to invoke.
  1642. * @param {*} thisArg The `this` binding of `func`.
  1643. * @param {Array} args The arguments to invoke `func` with.
  1644. * @returns {*} Returns the result of `func`.
  1645. */
  1646. function apply(func, thisArg, args) {
  1647. switch (args.length) {
  1648. case 0: return func.call(thisArg);
  1649. case 1: return func.call(thisArg, args[0]);
  1650. case 2: return func.call(thisArg, args[0], args[1]);
  1651. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1652. }
  1653. return func.apply(thisArg, args);
  1654. }
  1655. /**
  1656. * A specialized version of `baseAggregator` for arrays.
  1657. *
  1658. * @private
  1659. * @param {Array} [array] The array to iterate over.
  1660. * @param {Function} setter The function to set `accumulator` values.
  1661. * @param {Function} iteratee The iteratee to transform keys.
  1662. * @param {Object} accumulator The initial aggregated object.
  1663. * @returns {Function} Returns `accumulator`.
  1664. */
  1665. function arrayAggregator(array, setter, iteratee, accumulator) {
  1666. var index = -1,
  1667. length = array == null ? 0 : array.length;
  1668. while (++index < length) {
  1669. var value = array[index];
  1670. setter(accumulator, value, iteratee(value), array);
  1671. }
  1672. return accumulator;
  1673. }
  1674. /**
  1675. * A specialized version of `_.forEach` for arrays without support for
  1676. * iteratee shorthands.
  1677. *
  1678. * @private
  1679. * @param {Array} [array] The array to iterate over.
  1680. * @param {Function} iteratee The function invoked per iteration.
  1681. * @returns {Array} Returns `array`.
  1682. */
  1683. function arrayEach(array, iteratee) {
  1684. var index = -1,
  1685. length = array == null ? 0 : array.length;
  1686. while (++index < length) {
  1687. if (iteratee(array[index], index, array) === false) {
  1688. break;
  1689. }
  1690. }
  1691. return array;
  1692. }
  1693. /**
  1694. * A specialized version of `_.forEachRight` for arrays without support for
  1695. * iteratee shorthands.
  1696. *
  1697. * @private
  1698. * @param {Array} [array] The array to iterate over.
  1699. * @param {Function} iteratee The function invoked per iteration.
  1700. * @returns {Array} Returns `array`.
  1701. */
  1702. function arrayEachRight(array, iteratee) {
  1703. var length = array == null ? 0 : array.length;
  1704. while (length--) {
  1705. if (iteratee(array[length], length, array) === false) {
  1706. break;
  1707. }
  1708. }
  1709. return array;
  1710. }
  1711. /**
  1712. * A specialized version of `_.every` for arrays without support for
  1713. * iteratee shorthands.
  1714. *
  1715. * @private
  1716. * @param {Array} [array] The array to iterate over.
  1717. * @param {Function} predicate The function invoked per iteration.
  1718. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1719. * else `false`.
  1720. */
  1721. function arrayEvery(array, predicate) {
  1722. var index = -1,
  1723. length = array == null ? 0 : array.length;
  1724. while (++index < length) {
  1725. if (!predicate(array[index], index, array)) {
  1726. return false;
  1727. }
  1728. }
  1729. return true;
  1730. }
  1731. /**
  1732. * A specialized version of `_.filter` for arrays without support for
  1733. * iteratee shorthands.
  1734. *
  1735. * @private
  1736. * @param {Array} [array] The array to iterate over.
  1737. * @param {Function} predicate The function invoked per iteration.
  1738. * @returns {Array} Returns the new filtered array.
  1739. */
  1740. function arrayFilter(array, predicate) {
  1741. var index = -1,
  1742. length = array == null ? 0 : array.length,
  1743. resIndex = 0,
  1744. result = [];
  1745. while (++index < length) {
  1746. var value = array[index];
  1747. if (predicate(value, index, array)) {
  1748. result[resIndex++] = value;
  1749. }
  1750. }
  1751. return result;
  1752. }
  1753. /**
  1754. * A specialized version of `_.includes` for arrays without support for
  1755. * specifying an index to search from.
  1756. *
  1757. * @private
  1758. * @param {Array} [array] The array to inspect.
  1759. * @param {*} target The value to search for.
  1760. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1761. */
  1762. function arrayIncludes(array, value) {
  1763. var length = array == null ? 0 : array.length;
  1764. return !!length && baseIndexOf(array, value, 0) > -1;
  1765. }
  1766. /**
  1767. * This function is like `arrayIncludes` except that it accepts a comparator.
  1768. *
  1769. * @private
  1770. * @param {Array} [array] The array to inspect.
  1771. * @param {*} target The value to search for.
  1772. * @param {Function} comparator The comparator invoked per element.
  1773. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1774. */
  1775. function arrayIncludesWith(array, value, comparator) {
  1776. var index = -1,
  1777. length = array == null ? 0 : array.length;
  1778. while (++index < length) {
  1779. if (comparator(value, array[index])) {
  1780. return true;
  1781. }
  1782. }
  1783. return false;
  1784. }
  1785. /**
  1786. * A specialized version of `_.map` for arrays without support for iteratee
  1787. * shorthands.
  1788. *
  1789. * @private
  1790. * @param {Array} [array] The array to iterate over.
  1791. * @param {Function} iteratee The function invoked per iteration.
  1792. * @returns {Array} Returns the new mapped array.
  1793. */
  1794. function arrayMap(array, iteratee) {
  1795. var index = -1,
  1796. length = array == null ? 0 : array.length,
  1797. result = Array(length);
  1798. while (++index < length) {
  1799. result[index] = iteratee(array[index], index, array);
  1800. }
  1801. return result;
  1802. }
  1803. /**
  1804. * Appends the elements of `values` to `array`.
  1805. *
  1806. * @private
  1807. * @param {Array} array The array to modify.
  1808. * @param {Array} values The values to append.
  1809. * @returns {Array} Returns `array`.
  1810. */
  1811. function arrayPush(array, values) {
  1812. var index = -1,
  1813. length = values.length,
  1814. offset = array.length;
  1815. while (++index < length) {
  1816. array[offset + index] = values[index];
  1817. }
  1818. return array;
  1819. }
  1820. /**
  1821. * A specialized version of `_.reduce` for arrays without support for
  1822. * iteratee shorthands.
  1823. *
  1824. * @private
  1825. * @param {Array} [array] The array to iterate over.
  1826. * @param {Function} iteratee The function invoked per iteration.
  1827. * @param {*} [accumulator] The initial value.
  1828. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1829. * the initial value.
  1830. * @returns {*} Returns the accumulated value.
  1831. */
  1832. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1833. var index = -1,
  1834. length = array == null ? 0 : array.length;
  1835. if (initAccum && length) {
  1836. accumulator = array[++index];
  1837. }
  1838. while (++index < length) {
  1839. accumulator = iteratee(accumulator, array[index], index, array);
  1840. }
  1841. return accumulator;
  1842. }
  1843. /**
  1844. * A specialized version of `_.reduceRight` for arrays without support for
  1845. * iteratee shorthands.
  1846. *
  1847. * @private
  1848. * @param {Array} [array] The array to iterate over.
  1849. * @param {Function} iteratee The function invoked per iteration.
  1850. * @param {*} [accumulator] The initial value.
  1851. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1852. * the initial value.
  1853. * @returns {*} Returns the accumulated value.
  1854. */
  1855. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1856. var length = array == null ? 0 : array.length;
  1857. if (initAccum && length) {
  1858. accumulator = array[--length];
  1859. }
  1860. while (length--) {
  1861. accumulator = iteratee(accumulator, array[length], length, array);
  1862. }
  1863. return accumulator;
  1864. }
  1865. /**
  1866. * A specialized version of `_.some` for arrays without support for iteratee
  1867. * shorthands.
  1868. *
  1869. * @private
  1870. * @param {Array} [array] The array to iterate over.
  1871. * @param {Function} predicate The function invoked per iteration.
  1872. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1873. * else `false`.
  1874. */
  1875. function arraySome(array, predicate) {
  1876. var index = -1,
  1877. length = array == null ? 0 : array.length;
  1878. while (++index < length) {
  1879. if (predicate(array[index], index, array)) {
  1880. return true;
  1881. }
  1882. }
  1883. return false;
  1884. }
  1885. /**
  1886. * Gets the size of an ASCII `string`.
  1887. *
  1888. * @private
  1889. * @param {string} string The string inspect.
  1890. * @returns {number} Returns the string size.
  1891. */
  1892. var asciiSize = baseProperty('length');
  1893. /**
  1894. * Converts an ASCII `string` to an array.
  1895. *
  1896. * @private
  1897. * @param {string} string The string to convert.
  1898. * @returns {Array} Returns the converted array.
  1899. */
  1900. function asciiToArray(string) {
  1901. return string.split('');
  1902. }
  1903. /**
  1904. * Splits an ASCII `string` into an array of its words.
  1905. *
  1906. * @private
  1907. * @param {string} The string to inspect.
  1908. * @returns {Array} Returns the words of `string`.
  1909. */
  1910. function asciiWords(string) {
  1911. return string.match(reAsciiWord) || [];
  1912. }
  1913. /**
  1914. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1915. * without support for iteratee shorthands, which iterates over `collection`
  1916. * using `eachFunc`.
  1917. *
  1918. * @private
  1919. * @param {Array|Object} collection The collection to inspect.
  1920. * @param {Function} predicate The function invoked per iteration.
  1921. * @param {Function} eachFunc The function to iterate over `collection`.
  1922. * @returns {*} Returns the found element or its key, else `undefined`.
  1923. */
  1924. function baseFindKey(collection, predicate, eachFunc) {
  1925. var result;
  1926. eachFunc(collection, function(value, key, collection) {
  1927. if (predicate(value, key, collection)) {
  1928. result = key;
  1929. return false;
  1930. }
  1931. });
  1932. return result;
  1933. }
  1934. /**
  1935. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1936. * support for iteratee shorthands.
  1937. *
  1938. * @private
  1939. * @param {Array} array The array to inspect.
  1940. * @param {Function} predicate The function invoked per iteration.
  1941. * @param {number} fromIndex The index to search from.
  1942. * @param {boolean} [fromRight] Specify iterating from right to left.
  1943. * @returns {number} Returns the index of the matched value, else `-1`.
  1944. */
  1945. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1946. var length = array.length,
  1947. index = fromIndex + (fromRight ? 1 : -1);
  1948. while ((fromRight ? index-- : ++index < length)) {
  1949. if (predicate(array[index], index, array)) {
  1950. return index;
  1951. }
  1952. }
  1953. return -1;
  1954. }
  1955. /**
  1956. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1957. *
  1958. * @private
  1959. * @param {Array} array The array to inspect.
  1960. * @param {*} value The value to search for.
  1961. * @param {number} fromIndex The index to search from.
  1962. * @returns {number} Returns the index of the matched value, else `-1`.
  1963. */
  1964. function baseIndexOf(array, value, fromIndex) {
  1965. return value === value
  1966. ? strictIndexOf(array, value, fromIndex)
  1967. : baseFindIndex(array, baseIsNaN, fromIndex);
  1968. }
  1969. /**
  1970. * This function is like `baseIndexOf` except that it accepts a comparator.
  1971. *
  1972. * @private
  1973. * @param {Array} array The array to inspect.
  1974. * @param {*} value The value to search for.
  1975. * @param {number} fromIndex The index to search from.
  1976. * @param {Function} comparator The comparator invoked per element.
  1977. * @returns {number} Returns the index of the matched value, else `-1`.
  1978. */
  1979. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1980. var index = fromIndex - 1,
  1981. length = array.length;
  1982. while (++index < length) {
  1983. if (comparator(array[index], value)) {
  1984. return index;
  1985. }
  1986. }
  1987. return -1;
  1988. }
  1989. /**
  1990. * The base implementation of `_.isNaN` without support for number objects.
  1991. *
  1992. * @private
  1993. * @param {*} value The value to check.
  1994. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1995. */
  1996. function baseIsNaN(value) {
  1997. return value !== value;
  1998. }
  1999. /**
  2000. * The base implementation of `_.mean` and `_.meanBy` without support for
  2001. * iteratee shorthands.
  2002. *
  2003. * @private
  2004. * @param {Array} array The array to iterate over.
  2005. * @param {Function} iteratee The function invoked per iteration.
  2006. * @returns {number} Returns the mean.
  2007. */
  2008. function baseMean(array, iteratee) {
  2009. var length = array == null ? 0 : array.length;
  2010. return length ? (baseSum(array, iteratee) / length) : NAN;
  2011. }
  2012. /**
  2013. * The base implementation of `_.property` without support for deep paths.
  2014. *
  2015. * @private
  2016. * @param {string} key The key of the property to get.
  2017. * @returns {Function} Returns the new accessor function.
  2018. */
  2019. function baseProperty(key) {
  2020. return function(object) {
  2021. return object == null ? undefined : object[key];
  2022. };
  2023. }
  2024. /**
  2025. * The base implementation of `_.propertyOf` without support for deep paths.
  2026. *
  2027. * @private
  2028. * @param {Object} object The object to query.
  2029. * @returns {Function} Returns the new accessor function.
  2030. */
  2031. function basePropertyOf(object) {
  2032. return function(key) {
  2033. return object == null ? undefined : object[key];
  2034. };
  2035. }
  2036. /**
  2037. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2038. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2039. *
  2040. * @private
  2041. * @param {Array|Object} collection The collection to iterate over.
  2042. * @param {Function} iteratee The function invoked per iteration.
  2043. * @param {*} accumulator The initial value.
  2044. * @param {boolean} initAccum Specify using the first or last element of
  2045. * `collection` as the initial value.
  2046. * @param {Function} eachFunc The function to iterate over `collection`.
  2047. * @returns {*} Returns the accumulated value.
  2048. */
  2049. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2050. eachFunc(collection, function(value, index, collection) {
  2051. accumulator = initAccum
  2052. ? (initAccum = false, value)
  2053. : iteratee(accumulator, value, index, collection);
  2054. });
  2055. return accumulator;
  2056. }
  2057. /**
  2058. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2059. * sort order of `array` and replaces criteria objects with their corresponding
  2060. * values.
  2061. *
  2062. * @private
  2063. * @param {Array} array The array to sort.
  2064. * @param {Function} comparer The function to define sort order.
  2065. * @returns {Array} Returns `array`.
  2066. */
  2067. function baseSortBy(array, comparer) {
  2068. var length = array.length;
  2069. array.sort(comparer);
  2070. while (length--) {
  2071. array[length] = array[length].value;
  2072. }
  2073. return array;
  2074. }
  2075. /**
  2076. * The base implementation of `_.sum` and `_.sumBy` without support for
  2077. * iteratee shorthands.
  2078. *
  2079. * @private
  2080. * @param {Array} array The array to iterate over.
  2081. * @param {Function} iteratee The function invoked per iteration.
  2082. * @returns {number} Returns the sum.
  2083. */
  2084. function baseSum(array, iteratee) {
  2085. var result,
  2086. index = -1,
  2087. length = array.length;
  2088. while (++index < length) {
  2089. var current = iteratee(array[index]);
  2090. if (current !== undefined) {
  2091. result = result === undefined ? current : (result + current);
  2092. }
  2093. }
  2094. return result;
  2095. }
  2096. /**
  2097. * The base implementation of `_.times` without support for iteratee shorthands
  2098. * or max array length checks.
  2099. *
  2100. * @private
  2101. * @param {number} n The number of times to invoke `iteratee`.
  2102. * @param {Function} iteratee The function invoked per iteration.
  2103. * @returns {Array} Returns the array of results.
  2104. */
  2105. function baseTimes(n, iteratee) {
  2106. var index = -1,
  2107. result = Array(n);
  2108. while (++index < n) {
  2109. result[index] = iteratee(index);
  2110. }
  2111. return result;
  2112. }
  2113. /**
  2114. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2115. * of key-value pairs for `object` corresponding to the property names of `props`.
  2116. *
  2117. * @private
  2118. * @param {Object} object The object to query.
  2119. * @param {Array} props The property names to get values for.
  2120. * @returns {Object} Returns the key-value pairs.
  2121. */
  2122. function baseToPairs(object, props) {
  2123. return arrayMap(props, function(key) {
  2124. return [key, object[key]];
  2125. });
  2126. }
  2127. /**
  2128. * The base implementation of `_.trim`.
  2129. *
  2130. * @private
  2131. * @param {string} string The string to trim.
  2132. * @returns {string} Returns the trimmed string.
  2133. */
  2134. function baseTrim(string) {
  2135. return string
  2136. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2137. : string;
  2138. }
  2139. /**
  2140. * The base implementation of `_.unary` without support for storing metadata.
  2141. *
  2142. * @private
  2143. * @param {Function} func The function to cap arguments for.
  2144. * @returns {Function} Returns the new capped function.
  2145. */
  2146. function baseUnary(func) {
  2147. return function(value) {
  2148. return func(value);
  2149. };
  2150. }
  2151. /**
  2152. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2153. * array of `object` property values corresponding to the property names
  2154. * of `props`.
  2155. *
  2156. * @private
  2157. * @param {Object} object The object to query.
  2158. * @param {Array} props The property names to get values for.
  2159. * @returns {Object} Returns the array of property values.
  2160. */
  2161. function baseValues(object, props) {
  2162. return arrayMap(props, function(key) {
  2163. return object[key];
  2164. });
  2165. }
  2166. /**
  2167. * Checks if a `cache` value for `key` exists.
  2168. *
  2169. * @private
  2170. * @param {Object} cache The cache to query.
  2171. * @param {string} key The key of the entry to check.
  2172. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2173. */
  2174. function cacheHas(cache, key) {
  2175. return cache.has(key);
  2176. }
  2177. /**
  2178. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2179. * that is not found in the character symbols.
  2180. *
  2181. * @private
  2182. * @param {Array} strSymbols The string symbols to inspect.
  2183. * @param {Array} chrSymbols The character symbols to find.
  2184. * @returns {number} Returns the index of the first unmatched string symbol.
  2185. */
  2186. function charsStartIndex(strSymbols, chrSymbols) {
  2187. var index = -1,
  2188. length = strSymbols.length;
  2189. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2190. return index;
  2191. }
  2192. /**
  2193. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2194. * that is not found in the character symbols.
  2195. *
  2196. * @private
  2197. * @param {Array} strSymbols The string symbols to inspect.
  2198. * @param {Array} chrSymbols The character symbols to find.
  2199. * @returns {number} Returns the index of the last unmatched string symbol.
  2200. */
  2201. function charsEndIndex(strSymbols, chrSymbols) {
  2202. var index = strSymbols.length;
  2203. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2204. return index;
  2205. }
  2206. /**
  2207. * Gets the number of `placeholder` occurrences in `array`.
  2208. *
  2209. * @private
  2210. * @param {Array} array The array to inspect.
  2211. * @param {*} placeholder The placeholder to search for.
  2212. * @returns {number} Returns the placeholder count.
  2213. */
  2214. function countHolders(array, placeholder) {
  2215. var length = array.length,
  2216. result = 0;
  2217. while (length--) {
  2218. if (array[length] === placeholder) {
  2219. ++result;
  2220. }
  2221. }
  2222. return result;
  2223. }
  2224. /**
  2225. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2226. * letters to basic Latin letters.
  2227. *
  2228. * @private
  2229. * @param {string} letter The matched letter to deburr.
  2230. * @returns {string} Returns the deburred letter.
  2231. */
  2232. var deburrLetter = basePropertyOf(deburredLetters);
  2233. /**
  2234. * Used by `_.escape` to convert characters to HTML entities.
  2235. *
  2236. * @private
  2237. * @param {string} chr The matched character to escape.
  2238. * @returns {string} Returns the escaped character.
  2239. */
  2240. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2241. /**
  2242. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2243. *
  2244. * @private
  2245. * @param {string} chr The matched character to escape.
  2246. * @returns {string} Returns the escaped character.
  2247. */
  2248. function escapeStringChar(chr) {
  2249. return '\\' + stringEscapes[chr];
  2250. }
  2251. /**
  2252. * Gets the value at `key` of `object`.
  2253. *
  2254. * @private
  2255. * @param {Object} [object] The object to query.
  2256. * @param {string} key The key of the property to get.
  2257. * @returns {*} Returns the property value.
  2258. */
  2259. function getValue(object, key) {
  2260. return object == null ? undefined : object[key];
  2261. }
  2262. /**
  2263. * Checks if `string` contains Unicode symbols.
  2264. *
  2265. * @private
  2266. * @param {string} string The string to inspect.
  2267. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2268. */
  2269. function hasUnicode(string) {
  2270. return reHasUnicode.test(string);
  2271. }
  2272. /**
  2273. * Checks if `string` contains a word composed of Unicode symbols.
  2274. *
  2275. * @private
  2276. * @param {string} string The string to inspect.
  2277. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2278. */
  2279. function hasUnicodeWord(string) {
  2280. return reHasUnicodeWord.test(string);
  2281. }
  2282. /**
  2283. * Converts `iterator` to an array.
  2284. *
  2285. * @private
  2286. * @param {Object} iterator The iterator to convert.
  2287. * @returns {Array} Returns the converted array.
  2288. */
  2289. function iteratorToArray(iterator) {
  2290. var data,
  2291. result = [];
  2292. while (!(data = iterator.next()).done) {
  2293. result.push(data.value);
  2294. }
  2295. return result;
  2296. }
  2297. /**
  2298. * Converts `map` to its key-value pairs.
  2299. *
  2300. * @private
  2301. * @param {Object} map The map to convert.
  2302. * @returns {Array} Returns the key-value pairs.
  2303. */
  2304. function mapToArray(map) {
  2305. var index = -1,
  2306. result = Array(map.size);
  2307. map.forEach(function(value, key) {
  2308. result[++index] = [key, value];
  2309. });
  2310. return result;
  2311. }
  2312. /**
  2313. * Creates a unary function that invokes `func` with its argument transformed.
  2314. *
  2315. * @private
  2316. * @param {Function} func The function to wrap.
  2317. * @param {Function} transform The argument transform.
  2318. * @returns {Function} Returns the new function.
  2319. */
  2320. function overArg(func, transform) {
  2321. return function(arg) {
  2322. return func(transform(arg));
  2323. };
  2324. }
  2325. /**
  2326. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2327. * and returns an array of their indexes.
  2328. *
  2329. * @private
  2330. * @param {Array} array The array to modify.
  2331. * @param {*} placeholder The placeholder to replace.
  2332. * @returns {Array} Returns the new array of placeholder indexes.
  2333. */
  2334. function replaceHolders(array, placeholder) {
  2335. var index = -1,
  2336. length = array.length,
  2337. resIndex = 0,
  2338. result = [];
  2339. while (++index < length) {
  2340. var value = array[index];
  2341. if (value === placeholder || value === PLACEHOLDER) {
  2342. array[index] = PLACEHOLDER;
  2343. result[resIndex++] = index;
  2344. }
  2345. }
  2346. return result;
  2347. }
  2348. /**
  2349. * Converts `set` to an array of its values.
  2350. *
  2351. * @private
  2352. * @param {Object} set The set to convert.
  2353. * @returns {Array} Returns the values.
  2354. */
  2355. function setToArray(set) {
  2356. var index = -1,
  2357. result = Array(set.size);
  2358. set.forEach(function(value) {
  2359. result[++index] = value;
  2360. });
  2361. return result;
  2362. }
  2363. /**
  2364. * Converts `set` to its value-value pairs.
  2365. *
  2366. * @private
  2367. * @param {Object} set The set to convert.
  2368. * @returns {Array} Returns the value-value pairs.
  2369. */
  2370. function setToPairs(set) {
  2371. var index = -1,
  2372. result = Array(set.size);
  2373. set.forEach(function(value) {
  2374. result[++index] = [value, value];
  2375. });
  2376. return result;
  2377. }
  2378. /**
  2379. * A specialized version of `_.indexOf` which performs strict equality
  2380. * comparisons of values, i.e. `===`.
  2381. *
  2382. * @private
  2383. * @param {Array} array The array to inspect.
  2384. * @param {*} value The value to search for.
  2385. * @param {number} fromIndex The index to search from.
  2386. * @returns {number} Returns the index of the matched value, else `-1`.
  2387. */
  2388. function strictIndexOf(array, value, fromIndex) {
  2389. var index = fromIndex - 1,
  2390. length = array.length;
  2391. while (++index < length) {
  2392. if (array[index] === value) {
  2393. return index;
  2394. }
  2395. }
  2396. return -1;
  2397. }
  2398. /**
  2399. * A specialized version of `_.lastIndexOf` which performs strict equality
  2400. * comparisons of values, i.e. `===`.
  2401. *
  2402. * @private
  2403. * @param {Array} array The array to inspect.
  2404. * @param {*} value The value to search for.
  2405. * @param {number} fromIndex The index to search from.
  2406. * @returns {number} Returns the index of the matched value, else `-1`.
  2407. */
  2408. function strictLastIndexOf(array, value, fromIndex) {
  2409. var index = fromIndex + 1;
  2410. while (index--) {
  2411. if (array[index] === value) {
  2412. return index;
  2413. }
  2414. }
  2415. return index;
  2416. }
  2417. /**
  2418. * Gets the number of symbols in `string`.
  2419. *
  2420. * @private
  2421. * @param {string} string The string to inspect.
  2422. * @returns {number} Returns the string size.
  2423. */
  2424. function stringSize(string) {
  2425. return hasUnicode(string)
  2426. ? unicodeSize(string)
  2427. : asciiSize(string);
  2428. }
  2429. /**
  2430. * Converts `string` to an array.
  2431. *
  2432. * @private
  2433. * @param {string} string The string to convert.
  2434. * @returns {Array} Returns the converted array.
  2435. */
  2436. function stringToArray(string) {
  2437. return hasUnicode(string)
  2438. ? unicodeToArray(string)
  2439. : asciiToArray(string);
  2440. }
  2441. /**
  2442. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2443. * character of `string`.
  2444. *
  2445. * @private
  2446. * @param {string} string The string to inspect.
  2447. * @returns {number} Returns the index of the last non-whitespace character.
  2448. */
  2449. function trimmedEndIndex(string) {
  2450. var index = string.length;
  2451. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2452. return index;
  2453. }
  2454. /**
  2455. * Used by `_.unescape` to convert HTML entities to characters.
  2456. *
  2457. * @private
  2458. * @param {string} chr The matched character to unescape.
  2459. * @returns {string} Returns the unescaped character.
  2460. */
  2461. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2462. /**
  2463. * Gets the size of a Unicode `string`.
  2464. *
  2465. * @private
  2466. * @param {string} string The string inspect.
  2467. * @returns {number} Returns the string size.
  2468. */
  2469. function unicodeSize(string) {
  2470. var result = reUnicode.lastIndex = 0;
  2471. while (reUnicode.test(string)) {
  2472. ++result;
  2473. }
  2474. return result;
  2475. }
  2476. /**
  2477. * Converts a Unicode `string` to an array.
  2478. *
  2479. * @private
  2480. * @param {string} string The string to convert.
  2481. * @returns {Array} Returns the converted array.
  2482. */
  2483. function unicodeToArray(string) {
  2484. return string.match(reUnicode) || [];
  2485. }
  2486. /**
  2487. * Splits a Unicode `string` into an array of its words.
  2488. *
  2489. * @private
  2490. * @param {string} The string to inspect.
  2491. * @returns {Array} Returns the words of `string`.
  2492. */
  2493. function unicodeWords(string) {
  2494. return string.match(reUnicodeWord) || [];
  2495. }
  2496. /*--------------------------------------------------------------------------*/
  2497. /**
  2498. * Create a new pristine `lodash` function using the `context` object.
  2499. *
  2500. * @static
  2501. * @memberOf _
  2502. * @since 1.1.0
  2503. * @category Util
  2504. * @param {Object} [context=root] The context object.
  2505. * @returns {Function} Returns a new `lodash` function.
  2506. * @example
  2507. *
  2508. * _.mixin({ 'foo': _.constant('foo') });
  2509. *
  2510. * var lodash = _.runInContext();
  2511. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2512. *
  2513. * _.isFunction(_.foo);
  2514. * // => true
  2515. * _.isFunction(_.bar);
  2516. * // => false
  2517. *
  2518. * lodash.isFunction(lodash.foo);
  2519. * // => false
  2520. * lodash.isFunction(lodash.bar);
  2521. * // => true
  2522. *
  2523. * // Create a suped-up `defer` in Node.js.
  2524. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2525. */
  2526. var runInContext = (function runInContext(context) {
  2527. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2528. /** Built-in constructor references. */
  2529. var Array = context.Array,
  2530. Date = context.Date,
  2531. Error = context.Error,
  2532. Function = context.Function,
  2533. Math = context.Math,
  2534. Object = context.Object,
  2535. RegExp = context.RegExp,
  2536. String = context.String,
  2537. TypeError = context.TypeError;
  2538. /** Used for built-in method references. */
  2539. var arrayProto = Array.prototype,
  2540. funcProto = Function.prototype,
  2541. objectProto = Object.prototype;
  2542. /** Used to detect overreaching core-js shims. */
  2543. var coreJsData = context['__core-js_shared__'];
  2544. /** Used to resolve the decompiled source of functions. */
  2545. var funcToString = funcProto.toString;
  2546. /** Used to check objects for own properties. */
  2547. var hasOwnProperty = objectProto.hasOwnProperty;
  2548. /** Used to generate unique IDs. */
  2549. var idCounter = 0;
  2550. /** Used to detect methods masquerading as native. */
  2551. var maskSrcKey = (function() {
  2552. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2553. return uid ? ('Symbol(src)_1.' + uid) : '';
  2554. }());
  2555. /**
  2556. * Used to resolve the
  2557. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2558. * of values.
  2559. */
  2560. var nativeObjectToString = objectProto.toString;
  2561. /** Used to infer the `Object` constructor. */
  2562. var objectCtorString = funcToString.call(Object);
  2563. /** Used to restore the original `_` reference in `_.noConflict`. */
  2564. var oldDash = root._;
  2565. /** Used to detect if a method is native. */
  2566. var reIsNative = RegExp('^' +
  2567. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2568. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2569. );
  2570. /** Built-in value references. */
  2571. var Buffer = moduleExports ? context.Buffer : undefined,
  2572. Symbol = context.Symbol,
  2573. Uint8Array = context.Uint8Array,
  2574. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2575. getPrototype = overArg(Object.getPrototypeOf, Object),
  2576. objectCreate = Object.create,
  2577. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2578. splice = arrayProto.splice,
  2579. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2580. symIterator = Symbol ? Symbol.iterator : undefined,
  2581. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2582. var defineProperty = (function() {
  2583. try {
  2584. var func = getNative(Object, 'defineProperty');
  2585. func({}, '', {});
  2586. return func;
  2587. } catch (e) {}
  2588. }());
  2589. /** Mocked built-ins. */
  2590. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2591. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2592. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2593. /* Built-in method references for those with the same name as other `lodash` methods. */
  2594. var nativeCeil = Math.ceil,
  2595. nativeFloor = Math.floor,
  2596. nativeGetSymbols = Object.getOwnPropertySymbols,
  2597. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2598. nativeIsFinite = context.isFinite,
  2599. nativeJoin = arrayProto.join,
  2600. nativeKeys = overArg(Object.keys, Object),
  2601. nativeMax = Math.max,
  2602. nativeMin = Math.min,
  2603. nativeNow = Date.now,
  2604. nativeParseInt = context.parseInt,
  2605. nativeRandom = Math.random,
  2606. nativeReverse = arrayProto.reverse;
  2607. /* Built-in method references that are verified to be native. */
  2608. var DataView = getNative(context, 'DataView'),
  2609. Map = getNative(context, 'Map'),
  2610. Promise = getNative(context, 'Promise'),
  2611. Set = getNative(context, 'Set'),
  2612. WeakMap = getNative(context, 'WeakMap'),
  2613. nativeCreate = getNative(Object, 'create');
  2614. /** Used to store function metadata. */
  2615. var metaMap = WeakMap && new WeakMap;
  2616. /** Used to lookup unminified function names. */
  2617. var realNames = {};
  2618. /** Used to detect maps, sets, and weakmaps. */
  2619. var dataViewCtorString = toSource(DataView),
  2620. mapCtorString = toSource(Map),
  2621. promiseCtorString = toSource(Promise),
  2622. setCtorString = toSource(Set),
  2623. weakMapCtorString = toSource(WeakMap);
  2624. /** Used to convert symbols to primitives and strings. */
  2625. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2626. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2627. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2628. /*------------------------------------------------------------------------*/
  2629. /**
  2630. * Creates a `lodash` object which wraps `value` to enable implicit method
  2631. * chain sequences. Methods that operate on and return arrays, collections,
  2632. * and functions can be chained together. Methods that retrieve a single value
  2633. * or may return a primitive value will automatically end the chain sequence
  2634. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2635. * with `_#value`.
  2636. *
  2637. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2638. * enabled using `_.chain`.
  2639. *
  2640. * The execution of chained methods is lazy, that is, it's deferred until
  2641. * `_#value` is implicitly or explicitly called.
  2642. *
  2643. * Lazy evaluation allows several methods to support shortcut fusion.
  2644. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2645. * the creation of intermediate arrays and can greatly reduce the number of
  2646. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2647. * fusion if the section is applied to an array and iteratees accept only
  2648. * one argument. The heuristic for whether a section qualifies for shortcut
  2649. * fusion is subject to change.
  2650. *
  2651. * Chaining is supported in custom builds as long as the `_#value` method is
  2652. * directly or indirectly included in the build.
  2653. *
  2654. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2655. *
  2656. * The wrapper `Array` methods are:
  2657. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2658. *
  2659. * The wrapper `String` methods are:
  2660. * `replace` and `split`
  2661. *
  2662. * The wrapper methods that support shortcut fusion are:
  2663. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2664. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2665. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2666. *
  2667. * The chainable wrapper methods are:
  2668. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2669. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2670. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2671. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2672. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2673. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2674. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2675. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2676. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2677. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2678. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2679. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2680. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2681. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2682. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2683. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2684. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2685. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2686. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2687. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2688. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2689. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2690. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2691. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2692. *
  2693. * The wrapper methods that are **not** chainable by default are:
  2694. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2695. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2696. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2697. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2698. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2699. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2700. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2701. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2702. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2703. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2704. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2705. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2706. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2707. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2708. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2709. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2710. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2711. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2712. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2713. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2714. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2715. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2716. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2717. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2718. * `upperFirst`, `value`, and `words`
  2719. *
  2720. * @name _
  2721. * @constructor
  2722. * @category Seq
  2723. * @param {*} value The value to wrap in a `lodash` instance.
  2724. * @returns {Object} Returns the new `lodash` wrapper instance.
  2725. * @example
  2726. *
  2727. * function square(n) {
  2728. * return n * n;
  2729. * }
  2730. *
  2731. * var wrapped = _([1, 2, 3]);
  2732. *
  2733. * // Returns an unwrapped value.
  2734. * wrapped.reduce(_.add);
  2735. * // => 6
  2736. *
  2737. * // Returns a wrapped value.
  2738. * var squares = wrapped.map(square);
  2739. *
  2740. * _.isArray(squares);
  2741. * // => false
  2742. *
  2743. * _.isArray(squares.value());
  2744. * // => true
  2745. */
  2746. function lodash(value) {
  2747. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2748. if (value instanceof LodashWrapper) {
  2749. return value;
  2750. }
  2751. if (hasOwnProperty.call(value, '__wrapped__')) {
  2752. return wrapperClone(value);
  2753. }
  2754. }
  2755. return new LodashWrapper(value);
  2756. }
  2757. /**
  2758. * The base implementation of `_.create` without support for assigning
  2759. * properties to the created object.
  2760. *
  2761. * @private
  2762. * @param {Object} proto The object to inherit from.
  2763. * @returns {Object} Returns the new object.
  2764. */
  2765. var baseCreate = (function() {
  2766. function object() {}
  2767. return function(proto) {
  2768. if (!isObject(proto)) {
  2769. return {};
  2770. }
  2771. if (objectCreate) {
  2772. return objectCreate(proto);
  2773. }
  2774. object.prototype = proto;
  2775. var result = new object;
  2776. object.prototype = undefined;
  2777. return result;
  2778. };
  2779. }());
  2780. /**
  2781. * The function whose prototype chain sequence wrappers inherit from.
  2782. *
  2783. * @private
  2784. */
  2785. function baseLodash() {
  2786. // No operation performed.
  2787. }
  2788. /**
  2789. * The base constructor for creating `lodash` wrapper objects.
  2790. *
  2791. * @private
  2792. * @param {*} value The value to wrap.
  2793. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2794. */
  2795. function LodashWrapper(value, chainAll) {
  2796. this.__wrapped__ = value;
  2797. this.__actions__ = [];
  2798. this.__chain__ = !!chainAll;
  2799. this.__index__ = 0;
  2800. this.__values__ = undefined;
  2801. }
  2802. /**
  2803. * By default, the template delimiters used by lodash are like those in
  2804. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2805. * following template settings to use alternative delimiters.
  2806. *
  2807. * @static
  2808. * @memberOf _
  2809. * @type {Object}
  2810. */
  2811. lodash.templateSettings = {
  2812. /**
  2813. * Used to detect `data` property values to be HTML-escaped.
  2814. *
  2815. * @memberOf _.templateSettings
  2816. * @type {RegExp}
  2817. */
  2818. 'escape': reEscape,
  2819. /**
  2820. * Used to detect code to be evaluated.
  2821. *
  2822. * @memberOf _.templateSettings
  2823. * @type {RegExp}
  2824. */
  2825. 'evaluate': reEvaluate,
  2826. /**
  2827. * Used to detect `data` property values to inject.
  2828. *
  2829. * @memberOf _.templateSettings
  2830. * @type {RegExp}
  2831. */
  2832. 'interpolate': reInterpolate,
  2833. /**
  2834. * Used to reference the data object in the template text.
  2835. *
  2836. * @memberOf _.templateSettings
  2837. * @type {string}
  2838. */
  2839. 'variable': '',
  2840. /**
  2841. * Used to import variables into the compiled template.
  2842. *
  2843. * @memberOf _.templateSettings
  2844. * @type {Object}
  2845. */
  2846. 'imports': {
  2847. /**
  2848. * A reference to the `lodash` function.
  2849. *
  2850. * @memberOf _.templateSettings.imports
  2851. * @type {Function}
  2852. */
  2853. '_': lodash
  2854. }
  2855. };
  2856. // Ensure wrappers are instances of `baseLodash`.
  2857. lodash.prototype = baseLodash.prototype;
  2858. lodash.prototype.constructor = lodash;
  2859. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2860. LodashWrapper.prototype.constructor = LodashWrapper;
  2861. /*------------------------------------------------------------------------*/
  2862. /**
  2863. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2864. *
  2865. * @private
  2866. * @constructor
  2867. * @param {*} value The value to wrap.
  2868. */
  2869. function LazyWrapper(value) {
  2870. this.__wrapped__ = value;
  2871. this.__actions__ = [];
  2872. this.__dir__ = 1;
  2873. this.__filtered__ = false;
  2874. this.__iteratees__ = [];
  2875. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2876. this.__views__ = [];
  2877. }
  2878. /**
  2879. * Creates a clone of the lazy wrapper object.
  2880. *
  2881. * @private
  2882. * @name clone
  2883. * @memberOf LazyWrapper
  2884. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2885. */
  2886. function lazyClone() {
  2887. var result = new LazyWrapper(this.__wrapped__);
  2888. result.__actions__ = copyArray(this.__actions__);
  2889. result.__dir__ = this.__dir__;
  2890. result.__filtered__ = this.__filtered__;
  2891. result.__iteratees__ = copyArray(this.__iteratees__);
  2892. result.__takeCount__ = this.__takeCount__;
  2893. result.__views__ = copyArray(this.__views__);
  2894. return result;
  2895. }
  2896. /**
  2897. * Reverses the direction of lazy iteration.
  2898. *
  2899. * @private
  2900. * @name reverse
  2901. * @memberOf LazyWrapper
  2902. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2903. */
  2904. function lazyReverse() {
  2905. if (this.__filtered__) {
  2906. var result = new LazyWrapper(this);
  2907. result.__dir__ = -1;
  2908. result.__filtered__ = true;
  2909. } else {
  2910. result = this.clone();
  2911. result.__dir__ *= -1;
  2912. }
  2913. return result;
  2914. }
  2915. /**
  2916. * Extracts the unwrapped value from its lazy wrapper.
  2917. *
  2918. * @private
  2919. * @name value
  2920. * @memberOf LazyWrapper
  2921. * @returns {*} Returns the unwrapped value.
  2922. */
  2923. function lazyValue() {
  2924. var array = this.__wrapped__.value(),
  2925. dir = this.__dir__,
  2926. isArr = isArray(array),
  2927. isRight = dir < 0,
  2928. arrLength = isArr ? array.length : 0,
  2929. view = getView(0, arrLength, this.__views__),
  2930. start = view.start,
  2931. end = view.end,
  2932. length = end - start,
  2933. index = isRight ? end : (start - 1),
  2934. iteratees = this.__iteratees__,
  2935. iterLength = iteratees.length,
  2936. resIndex = 0,
  2937. takeCount = nativeMin(length, this.__takeCount__);
  2938. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2939. return baseWrapperValue(array, this.__actions__);
  2940. }
  2941. var result = [];
  2942. outer:
  2943. while (length-- && resIndex < takeCount) {
  2944. index += dir;
  2945. var iterIndex = -1,
  2946. value = array[index];
  2947. while (++iterIndex < iterLength) {
  2948. var data = iteratees[iterIndex],
  2949. iteratee = data.iteratee,
  2950. type = data.type,
  2951. computed = iteratee(value);
  2952. if (type == LAZY_MAP_FLAG) {
  2953. value = computed;
  2954. } else if (!computed) {
  2955. if (type == LAZY_FILTER_FLAG) {
  2956. continue outer;
  2957. } else {
  2958. break outer;
  2959. }
  2960. }
  2961. }
  2962. result[resIndex++] = value;
  2963. }
  2964. return result;
  2965. }
  2966. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2967. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2968. LazyWrapper.prototype.constructor = LazyWrapper;
  2969. /*------------------------------------------------------------------------*/
  2970. /**
  2971. * Creates a hash object.
  2972. *
  2973. * @private
  2974. * @constructor
  2975. * @param {Array} [entries] The key-value pairs to cache.
  2976. */
  2977. function Hash(entries) {
  2978. var index = -1,
  2979. length = entries == null ? 0 : entries.length;
  2980. this.clear();
  2981. while (++index < length) {
  2982. var entry = entries[index];
  2983. this.set(entry[0], entry[1]);
  2984. }
  2985. }
  2986. /**
  2987. * Removes all key-value entries from the hash.
  2988. *
  2989. * @private
  2990. * @name clear
  2991. * @memberOf Hash
  2992. */
  2993. function hashClear() {
  2994. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2995. this.size = 0;
  2996. }
  2997. /**
  2998. * Removes `key` and its value from the hash.
  2999. *
  3000. * @private
  3001. * @name delete
  3002. * @memberOf Hash
  3003. * @param {Object} hash The hash to modify.
  3004. * @param {string} key The key of the value to remove.
  3005. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3006. */
  3007. function hashDelete(key) {
  3008. var result = this.has(key) && delete this.__data__[key];
  3009. this.size -= result ? 1 : 0;
  3010. return result;
  3011. }
  3012. /**
  3013. * Gets the hash value for `key`.
  3014. *
  3015. * @private
  3016. * @name get
  3017. * @memberOf Hash
  3018. * @param {string} key The key of the value to get.
  3019. * @returns {*} Returns the entry value.
  3020. */
  3021. function hashGet(key) {
  3022. var data = this.__data__;
  3023. if (nativeCreate) {
  3024. var result = data[key];
  3025. return result === HASH_UNDEFINED ? undefined : result;
  3026. }
  3027. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3028. }
  3029. /**
  3030. * Checks if a hash value for `key` exists.
  3031. *
  3032. * @private
  3033. * @name has
  3034. * @memberOf Hash
  3035. * @param {string} key The key of the entry to check.
  3036. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3037. */
  3038. function hashHas(key) {
  3039. var data = this.__data__;
  3040. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3041. }
  3042. /**
  3043. * Sets the hash `key` to `value`.
  3044. *
  3045. * @private
  3046. * @name set
  3047. * @memberOf Hash
  3048. * @param {string} key The key of the value to set.
  3049. * @param {*} value The value to set.
  3050. * @returns {Object} Returns the hash instance.
  3051. */
  3052. function hashSet(key, value) {
  3053. var data = this.__data__;
  3054. this.size += this.has(key) ? 0 : 1;
  3055. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3056. return this;
  3057. }
  3058. // Add methods to `Hash`.
  3059. Hash.prototype.clear = hashClear;
  3060. Hash.prototype['delete'] = hashDelete;
  3061. Hash.prototype.get = hashGet;
  3062. Hash.prototype.has = hashHas;
  3063. Hash.prototype.set = hashSet;
  3064. /*------------------------------------------------------------------------*/
  3065. /**
  3066. * Creates an list cache object.
  3067. *
  3068. * @private
  3069. * @constructor
  3070. * @param {Array} [entries] The key-value pairs to cache.
  3071. */
  3072. function ListCache(entries) {
  3073. var index = -1,
  3074. length = entries == null ? 0 : entries.length;
  3075. this.clear();
  3076. while (++index < length) {
  3077. var entry = entries[index];
  3078. this.set(entry[0], entry[1]);
  3079. }
  3080. }
  3081. /**
  3082. * Removes all key-value entries from the list cache.
  3083. *
  3084. * @private
  3085. * @name clear
  3086. * @memberOf ListCache
  3087. */
  3088. function listCacheClear() {
  3089. this.__data__ = [];
  3090. this.size = 0;
  3091. }
  3092. /**
  3093. * Removes `key` and its value from the list cache.
  3094. *
  3095. * @private
  3096. * @name delete
  3097. * @memberOf ListCache
  3098. * @param {string} key The key of the value to remove.
  3099. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3100. */
  3101. function listCacheDelete(key) {
  3102. var data = this.__data__,
  3103. index = assocIndexOf(data, key);
  3104. if (index < 0) {
  3105. return false;
  3106. }
  3107. var lastIndex = data.length - 1;
  3108. if (index == lastIndex) {
  3109. data.pop();
  3110. } else {
  3111. splice.call(data, index, 1);
  3112. }
  3113. --this.size;
  3114. return true;
  3115. }
  3116. /**
  3117. * Gets the list cache value for `key`.
  3118. *
  3119. * @private
  3120. * @name get
  3121. * @memberOf ListCache
  3122. * @param {string} key The key of the value to get.
  3123. * @returns {*} Returns the entry value.
  3124. */
  3125. function listCacheGet(key) {
  3126. var data = this.__data__,
  3127. index = assocIndexOf(data, key);
  3128. return index < 0 ? undefined : data[index][1];
  3129. }
  3130. /**
  3131. * Checks if a list cache value for `key` exists.
  3132. *
  3133. * @private
  3134. * @name has
  3135. * @memberOf ListCache
  3136. * @param {string} key The key of the entry to check.
  3137. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3138. */
  3139. function listCacheHas(key) {
  3140. return assocIndexOf(this.__data__, key) > -1;
  3141. }
  3142. /**
  3143. * Sets the list cache `key` to `value`.
  3144. *
  3145. * @private
  3146. * @name set
  3147. * @memberOf ListCache
  3148. * @param {string} key The key of the value to set.
  3149. * @param {*} value The value to set.
  3150. * @returns {Object} Returns the list cache instance.
  3151. */
  3152. function listCacheSet(key, value) {
  3153. var data = this.__data__,
  3154. index = assocIndexOf(data, key);
  3155. if (index < 0) {
  3156. ++this.size;
  3157. data.push([key, value]);
  3158. } else {
  3159. data[index][1] = value;
  3160. }
  3161. return this;
  3162. }
  3163. // Add methods to `ListCache`.
  3164. ListCache.prototype.clear = listCacheClear;
  3165. ListCache.prototype['delete'] = listCacheDelete;
  3166. ListCache.prototype.get = listCacheGet;
  3167. ListCache.prototype.has = listCacheHas;
  3168. ListCache.prototype.set = listCacheSet;
  3169. /*------------------------------------------------------------------------*/
  3170. /**
  3171. * Creates a map cache object to store key-value pairs.
  3172. *
  3173. * @private
  3174. * @constructor
  3175. * @param {Array} [entries] The key-value pairs to cache.
  3176. */
  3177. function MapCache(entries) {
  3178. var index = -1,
  3179. length = entries == null ? 0 : entries.length;
  3180. this.clear();
  3181. while (++index < length) {
  3182. var entry = entries[index];
  3183. this.set(entry[0], entry[1]);
  3184. }
  3185. }
  3186. /**
  3187. * Removes all key-value entries from the map.
  3188. *
  3189. * @private
  3190. * @name clear
  3191. * @memberOf MapCache
  3192. */
  3193. function mapCacheClear() {
  3194. this.size = 0;
  3195. this.__data__ = {
  3196. 'hash': new Hash,
  3197. 'map': new (Map || ListCache),
  3198. 'string': new Hash
  3199. };
  3200. }
  3201. /**
  3202. * Removes `key` and its value from the map.
  3203. *
  3204. * @private
  3205. * @name delete
  3206. * @memberOf MapCache
  3207. * @param {string} key The key of the value to remove.
  3208. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3209. */
  3210. function mapCacheDelete(key) {
  3211. var result = getMapData(this, key)['delete'](key);
  3212. this.size -= result ? 1 : 0;
  3213. return result;
  3214. }
  3215. /**
  3216. * Gets the map value for `key`.
  3217. *
  3218. * @private
  3219. * @name get
  3220. * @memberOf MapCache
  3221. * @param {string} key The key of the value to get.
  3222. * @returns {*} Returns the entry value.
  3223. */
  3224. function mapCacheGet(key) {
  3225. return getMapData(this, key).get(key);
  3226. }
  3227. /**
  3228. * Checks if a map value for `key` exists.
  3229. *
  3230. * @private
  3231. * @name has
  3232. * @memberOf MapCache
  3233. * @param {string} key The key of the entry to check.
  3234. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3235. */
  3236. function mapCacheHas(key) {
  3237. return getMapData(this, key).has(key);
  3238. }
  3239. /**
  3240. * Sets the map `key` to `value`.
  3241. *
  3242. * @private
  3243. * @name set
  3244. * @memberOf MapCache
  3245. * @param {string} key The key of the value to set.
  3246. * @param {*} value The value to set.
  3247. * @returns {Object} Returns the map cache instance.
  3248. */
  3249. function mapCacheSet(key, value) {
  3250. var data = getMapData(this, key),
  3251. size = data.size;
  3252. data.set(key, value);
  3253. this.size += data.size == size ? 0 : 1;
  3254. return this;
  3255. }
  3256. // Add methods to `MapCache`.
  3257. MapCache.prototype.clear = mapCacheClear;
  3258. MapCache.prototype['delete'] = mapCacheDelete;
  3259. MapCache.prototype.get = mapCacheGet;
  3260. MapCache.prototype.has = mapCacheHas;
  3261. MapCache.prototype.set = mapCacheSet;
  3262. /*------------------------------------------------------------------------*/
  3263. /**
  3264. *
  3265. * Creates an array cache object to store unique values.
  3266. *
  3267. * @private
  3268. * @constructor
  3269. * @param {Array} [values] The values to cache.
  3270. */
  3271. function SetCache(values) {
  3272. var index = -1,
  3273. length = values == null ? 0 : values.length;
  3274. this.__data__ = new MapCache;
  3275. while (++index < length) {
  3276. this.add(values[index]);
  3277. }
  3278. }
  3279. /**
  3280. * Adds `value` to the array cache.
  3281. *
  3282. * @private
  3283. * @name add
  3284. * @memberOf SetCache
  3285. * @alias push
  3286. * @param {*} value The value to cache.
  3287. * @returns {Object} Returns the cache instance.
  3288. */
  3289. function setCacheAdd(value) {
  3290. this.__data__.set(value, HASH_UNDEFINED);
  3291. return this;
  3292. }
  3293. /**
  3294. * Checks if `value` is in the array cache.
  3295. *
  3296. * @private
  3297. * @name has
  3298. * @memberOf SetCache
  3299. * @param {*} value The value to search for.
  3300. * @returns {number} Returns `true` if `value` is found, else `false`.
  3301. */
  3302. function setCacheHas(value) {
  3303. return this.__data__.has(value);
  3304. }
  3305. // Add methods to `SetCache`.
  3306. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3307. SetCache.prototype.has = setCacheHas;
  3308. /*------------------------------------------------------------------------*/
  3309. /**
  3310. * Creates a stack cache object to store key-value pairs.
  3311. *
  3312. * @private
  3313. * @constructor
  3314. * @param {Array} [entries] The key-value pairs to cache.
  3315. */
  3316. function Stack(entries) {
  3317. var data = this.__data__ = new ListCache(entries);
  3318. this.size = data.size;
  3319. }
  3320. /**
  3321. * Removes all key-value entries from the stack.
  3322. *
  3323. * @private
  3324. * @name clear
  3325. * @memberOf Stack
  3326. */
  3327. function stackClear() {
  3328. this.__data__ = new ListCache;
  3329. this.size = 0;
  3330. }
  3331. /**
  3332. * Removes `key` and its value from the stack.
  3333. *
  3334. * @private
  3335. * @name delete
  3336. * @memberOf Stack
  3337. * @param {string} key The key of the value to remove.
  3338. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3339. */
  3340. function stackDelete(key) {
  3341. var data = this.__data__,
  3342. result = data['delete'](key);
  3343. this.size = data.size;
  3344. return result;
  3345. }
  3346. /**
  3347. * Gets the stack value for `key`.
  3348. *
  3349. * @private
  3350. * @name get
  3351. * @memberOf Stack
  3352. * @param {string} key The key of the value to get.
  3353. * @returns {*} Returns the entry value.
  3354. */
  3355. function stackGet(key) {
  3356. return this.__data__.get(key);
  3357. }
  3358. /**
  3359. * Checks if a stack value for `key` exists.
  3360. *
  3361. * @private
  3362. * @name has
  3363. * @memberOf Stack
  3364. * @param {string} key The key of the entry to check.
  3365. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3366. */
  3367. function stackHas(key) {
  3368. return this.__data__.has(key);
  3369. }
  3370. /**
  3371. * Sets the stack `key` to `value`.
  3372. *
  3373. * @private
  3374. * @name set
  3375. * @memberOf Stack
  3376. * @param {string} key The key of the value to set.
  3377. * @param {*} value The value to set.
  3378. * @returns {Object} Returns the stack cache instance.
  3379. */
  3380. function stackSet(key, value) {
  3381. var data = this.__data__;
  3382. if (data instanceof ListCache) {
  3383. var pairs = data.__data__;
  3384. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3385. pairs.push([key, value]);
  3386. this.size = ++data.size;
  3387. return this;
  3388. }
  3389. data = this.__data__ = new MapCache(pairs);
  3390. }
  3391. data.set(key, value);
  3392. this.size = data.size;
  3393. return this;
  3394. }
  3395. // Add methods to `Stack`.
  3396. Stack.prototype.clear = stackClear;
  3397. Stack.prototype['delete'] = stackDelete;
  3398. Stack.prototype.get = stackGet;
  3399. Stack.prototype.has = stackHas;
  3400. Stack.prototype.set = stackSet;
  3401. /*------------------------------------------------------------------------*/
  3402. /**
  3403. * Creates an array of the enumerable property names of the array-like `value`.
  3404. *
  3405. * @private
  3406. * @param {*} value The value to query.
  3407. * @param {boolean} inherited Specify returning inherited property names.
  3408. * @returns {Array} Returns the array of property names.
  3409. */
  3410. function arrayLikeKeys(value, inherited) {
  3411. var isArr = isArray(value),
  3412. isArg = !isArr && isArguments(value),
  3413. isBuff = !isArr && !isArg && isBuffer(value),
  3414. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3415. skipIndexes = isArr || isArg || isBuff || isType,
  3416. result = skipIndexes ? baseTimes(value.length, String) : [],
  3417. length = result.length;
  3418. for (var key in value) {
  3419. if ((inherited || hasOwnProperty.call(value, key)) &&
  3420. !(skipIndexes && (
  3421. // Safari 9 has enumerable `arguments.length` in strict mode.
  3422. key == 'length' ||
  3423. // Node.js 0.10 has enumerable non-index properties on buffers.
  3424. (isBuff && (key == 'offset' || key == 'parent')) ||
  3425. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3426. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3427. // Skip index properties.
  3428. isIndex(key, length)
  3429. ))) {
  3430. result.push(key);
  3431. }
  3432. }
  3433. return result;
  3434. }
  3435. /**
  3436. * A specialized version of `_.sample` for arrays.
  3437. *
  3438. * @private
  3439. * @param {Array} array The array to sample.
  3440. * @returns {*} Returns the random element.
  3441. */
  3442. function arraySample(array) {
  3443. var length = array.length;
  3444. return length ? array[baseRandom(0, length - 1)] : undefined;
  3445. }
  3446. /**
  3447. * A specialized version of `_.sampleSize` for arrays.
  3448. *
  3449. * @private
  3450. * @param {Array} array The array to sample.
  3451. * @param {number} n The number of elements to sample.
  3452. * @returns {Array} Returns the random elements.
  3453. */
  3454. function arraySampleSize(array, n) {
  3455. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3456. }
  3457. /**
  3458. * A specialized version of `_.shuffle` for arrays.
  3459. *
  3460. * @private
  3461. * @param {Array} array The array to shuffle.
  3462. * @returns {Array} Returns the new shuffled array.
  3463. */
  3464. function arrayShuffle(array) {
  3465. return shuffleSelf(copyArray(array));
  3466. }
  3467. /**
  3468. * This function is like `assignValue` except that it doesn't assign
  3469. * `undefined` values.
  3470. *
  3471. * @private
  3472. * @param {Object} object The object to modify.
  3473. * @param {string} key The key of the property to assign.
  3474. * @param {*} value The value to assign.
  3475. */
  3476. function assignMergeValue(object, key, value) {
  3477. if ((value !== undefined && !eq(object[key], value)) ||
  3478. (value === undefined && !(key in object))) {
  3479. baseAssignValue(object, key, value);
  3480. }
  3481. }
  3482. /**
  3483. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3484. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3485. * for equality comparisons.
  3486. *
  3487. * @private
  3488. * @param {Object} object The object to modify.
  3489. * @param {string} key The key of the property to assign.
  3490. * @param {*} value The value to assign.
  3491. */
  3492. function assignValue(object, key, value) {
  3493. var objValue = object[key];
  3494. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3495. (value === undefined && !(key in object))) {
  3496. baseAssignValue(object, key, value);
  3497. }
  3498. }
  3499. /**
  3500. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3501. *
  3502. * @private
  3503. * @param {Array} array The array to inspect.
  3504. * @param {*} key The key to search for.
  3505. * @returns {number} Returns the index of the matched value, else `-1`.
  3506. */
  3507. function assocIndexOf(array, key) {
  3508. var length = array.length;
  3509. while (length--) {
  3510. if (eq(array[length][0], key)) {
  3511. return length;
  3512. }
  3513. }
  3514. return -1;
  3515. }
  3516. /**
  3517. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3518. * by `iteratee` and values set by `setter`.
  3519. *
  3520. * @private
  3521. * @param {Array|Object} collection The collection to iterate over.
  3522. * @param {Function} setter The function to set `accumulator` values.
  3523. * @param {Function} iteratee The iteratee to transform keys.
  3524. * @param {Object} accumulator The initial aggregated object.
  3525. * @returns {Function} Returns `accumulator`.
  3526. */
  3527. function baseAggregator(collection, setter, iteratee, accumulator) {
  3528. baseEach(collection, function(value, key, collection) {
  3529. setter(accumulator, value, iteratee(value), collection);
  3530. });
  3531. return accumulator;
  3532. }
  3533. /**
  3534. * The base implementation of `_.assign` without support for multiple sources
  3535. * or `customizer` functions.
  3536. *
  3537. * @private
  3538. * @param {Object} object The destination object.
  3539. * @param {Object} source The source object.
  3540. * @returns {Object} Returns `object`.
  3541. */
  3542. function baseAssign(object, source) {
  3543. return object && copyObject(source, keys(source), object);
  3544. }
  3545. /**
  3546. * The base implementation of `_.assignIn` without support for multiple sources
  3547. * or `customizer` functions.
  3548. *
  3549. * @private
  3550. * @param {Object} object The destination object.
  3551. * @param {Object} source The source object.
  3552. * @returns {Object} Returns `object`.
  3553. */
  3554. function baseAssignIn(object, source) {
  3555. return object && copyObject(source, keysIn(source), object);
  3556. }
  3557. /**
  3558. * The base implementation of `assignValue` and `assignMergeValue` without
  3559. * value checks.
  3560. *
  3561. * @private
  3562. * @param {Object} object The object to modify.
  3563. * @param {string} key The key of the property to assign.
  3564. * @param {*} value The value to assign.
  3565. */
  3566. function baseAssignValue(object, key, value) {
  3567. if (key == '__proto__' && defineProperty) {
  3568. defineProperty(object, key, {
  3569. 'configurable': true,
  3570. 'enumerable': true,
  3571. 'value': value,
  3572. 'writable': true
  3573. });
  3574. } else {
  3575. object[key] = value;
  3576. }
  3577. }
  3578. /**
  3579. * The base implementation of `_.at` without support for individual paths.
  3580. *
  3581. * @private
  3582. * @param {Object} object The object to iterate over.
  3583. * @param {string[]} paths The property paths to pick.
  3584. * @returns {Array} Returns the picked elements.
  3585. */
  3586. function baseAt(object, paths) {
  3587. var index = -1,
  3588. length = paths.length,
  3589. result = Array(length),
  3590. skip = object == null;
  3591. while (++index < length) {
  3592. result[index] = skip ? undefined : get(object, paths[index]);
  3593. }
  3594. return result;
  3595. }
  3596. /**
  3597. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3598. *
  3599. * @private
  3600. * @param {number} number The number to clamp.
  3601. * @param {number} [lower] The lower bound.
  3602. * @param {number} upper The upper bound.
  3603. * @returns {number} Returns the clamped number.
  3604. */
  3605. function baseClamp(number, lower, upper) {
  3606. if (number === number) {
  3607. if (upper !== undefined) {
  3608. number = number <= upper ? number : upper;
  3609. }
  3610. if (lower !== undefined) {
  3611. number = number >= lower ? number : lower;
  3612. }
  3613. }
  3614. return number;
  3615. }
  3616. /**
  3617. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3618. * traversed objects.
  3619. *
  3620. * @private
  3621. * @param {*} value The value to clone.
  3622. * @param {boolean} bitmask The bitmask flags.
  3623. * 1 - Deep clone
  3624. * 2 - Flatten inherited properties
  3625. * 4 - Clone symbols
  3626. * @param {Function} [customizer] The function to customize cloning.
  3627. * @param {string} [key] The key of `value`.
  3628. * @param {Object} [object] The parent object of `value`.
  3629. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3630. * @returns {*} Returns the cloned value.
  3631. */
  3632. function baseClone(value, bitmask, customizer, key, object, stack) {
  3633. var result,
  3634. isDeep = bitmask & CLONE_DEEP_FLAG,
  3635. isFlat = bitmask & CLONE_FLAT_FLAG,
  3636. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3637. if (customizer) {
  3638. result = object ? customizer(value, key, object, stack) : customizer(value);
  3639. }
  3640. if (result !== undefined) {
  3641. return result;
  3642. }
  3643. if (!isObject(value)) {
  3644. return value;
  3645. }
  3646. var isArr = isArray(value);
  3647. if (isArr) {
  3648. result = initCloneArray(value);
  3649. if (!isDeep) {
  3650. return copyArray(value, result);
  3651. }
  3652. } else {
  3653. var tag = getTag(value),
  3654. isFunc = tag == funcTag || tag == genTag;
  3655. if (isBuffer(value)) {
  3656. return cloneBuffer(value, isDeep);
  3657. }
  3658. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3659. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3660. if (!isDeep) {
  3661. return isFlat
  3662. ? copySymbolsIn(value, baseAssignIn(result, value))
  3663. : copySymbols(value, baseAssign(result, value));
  3664. }
  3665. } else {
  3666. if (!cloneableTags[tag]) {
  3667. return object ? value : {};
  3668. }
  3669. result = initCloneByTag(value, tag, isDeep);
  3670. }
  3671. }
  3672. // Check for circular references and return its corresponding clone.
  3673. stack || (stack = new Stack);
  3674. var stacked = stack.get(value);
  3675. if (stacked) {
  3676. return stacked;
  3677. }
  3678. stack.set(value, result);
  3679. if (isSet(value)) {
  3680. value.forEach(function(subValue) {
  3681. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3682. });
  3683. } else if (isMap(value)) {
  3684. value.forEach(function(subValue, key) {
  3685. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3686. });
  3687. }
  3688. var keysFunc = isFull
  3689. ? (isFlat ? getAllKeysIn : getAllKeys)
  3690. : (isFlat ? keysIn : keys);
  3691. var props = isArr ? undefined : keysFunc(value);
  3692. arrayEach(props || value, function(subValue, key) {
  3693. if (props) {
  3694. key = subValue;
  3695. subValue = value[key];
  3696. }
  3697. // Recursively populate clone (susceptible to call stack limits).
  3698. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3699. });
  3700. return result;
  3701. }
  3702. /**
  3703. * The base implementation of `_.conforms` which doesn't clone `source`.
  3704. *
  3705. * @private
  3706. * @param {Object} source The object of property predicates to conform to.
  3707. * @returns {Function} Returns the new spec function.
  3708. */
  3709. function baseConforms(source) {
  3710. var props = keys(source);
  3711. return function(object) {
  3712. return baseConformsTo(object, source, props);
  3713. };
  3714. }
  3715. /**
  3716. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3717. *
  3718. * @private
  3719. * @param {Object} object The object to inspect.
  3720. * @param {Object} source The object of property predicates to conform to.
  3721. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3722. */
  3723. function baseConformsTo(object, source, props) {
  3724. var length = props.length;
  3725. if (object == null) {
  3726. return !length;
  3727. }
  3728. object = Object(object);
  3729. while (length--) {
  3730. var key = props[length],
  3731. predicate = source[key],
  3732. value = object[key];
  3733. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3734. return false;
  3735. }
  3736. }
  3737. return true;
  3738. }
  3739. /**
  3740. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3741. * to provide to `func`.
  3742. *
  3743. * @private
  3744. * @param {Function} func The function to delay.
  3745. * @param {number} wait The number of milliseconds to delay invocation.
  3746. * @param {Array} args The arguments to provide to `func`.
  3747. * @returns {number|Object} Returns the timer id or timeout object.
  3748. */
  3749. function baseDelay(func, wait, args) {
  3750. if (typeof func != 'function') {
  3751. throw new TypeError(FUNC_ERROR_TEXT);
  3752. }
  3753. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3754. }
  3755. /**
  3756. * The base implementation of methods like `_.difference` without support
  3757. * for excluding multiple arrays or iteratee shorthands.
  3758. *
  3759. * @private
  3760. * @param {Array} array The array to inspect.
  3761. * @param {Array} values The values to exclude.
  3762. * @param {Function} [iteratee] The iteratee invoked per element.
  3763. * @param {Function} [comparator] The comparator invoked per element.
  3764. * @returns {Array} Returns the new array of filtered values.
  3765. */
  3766. function baseDifference(array, values, iteratee, comparator) {
  3767. var index = -1,
  3768. includes = arrayIncludes,
  3769. isCommon = true,
  3770. length = array.length,
  3771. result = [],
  3772. valuesLength = values.length;
  3773. if (!length) {
  3774. return result;
  3775. }
  3776. if (iteratee) {
  3777. values = arrayMap(values, baseUnary(iteratee));
  3778. }
  3779. if (comparator) {
  3780. includes = arrayIncludesWith;
  3781. isCommon = false;
  3782. }
  3783. else if (values.length >= LARGE_ARRAY_SIZE) {
  3784. includes = cacheHas;
  3785. isCommon = false;
  3786. values = new SetCache(values);
  3787. }
  3788. outer:
  3789. while (++index < length) {
  3790. var value = array[index],
  3791. computed = iteratee == null ? value : iteratee(value);
  3792. value = (comparator || value !== 0) ? value : 0;
  3793. if (isCommon && computed === computed) {
  3794. var valuesIndex = valuesLength;
  3795. while (valuesIndex--) {
  3796. if (values[valuesIndex] === computed) {
  3797. continue outer;
  3798. }
  3799. }
  3800. result.push(value);
  3801. }
  3802. else if (!includes(values, computed, comparator)) {
  3803. result.push(value);
  3804. }
  3805. }
  3806. return result;
  3807. }
  3808. /**
  3809. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3810. *
  3811. * @private
  3812. * @param {Array|Object} collection The collection to iterate over.
  3813. * @param {Function} iteratee The function invoked per iteration.
  3814. * @returns {Array|Object} Returns `collection`.
  3815. */
  3816. var baseEach = createBaseEach(baseForOwn);
  3817. /**
  3818. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3819. *
  3820. * @private
  3821. * @param {Array|Object} collection The collection to iterate over.
  3822. * @param {Function} iteratee The function invoked per iteration.
  3823. * @returns {Array|Object} Returns `collection`.
  3824. */
  3825. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3826. /**
  3827. * The base implementation of `_.every` without support for iteratee shorthands.
  3828. *
  3829. * @private
  3830. * @param {Array|Object} collection The collection to iterate over.
  3831. * @param {Function} predicate The function invoked per iteration.
  3832. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3833. * else `false`
  3834. */
  3835. function baseEvery(collection, predicate) {
  3836. var result = true;
  3837. baseEach(collection, function(value, index, collection) {
  3838. result = !!predicate(value, index, collection);
  3839. return result;
  3840. });
  3841. return result;
  3842. }
  3843. /**
  3844. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3845. * `comparator` to determine the extremum value.
  3846. *
  3847. * @private
  3848. * @param {Array} array The array to iterate over.
  3849. * @param {Function} iteratee The iteratee invoked per iteration.
  3850. * @param {Function} comparator The comparator used to compare values.
  3851. * @returns {*} Returns the extremum value.
  3852. */
  3853. function baseExtremum(array, iteratee, comparator) {
  3854. var index = -1,
  3855. length = array.length;
  3856. while (++index < length) {
  3857. var value = array[index],
  3858. current = iteratee(value);
  3859. if (current != null && (computed === undefined
  3860. ? (current === current && !isSymbol(current))
  3861. : comparator(current, computed)
  3862. )) {
  3863. var computed = current,
  3864. result = value;
  3865. }
  3866. }
  3867. return result;
  3868. }
  3869. /**
  3870. * The base implementation of `_.fill` without an iteratee call guard.
  3871. *
  3872. * @private
  3873. * @param {Array} array The array to fill.
  3874. * @param {*} value The value to fill `array` with.
  3875. * @param {number} [start=0] The start position.
  3876. * @param {number} [end=array.length] The end position.
  3877. * @returns {Array} Returns `array`.
  3878. */
  3879. function baseFill(array, value, start, end) {
  3880. var length = array.length;
  3881. start = toInteger(start);
  3882. if (start < 0) {
  3883. start = -start > length ? 0 : (length + start);
  3884. }
  3885. end = (end === undefined || end > length) ? length : toInteger(end);
  3886. if (end < 0) {
  3887. end += length;
  3888. }
  3889. end = start > end ? 0 : toLength(end);
  3890. while (start < end) {
  3891. array[start++] = value;
  3892. }
  3893. return array;
  3894. }
  3895. /**
  3896. * The base implementation of `_.filter` without support for iteratee shorthands.
  3897. *
  3898. * @private
  3899. * @param {Array|Object} collection The collection to iterate over.
  3900. * @param {Function} predicate The function invoked per iteration.
  3901. * @returns {Array} Returns the new filtered array.
  3902. */
  3903. function baseFilter(collection, predicate) {
  3904. var result = [];
  3905. baseEach(collection, function(value, index, collection) {
  3906. if (predicate(value, index, collection)) {
  3907. result.push(value);
  3908. }
  3909. });
  3910. return result;
  3911. }
  3912. /**
  3913. * The base implementation of `_.flatten` with support for restricting flattening.
  3914. *
  3915. * @private
  3916. * @param {Array} array The array to flatten.
  3917. * @param {number} depth The maximum recursion depth.
  3918. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3919. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3920. * @param {Array} [result=[]] The initial result value.
  3921. * @returns {Array} Returns the new flattened array.
  3922. */
  3923. function baseFlatten(array, depth, predicate, isStrict, result) {
  3924. var index = -1,
  3925. length = array.length;
  3926. predicate || (predicate = isFlattenable);
  3927. result || (result = []);
  3928. while (++index < length) {
  3929. var value = array[index];
  3930. if (depth > 0 && predicate(value)) {
  3931. if (depth > 1) {
  3932. // Recursively flatten arrays (susceptible to call stack limits).
  3933. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3934. } else {
  3935. arrayPush(result, value);
  3936. }
  3937. } else if (!isStrict) {
  3938. result[result.length] = value;
  3939. }
  3940. }
  3941. return result;
  3942. }
  3943. /**
  3944. * The base implementation of `baseForOwn` which iterates over `object`
  3945. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3946. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3947. *
  3948. * @private
  3949. * @param {Object} object The object to iterate over.
  3950. * @param {Function} iteratee The function invoked per iteration.
  3951. * @param {Function} keysFunc The function to get the keys of `object`.
  3952. * @returns {Object} Returns `object`.
  3953. */
  3954. var baseFor = createBaseFor();
  3955. /**
  3956. * This function is like `baseFor` except that it iterates over properties
  3957. * in the opposite order.
  3958. *
  3959. * @private
  3960. * @param {Object} object The object to iterate over.
  3961. * @param {Function} iteratee The function invoked per iteration.
  3962. * @param {Function} keysFunc The function to get the keys of `object`.
  3963. * @returns {Object} Returns `object`.
  3964. */
  3965. var baseForRight = createBaseFor(true);
  3966. /**
  3967. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3968. *
  3969. * @private
  3970. * @param {Object} object The object to iterate over.
  3971. * @param {Function} iteratee The function invoked per iteration.
  3972. * @returns {Object} Returns `object`.
  3973. */
  3974. function baseForOwn(object, iteratee) {
  3975. return object && baseFor(object, iteratee, keys);
  3976. }
  3977. /**
  3978. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3979. *
  3980. * @private
  3981. * @param {Object} object The object to iterate over.
  3982. * @param {Function} iteratee The function invoked per iteration.
  3983. * @returns {Object} Returns `object`.
  3984. */
  3985. function baseForOwnRight(object, iteratee) {
  3986. return object && baseForRight(object, iteratee, keys);
  3987. }
  3988. /**
  3989. * The base implementation of `_.functions` which creates an array of
  3990. * `object` function property names filtered from `props`.
  3991. *
  3992. * @private
  3993. * @param {Object} object The object to inspect.
  3994. * @param {Array} props The property names to filter.
  3995. * @returns {Array} Returns the function names.
  3996. */
  3997. function baseFunctions(object, props) {
  3998. return arrayFilter(props, function(key) {
  3999. return isFunction(object[key]);
  4000. });
  4001. }
  4002. /**
  4003. * The base implementation of `_.get` without support for default values.
  4004. *
  4005. * @private
  4006. * @param {Object} object The object to query.
  4007. * @param {Array|string} path The path of the property to get.
  4008. * @returns {*} Returns the resolved value.
  4009. */
  4010. function baseGet(object, path) {
  4011. path = castPath(path, object);
  4012. var index = 0,
  4013. length = path.length;
  4014. while (object != null && index < length) {
  4015. object = object[toKey(path[index++])];
  4016. }
  4017. return (index && index == length) ? object : undefined;
  4018. }
  4019. /**
  4020. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4021. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4022. * symbols of `object`.
  4023. *
  4024. * @private
  4025. * @param {Object} object The object to query.
  4026. * @param {Function} keysFunc The function to get the keys of `object`.
  4027. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4028. * @returns {Array} Returns the array of property names and symbols.
  4029. */
  4030. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4031. var result = keysFunc(object);
  4032. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4033. }
  4034. /**
  4035. * The base implementation of `getTag` without fallbacks for buggy environments.
  4036. *
  4037. * @private
  4038. * @param {*} value The value to query.
  4039. * @returns {string} Returns the `toStringTag`.
  4040. */
  4041. function baseGetTag(value) {
  4042. if (value == null) {
  4043. return value === undefined ? undefinedTag : nullTag;
  4044. }
  4045. return (symToStringTag && symToStringTag in Object(value))
  4046. ? getRawTag(value)
  4047. : objectToString(value);
  4048. }
  4049. /**
  4050. * The base implementation of `_.gt` which doesn't coerce arguments.
  4051. *
  4052. * @private
  4053. * @param {*} value The value to compare.
  4054. * @param {*} other The other value to compare.
  4055. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4056. * else `false`.
  4057. */
  4058. function baseGt(value, other) {
  4059. return value > other;
  4060. }
  4061. /**
  4062. * The base implementation of `_.has` without support for deep paths.
  4063. *
  4064. * @private
  4065. * @param {Object} [object] The object to query.
  4066. * @param {Array|string} key The key to check.
  4067. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4068. */
  4069. function baseHas(object, key) {
  4070. return object != null && hasOwnProperty.call(object, key);
  4071. }
  4072. /**
  4073. * The base implementation of `_.hasIn` without support for deep paths.
  4074. *
  4075. * @private
  4076. * @param {Object} [object] The object to query.
  4077. * @param {Array|string} key The key to check.
  4078. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4079. */
  4080. function baseHasIn(object, key) {
  4081. return object != null && key in Object(object);
  4082. }
  4083. /**
  4084. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4085. *
  4086. * @private
  4087. * @param {number} number The number to check.
  4088. * @param {number} start The start of the range.
  4089. * @param {number} end The end of the range.
  4090. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4091. */
  4092. function baseInRange(number, start, end) {
  4093. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4094. }
  4095. /**
  4096. * The base implementation of methods like `_.intersection`, without support
  4097. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4098. *
  4099. * @private
  4100. * @param {Array} arrays The arrays to inspect.
  4101. * @param {Function} [iteratee] The iteratee invoked per element.
  4102. * @param {Function} [comparator] The comparator invoked per element.
  4103. * @returns {Array} Returns the new array of shared values.
  4104. */
  4105. function baseIntersection(arrays, iteratee, comparator) {
  4106. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4107. length = arrays[0].length,
  4108. othLength = arrays.length,
  4109. othIndex = othLength,
  4110. caches = Array(othLength),
  4111. maxLength = Infinity,
  4112. result = [];
  4113. while (othIndex--) {
  4114. var array = arrays[othIndex];
  4115. if (othIndex && iteratee) {
  4116. array = arrayMap(array, baseUnary(iteratee));
  4117. }
  4118. maxLength = nativeMin(array.length, maxLength);
  4119. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4120. ? new SetCache(othIndex && array)
  4121. : undefined;
  4122. }
  4123. array = arrays[0];
  4124. var index = -1,
  4125. seen = caches[0];
  4126. outer:
  4127. while (++index < length && result.length < maxLength) {
  4128. var value = array[index],
  4129. computed = iteratee ? iteratee(value) : value;
  4130. value = (comparator || value !== 0) ? value : 0;
  4131. if (!(seen
  4132. ? cacheHas(seen, computed)
  4133. : includes(result, computed, comparator)
  4134. )) {
  4135. othIndex = othLength;
  4136. while (--othIndex) {
  4137. var cache = caches[othIndex];
  4138. if (!(cache
  4139. ? cacheHas(cache, computed)
  4140. : includes(arrays[othIndex], computed, comparator))
  4141. ) {
  4142. continue outer;
  4143. }
  4144. }
  4145. if (seen) {
  4146. seen.push(computed);
  4147. }
  4148. result.push(value);
  4149. }
  4150. }
  4151. return result;
  4152. }
  4153. /**
  4154. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4155. * `object` with values transformed by `iteratee` and set by `setter`.
  4156. *
  4157. * @private
  4158. * @param {Object} object The object to iterate over.
  4159. * @param {Function} setter The function to set `accumulator` values.
  4160. * @param {Function} iteratee The iteratee to transform values.
  4161. * @param {Object} accumulator The initial inverted object.
  4162. * @returns {Function} Returns `accumulator`.
  4163. */
  4164. function baseInverter(object, setter, iteratee, accumulator) {
  4165. baseForOwn(object, function(value, key, object) {
  4166. setter(accumulator, iteratee(value), key, object);
  4167. });
  4168. return accumulator;
  4169. }
  4170. /**
  4171. * The base implementation of `_.invoke` without support for individual
  4172. * method arguments.
  4173. *
  4174. * @private
  4175. * @param {Object} object The object to query.
  4176. * @param {Array|string} path The path of the method to invoke.
  4177. * @param {Array} args The arguments to invoke the method with.
  4178. * @returns {*} Returns the result of the invoked method.
  4179. */
  4180. function baseInvoke(object, path, args) {
  4181. path = castPath(path, object);
  4182. object = parent(object, path);
  4183. var func = object == null ? object : object[toKey(last(path))];
  4184. return func == null ? undefined : apply(func, object, args);
  4185. }
  4186. /**
  4187. * The base implementation of `_.isArguments`.
  4188. *
  4189. * @private
  4190. * @param {*} value The value to check.
  4191. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4192. */
  4193. function baseIsArguments(value) {
  4194. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4195. }
  4196. /**
  4197. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4198. *
  4199. * @private
  4200. * @param {*} value The value to check.
  4201. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4202. */
  4203. function baseIsArrayBuffer(value) {
  4204. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4205. }
  4206. /**
  4207. * The base implementation of `_.isDate` without Node.js optimizations.
  4208. *
  4209. * @private
  4210. * @param {*} value The value to check.
  4211. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4212. */
  4213. function baseIsDate(value) {
  4214. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4215. }
  4216. /**
  4217. * The base implementation of `_.isEqual` which supports partial comparisons
  4218. * and tracks traversed objects.
  4219. *
  4220. * @private
  4221. * @param {*} value The value to compare.
  4222. * @param {*} other The other value to compare.
  4223. * @param {boolean} bitmask The bitmask flags.
  4224. * 1 - Unordered comparison
  4225. * 2 - Partial comparison
  4226. * @param {Function} [customizer] The function to customize comparisons.
  4227. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4228. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4229. */
  4230. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4231. if (value === other) {
  4232. return true;
  4233. }
  4234. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4235. return value !== value && other !== other;
  4236. }
  4237. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4238. }
  4239. /**
  4240. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4241. * deep comparisons and tracks traversed objects enabling objects with circular
  4242. * references to be compared.
  4243. *
  4244. * @private
  4245. * @param {Object} object The object to compare.
  4246. * @param {Object} other The other object to compare.
  4247. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4248. * @param {Function} customizer The function to customize comparisons.
  4249. * @param {Function} equalFunc The function to determine equivalents of values.
  4250. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4251. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4252. */
  4253. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4254. var objIsArr = isArray(object),
  4255. othIsArr = isArray(other),
  4256. objTag = objIsArr ? arrayTag : getTag(object),
  4257. othTag = othIsArr ? arrayTag : getTag(other);
  4258. objTag = objTag == argsTag ? objectTag : objTag;
  4259. othTag = othTag == argsTag ? objectTag : othTag;
  4260. var objIsObj = objTag == objectTag,
  4261. othIsObj = othTag == objectTag,
  4262. isSameTag = objTag == othTag;
  4263. if (isSameTag && isBuffer(object)) {
  4264. if (!isBuffer(other)) {
  4265. return false;
  4266. }
  4267. objIsArr = true;
  4268. objIsObj = false;
  4269. }
  4270. if (isSameTag && !objIsObj) {
  4271. stack || (stack = new Stack);
  4272. return (objIsArr || isTypedArray(object))
  4273. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4274. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4275. }
  4276. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4277. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4278. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4279. if (objIsWrapped || othIsWrapped) {
  4280. var objUnwrapped = objIsWrapped ? object.value() : object,
  4281. othUnwrapped = othIsWrapped ? other.value() : other;
  4282. stack || (stack = new Stack);
  4283. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4284. }
  4285. }
  4286. if (!isSameTag) {
  4287. return false;
  4288. }
  4289. stack || (stack = new Stack);
  4290. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4291. }
  4292. /**
  4293. * The base implementation of `_.isMap` without Node.js optimizations.
  4294. *
  4295. * @private
  4296. * @param {*} value The value to check.
  4297. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4298. */
  4299. function baseIsMap(value) {
  4300. return isObjectLike(value) && getTag(value) == mapTag;
  4301. }
  4302. /**
  4303. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4304. *
  4305. * @private
  4306. * @param {Object} object The object to inspect.
  4307. * @param {Object} source The object of property values to match.
  4308. * @param {Array} matchData The property names, values, and compare flags to match.
  4309. * @param {Function} [customizer] The function to customize comparisons.
  4310. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4311. */
  4312. function baseIsMatch(object, source, matchData, customizer) {
  4313. var index = matchData.length,
  4314. length = index,
  4315. noCustomizer = !customizer;
  4316. if (object == null) {
  4317. return !length;
  4318. }
  4319. object = Object(object);
  4320. while (index--) {
  4321. var data = matchData[index];
  4322. if ((noCustomizer && data[2])
  4323. ? data[1] !== object[data[0]]
  4324. : !(data[0] in object)
  4325. ) {
  4326. return false;
  4327. }
  4328. }
  4329. while (++index < length) {
  4330. data = matchData[index];
  4331. var key = data[0],
  4332. objValue = object[key],
  4333. srcValue = data[1];
  4334. if (noCustomizer && data[2]) {
  4335. if (objValue === undefined && !(key in object)) {
  4336. return false;
  4337. }
  4338. } else {
  4339. var stack = new Stack;
  4340. if (customizer) {
  4341. var result = customizer(objValue, srcValue, key, object, source, stack);
  4342. }
  4343. if (!(result === undefined
  4344. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4345. : result
  4346. )) {
  4347. return false;
  4348. }
  4349. }
  4350. }
  4351. return true;
  4352. }
  4353. /**
  4354. * The base implementation of `_.isNative` without bad shim checks.
  4355. *
  4356. * @private
  4357. * @param {*} value The value to check.
  4358. * @returns {boolean} Returns `true` if `value` is a native function,
  4359. * else `false`.
  4360. */
  4361. function baseIsNative(value) {
  4362. if (!isObject(value) || isMasked(value)) {
  4363. return false;
  4364. }
  4365. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4366. return pattern.test(toSource(value));
  4367. }
  4368. /**
  4369. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4370. *
  4371. * @private
  4372. * @param {*} value The value to check.
  4373. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4374. */
  4375. function baseIsRegExp(value) {
  4376. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4377. }
  4378. /**
  4379. * The base implementation of `_.isSet` without Node.js optimizations.
  4380. *
  4381. * @private
  4382. * @param {*} value The value to check.
  4383. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4384. */
  4385. function baseIsSet(value) {
  4386. return isObjectLike(value) && getTag(value) == setTag;
  4387. }
  4388. /**
  4389. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4390. *
  4391. * @private
  4392. * @param {*} value The value to check.
  4393. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4394. */
  4395. function baseIsTypedArray(value) {
  4396. return isObjectLike(value) &&
  4397. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4398. }
  4399. /**
  4400. * The base implementation of `_.iteratee`.
  4401. *
  4402. * @private
  4403. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4404. * @returns {Function} Returns the iteratee.
  4405. */
  4406. function baseIteratee(value) {
  4407. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4408. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4409. if (typeof value == 'function') {
  4410. return value;
  4411. }
  4412. if (value == null) {
  4413. return identity;
  4414. }
  4415. if (typeof value == 'object') {
  4416. return isArray(value)
  4417. ? baseMatchesProperty(value[0], value[1])
  4418. : baseMatches(value);
  4419. }
  4420. return property(value);
  4421. }
  4422. /**
  4423. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4424. *
  4425. * @private
  4426. * @param {Object} object The object to query.
  4427. * @returns {Array} Returns the array of property names.
  4428. */
  4429. function baseKeys(object) {
  4430. if (!isPrototype(object)) {
  4431. return nativeKeys(object);
  4432. }
  4433. var result = [];
  4434. for (var key in Object(object)) {
  4435. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4436. result.push(key);
  4437. }
  4438. }
  4439. return result;
  4440. }
  4441. /**
  4442. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4443. *
  4444. * @private
  4445. * @param {Object} object The object to query.
  4446. * @returns {Array} Returns the array of property names.
  4447. */
  4448. function baseKeysIn(object) {
  4449. if (!isObject(object)) {
  4450. return nativeKeysIn(object);
  4451. }
  4452. var isProto = isPrototype(object),
  4453. result = [];
  4454. for (var key in object) {
  4455. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4456. result.push(key);
  4457. }
  4458. }
  4459. return result;
  4460. }
  4461. /**
  4462. * The base implementation of `_.lt` which doesn't coerce arguments.
  4463. *
  4464. * @private
  4465. * @param {*} value The value to compare.
  4466. * @param {*} other The other value to compare.
  4467. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4468. * else `false`.
  4469. */
  4470. function baseLt(value, other) {
  4471. return value < other;
  4472. }
  4473. /**
  4474. * The base implementation of `_.map` without support for iteratee shorthands.
  4475. *
  4476. * @private
  4477. * @param {Array|Object} collection The collection to iterate over.
  4478. * @param {Function} iteratee The function invoked per iteration.
  4479. * @returns {Array} Returns the new mapped array.
  4480. */
  4481. function baseMap(collection, iteratee) {
  4482. var index = -1,
  4483. result = isArrayLike(collection) ? Array(collection.length) : [];
  4484. baseEach(collection, function(value, key, collection) {
  4485. result[++index] = iteratee(value, key, collection);
  4486. });
  4487. return result;
  4488. }
  4489. /**
  4490. * The base implementation of `_.matches` which doesn't clone `source`.
  4491. *
  4492. * @private
  4493. * @param {Object} source The object of property values to match.
  4494. * @returns {Function} Returns the new spec function.
  4495. */
  4496. function baseMatches(source) {
  4497. var matchData = getMatchData(source);
  4498. if (matchData.length == 1 && matchData[0][2]) {
  4499. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4500. }
  4501. return function(object) {
  4502. return object === source || baseIsMatch(object, source, matchData);
  4503. };
  4504. }
  4505. /**
  4506. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4507. *
  4508. * @private
  4509. * @param {string} path The path of the property to get.
  4510. * @param {*} srcValue The value to match.
  4511. * @returns {Function} Returns the new spec function.
  4512. */
  4513. function baseMatchesProperty(path, srcValue) {
  4514. if (isKey(path) && isStrictComparable(srcValue)) {
  4515. return matchesStrictComparable(toKey(path), srcValue);
  4516. }
  4517. return function(object) {
  4518. var objValue = get(object, path);
  4519. return (objValue === undefined && objValue === srcValue)
  4520. ? hasIn(object, path)
  4521. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4522. };
  4523. }
  4524. /**
  4525. * The base implementation of `_.merge` without support for multiple sources.
  4526. *
  4527. * @private
  4528. * @param {Object} object The destination object.
  4529. * @param {Object} source The source object.
  4530. * @param {number} srcIndex The index of `source`.
  4531. * @param {Function} [customizer] The function to customize merged values.
  4532. * @param {Object} [stack] Tracks traversed source values and their merged
  4533. * counterparts.
  4534. */
  4535. function baseMerge(object, source, srcIndex, customizer, stack) {
  4536. if (object === source) {
  4537. return;
  4538. }
  4539. baseFor(source, function(srcValue, key) {
  4540. stack || (stack = new Stack);
  4541. if (isObject(srcValue)) {
  4542. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4543. }
  4544. else {
  4545. var newValue = customizer
  4546. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4547. : undefined;
  4548. if (newValue === undefined) {
  4549. newValue = srcValue;
  4550. }
  4551. assignMergeValue(object, key, newValue);
  4552. }
  4553. }, keysIn);
  4554. }
  4555. /**
  4556. * A specialized version of `baseMerge` for arrays and objects which performs
  4557. * deep merges and tracks traversed objects enabling objects with circular
  4558. * references to be merged.
  4559. *
  4560. * @private
  4561. * @param {Object} object The destination object.
  4562. * @param {Object} source The source object.
  4563. * @param {string} key The key of the value to merge.
  4564. * @param {number} srcIndex The index of `source`.
  4565. * @param {Function} mergeFunc The function to merge values.
  4566. * @param {Function} [customizer] The function to customize assigned values.
  4567. * @param {Object} [stack] Tracks traversed source values and their merged
  4568. * counterparts.
  4569. */
  4570. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4571. var objValue = safeGet(object, key),
  4572. srcValue = safeGet(source, key),
  4573. stacked = stack.get(srcValue);
  4574. if (stacked) {
  4575. assignMergeValue(object, key, stacked);
  4576. return;
  4577. }
  4578. var newValue = customizer
  4579. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4580. : undefined;
  4581. var isCommon = newValue === undefined;
  4582. if (isCommon) {
  4583. var isArr = isArray(srcValue),
  4584. isBuff = !isArr && isBuffer(srcValue),
  4585. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4586. newValue = srcValue;
  4587. if (isArr || isBuff || isTyped) {
  4588. if (isArray(objValue)) {
  4589. newValue = objValue;
  4590. }
  4591. else if (isArrayLikeObject(objValue)) {
  4592. newValue = copyArray(objValue);
  4593. }
  4594. else if (isBuff) {
  4595. isCommon = false;
  4596. newValue = cloneBuffer(srcValue, true);
  4597. }
  4598. else if (isTyped) {
  4599. isCommon = false;
  4600. newValue = cloneTypedArray(srcValue, true);
  4601. }
  4602. else {
  4603. newValue = [];
  4604. }
  4605. }
  4606. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4607. newValue = objValue;
  4608. if (isArguments(objValue)) {
  4609. newValue = toPlainObject(objValue);
  4610. }
  4611. else if (!isObject(objValue) || isFunction(objValue)) {
  4612. newValue = initCloneObject(srcValue);
  4613. }
  4614. }
  4615. else {
  4616. isCommon = false;
  4617. }
  4618. }
  4619. if (isCommon) {
  4620. // Recursively merge objects and arrays (susceptible to call stack limits).
  4621. stack.set(srcValue, newValue);
  4622. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4623. stack['delete'](srcValue);
  4624. }
  4625. assignMergeValue(object, key, newValue);
  4626. }
  4627. /**
  4628. * The base implementation of `_.nth` which doesn't coerce arguments.
  4629. *
  4630. * @private
  4631. * @param {Array} array The array to query.
  4632. * @param {number} n The index of the element to return.
  4633. * @returns {*} Returns the nth element of `array`.
  4634. */
  4635. function baseNth(array, n) {
  4636. var length = array.length;
  4637. if (!length) {
  4638. return;
  4639. }
  4640. n += n < 0 ? length : 0;
  4641. return isIndex(n, length) ? array[n] : undefined;
  4642. }
  4643. /**
  4644. * The base implementation of `_.orderBy` without param guards.
  4645. *
  4646. * @private
  4647. * @param {Array|Object} collection The collection to iterate over.
  4648. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4649. * @param {string[]} orders The sort orders of `iteratees`.
  4650. * @returns {Array} Returns the new sorted array.
  4651. */
  4652. function baseOrderBy(collection, iteratees, orders) {
  4653. if (iteratees.length) {
  4654. iteratees = arrayMap(iteratees, function(iteratee) {
  4655. if (isArray(iteratee)) {
  4656. return function(value) {
  4657. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4658. }
  4659. }
  4660. return iteratee;
  4661. });
  4662. } else {
  4663. iteratees = [identity];
  4664. }
  4665. var index = -1;
  4666. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4667. var result = baseMap(collection, function(value, key, collection) {
  4668. var criteria = arrayMap(iteratees, function(iteratee) {
  4669. return iteratee(value);
  4670. });
  4671. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4672. });
  4673. return baseSortBy(result, function(object, other) {
  4674. return compareMultiple(object, other, orders);
  4675. });
  4676. }
  4677. /**
  4678. * The base implementation of `_.pick` without support for individual
  4679. * property identifiers.
  4680. *
  4681. * @private
  4682. * @param {Object} object The source object.
  4683. * @param {string[]} paths The property paths to pick.
  4684. * @returns {Object} Returns the new object.
  4685. */
  4686. function basePick(object, paths) {
  4687. return basePickBy(object, paths, function(value, path) {
  4688. return hasIn(object, path);
  4689. });
  4690. }
  4691. /**
  4692. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4693. *
  4694. * @private
  4695. * @param {Object} object The source object.
  4696. * @param {string[]} paths The property paths to pick.
  4697. * @param {Function} predicate The function invoked per property.
  4698. * @returns {Object} Returns the new object.
  4699. */
  4700. function basePickBy(object, paths, predicate) {
  4701. var index = -1,
  4702. length = paths.length,
  4703. result = {};
  4704. while (++index < length) {
  4705. var path = paths[index],
  4706. value = baseGet(object, path);
  4707. if (predicate(value, path)) {
  4708. baseSet(result, castPath(path, object), value);
  4709. }
  4710. }
  4711. return result;
  4712. }
  4713. /**
  4714. * A specialized version of `baseProperty` which supports deep paths.
  4715. *
  4716. * @private
  4717. * @param {Array|string} path The path of the property to get.
  4718. * @returns {Function} Returns the new accessor function.
  4719. */
  4720. function basePropertyDeep(path) {
  4721. return function(object) {
  4722. return baseGet(object, path);
  4723. };
  4724. }
  4725. /**
  4726. * The base implementation of `_.pullAllBy` without support for iteratee
  4727. * shorthands.
  4728. *
  4729. * @private
  4730. * @param {Array} array The array to modify.
  4731. * @param {Array} values The values to remove.
  4732. * @param {Function} [iteratee] The iteratee invoked per element.
  4733. * @param {Function} [comparator] The comparator invoked per element.
  4734. * @returns {Array} Returns `array`.
  4735. */
  4736. function basePullAll(array, values, iteratee, comparator) {
  4737. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4738. index = -1,
  4739. length = values.length,
  4740. seen = array;
  4741. if (array === values) {
  4742. values = copyArray(values);
  4743. }
  4744. if (iteratee) {
  4745. seen = arrayMap(array, baseUnary(iteratee));
  4746. }
  4747. while (++index < length) {
  4748. var fromIndex = 0,
  4749. value = values[index],
  4750. computed = iteratee ? iteratee(value) : value;
  4751. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4752. if (seen !== array) {
  4753. splice.call(seen, fromIndex, 1);
  4754. }
  4755. splice.call(array, fromIndex, 1);
  4756. }
  4757. }
  4758. return array;
  4759. }
  4760. /**
  4761. * The base implementation of `_.pullAt` without support for individual
  4762. * indexes or capturing the removed elements.
  4763. *
  4764. * @private
  4765. * @param {Array} array The array to modify.
  4766. * @param {number[]} indexes The indexes of elements to remove.
  4767. * @returns {Array} Returns `array`.
  4768. */
  4769. function basePullAt(array, indexes) {
  4770. var length = array ? indexes.length : 0,
  4771. lastIndex = length - 1;
  4772. while (length--) {
  4773. var index = indexes[length];
  4774. if (length == lastIndex || index !== previous) {
  4775. var previous = index;
  4776. if (isIndex(index)) {
  4777. splice.call(array, index, 1);
  4778. } else {
  4779. baseUnset(array, index);
  4780. }
  4781. }
  4782. }
  4783. return array;
  4784. }
  4785. /**
  4786. * The base implementation of `_.random` without support for returning
  4787. * floating-point numbers.
  4788. *
  4789. * @private
  4790. * @param {number} lower The lower bound.
  4791. * @param {number} upper The upper bound.
  4792. * @returns {number} Returns the random number.
  4793. */
  4794. function baseRandom(lower, upper) {
  4795. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4796. }
  4797. /**
  4798. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4799. * coerce arguments.
  4800. *
  4801. * @private
  4802. * @param {number} start The start of the range.
  4803. * @param {number} end The end of the range.
  4804. * @param {number} step The value to increment or decrement by.
  4805. * @param {boolean} [fromRight] Specify iterating from right to left.
  4806. * @returns {Array} Returns the range of numbers.
  4807. */
  4808. function baseRange(start, end, step, fromRight) {
  4809. var index = -1,
  4810. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4811. result = Array(length);
  4812. while (length--) {
  4813. result[fromRight ? length : ++index] = start;
  4814. start += step;
  4815. }
  4816. return result;
  4817. }
  4818. /**
  4819. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4820. *
  4821. * @private
  4822. * @param {string} string The string to repeat.
  4823. * @param {number} n The number of times to repeat the string.
  4824. * @returns {string} Returns the repeated string.
  4825. */
  4826. function baseRepeat(string, n) {
  4827. var result = '';
  4828. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4829. return result;
  4830. }
  4831. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4832. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4833. do {
  4834. if (n % 2) {
  4835. result += string;
  4836. }
  4837. n = nativeFloor(n / 2);
  4838. if (n) {
  4839. string += string;
  4840. }
  4841. } while (n);
  4842. return result;
  4843. }
  4844. /**
  4845. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4846. *
  4847. * @private
  4848. * @param {Function} func The function to apply a rest parameter to.
  4849. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4850. * @returns {Function} Returns the new function.
  4851. */
  4852. function baseRest(func, start) {
  4853. return setToString(overRest(func, start, identity), func + '');
  4854. }
  4855. /**
  4856. * The base implementation of `_.sample`.
  4857. *
  4858. * @private
  4859. * @param {Array|Object} collection The collection to sample.
  4860. * @returns {*} Returns the random element.
  4861. */
  4862. function baseSample(collection) {
  4863. return arraySample(values(collection));
  4864. }
  4865. /**
  4866. * The base implementation of `_.sampleSize` without param guards.
  4867. *
  4868. * @private
  4869. * @param {Array|Object} collection The collection to sample.
  4870. * @param {number} n The number of elements to sample.
  4871. * @returns {Array} Returns the random elements.
  4872. */
  4873. function baseSampleSize(collection, n) {
  4874. var array = values(collection);
  4875. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4876. }
  4877. /**
  4878. * The base implementation of `_.set`.
  4879. *
  4880. * @private
  4881. * @param {Object} object The object to modify.
  4882. * @param {Array|string} path The path of the property to set.
  4883. * @param {*} value The value to set.
  4884. * @param {Function} [customizer] The function to customize path creation.
  4885. * @returns {Object} Returns `object`.
  4886. */
  4887. function baseSet(object, path, value, customizer) {
  4888. if (!isObject(object)) {
  4889. return object;
  4890. }
  4891. path = castPath(path, object);
  4892. var index = -1,
  4893. length = path.length,
  4894. lastIndex = length - 1,
  4895. nested = object;
  4896. while (nested != null && ++index < length) {
  4897. var key = toKey(path[index]),
  4898. newValue = value;
  4899. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4900. return object;
  4901. }
  4902. if (index != lastIndex) {
  4903. var objValue = nested[key];
  4904. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4905. if (newValue === undefined) {
  4906. newValue = isObject(objValue)
  4907. ? objValue
  4908. : (isIndex(path[index + 1]) ? [] : {});
  4909. }
  4910. }
  4911. assignValue(nested, key, newValue);
  4912. nested = nested[key];
  4913. }
  4914. return object;
  4915. }
  4916. /**
  4917. * The base implementation of `setData` without support for hot loop shorting.
  4918. *
  4919. * @private
  4920. * @param {Function} func The function to associate metadata with.
  4921. * @param {*} data The metadata.
  4922. * @returns {Function} Returns `func`.
  4923. */
  4924. var baseSetData = !metaMap ? identity : function(func, data) {
  4925. metaMap.set(func, data);
  4926. return func;
  4927. };
  4928. /**
  4929. * The base implementation of `setToString` without support for hot loop shorting.
  4930. *
  4931. * @private
  4932. * @param {Function} func The function to modify.
  4933. * @param {Function} string The `toString` result.
  4934. * @returns {Function} Returns `func`.
  4935. */
  4936. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4937. return defineProperty(func, 'toString', {
  4938. 'configurable': true,
  4939. 'enumerable': false,
  4940. 'value': constant(string),
  4941. 'writable': true
  4942. });
  4943. };
  4944. /**
  4945. * The base implementation of `_.shuffle`.
  4946. *
  4947. * @private
  4948. * @param {Array|Object} collection The collection to shuffle.
  4949. * @returns {Array} Returns the new shuffled array.
  4950. */
  4951. function baseShuffle(collection) {
  4952. return shuffleSelf(values(collection));
  4953. }
  4954. /**
  4955. * The base implementation of `_.slice` without an iteratee call guard.
  4956. *
  4957. * @private
  4958. * @param {Array} array The array to slice.
  4959. * @param {number} [start=0] The start position.
  4960. * @param {number} [end=array.length] The end position.
  4961. * @returns {Array} Returns the slice of `array`.
  4962. */
  4963. function baseSlice(array, start, end) {
  4964. var index = -1,
  4965. length = array.length;
  4966. if (start < 0) {
  4967. start = -start > length ? 0 : (length + start);
  4968. }
  4969. end = end > length ? length : end;
  4970. if (end < 0) {
  4971. end += length;
  4972. }
  4973. length = start > end ? 0 : ((end - start) >>> 0);
  4974. start >>>= 0;
  4975. var result = Array(length);
  4976. while (++index < length) {
  4977. result[index] = array[index + start];
  4978. }
  4979. return result;
  4980. }
  4981. /**
  4982. * The base implementation of `_.some` without support for iteratee shorthands.
  4983. *
  4984. * @private
  4985. * @param {Array|Object} collection The collection to iterate over.
  4986. * @param {Function} predicate The function invoked per iteration.
  4987. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4988. * else `false`.
  4989. */
  4990. function baseSome(collection, predicate) {
  4991. var result;
  4992. baseEach(collection, function(value, index, collection) {
  4993. result = predicate(value, index, collection);
  4994. return !result;
  4995. });
  4996. return !!result;
  4997. }
  4998. /**
  4999. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5000. * performs a binary search of `array` to determine the index at which `value`
  5001. * should be inserted into `array` in order to maintain its sort order.
  5002. *
  5003. * @private
  5004. * @param {Array} array The sorted array to inspect.
  5005. * @param {*} value The value to evaluate.
  5006. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5007. * @returns {number} Returns the index at which `value` should be inserted
  5008. * into `array`.
  5009. */
  5010. function baseSortedIndex(array, value, retHighest) {
  5011. var low = 0,
  5012. high = array == null ? low : array.length;
  5013. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5014. while (low < high) {
  5015. var mid = (low + high) >>> 1,
  5016. computed = array[mid];
  5017. if (computed !== null && !isSymbol(computed) &&
  5018. (retHighest ? (computed <= value) : (computed < value))) {
  5019. low = mid + 1;
  5020. } else {
  5021. high = mid;
  5022. }
  5023. }
  5024. return high;
  5025. }
  5026. return baseSortedIndexBy(array, value, identity, retHighest);
  5027. }
  5028. /**
  5029. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5030. * which invokes `iteratee` for `value` and each element of `array` to compute
  5031. * their sort ranking. The iteratee is invoked with one argument; (value).
  5032. *
  5033. * @private
  5034. * @param {Array} array The sorted array to inspect.
  5035. * @param {*} value The value to evaluate.
  5036. * @param {Function} iteratee The iteratee invoked per element.
  5037. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5038. * @returns {number} Returns the index at which `value` should be inserted
  5039. * into `array`.
  5040. */
  5041. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5042. var low = 0,
  5043. high = array == null ? 0 : array.length;
  5044. if (high === 0) {
  5045. return 0;
  5046. }
  5047. value = iteratee(value);
  5048. var valIsNaN = value !== value,
  5049. valIsNull = value === null,
  5050. valIsSymbol = isSymbol(value),
  5051. valIsUndefined = value === undefined;
  5052. while (low < high) {
  5053. var mid = nativeFloor((low + high) / 2),
  5054. computed = iteratee(array[mid]),
  5055. othIsDefined = computed !== undefined,
  5056. othIsNull = computed === null,
  5057. othIsReflexive = computed === computed,
  5058. othIsSymbol = isSymbol(computed);
  5059. if (valIsNaN) {
  5060. var setLow = retHighest || othIsReflexive;
  5061. } else if (valIsUndefined) {
  5062. setLow = othIsReflexive && (retHighest || othIsDefined);
  5063. } else if (valIsNull) {
  5064. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5065. } else if (valIsSymbol) {
  5066. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5067. } else if (othIsNull || othIsSymbol) {
  5068. setLow = false;
  5069. } else {
  5070. setLow = retHighest ? (computed <= value) : (computed < value);
  5071. }
  5072. if (setLow) {
  5073. low = mid + 1;
  5074. } else {
  5075. high = mid;
  5076. }
  5077. }
  5078. return nativeMin(high, MAX_ARRAY_INDEX);
  5079. }
  5080. /**
  5081. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5082. * support for iteratee shorthands.
  5083. *
  5084. * @private
  5085. * @param {Array} array The array to inspect.
  5086. * @param {Function} [iteratee] The iteratee invoked per element.
  5087. * @returns {Array} Returns the new duplicate free array.
  5088. */
  5089. function baseSortedUniq(array, iteratee) {
  5090. var index = -1,
  5091. length = array.length,
  5092. resIndex = 0,
  5093. result = [];
  5094. while (++index < length) {
  5095. var value = array[index],
  5096. computed = iteratee ? iteratee(value) : value;
  5097. if (!index || !eq(computed, seen)) {
  5098. var seen = computed;
  5099. result[resIndex++] = value === 0 ? 0 : value;
  5100. }
  5101. }
  5102. return result;
  5103. }
  5104. /**
  5105. * The base implementation of `_.toNumber` which doesn't ensure correct
  5106. * conversions of binary, hexadecimal, or octal string values.
  5107. *
  5108. * @private
  5109. * @param {*} value The value to process.
  5110. * @returns {number} Returns the number.
  5111. */
  5112. function baseToNumber(value) {
  5113. if (typeof value == 'number') {
  5114. return value;
  5115. }
  5116. if (isSymbol(value)) {
  5117. return NAN;
  5118. }
  5119. return +value;
  5120. }
  5121. /**
  5122. * The base implementation of `_.toString` which doesn't convert nullish
  5123. * values to empty strings.
  5124. *
  5125. * @private
  5126. * @param {*} value The value to process.
  5127. * @returns {string} Returns the string.
  5128. */
  5129. function baseToString(value) {
  5130. // Exit early for strings to avoid a performance hit in some environments.
  5131. if (typeof value == 'string') {
  5132. return value;
  5133. }
  5134. if (isArray(value)) {
  5135. // Recursively convert values (susceptible to call stack limits).
  5136. return arrayMap(value, baseToString) + '';
  5137. }
  5138. if (isSymbol(value)) {
  5139. return symbolToString ? symbolToString.call(value) : '';
  5140. }
  5141. var result = (value + '');
  5142. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5143. }
  5144. /**
  5145. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5146. *
  5147. * @private
  5148. * @param {Array} array The array to inspect.
  5149. * @param {Function} [iteratee] The iteratee invoked per element.
  5150. * @param {Function} [comparator] The comparator invoked per element.
  5151. * @returns {Array} Returns the new duplicate free array.
  5152. */
  5153. function baseUniq(array, iteratee, comparator) {
  5154. var index = -1,
  5155. includes = arrayIncludes,
  5156. length = array.length,
  5157. isCommon = true,
  5158. result = [],
  5159. seen = result;
  5160. if (comparator) {
  5161. isCommon = false;
  5162. includes = arrayIncludesWith;
  5163. }
  5164. else if (length >= LARGE_ARRAY_SIZE) {
  5165. var set = iteratee ? null : createSet(array);
  5166. if (set) {
  5167. return setToArray(set);
  5168. }
  5169. isCommon = false;
  5170. includes = cacheHas;
  5171. seen = new SetCache;
  5172. }
  5173. else {
  5174. seen = iteratee ? [] : result;
  5175. }
  5176. outer:
  5177. while (++index < length) {
  5178. var value = array[index],
  5179. computed = iteratee ? iteratee(value) : value;
  5180. value = (comparator || value !== 0) ? value : 0;
  5181. if (isCommon && computed === computed) {
  5182. var seenIndex = seen.length;
  5183. while (seenIndex--) {
  5184. if (seen[seenIndex] === computed) {
  5185. continue outer;
  5186. }
  5187. }
  5188. if (iteratee) {
  5189. seen.push(computed);
  5190. }
  5191. result.push(value);
  5192. }
  5193. else if (!includes(seen, computed, comparator)) {
  5194. if (seen !== result) {
  5195. seen.push(computed);
  5196. }
  5197. result.push(value);
  5198. }
  5199. }
  5200. return result;
  5201. }
  5202. /**
  5203. * The base implementation of `_.unset`.
  5204. *
  5205. * @private
  5206. * @param {Object} object The object to modify.
  5207. * @param {Array|string} path The property path to unset.
  5208. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5209. */
  5210. function baseUnset(object, path) {
  5211. path = castPath(path, object);
  5212. object = parent(object, path);
  5213. return object == null || delete object[toKey(last(path))];
  5214. }
  5215. /**
  5216. * The base implementation of `_.update`.
  5217. *
  5218. * @private
  5219. * @param {Object} object The object to modify.
  5220. * @param {Array|string} path The path of the property to update.
  5221. * @param {Function} updater The function to produce the updated value.
  5222. * @param {Function} [customizer] The function to customize path creation.
  5223. * @returns {Object} Returns `object`.
  5224. */
  5225. function baseUpdate(object, path, updater, customizer) {
  5226. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5227. }
  5228. /**
  5229. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5230. * without support for iteratee shorthands.
  5231. *
  5232. * @private
  5233. * @param {Array} array The array to query.
  5234. * @param {Function} predicate The function invoked per iteration.
  5235. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5236. * @param {boolean} [fromRight] Specify iterating from right to left.
  5237. * @returns {Array} Returns the slice of `array`.
  5238. */
  5239. function baseWhile(array, predicate, isDrop, fromRight) {
  5240. var length = array.length,
  5241. index = fromRight ? length : -1;
  5242. while ((fromRight ? index-- : ++index < length) &&
  5243. predicate(array[index], index, array)) {}
  5244. return isDrop
  5245. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5246. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5247. }
  5248. /**
  5249. * The base implementation of `wrapperValue` which returns the result of
  5250. * performing a sequence of actions on the unwrapped `value`, where each
  5251. * successive action is supplied the return value of the previous.
  5252. *
  5253. * @private
  5254. * @param {*} value The unwrapped value.
  5255. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5256. * @returns {*} Returns the resolved value.
  5257. */
  5258. function baseWrapperValue(value, actions) {
  5259. var result = value;
  5260. if (result instanceof LazyWrapper) {
  5261. result = result.value();
  5262. }
  5263. return arrayReduce(actions, function(result, action) {
  5264. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5265. }, result);
  5266. }
  5267. /**
  5268. * The base implementation of methods like `_.xor`, without support for
  5269. * iteratee shorthands, that accepts an array of arrays to inspect.
  5270. *
  5271. * @private
  5272. * @param {Array} arrays The arrays to inspect.
  5273. * @param {Function} [iteratee] The iteratee invoked per element.
  5274. * @param {Function} [comparator] The comparator invoked per element.
  5275. * @returns {Array} Returns the new array of values.
  5276. */
  5277. function baseXor(arrays, iteratee, comparator) {
  5278. var length = arrays.length;
  5279. if (length < 2) {
  5280. return length ? baseUniq(arrays[0]) : [];
  5281. }
  5282. var index = -1,
  5283. result = Array(length);
  5284. while (++index < length) {
  5285. var array = arrays[index],
  5286. othIndex = -1;
  5287. while (++othIndex < length) {
  5288. if (othIndex != index) {
  5289. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5290. }
  5291. }
  5292. }
  5293. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5294. }
  5295. /**
  5296. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5297. *
  5298. * @private
  5299. * @param {Array} props The property identifiers.
  5300. * @param {Array} values The property values.
  5301. * @param {Function} assignFunc The function to assign values.
  5302. * @returns {Object} Returns the new object.
  5303. */
  5304. function baseZipObject(props, values, assignFunc) {
  5305. var index = -1,
  5306. length = props.length,
  5307. valsLength = values.length,
  5308. result = {};
  5309. while (++index < length) {
  5310. var value = index < valsLength ? values[index] : undefined;
  5311. assignFunc(result, props[index], value);
  5312. }
  5313. return result;
  5314. }
  5315. /**
  5316. * Casts `value` to an empty array if it's not an array like object.
  5317. *
  5318. * @private
  5319. * @param {*} value The value to inspect.
  5320. * @returns {Array|Object} Returns the cast array-like object.
  5321. */
  5322. function castArrayLikeObject(value) {
  5323. return isArrayLikeObject(value) ? value : [];
  5324. }
  5325. /**
  5326. * Casts `value` to `identity` if it's not a function.
  5327. *
  5328. * @private
  5329. * @param {*} value The value to inspect.
  5330. * @returns {Function} Returns cast function.
  5331. */
  5332. function castFunction(value) {
  5333. return typeof value == 'function' ? value : identity;
  5334. }
  5335. /**
  5336. * Casts `value` to a path array if it's not one.
  5337. *
  5338. * @private
  5339. * @param {*} value The value to inspect.
  5340. * @param {Object} [object] The object to query keys on.
  5341. * @returns {Array} Returns the cast property path array.
  5342. */
  5343. function castPath(value, object) {
  5344. if (isArray(value)) {
  5345. return value;
  5346. }
  5347. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5348. }
  5349. /**
  5350. * A `baseRest` alias which can be replaced with `identity` by module
  5351. * replacement plugins.
  5352. *
  5353. * @private
  5354. * @type {Function}
  5355. * @param {Function} func The function to apply a rest parameter to.
  5356. * @returns {Function} Returns the new function.
  5357. */
  5358. var castRest = baseRest;
  5359. /**
  5360. * Casts `array` to a slice if it's needed.
  5361. *
  5362. * @private
  5363. * @param {Array} array The array to inspect.
  5364. * @param {number} start The start position.
  5365. * @param {number} [end=array.length] The end position.
  5366. * @returns {Array} Returns the cast slice.
  5367. */
  5368. function castSlice(array, start, end) {
  5369. var length = array.length;
  5370. end = end === undefined ? length : end;
  5371. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5372. }
  5373. /**
  5374. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5375. *
  5376. * @private
  5377. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5378. */
  5379. var clearTimeout = ctxClearTimeout || function(id) {
  5380. return root.clearTimeout(id);
  5381. };
  5382. /**
  5383. * Creates a clone of `buffer`.
  5384. *
  5385. * @private
  5386. * @param {Buffer} buffer The buffer to clone.
  5387. * @param {boolean} [isDeep] Specify a deep clone.
  5388. * @returns {Buffer} Returns the cloned buffer.
  5389. */
  5390. function cloneBuffer(buffer, isDeep) {
  5391. if (isDeep) {
  5392. return buffer.slice();
  5393. }
  5394. var length = buffer.length,
  5395. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5396. buffer.copy(result);
  5397. return result;
  5398. }
  5399. /**
  5400. * Creates a clone of `arrayBuffer`.
  5401. *
  5402. * @private
  5403. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5404. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5405. */
  5406. function cloneArrayBuffer(arrayBuffer) {
  5407. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5408. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5409. return result;
  5410. }
  5411. /**
  5412. * Creates a clone of `dataView`.
  5413. *
  5414. * @private
  5415. * @param {Object} dataView The data view to clone.
  5416. * @param {boolean} [isDeep] Specify a deep clone.
  5417. * @returns {Object} Returns the cloned data view.
  5418. */
  5419. function cloneDataView(dataView, isDeep) {
  5420. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5421. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5422. }
  5423. /**
  5424. * Creates a clone of `regexp`.
  5425. *
  5426. * @private
  5427. * @param {Object} regexp The regexp to clone.
  5428. * @returns {Object} Returns the cloned regexp.
  5429. */
  5430. function cloneRegExp(regexp) {
  5431. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5432. result.lastIndex = regexp.lastIndex;
  5433. return result;
  5434. }
  5435. /**
  5436. * Creates a clone of the `symbol` object.
  5437. *
  5438. * @private
  5439. * @param {Object} symbol The symbol object to clone.
  5440. * @returns {Object} Returns the cloned symbol object.
  5441. */
  5442. function cloneSymbol(symbol) {
  5443. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5444. }
  5445. /**
  5446. * Creates a clone of `typedArray`.
  5447. *
  5448. * @private
  5449. * @param {Object} typedArray The typed array to clone.
  5450. * @param {boolean} [isDeep] Specify a deep clone.
  5451. * @returns {Object} Returns the cloned typed array.
  5452. */
  5453. function cloneTypedArray(typedArray, isDeep) {
  5454. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5455. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5456. }
  5457. /**
  5458. * Compares values to sort them in ascending order.
  5459. *
  5460. * @private
  5461. * @param {*} value The value to compare.
  5462. * @param {*} other The other value to compare.
  5463. * @returns {number} Returns the sort order indicator for `value`.
  5464. */
  5465. function compareAscending(value, other) {
  5466. if (value !== other) {
  5467. var valIsDefined = value !== undefined,
  5468. valIsNull = value === null,
  5469. valIsReflexive = value === value,
  5470. valIsSymbol = isSymbol(value);
  5471. var othIsDefined = other !== undefined,
  5472. othIsNull = other === null,
  5473. othIsReflexive = other === other,
  5474. othIsSymbol = isSymbol(other);
  5475. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5476. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5477. (valIsNull && othIsDefined && othIsReflexive) ||
  5478. (!valIsDefined && othIsReflexive) ||
  5479. !valIsReflexive) {
  5480. return 1;
  5481. }
  5482. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5483. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5484. (othIsNull && valIsDefined && valIsReflexive) ||
  5485. (!othIsDefined && valIsReflexive) ||
  5486. !othIsReflexive) {
  5487. return -1;
  5488. }
  5489. }
  5490. return 0;
  5491. }
  5492. /**
  5493. * Used by `_.orderBy` to compare multiple properties of a value to another
  5494. * and stable sort them.
  5495. *
  5496. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5497. * specify an order of "desc" for descending or "asc" for ascending sort order
  5498. * of corresponding values.
  5499. *
  5500. * @private
  5501. * @param {Object} object The object to compare.
  5502. * @param {Object} other The other object to compare.
  5503. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5504. * @returns {number} Returns the sort order indicator for `object`.
  5505. */
  5506. function compareMultiple(object, other, orders) {
  5507. var index = -1,
  5508. objCriteria = object.criteria,
  5509. othCriteria = other.criteria,
  5510. length = objCriteria.length,
  5511. ordersLength = orders.length;
  5512. while (++index < length) {
  5513. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5514. if (result) {
  5515. if (index >= ordersLength) {
  5516. return result;
  5517. }
  5518. var order = orders[index];
  5519. return result * (order == 'desc' ? -1 : 1);
  5520. }
  5521. }
  5522. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5523. // that causes it, under certain circumstances, to provide the same value for
  5524. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5525. // for more details.
  5526. //
  5527. // This also ensures a stable sort in V8 and other engines.
  5528. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5529. return object.index - other.index;
  5530. }
  5531. /**
  5532. * Creates an array that is the composition of partially applied arguments,
  5533. * placeholders, and provided arguments into a single array of arguments.
  5534. *
  5535. * @private
  5536. * @param {Array} args The provided arguments.
  5537. * @param {Array} partials The arguments to prepend to those provided.
  5538. * @param {Array} holders The `partials` placeholder indexes.
  5539. * @params {boolean} [isCurried] Specify composing for a curried function.
  5540. * @returns {Array} Returns the new array of composed arguments.
  5541. */
  5542. function composeArgs(args, partials, holders, isCurried) {
  5543. var argsIndex = -1,
  5544. argsLength = args.length,
  5545. holdersLength = holders.length,
  5546. leftIndex = -1,
  5547. leftLength = partials.length,
  5548. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5549. result = Array(leftLength + rangeLength),
  5550. isUncurried = !isCurried;
  5551. while (++leftIndex < leftLength) {
  5552. result[leftIndex] = partials[leftIndex];
  5553. }
  5554. while (++argsIndex < holdersLength) {
  5555. if (isUncurried || argsIndex < argsLength) {
  5556. result[holders[argsIndex]] = args[argsIndex];
  5557. }
  5558. }
  5559. while (rangeLength--) {
  5560. result[leftIndex++] = args[argsIndex++];
  5561. }
  5562. return result;
  5563. }
  5564. /**
  5565. * This function is like `composeArgs` except that the arguments composition
  5566. * is tailored for `_.partialRight`.
  5567. *
  5568. * @private
  5569. * @param {Array} args The provided arguments.
  5570. * @param {Array} partials The arguments to append to those provided.
  5571. * @param {Array} holders The `partials` placeholder indexes.
  5572. * @params {boolean} [isCurried] Specify composing for a curried function.
  5573. * @returns {Array} Returns the new array of composed arguments.
  5574. */
  5575. function composeArgsRight(args, partials, holders, isCurried) {
  5576. var argsIndex = -1,
  5577. argsLength = args.length,
  5578. holdersIndex = -1,
  5579. holdersLength = holders.length,
  5580. rightIndex = -1,
  5581. rightLength = partials.length,
  5582. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5583. result = Array(rangeLength + rightLength),
  5584. isUncurried = !isCurried;
  5585. while (++argsIndex < rangeLength) {
  5586. result[argsIndex] = args[argsIndex];
  5587. }
  5588. var offset = argsIndex;
  5589. while (++rightIndex < rightLength) {
  5590. result[offset + rightIndex] = partials[rightIndex];
  5591. }
  5592. while (++holdersIndex < holdersLength) {
  5593. if (isUncurried || argsIndex < argsLength) {
  5594. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5595. }
  5596. }
  5597. return result;
  5598. }
  5599. /**
  5600. * Copies the values of `source` to `array`.
  5601. *
  5602. * @private
  5603. * @param {Array} source The array to copy values from.
  5604. * @param {Array} [array=[]] The array to copy values to.
  5605. * @returns {Array} Returns `array`.
  5606. */
  5607. function copyArray(source, array) {
  5608. var index = -1,
  5609. length = source.length;
  5610. array || (array = Array(length));
  5611. while (++index < length) {
  5612. array[index] = source[index];
  5613. }
  5614. return array;
  5615. }
  5616. /**
  5617. * Copies properties of `source` to `object`.
  5618. *
  5619. * @private
  5620. * @param {Object} source The object to copy properties from.
  5621. * @param {Array} props The property identifiers to copy.
  5622. * @param {Object} [object={}] The object to copy properties to.
  5623. * @param {Function} [customizer] The function to customize copied values.
  5624. * @returns {Object} Returns `object`.
  5625. */
  5626. function copyObject(source, props, object, customizer) {
  5627. var isNew = !object;
  5628. object || (object = {});
  5629. var index = -1,
  5630. length = props.length;
  5631. while (++index < length) {
  5632. var key = props[index];
  5633. var newValue = customizer
  5634. ? customizer(object[key], source[key], key, object, source)
  5635. : undefined;
  5636. if (newValue === undefined) {
  5637. newValue = source[key];
  5638. }
  5639. if (isNew) {
  5640. baseAssignValue(object, key, newValue);
  5641. } else {
  5642. assignValue(object, key, newValue);
  5643. }
  5644. }
  5645. return object;
  5646. }
  5647. /**
  5648. * Copies own symbols of `source` to `object`.
  5649. *
  5650. * @private
  5651. * @param {Object} source The object to copy symbols from.
  5652. * @param {Object} [object={}] The object to copy symbols to.
  5653. * @returns {Object} Returns `object`.
  5654. */
  5655. function copySymbols(source, object) {
  5656. return copyObject(source, getSymbols(source), object);
  5657. }
  5658. /**
  5659. * Copies own and inherited symbols of `source` to `object`.
  5660. *
  5661. * @private
  5662. * @param {Object} source The object to copy symbols from.
  5663. * @param {Object} [object={}] The object to copy symbols to.
  5664. * @returns {Object} Returns `object`.
  5665. */
  5666. function copySymbolsIn(source, object) {
  5667. return copyObject(source, getSymbolsIn(source), object);
  5668. }
  5669. /**
  5670. * Creates a function like `_.groupBy`.
  5671. *
  5672. * @private
  5673. * @param {Function} setter The function to set accumulator values.
  5674. * @param {Function} [initializer] The accumulator object initializer.
  5675. * @returns {Function} Returns the new aggregator function.
  5676. */
  5677. function createAggregator(setter, initializer) {
  5678. return function(collection, iteratee) {
  5679. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5680. accumulator = initializer ? initializer() : {};
  5681. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5682. };
  5683. }
  5684. /**
  5685. * Creates a function like `_.assign`.
  5686. *
  5687. * @private
  5688. * @param {Function} assigner The function to assign values.
  5689. * @returns {Function} Returns the new assigner function.
  5690. */
  5691. function createAssigner(assigner) {
  5692. return baseRest(function(object, sources) {
  5693. var index = -1,
  5694. length = sources.length,
  5695. customizer = length > 1 ? sources[length - 1] : undefined,
  5696. guard = length > 2 ? sources[2] : undefined;
  5697. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5698. ? (length--, customizer)
  5699. : undefined;
  5700. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5701. customizer = length < 3 ? undefined : customizer;
  5702. length = 1;
  5703. }
  5704. object = Object(object);
  5705. while (++index < length) {
  5706. var source = sources[index];
  5707. if (source) {
  5708. assigner(object, source, index, customizer);
  5709. }
  5710. }
  5711. return object;
  5712. });
  5713. }
  5714. /**
  5715. * Creates a `baseEach` or `baseEachRight` function.
  5716. *
  5717. * @private
  5718. * @param {Function} eachFunc The function to iterate over a collection.
  5719. * @param {boolean} [fromRight] Specify iterating from right to left.
  5720. * @returns {Function} Returns the new base function.
  5721. */
  5722. function createBaseEach(eachFunc, fromRight) {
  5723. return function(collection, iteratee) {
  5724. if (collection == null) {
  5725. return collection;
  5726. }
  5727. if (!isArrayLike(collection)) {
  5728. return eachFunc(collection, iteratee);
  5729. }
  5730. var length = collection.length,
  5731. index = fromRight ? length : -1,
  5732. iterable = Object(collection);
  5733. while ((fromRight ? index-- : ++index < length)) {
  5734. if (iteratee(iterable[index], index, iterable) === false) {
  5735. break;
  5736. }
  5737. }
  5738. return collection;
  5739. };
  5740. }
  5741. /**
  5742. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5743. *
  5744. * @private
  5745. * @param {boolean} [fromRight] Specify iterating from right to left.
  5746. * @returns {Function} Returns the new base function.
  5747. */
  5748. function createBaseFor(fromRight) {
  5749. return function(object, iteratee, keysFunc) {
  5750. var index = -1,
  5751. iterable = Object(object),
  5752. props = keysFunc(object),
  5753. length = props.length;
  5754. while (length--) {
  5755. var key = props[fromRight ? length : ++index];
  5756. if (iteratee(iterable[key], key, iterable) === false) {
  5757. break;
  5758. }
  5759. }
  5760. return object;
  5761. };
  5762. }
  5763. /**
  5764. * Creates a function that wraps `func` to invoke it with the optional `this`
  5765. * binding of `thisArg`.
  5766. *
  5767. * @private
  5768. * @param {Function} func The function to wrap.
  5769. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5770. * @param {*} [thisArg] The `this` binding of `func`.
  5771. * @returns {Function} Returns the new wrapped function.
  5772. */
  5773. function createBind(func, bitmask, thisArg) {
  5774. var isBind = bitmask & WRAP_BIND_FLAG,
  5775. Ctor = createCtor(func);
  5776. function wrapper() {
  5777. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5778. return fn.apply(isBind ? thisArg : this, arguments);
  5779. }
  5780. return wrapper;
  5781. }
  5782. /**
  5783. * Creates a function like `_.lowerFirst`.
  5784. *
  5785. * @private
  5786. * @param {string} methodName The name of the `String` case method to use.
  5787. * @returns {Function} Returns the new case function.
  5788. */
  5789. function createCaseFirst(methodName) {
  5790. return function(string) {
  5791. string = toString(string);
  5792. var strSymbols = hasUnicode(string)
  5793. ? stringToArray(string)
  5794. : undefined;
  5795. var chr = strSymbols
  5796. ? strSymbols[0]
  5797. : string.charAt(0);
  5798. var trailing = strSymbols
  5799. ? castSlice(strSymbols, 1).join('')
  5800. : string.slice(1);
  5801. return chr[methodName]() + trailing;
  5802. };
  5803. }
  5804. /**
  5805. * Creates a function like `_.camelCase`.
  5806. *
  5807. * @private
  5808. * @param {Function} callback The function to combine each word.
  5809. * @returns {Function} Returns the new compounder function.
  5810. */
  5811. function createCompounder(callback) {
  5812. return function(string) {
  5813. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5814. };
  5815. }
  5816. /**
  5817. * Creates a function that produces an instance of `Ctor` regardless of
  5818. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5819. *
  5820. * @private
  5821. * @param {Function} Ctor The constructor to wrap.
  5822. * @returns {Function} Returns the new wrapped function.
  5823. */
  5824. function createCtor(Ctor) {
  5825. return function() {
  5826. // Use a `switch` statement to work with class constructors. See
  5827. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5828. // for more details.
  5829. var args = arguments;
  5830. switch (args.length) {
  5831. case 0: return new Ctor;
  5832. case 1: return new Ctor(args[0]);
  5833. case 2: return new Ctor(args[0], args[1]);
  5834. case 3: return new Ctor(args[0], args[1], args[2]);
  5835. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5836. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5837. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5838. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5839. }
  5840. var thisBinding = baseCreate(Ctor.prototype),
  5841. result = Ctor.apply(thisBinding, args);
  5842. // Mimic the constructor's `return` behavior.
  5843. // See https://es5.github.io/#x13.2.2 for more details.
  5844. return isObject(result) ? result : thisBinding;
  5845. };
  5846. }
  5847. /**
  5848. * Creates a function that wraps `func` to enable currying.
  5849. *
  5850. * @private
  5851. * @param {Function} func The function to wrap.
  5852. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5853. * @param {number} arity The arity of `func`.
  5854. * @returns {Function} Returns the new wrapped function.
  5855. */
  5856. function createCurry(func, bitmask, arity) {
  5857. var Ctor = createCtor(func);
  5858. function wrapper() {
  5859. var length = arguments.length,
  5860. args = Array(length),
  5861. index = length,
  5862. placeholder = getHolder(wrapper);
  5863. while (index--) {
  5864. args[index] = arguments[index];
  5865. }
  5866. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5867. ? []
  5868. : replaceHolders(args, placeholder);
  5869. length -= holders.length;
  5870. if (length < arity) {
  5871. return createRecurry(
  5872. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5873. args, holders, undefined, undefined, arity - length);
  5874. }
  5875. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5876. return apply(fn, this, args);
  5877. }
  5878. return wrapper;
  5879. }
  5880. /**
  5881. * Creates a `_.find` or `_.findLast` function.
  5882. *
  5883. * @private
  5884. * @param {Function} findIndexFunc The function to find the collection index.
  5885. * @returns {Function} Returns the new find function.
  5886. */
  5887. function createFind(findIndexFunc) {
  5888. return function(collection, predicate, fromIndex) {
  5889. var iterable = Object(collection);
  5890. if (!isArrayLike(collection)) {
  5891. var iteratee = getIteratee(predicate, 3);
  5892. collection = keys(collection);
  5893. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5894. }
  5895. var index = findIndexFunc(collection, predicate, fromIndex);
  5896. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5897. };
  5898. }
  5899. /**
  5900. * Creates a `_.flow` or `_.flowRight` function.
  5901. *
  5902. * @private
  5903. * @param {boolean} [fromRight] Specify iterating from right to left.
  5904. * @returns {Function} Returns the new flow function.
  5905. */
  5906. function createFlow(fromRight) {
  5907. return flatRest(function(funcs) {
  5908. var length = funcs.length,
  5909. index = length,
  5910. prereq = LodashWrapper.prototype.thru;
  5911. if (fromRight) {
  5912. funcs.reverse();
  5913. }
  5914. while (index--) {
  5915. var func = funcs[index];
  5916. if (typeof func != 'function') {
  5917. throw new TypeError(FUNC_ERROR_TEXT);
  5918. }
  5919. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5920. var wrapper = new LodashWrapper([], true);
  5921. }
  5922. }
  5923. index = wrapper ? index : length;
  5924. while (++index < length) {
  5925. func = funcs[index];
  5926. var funcName = getFuncName(func),
  5927. data = funcName == 'wrapper' ? getData(func) : undefined;
  5928. if (data && isLaziable(data[0]) &&
  5929. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5930. !data[4].length && data[9] == 1
  5931. ) {
  5932. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5933. } else {
  5934. wrapper = (func.length == 1 && isLaziable(func))
  5935. ? wrapper[funcName]()
  5936. : wrapper.thru(func);
  5937. }
  5938. }
  5939. return function() {
  5940. var args = arguments,
  5941. value = args[0];
  5942. if (wrapper && args.length == 1 && isArray(value)) {
  5943. return wrapper.plant(value).value();
  5944. }
  5945. var index = 0,
  5946. result = length ? funcs[index].apply(this, args) : value;
  5947. while (++index < length) {
  5948. result = funcs[index].call(this, result);
  5949. }
  5950. return result;
  5951. };
  5952. });
  5953. }
  5954. /**
  5955. * Creates a function that wraps `func` to invoke it with optional `this`
  5956. * binding of `thisArg`, partial application, and currying.
  5957. *
  5958. * @private
  5959. * @param {Function|string} func The function or method name to wrap.
  5960. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5961. * @param {*} [thisArg] The `this` binding of `func`.
  5962. * @param {Array} [partials] The arguments to prepend to those provided to
  5963. * the new function.
  5964. * @param {Array} [holders] The `partials` placeholder indexes.
  5965. * @param {Array} [partialsRight] The arguments to append to those provided
  5966. * to the new function.
  5967. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5968. * @param {Array} [argPos] The argument positions of the new function.
  5969. * @param {number} [ary] The arity cap of `func`.
  5970. * @param {number} [arity] The arity of `func`.
  5971. * @returns {Function} Returns the new wrapped function.
  5972. */
  5973. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5974. var isAry = bitmask & WRAP_ARY_FLAG,
  5975. isBind = bitmask & WRAP_BIND_FLAG,
  5976. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5977. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5978. isFlip = bitmask & WRAP_FLIP_FLAG,
  5979. Ctor = isBindKey ? undefined : createCtor(func);
  5980. function wrapper() {
  5981. var length = arguments.length,
  5982. args = Array(length),
  5983. index = length;
  5984. while (index--) {
  5985. args[index] = arguments[index];
  5986. }
  5987. if (isCurried) {
  5988. var placeholder = getHolder(wrapper),
  5989. holdersCount = countHolders(args, placeholder);
  5990. }
  5991. if (partials) {
  5992. args = composeArgs(args, partials, holders, isCurried);
  5993. }
  5994. if (partialsRight) {
  5995. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5996. }
  5997. length -= holdersCount;
  5998. if (isCurried && length < arity) {
  5999. var newHolders = replaceHolders(args, placeholder);
  6000. return createRecurry(
  6001. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6002. args, newHolders, argPos, ary, arity - length
  6003. );
  6004. }
  6005. var thisBinding = isBind ? thisArg : this,
  6006. fn = isBindKey ? thisBinding[func] : func;
  6007. length = args.length;
  6008. if (argPos) {
  6009. args = reorder(args, argPos);
  6010. } else if (isFlip && length > 1) {
  6011. args.reverse();
  6012. }
  6013. if (isAry && ary < length) {
  6014. args.length = ary;
  6015. }
  6016. if (this && this !== root && this instanceof wrapper) {
  6017. fn = Ctor || createCtor(fn);
  6018. }
  6019. return fn.apply(thisBinding, args);
  6020. }
  6021. return wrapper;
  6022. }
  6023. /**
  6024. * Creates a function like `_.invertBy`.
  6025. *
  6026. * @private
  6027. * @param {Function} setter The function to set accumulator values.
  6028. * @param {Function} toIteratee The function to resolve iteratees.
  6029. * @returns {Function} Returns the new inverter function.
  6030. */
  6031. function createInverter(setter, toIteratee) {
  6032. return function(object, iteratee) {
  6033. return baseInverter(object, setter, toIteratee(iteratee), {});
  6034. };
  6035. }
  6036. /**
  6037. * Creates a function that performs a mathematical operation on two values.
  6038. *
  6039. * @private
  6040. * @param {Function} operator The function to perform the operation.
  6041. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6042. * @returns {Function} Returns the new mathematical operation function.
  6043. */
  6044. function createMathOperation(operator, defaultValue) {
  6045. return function(value, other) {
  6046. var result;
  6047. if (value === undefined && other === undefined) {
  6048. return defaultValue;
  6049. }
  6050. if (value !== undefined) {
  6051. result = value;
  6052. }
  6053. if (other !== undefined) {
  6054. if (result === undefined) {
  6055. return other;
  6056. }
  6057. if (typeof value == 'string' || typeof other == 'string') {
  6058. value = baseToString(value);
  6059. other = baseToString(other);
  6060. } else {
  6061. value = baseToNumber(value);
  6062. other = baseToNumber(other);
  6063. }
  6064. result = operator(value, other);
  6065. }
  6066. return result;
  6067. };
  6068. }
  6069. /**
  6070. * Creates a function like `_.over`.
  6071. *
  6072. * @private
  6073. * @param {Function} arrayFunc The function to iterate over iteratees.
  6074. * @returns {Function} Returns the new over function.
  6075. */
  6076. function createOver(arrayFunc) {
  6077. return flatRest(function(iteratees) {
  6078. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6079. return baseRest(function(args) {
  6080. var thisArg = this;
  6081. return arrayFunc(iteratees, function(iteratee) {
  6082. return apply(iteratee, thisArg, args);
  6083. });
  6084. });
  6085. });
  6086. }
  6087. /**
  6088. * Creates the padding for `string` based on `length`. The `chars` string
  6089. * is truncated if the number of characters exceeds `length`.
  6090. *
  6091. * @private
  6092. * @param {number} length The padding length.
  6093. * @param {string} [chars=' '] The string used as padding.
  6094. * @returns {string} Returns the padding for `string`.
  6095. */
  6096. function createPadding(length, chars) {
  6097. chars = chars === undefined ? ' ' : baseToString(chars);
  6098. var charsLength = chars.length;
  6099. if (charsLength < 2) {
  6100. return charsLength ? baseRepeat(chars, length) : chars;
  6101. }
  6102. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6103. return hasUnicode(chars)
  6104. ? castSlice(stringToArray(result), 0, length).join('')
  6105. : result.slice(0, length);
  6106. }
  6107. /**
  6108. * Creates a function that wraps `func` to invoke it with the `this` binding
  6109. * of `thisArg` and `partials` prepended to the arguments it receives.
  6110. *
  6111. * @private
  6112. * @param {Function} func The function to wrap.
  6113. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6114. * @param {*} thisArg The `this` binding of `func`.
  6115. * @param {Array} partials The arguments to prepend to those provided to
  6116. * the new function.
  6117. * @returns {Function} Returns the new wrapped function.
  6118. */
  6119. function createPartial(func, bitmask, thisArg, partials) {
  6120. var isBind = bitmask & WRAP_BIND_FLAG,
  6121. Ctor = createCtor(func);
  6122. function wrapper() {
  6123. var argsIndex = -1,
  6124. argsLength = arguments.length,
  6125. leftIndex = -1,
  6126. leftLength = partials.length,
  6127. args = Array(leftLength + argsLength),
  6128. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6129. while (++leftIndex < leftLength) {
  6130. args[leftIndex] = partials[leftIndex];
  6131. }
  6132. while (argsLength--) {
  6133. args[leftIndex++] = arguments[++argsIndex];
  6134. }
  6135. return apply(fn, isBind ? thisArg : this, args);
  6136. }
  6137. return wrapper;
  6138. }
  6139. /**
  6140. * Creates a `_.range` or `_.rangeRight` function.
  6141. *
  6142. * @private
  6143. * @param {boolean} [fromRight] Specify iterating from right to left.
  6144. * @returns {Function} Returns the new range function.
  6145. */
  6146. function createRange(fromRight) {
  6147. return function(start, end, step) {
  6148. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6149. end = step = undefined;
  6150. }
  6151. // Ensure the sign of `-0` is preserved.
  6152. start = toFinite(start);
  6153. if (end === undefined) {
  6154. end = start;
  6155. start = 0;
  6156. } else {
  6157. end = toFinite(end);
  6158. }
  6159. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6160. return baseRange(start, end, step, fromRight);
  6161. };
  6162. }
  6163. /**
  6164. * Creates a function that performs a relational operation on two values.
  6165. *
  6166. * @private
  6167. * @param {Function} operator The function to perform the operation.
  6168. * @returns {Function} Returns the new relational operation function.
  6169. */
  6170. function createRelationalOperation(operator) {
  6171. return function(value, other) {
  6172. if (!(typeof value == 'string' && typeof other == 'string')) {
  6173. value = toNumber(value);
  6174. other = toNumber(other);
  6175. }
  6176. return operator(value, other);
  6177. };
  6178. }
  6179. /**
  6180. * Creates a function that wraps `func` to continue currying.
  6181. *
  6182. * @private
  6183. * @param {Function} func The function to wrap.
  6184. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6185. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6186. * @param {*} placeholder The placeholder value.
  6187. * @param {*} [thisArg] The `this` binding of `func`.
  6188. * @param {Array} [partials] The arguments to prepend to those provided to
  6189. * the new function.
  6190. * @param {Array} [holders] The `partials` placeholder indexes.
  6191. * @param {Array} [argPos] The argument positions of the new function.
  6192. * @param {number} [ary] The arity cap of `func`.
  6193. * @param {number} [arity] The arity of `func`.
  6194. * @returns {Function} Returns the new wrapped function.
  6195. */
  6196. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6197. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6198. newHolders = isCurry ? holders : undefined,
  6199. newHoldersRight = isCurry ? undefined : holders,
  6200. newPartials = isCurry ? partials : undefined,
  6201. newPartialsRight = isCurry ? undefined : partials;
  6202. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6203. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6204. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6205. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6206. }
  6207. var newData = [
  6208. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6209. newHoldersRight, argPos, ary, arity
  6210. ];
  6211. var result = wrapFunc.apply(undefined, newData);
  6212. if (isLaziable(func)) {
  6213. setData(result, newData);
  6214. }
  6215. result.placeholder = placeholder;
  6216. return setWrapToString(result, func, bitmask);
  6217. }
  6218. /**
  6219. * Creates a function like `_.round`.
  6220. *
  6221. * @private
  6222. * @param {string} methodName The name of the `Math` method to use when rounding.
  6223. * @returns {Function} Returns the new round function.
  6224. */
  6225. function createRound(methodName) {
  6226. var func = Math[methodName];
  6227. return function(number, precision) {
  6228. number = toNumber(number);
  6229. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6230. if (precision && nativeIsFinite(number)) {
  6231. // Shift with exponential notation to avoid floating-point issues.
  6232. // See [MDN](https://mdn.io/round#Examples) for more details.
  6233. var pair = (toString(number) + 'e').split('e'),
  6234. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6235. pair = (toString(value) + 'e').split('e');
  6236. return +(pair[0] + 'e' + (+pair[1] - precision));
  6237. }
  6238. return func(number);
  6239. };
  6240. }
  6241. /**
  6242. * Creates a set object of `values`.
  6243. *
  6244. * @private
  6245. * @param {Array} values The values to add to the set.
  6246. * @returns {Object} Returns the new set.
  6247. */
  6248. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6249. return new Set(values);
  6250. };
  6251. /**
  6252. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6253. *
  6254. * @private
  6255. * @param {Function} keysFunc The function to get the keys of a given object.
  6256. * @returns {Function} Returns the new pairs function.
  6257. */
  6258. function createToPairs(keysFunc) {
  6259. return function(object) {
  6260. var tag = getTag(object);
  6261. if (tag == mapTag) {
  6262. return mapToArray(object);
  6263. }
  6264. if (tag == setTag) {
  6265. return setToPairs(object);
  6266. }
  6267. return baseToPairs(object, keysFunc(object));
  6268. };
  6269. }
  6270. /**
  6271. * Creates a function that either curries or invokes `func` with optional
  6272. * `this` binding and partially applied arguments.
  6273. *
  6274. * @private
  6275. * @param {Function|string} func The function or method name to wrap.
  6276. * @param {number} bitmask The bitmask flags.
  6277. * 1 - `_.bind`
  6278. * 2 - `_.bindKey`
  6279. * 4 - `_.curry` or `_.curryRight` of a bound function
  6280. * 8 - `_.curry`
  6281. * 16 - `_.curryRight`
  6282. * 32 - `_.partial`
  6283. * 64 - `_.partialRight`
  6284. * 128 - `_.rearg`
  6285. * 256 - `_.ary`
  6286. * 512 - `_.flip`
  6287. * @param {*} [thisArg] The `this` binding of `func`.
  6288. * @param {Array} [partials] The arguments to be partially applied.
  6289. * @param {Array} [holders] The `partials` placeholder indexes.
  6290. * @param {Array} [argPos] The argument positions of the new function.
  6291. * @param {number} [ary] The arity cap of `func`.
  6292. * @param {number} [arity] The arity of `func`.
  6293. * @returns {Function} Returns the new wrapped function.
  6294. */
  6295. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6296. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6297. if (!isBindKey && typeof func != 'function') {
  6298. throw new TypeError(FUNC_ERROR_TEXT);
  6299. }
  6300. var length = partials ? partials.length : 0;
  6301. if (!length) {
  6302. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6303. partials = holders = undefined;
  6304. }
  6305. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6306. arity = arity === undefined ? arity : toInteger(arity);
  6307. length -= holders ? holders.length : 0;
  6308. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6309. var partialsRight = partials,
  6310. holdersRight = holders;
  6311. partials = holders = undefined;
  6312. }
  6313. var data = isBindKey ? undefined : getData(func);
  6314. var newData = [
  6315. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6316. argPos, ary, arity
  6317. ];
  6318. if (data) {
  6319. mergeData(newData, data);
  6320. }
  6321. func = newData[0];
  6322. bitmask = newData[1];
  6323. thisArg = newData[2];
  6324. partials = newData[3];
  6325. holders = newData[4];
  6326. arity = newData[9] = newData[9] === undefined
  6327. ? (isBindKey ? 0 : func.length)
  6328. : nativeMax(newData[9] - length, 0);
  6329. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6330. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6331. }
  6332. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6333. var result = createBind(func, bitmask, thisArg);
  6334. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6335. result = createCurry(func, bitmask, arity);
  6336. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6337. result = createPartial(func, bitmask, thisArg, partials);
  6338. } else {
  6339. result = createHybrid.apply(undefined, newData);
  6340. }
  6341. var setter = data ? baseSetData : setData;
  6342. return setWrapToString(setter(result, newData), func, bitmask);
  6343. }
  6344. /**
  6345. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6346. * of source objects to the destination object for all destination properties
  6347. * that resolve to `undefined`.
  6348. *
  6349. * @private
  6350. * @param {*} objValue The destination value.
  6351. * @param {*} srcValue The source value.
  6352. * @param {string} key The key of the property to assign.
  6353. * @param {Object} object The parent object of `objValue`.
  6354. * @returns {*} Returns the value to assign.
  6355. */
  6356. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6357. if (objValue === undefined ||
  6358. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6359. return srcValue;
  6360. }
  6361. return objValue;
  6362. }
  6363. /**
  6364. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6365. * objects into destination objects that are passed thru.
  6366. *
  6367. * @private
  6368. * @param {*} objValue The destination value.
  6369. * @param {*} srcValue The source value.
  6370. * @param {string} key The key of the property to merge.
  6371. * @param {Object} object The parent object of `objValue`.
  6372. * @param {Object} source The parent object of `srcValue`.
  6373. * @param {Object} [stack] Tracks traversed source values and their merged
  6374. * counterparts.
  6375. * @returns {*} Returns the value to assign.
  6376. */
  6377. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6378. if (isObject(objValue) && isObject(srcValue)) {
  6379. // Recursively merge objects and arrays (susceptible to call stack limits).
  6380. stack.set(srcValue, objValue);
  6381. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6382. stack['delete'](srcValue);
  6383. }
  6384. return objValue;
  6385. }
  6386. /**
  6387. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6388. * objects.
  6389. *
  6390. * @private
  6391. * @param {*} value The value to inspect.
  6392. * @param {string} key The key of the property to inspect.
  6393. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6394. */
  6395. function customOmitClone(value) {
  6396. return isPlainObject(value) ? undefined : value;
  6397. }
  6398. /**
  6399. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6400. * partial deep comparisons.
  6401. *
  6402. * @private
  6403. * @param {Array} array The array to compare.
  6404. * @param {Array} other The other array to compare.
  6405. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6406. * @param {Function} customizer The function to customize comparisons.
  6407. * @param {Function} equalFunc The function to determine equivalents of values.
  6408. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6409. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6410. */
  6411. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6412. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6413. arrLength = array.length,
  6414. othLength = other.length;
  6415. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6416. return false;
  6417. }
  6418. // Check that cyclic values are equal.
  6419. var arrStacked = stack.get(array);
  6420. var othStacked = stack.get(other);
  6421. if (arrStacked && othStacked) {
  6422. return arrStacked == other && othStacked == array;
  6423. }
  6424. var index = -1,
  6425. result = true,
  6426. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6427. stack.set(array, other);
  6428. stack.set(other, array);
  6429. // Ignore non-index properties.
  6430. while (++index < arrLength) {
  6431. var arrValue = array[index],
  6432. othValue = other[index];
  6433. if (customizer) {
  6434. var compared = isPartial
  6435. ? customizer(othValue, arrValue, index, other, array, stack)
  6436. : customizer(arrValue, othValue, index, array, other, stack);
  6437. }
  6438. if (compared !== undefined) {
  6439. if (compared) {
  6440. continue;
  6441. }
  6442. result = false;
  6443. break;
  6444. }
  6445. // Recursively compare arrays (susceptible to call stack limits).
  6446. if (seen) {
  6447. if (!arraySome(other, function(othValue, othIndex) {
  6448. if (!cacheHas(seen, othIndex) &&
  6449. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6450. return seen.push(othIndex);
  6451. }
  6452. })) {
  6453. result = false;
  6454. break;
  6455. }
  6456. } else if (!(
  6457. arrValue === othValue ||
  6458. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6459. )) {
  6460. result = false;
  6461. break;
  6462. }
  6463. }
  6464. stack['delete'](array);
  6465. stack['delete'](other);
  6466. return result;
  6467. }
  6468. /**
  6469. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6470. * the same `toStringTag`.
  6471. *
  6472. * **Note:** This function only supports comparing values with tags of
  6473. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6474. *
  6475. * @private
  6476. * @param {Object} object The object to compare.
  6477. * @param {Object} other The other object to compare.
  6478. * @param {string} tag The `toStringTag` of the objects to compare.
  6479. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6480. * @param {Function} customizer The function to customize comparisons.
  6481. * @param {Function} equalFunc The function to determine equivalents of values.
  6482. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6483. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6484. */
  6485. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6486. switch (tag) {
  6487. case dataViewTag:
  6488. if ((object.byteLength != other.byteLength) ||
  6489. (object.byteOffset != other.byteOffset)) {
  6490. return false;
  6491. }
  6492. object = object.buffer;
  6493. other = other.buffer;
  6494. case arrayBufferTag:
  6495. if ((object.byteLength != other.byteLength) ||
  6496. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6497. return false;
  6498. }
  6499. return true;
  6500. case boolTag:
  6501. case dateTag:
  6502. case numberTag:
  6503. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6504. // Invalid dates are coerced to `NaN`.
  6505. return eq(+object, +other);
  6506. case errorTag:
  6507. return object.name == other.name && object.message == other.message;
  6508. case regexpTag:
  6509. case stringTag:
  6510. // Coerce regexes to strings and treat strings, primitives and objects,
  6511. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6512. // for more details.
  6513. return object == (other + '');
  6514. case mapTag:
  6515. var convert = mapToArray;
  6516. case setTag:
  6517. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6518. convert || (convert = setToArray);
  6519. if (object.size != other.size && !isPartial) {
  6520. return false;
  6521. }
  6522. // Assume cyclic values are equal.
  6523. var stacked = stack.get(object);
  6524. if (stacked) {
  6525. return stacked == other;
  6526. }
  6527. bitmask |= COMPARE_UNORDERED_FLAG;
  6528. // Recursively compare objects (susceptible to call stack limits).
  6529. stack.set(object, other);
  6530. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6531. stack['delete'](object);
  6532. return result;
  6533. case symbolTag:
  6534. if (symbolValueOf) {
  6535. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6536. }
  6537. }
  6538. return false;
  6539. }
  6540. /**
  6541. * A specialized version of `baseIsEqualDeep` for objects with support for
  6542. * partial deep comparisons.
  6543. *
  6544. * @private
  6545. * @param {Object} object The object to compare.
  6546. * @param {Object} other The other object to compare.
  6547. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6548. * @param {Function} customizer The function to customize comparisons.
  6549. * @param {Function} equalFunc The function to determine equivalents of values.
  6550. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6551. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6552. */
  6553. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6554. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6555. objProps = getAllKeys(object),
  6556. objLength = objProps.length,
  6557. othProps = getAllKeys(other),
  6558. othLength = othProps.length;
  6559. if (objLength != othLength && !isPartial) {
  6560. return false;
  6561. }
  6562. var index = objLength;
  6563. while (index--) {
  6564. var key = objProps[index];
  6565. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6566. return false;
  6567. }
  6568. }
  6569. // Check that cyclic values are equal.
  6570. var objStacked = stack.get(object);
  6571. var othStacked = stack.get(other);
  6572. if (objStacked && othStacked) {
  6573. return objStacked == other && othStacked == object;
  6574. }
  6575. var result = true;
  6576. stack.set(object, other);
  6577. stack.set(other, object);
  6578. var skipCtor = isPartial;
  6579. while (++index < objLength) {
  6580. key = objProps[index];
  6581. var objValue = object[key],
  6582. othValue = other[key];
  6583. if (customizer) {
  6584. var compared = isPartial
  6585. ? customizer(othValue, objValue, key, other, object, stack)
  6586. : customizer(objValue, othValue, key, object, other, stack);
  6587. }
  6588. // Recursively compare objects (susceptible to call stack limits).
  6589. if (!(compared === undefined
  6590. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6591. : compared
  6592. )) {
  6593. result = false;
  6594. break;
  6595. }
  6596. skipCtor || (skipCtor = key == 'constructor');
  6597. }
  6598. if (result && !skipCtor) {
  6599. var objCtor = object.constructor,
  6600. othCtor = other.constructor;
  6601. // Non `Object` object instances with different constructors are not equal.
  6602. if (objCtor != othCtor &&
  6603. ('constructor' in object && 'constructor' in other) &&
  6604. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6605. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6606. result = false;
  6607. }
  6608. }
  6609. stack['delete'](object);
  6610. stack['delete'](other);
  6611. return result;
  6612. }
  6613. /**
  6614. * A specialized version of `baseRest` which flattens the rest array.
  6615. *
  6616. * @private
  6617. * @param {Function} func The function to apply a rest parameter to.
  6618. * @returns {Function} Returns the new function.
  6619. */
  6620. function flatRest(func) {
  6621. return setToString(overRest(func, undefined, flatten), func + '');
  6622. }
  6623. /**
  6624. * Creates an array of own enumerable property names and symbols of `object`.
  6625. *
  6626. * @private
  6627. * @param {Object} object The object to query.
  6628. * @returns {Array} Returns the array of property names and symbols.
  6629. */
  6630. function getAllKeys(object) {
  6631. return baseGetAllKeys(object, keys, getSymbols);
  6632. }
  6633. /**
  6634. * Creates an array of own and inherited enumerable property names and
  6635. * symbols of `object`.
  6636. *
  6637. * @private
  6638. * @param {Object} object The object to query.
  6639. * @returns {Array} Returns the array of property names and symbols.
  6640. */
  6641. function getAllKeysIn(object) {
  6642. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6643. }
  6644. /**
  6645. * Gets metadata for `func`.
  6646. *
  6647. * @private
  6648. * @param {Function} func The function to query.
  6649. * @returns {*} Returns the metadata for `func`.
  6650. */
  6651. var getData = !metaMap ? noop : function(func) {
  6652. return metaMap.get(func);
  6653. };
  6654. /**
  6655. * Gets the name of `func`.
  6656. *
  6657. * @private
  6658. * @param {Function} func The function to query.
  6659. * @returns {string} Returns the function name.
  6660. */
  6661. function getFuncName(func) {
  6662. var result = (func.name + ''),
  6663. array = realNames[result],
  6664. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6665. while (length--) {
  6666. var data = array[length],
  6667. otherFunc = data.func;
  6668. if (otherFunc == null || otherFunc == func) {
  6669. return data.name;
  6670. }
  6671. }
  6672. return result;
  6673. }
  6674. /**
  6675. * Gets the argument placeholder value for `func`.
  6676. *
  6677. * @private
  6678. * @param {Function} func The function to inspect.
  6679. * @returns {*} Returns the placeholder value.
  6680. */
  6681. function getHolder(func) {
  6682. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6683. return object.placeholder;
  6684. }
  6685. /**
  6686. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6687. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6688. * If arguments are provided, the chosen function is invoked with them and
  6689. * its result is returned.
  6690. *
  6691. * @private
  6692. * @param {*} [value] The value to convert to an iteratee.
  6693. * @param {number} [arity] The arity of the created iteratee.
  6694. * @returns {Function} Returns the chosen function or its result.
  6695. */
  6696. function getIteratee() {
  6697. var result = lodash.iteratee || iteratee;
  6698. result = result === iteratee ? baseIteratee : result;
  6699. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6700. }
  6701. /**
  6702. * Gets the data for `map`.
  6703. *
  6704. * @private
  6705. * @param {Object} map The map to query.
  6706. * @param {string} key The reference key.
  6707. * @returns {*} Returns the map data.
  6708. */
  6709. function getMapData(map, key) {
  6710. var data = map.__data__;
  6711. return isKeyable(key)
  6712. ? data[typeof key == 'string' ? 'string' : 'hash']
  6713. : data.map;
  6714. }
  6715. /**
  6716. * Gets the property names, values, and compare flags of `object`.
  6717. *
  6718. * @private
  6719. * @param {Object} object The object to query.
  6720. * @returns {Array} Returns the match data of `object`.
  6721. */
  6722. function getMatchData(object) {
  6723. var result = keys(object),
  6724. length = result.length;
  6725. while (length--) {
  6726. var key = result[length],
  6727. value = object[key];
  6728. result[length] = [key, value, isStrictComparable(value)];
  6729. }
  6730. return result;
  6731. }
  6732. /**
  6733. * Gets the native function at `key` of `object`.
  6734. *
  6735. * @private
  6736. * @param {Object} object The object to query.
  6737. * @param {string} key The key of the method to get.
  6738. * @returns {*} Returns the function if it's native, else `undefined`.
  6739. */
  6740. function getNative(object, key) {
  6741. var value = getValue(object, key);
  6742. return baseIsNative(value) ? value : undefined;
  6743. }
  6744. /**
  6745. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6746. *
  6747. * @private
  6748. * @param {*} value The value to query.
  6749. * @returns {string} Returns the raw `toStringTag`.
  6750. */
  6751. function getRawTag(value) {
  6752. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6753. tag = value[symToStringTag];
  6754. try {
  6755. value[symToStringTag] = undefined;
  6756. var unmasked = true;
  6757. } catch (e) {}
  6758. var result = nativeObjectToString.call(value);
  6759. if (unmasked) {
  6760. if (isOwn) {
  6761. value[symToStringTag] = tag;
  6762. } else {
  6763. delete value[symToStringTag];
  6764. }
  6765. }
  6766. return result;
  6767. }
  6768. /**
  6769. * Creates an array of the own enumerable symbols of `object`.
  6770. *
  6771. * @private
  6772. * @param {Object} object The object to query.
  6773. * @returns {Array} Returns the array of symbols.
  6774. */
  6775. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6776. if (object == null) {
  6777. return [];
  6778. }
  6779. object = Object(object);
  6780. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6781. return propertyIsEnumerable.call(object, symbol);
  6782. });
  6783. };
  6784. /**
  6785. * Creates an array of the own and inherited enumerable symbols of `object`.
  6786. *
  6787. * @private
  6788. * @param {Object} object The object to query.
  6789. * @returns {Array} Returns the array of symbols.
  6790. */
  6791. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6792. var result = [];
  6793. while (object) {
  6794. arrayPush(result, getSymbols(object));
  6795. object = getPrototype(object);
  6796. }
  6797. return result;
  6798. };
  6799. /**
  6800. * Gets the `toStringTag` of `value`.
  6801. *
  6802. * @private
  6803. * @param {*} value The value to query.
  6804. * @returns {string} Returns the `toStringTag`.
  6805. */
  6806. var getTag = baseGetTag;
  6807. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6808. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6809. (Map && getTag(new Map) != mapTag) ||
  6810. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6811. (Set && getTag(new Set) != setTag) ||
  6812. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6813. getTag = function(value) {
  6814. var result = baseGetTag(value),
  6815. Ctor = result == objectTag ? value.constructor : undefined,
  6816. ctorString = Ctor ? toSource(Ctor) : '';
  6817. if (ctorString) {
  6818. switch (ctorString) {
  6819. case dataViewCtorString: return dataViewTag;
  6820. case mapCtorString: return mapTag;
  6821. case promiseCtorString: return promiseTag;
  6822. case setCtorString: return setTag;
  6823. case weakMapCtorString: return weakMapTag;
  6824. }
  6825. }
  6826. return result;
  6827. };
  6828. }
  6829. /**
  6830. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6831. *
  6832. * @private
  6833. * @param {number} start The start of the view.
  6834. * @param {number} end The end of the view.
  6835. * @param {Array} transforms The transformations to apply to the view.
  6836. * @returns {Object} Returns an object containing the `start` and `end`
  6837. * positions of the view.
  6838. */
  6839. function getView(start, end, transforms) {
  6840. var index = -1,
  6841. length = transforms.length;
  6842. while (++index < length) {
  6843. var data = transforms[index],
  6844. size = data.size;
  6845. switch (data.type) {
  6846. case 'drop': start += size; break;
  6847. case 'dropRight': end -= size; break;
  6848. case 'take': end = nativeMin(end, start + size); break;
  6849. case 'takeRight': start = nativeMax(start, end - size); break;
  6850. }
  6851. }
  6852. return { 'start': start, 'end': end };
  6853. }
  6854. /**
  6855. * Extracts wrapper details from the `source` body comment.
  6856. *
  6857. * @private
  6858. * @param {string} source The source to inspect.
  6859. * @returns {Array} Returns the wrapper details.
  6860. */
  6861. function getWrapDetails(source) {
  6862. var match = source.match(reWrapDetails);
  6863. return match ? match[1].split(reSplitDetails) : [];
  6864. }
  6865. /**
  6866. * Checks if `path` exists on `object`.
  6867. *
  6868. * @private
  6869. * @param {Object} object The object to query.
  6870. * @param {Array|string} path The path to check.
  6871. * @param {Function} hasFunc The function to check properties.
  6872. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6873. */
  6874. function hasPath(object, path, hasFunc) {
  6875. path = castPath(path, object);
  6876. var index = -1,
  6877. length = path.length,
  6878. result = false;
  6879. while (++index < length) {
  6880. var key = toKey(path[index]);
  6881. if (!(result = object != null && hasFunc(object, key))) {
  6882. break;
  6883. }
  6884. object = object[key];
  6885. }
  6886. if (result || ++index != length) {
  6887. return result;
  6888. }
  6889. length = object == null ? 0 : object.length;
  6890. return !!length && isLength(length) && isIndex(key, length) &&
  6891. (isArray(object) || isArguments(object));
  6892. }
  6893. /**
  6894. * Initializes an array clone.
  6895. *
  6896. * @private
  6897. * @param {Array} array The array to clone.
  6898. * @returns {Array} Returns the initialized clone.
  6899. */
  6900. function initCloneArray(array) {
  6901. var length = array.length,
  6902. result = new array.constructor(length);
  6903. // Add properties assigned by `RegExp#exec`.
  6904. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6905. result.index = array.index;
  6906. result.input = array.input;
  6907. }
  6908. return result;
  6909. }
  6910. /**
  6911. * Initializes an object clone.
  6912. *
  6913. * @private
  6914. * @param {Object} object The object to clone.
  6915. * @returns {Object} Returns the initialized clone.
  6916. */
  6917. function initCloneObject(object) {
  6918. return (typeof object.constructor == 'function' && !isPrototype(object))
  6919. ? baseCreate(getPrototype(object))
  6920. : {};
  6921. }
  6922. /**
  6923. * Initializes an object clone based on its `toStringTag`.
  6924. *
  6925. * **Note:** This function only supports cloning values with tags of
  6926. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6927. *
  6928. * @private
  6929. * @param {Object} object The object to clone.
  6930. * @param {string} tag The `toStringTag` of the object to clone.
  6931. * @param {boolean} [isDeep] Specify a deep clone.
  6932. * @returns {Object} Returns the initialized clone.
  6933. */
  6934. function initCloneByTag(object, tag, isDeep) {
  6935. var Ctor = object.constructor;
  6936. switch (tag) {
  6937. case arrayBufferTag:
  6938. return cloneArrayBuffer(object);
  6939. case boolTag:
  6940. case dateTag:
  6941. return new Ctor(+object);
  6942. case dataViewTag:
  6943. return cloneDataView(object, isDeep);
  6944. case float32Tag: case float64Tag:
  6945. case int8Tag: case int16Tag: case int32Tag:
  6946. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6947. return cloneTypedArray(object, isDeep);
  6948. case mapTag:
  6949. return new Ctor;
  6950. case numberTag:
  6951. case stringTag:
  6952. return new Ctor(object);
  6953. case regexpTag:
  6954. return cloneRegExp(object);
  6955. case setTag:
  6956. return new Ctor;
  6957. case symbolTag:
  6958. return cloneSymbol(object);
  6959. }
  6960. }
  6961. /**
  6962. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6963. *
  6964. * @private
  6965. * @param {string} source The source to modify.
  6966. * @returns {Array} details The details to insert.
  6967. * @returns {string} Returns the modified source.
  6968. */
  6969. function insertWrapDetails(source, details) {
  6970. var length = details.length;
  6971. if (!length) {
  6972. return source;
  6973. }
  6974. var lastIndex = length - 1;
  6975. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6976. details = details.join(length > 2 ? ', ' : ' ');
  6977. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6978. }
  6979. /**
  6980. * Checks if `value` is a flattenable `arguments` object or array.
  6981. *
  6982. * @private
  6983. * @param {*} value The value to check.
  6984. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6985. */
  6986. function isFlattenable(value) {
  6987. return isArray(value) || isArguments(value) ||
  6988. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6989. }
  6990. /**
  6991. * Checks if `value` is a valid array-like index.
  6992. *
  6993. * @private
  6994. * @param {*} value The value to check.
  6995. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6996. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6997. */
  6998. function isIndex(value, length) {
  6999. var type = typeof value;
  7000. length = length == null ? MAX_SAFE_INTEGER : length;
  7001. return !!length &&
  7002. (type == 'number' ||
  7003. (type != 'symbol' && reIsUint.test(value))) &&
  7004. (value > -1 && value % 1 == 0 && value < length);
  7005. }
  7006. /**
  7007. * Checks if the given arguments are from an iteratee call.
  7008. *
  7009. * @private
  7010. * @param {*} value The potential iteratee value argument.
  7011. * @param {*} index The potential iteratee index or key argument.
  7012. * @param {*} object The potential iteratee object argument.
  7013. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7014. * else `false`.
  7015. */
  7016. function isIterateeCall(value, index, object) {
  7017. if (!isObject(object)) {
  7018. return false;
  7019. }
  7020. var type = typeof index;
  7021. if (type == 'number'
  7022. ? (isArrayLike(object) && isIndex(index, object.length))
  7023. : (type == 'string' && index in object)
  7024. ) {
  7025. return eq(object[index], value);
  7026. }
  7027. return false;
  7028. }
  7029. /**
  7030. * Checks if `value` is a property name and not a property path.
  7031. *
  7032. * @private
  7033. * @param {*} value The value to check.
  7034. * @param {Object} [object] The object to query keys on.
  7035. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7036. */
  7037. function isKey(value, object) {
  7038. if (isArray(value)) {
  7039. return false;
  7040. }
  7041. var type = typeof value;
  7042. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7043. value == null || isSymbol(value)) {
  7044. return true;
  7045. }
  7046. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7047. (object != null && value in Object(object));
  7048. }
  7049. /**
  7050. * Checks if `value` is suitable for use as unique object key.
  7051. *
  7052. * @private
  7053. * @param {*} value The value to check.
  7054. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7055. */
  7056. function isKeyable(value) {
  7057. var type = typeof value;
  7058. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7059. ? (value !== '__proto__')
  7060. : (value === null);
  7061. }
  7062. /**
  7063. * Checks if `func` has a lazy counterpart.
  7064. *
  7065. * @private
  7066. * @param {Function} func The function to check.
  7067. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7068. * else `false`.
  7069. */
  7070. function isLaziable(func) {
  7071. var funcName = getFuncName(func),
  7072. other = lodash[funcName];
  7073. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7074. return false;
  7075. }
  7076. if (func === other) {
  7077. return true;
  7078. }
  7079. var data = getData(other);
  7080. return !!data && func === data[0];
  7081. }
  7082. /**
  7083. * Checks if `func` has its source masked.
  7084. *
  7085. * @private
  7086. * @param {Function} func The function to check.
  7087. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7088. */
  7089. function isMasked(func) {
  7090. return !!maskSrcKey && (maskSrcKey in func);
  7091. }
  7092. /**
  7093. * Checks if `func` is capable of being masked.
  7094. *
  7095. * @private
  7096. * @param {*} value The value to check.
  7097. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7098. */
  7099. var isMaskable = coreJsData ? isFunction : stubFalse;
  7100. /**
  7101. * Checks if `value` is likely a prototype object.
  7102. *
  7103. * @private
  7104. * @param {*} value The value to check.
  7105. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7106. */
  7107. function isPrototype(value) {
  7108. var Ctor = value && value.constructor,
  7109. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7110. return value === proto;
  7111. }
  7112. /**
  7113. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7114. *
  7115. * @private
  7116. * @param {*} value The value to check.
  7117. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7118. * equality comparisons, else `false`.
  7119. */
  7120. function isStrictComparable(value) {
  7121. return value === value && !isObject(value);
  7122. }
  7123. /**
  7124. * A specialized version of `matchesProperty` for source values suitable
  7125. * for strict equality comparisons, i.e. `===`.
  7126. *
  7127. * @private
  7128. * @param {string} key The key of the property to get.
  7129. * @param {*} srcValue The value to match.
  7130. * @returns {Function} Returns the new spec function.
  7131. */
  7132. function matchesStrictComparable(key, srcValue) {
  7133. return function(object) {
  7134. if (object == null) {
  7135. return false;
  7136. }
  7137. return object[key] === srcValue &&
  7138. (srcValue !== undefined || (key in Object(object)));
  7139. };
  7140. }
  7141. /**
  7142. * A specialized version of `_.memoize` which clears the memoized function's
  7143. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7144. *
  7145. * @private
  7146. * @param {Function} func The function to have its output memoized.
  7147. * @returns {Function} Returns the new memoized function.
  7148. */
  7149. function memoizeCapped(func) {
  7150. var result = memoize(func, function(key) {
  7151. if (cache.size === MAX_MEMOIZE_SIZE) {
  7152. cache.clear();
  7153. }
  7154. return key;
  7155. });
  7156. var cache = result.cache;
  7157. return result;
  7158. }
  7159. /**
  7160. * Merges the function metadata of `source` into `data`.
  7161. *
  7162. * Merging metadata reduces the number of wrappers used to invoke a function.
  7163. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7164. * may be applied regardless of execution order. Methods like `_.ary` and
  7165. * `_.rearg` modify function arguments, making the order in which they are
  7166. * executed important, preventing the merging of metadata. However, we make
  7167. * an exception for a safe combined case where curried functions have `_.ary`
  7168. * and or `_.rearg` applied.
  7169. *
  7170. * @private
  7171. * @param {Array} data The destination metadata.
  7172. * @param {Array} source The source metadata.
  7173. * @returns {Array} Returns `data`.
  7174. */
  7175. function mergeData(data, source) {
  7176. var bitmask = data[1],
  7177. srcBitmask = source[1],
  7178. newBitmask = bitmask | srcBitmask,
  7179. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7180. var isCombo =
  7181. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7182. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7183. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7184. // Exit early if metadata can't be merged.
  7185. if (!(isCommon || isCombo)) {
  7186. return data;
  7187. }
  7188. // Use source `thisArg` if available.
  7189. if (srcBitmask & WRAP_BIND_FLAG) {
  7190. data[2] = source[2];
  7191. // Set when currying a bound function.
  7192. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7193. }
  7194. // Compose partial arguments.
  7195. var value = source[3];
  7196. if (value) {
  7197. var partials = data[3];
  7198. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7199. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7200. }
  7201. // Compose partial right arguments.
  7202. value = source[5];
  7203. if (value) {
  7204. partials = data[5];
  7205. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7206. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7207. }
  7208. // Use source `argPos` if available.
  7209. value = source[7];
  7210. if (value) {
  7211. data[7] = value;
  7212. }
  7213. // Use source `ary` if it's smaller.
  7214. if (srcBitmask & WRAP_ARY_FLAG) {
  7215. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7216. }
  7217. // Use source `arity` if one is not provided.
  7218. if (data[9] == null) {
  7219. data[9] = source[9];
  7220. }
  7221. // Use source `func` and merge bitmasks.
  7222. data[0] = source[0];
  7223. data[1] = newBitmask;
  7224. return data;
  7225. }
  7226. /**
  7227. * This function is like
  7228. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7229. * except that it includes inherited enumerable properties.
  7230. *
  7231. * @private
  7232. * @param {Object} object The object to query.
  7233. * @returns {Array} Returns the array of property names.
  7234. */
  7235. function nativeKeysIn(object) {
  7236. var result = [];
  7237. if (object != null) {
  7238. for (var key in Object(object)) {
  7239. result.push(key);
  7240. }
  7241. }
  7242. return result;
  7243. }
  7244. /**
  7245. * Converts `value` to a string using `Object.prototype.toString`.
  7246. *
  7247. * @private
  7248. * @param {*} value The value to convert.
  7249. * @returns {string} Returns the converted string.
  7250. */
  7251. function objectToString(value) {
  7252. return nativeObjectToString.call(value);
  7253. }
  7254. /**
  7255. * A specialized version of `baseRest` which transforms the rest array.
  7256. *
  7257. * @private
  7258. * @param {Function} func The function to apply a rest parameter to.
  7259. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7260. * @param {Function} transform The rest array transform.
  7261. * @returns {Function} Returns the new function.
  7262. */
  7263. function overRest(func, start, transform) {
  7264. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7265. return function() {
  7266. var args = arguments,
  7267. index = -1,
  7268. length = nativeMax(args.length - start, 0),
  7269. array = Array(length);
  7270. while (++index < length) {
  7271. array[index] = args[start + index];
  7272. }
  7273. index = -1;
  7274. var otherArgs = Array(start + 1);
  7275. while (++index < start) {
  7276. otherArgs[index] = args[index];
  7277. }
  7278. otherArgs[start] = transform(array);
  7279. return apply(func, this, otherArgs);
  7280. };
  7281. }
  7282. /**
  7283. * Gets the parent value at `path` of `object`.
  7284. *
  7285. * @private
  7286. * @param {Object} object The object to query.
  7287. * @param {Array} path The path to get the parent value of.
  7288. * @returns {*} Returns the parent value.
  7289. */
  7290. function parent(object, path) {
  7291. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7292. }
  7293. /**
  7294. * Reorder `array` according to the specified indexes where the element at
  7295. * the first index is assigned as the first element, the element at
  7296. * the second index is assigned as the second element, and so on.
  7297. *
  7298. * @private
  7299. * @param {Array} array The array to reorder.
  7300. * @param {Array} indexes The arranged array indexes.
  7301. * @returns {Array} Returns `array`.
  7302. */
  7303. function reorder(array, indexes) {
  7304. var arrLength = array.length,
  7305. length = nativeMin(indexes.length, arrLength),
  7306. oldArray = copyArray(array);
  7307. while (length--) {
  7308. var index = indexes[length];
  7309. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7310. }
  7311. return array;
  7312. }
  7313. /**
  7314. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7315. *
  7316. * @private
  7317. * @param {Object} object The object to query.
  7318. * @param {string} key The key of the property to get.
  7319. * @returns {*} Returns the property value.
  7320. */
  7321. function safeGet(object, key) {
  7322. if (key === 'constructor' && typeof object[key] === 'function') {
  7323. return;
  7324. }
  7325. if (key == '__proto__') {
  7326. return;
  7327. }
  7328. return object[key];
  7329. }
  7330. /**
  7331. * Sets metadata for `func`.
  7332. *
  7333. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7334. * period of time, it will trip its breaker and transition to an identity
  7335. * function to avoid garbage collection pauses in V8. See
  7336. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7337. * for more details.
  7338. *
  7339. * @private
  7340. * @param {Function} func The function to associate metadata with.
  7341. * @param {*} data The metadata.
  7342. * @returns {Function} Returns `func`.
  7343. */
  7344. var setData = shortOut(baseSetData);
  7345. /**
  7346. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7347. *
  7348. * @private
  7349. * @param {Function} func The function to delay.
  7350. * @param {number} wait The number of milliseconds to delay invocation.
  7351. * @returns {number|Object} Returns the timer id or timeout object.
  7352. */
  7353. var setTimeout = ctxSetTimeout || function(func, wait) {
  7354. return root.setTimeout(func, wait);
  7355. };
  7356. /**
  7357. * Sets the `toString` method of `func` to return `string`.
  7358. *
  7359. * @private
  7360. * @param {Function} func The function to modify.
  7361. * @param {Function} string The `toString` result.
  7362. * @returns {Function} Returns `func`.
  7363. */
  7364. var setToString = shortOut(baseSetToString);
  7365. /**
  7366. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7367. * with wrapper details in a comment at the top of the source body.
  7368. *
  7369. * @private
  7370. * @param {Function} wrapper The function to modify.
  7371. * @param {Function} reference The reference function.
  7372. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7373. * @returns {Function} Returns `wrapper`.
  7374. */
  7375. function setWrapToString(wrapper, reference, bitmask) {
  7376. var source = (reference + '');
  7377. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7378. }
  7379. /**
  7380. * Creates a function that'll short out and invoke `identity` instead
  7381. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7382. * milliseconds.
  7383. *
  7384. * @private
  7385. * @param {Function} func The function to restrict.
  7386. * @returns {Function} Returns the new shortable function.
  7387. */
  7388. function shortOut(func) {
  7389. var count = 0,
  7390. lastCalled = 0;
  7391. return function() {
  7392. var stamp = nativeNow(),
  7393. remaining = HOT_SPAN - (stamp - lastCalled);
  7394. lastCalled = stamp;
  7395. if (remaining > 0) {
  7396. if (++count >= HOT_COUNT) {
  7397. return arguments[0];
  7398. }
  7399. } else {
  7400. count = 0;
  7401. }
  7402. return func.apply(undefined, arguments);
  7403. };
  7404. }
  7405. /**
  7406. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7407. *
  7408. * @private
  7409. * @param {Array} array The array to shuffle.
  7410. * @param {number} [size=array.length] The size of `array`.
  7411. * @returns {Array} Returns `array`.
  7412. */
  7413. function shuffleSelf(array, size) {
  7414. var index = -1,
  7415. length = array.length,
  7416. lastIndex = length - 1;
  7417. size = size === undefined ? length : size;
  7418. while (++index < size) {
  7419. var rand = baseRandom(index, lastIndex),
  7420. value = array[rand];
  7421. array[rand] = array[index];
  7422. array[index] = value;
  7423. }
  7424. array.length = size;
  7425. return array;
  7426. }
  7427. /**
  7428. * Converts `string` to a property path array.
  7429. *
  7430. * @private
  7431. * @param {string} string The string to convert.
  7432. * @returns {Array} Returns the property path array.
  7433. */
  7434. var stringToPath = memoizeCapped(function(string) {
  7435. var result = [];
  7436. if (string.charCodeAt(0) === 46 /* . */) {
  7437. result.push('');
  7438. }
  7439. string.replace(rePropName, function(match, number, quote, subString) {
  7440. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7441. });
  7442. return result;
  7443. });
  7444. /**
  7445. * Converts `value` to a string key if it's not a string or symbol.
  7446. *
  7447. * @private
  7448. * @param {*} value The value to inspect.
  7449. * @returns {string|symbol} Returns the key.
  7450. */
  7451. function toKey(value) {
  7452. if (typeof value == 'string' || isSymbol(value)) {
  7453. return value;
  7454. }
  7455. var result = (value + '');
  7456. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7457. }
  7458. /**
  7459. * Converts `func` to its source code.
  7460. *
  7461. * @private
  7462. * @param {Function} func The function to convert.
  7463. * @returns {string} Returns the source code.
  7464. */
  7465. function toSource(func) {
  7466. if (func != null) {
  7467. try {
  7468. return funcToString.call(func);
  7469. } catch (e) {}
  7470. try {
  7471. return (func + '');
  7472. } catch (e) {}
  7473. }
  7474. return '';
  7475. }
  7476. /**
  7477. * Updates wrapper `details` based on `bitmask` flags.
  7478. *
  7479. * @private
  7480. * @returns {Array} details The details to modify.
  7481. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7482. * @returns {Array} Returns `details`.
  7483. */
  7484. function updateWrapDetails(details, bitmask) {
  7485. arrayEach(wrapFlags, function(pair) {
  7486. var value = '_.' + pair[0];
  7487. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7488. details.push(value);
  7489. }
  7490. });
  7491. return details.sort();
  7492. }
  7493. /**
  7494. * Creates a clone of `wrapper`.
  7495. *
  7496. * @private
  7497. * @param {Object} wrapper The wrapper to clone.
  7498. * @returns {Object} Returns the cloned wrapper.
  7499. */
  7500. function wrapperClone(wrapper) {
  7501. if (wrapper instanceof LazyWrapper) {
  7502. return wrapper.clone();
  7503. }
  7504. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7505. result.__actions__ = copyArray(wrapper.__actions__);
  7506. result.__index__ = wrapper.__index__;
  7507. result.__values__ = wrapper.__values__;
  7508. return result;
  7509. }
  7510. /*------------------------------------------------------------------------*/
  7511. /**
  7512. * Creates an array of elements split into groups the length of `size`.
  7513. * If `array` can't be split evenly, the final chunk will be the remaining
  7514. * elements.
  7515. *
  7516. * @static
  7517. * @memberOf _
  7518. * @since 3.0.0
  7519. * @category Array
  7520. * @param {Array} array The array to process.
  7521. * @param {number} [size=1] The length of each chunk
  7522. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7523. * @returns {Array} Returns the new array of chunks.
  7524. * @example
  7525. *
  7526. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7527. * // => [['a', 'b'], ['c', 'd']]
  7528. *
  7529. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7530. * // => [['a', 'b', 'c'], ['d']]
  7531. */
  7532. function chunk(array, size, guard) {
  7533. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7534. size = 1;
  7535. } else {
  7536. size = nativeMax(toInteger(size), 0);
  7537. }
  7538. var length = array == null ? 0 : array.length;
  7539. if (!length || size < 1) {
  7540. return [];
  7541. }
  7542. var index = 0,
  7543. resIndex = 0,
  7544. result = Array(nativeCeil(length / size));
  7545. while (index < length) {
  7546. result[resIndex++] = baseSlice(array, index, (index += size));
  7547. }
  7548. return result;
  7549. }
  7550. /**
  7551. * Creates an array with all falsey values removed. The values `false`, `null`,
  7552. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7553. *
  7554. * @static
  7555. * @memberOf _
  7556. * @since 0.1.0
  7557. * @category Array
  7558. * @param {Array} array The array to compact.
  7559. * @returns {Array} Returns the new array of filtered values.
  7560. * @example
  7561. *
  7562. * _.compact([0, 1, false, 2, '', 3]);
  7563. * // => [1, 2, 3]
  7564. */
  7565. function compact(array) {
  7566. var index = -1,
  7567. length = array == null ? 0 : array.length,
  7568. resIndex = 0,
  7569. result = [];
  7570. while (++index < length) {
  7571. var value = array[index];
  7572. if (value) {
  7573. result[resIndex++] = value;
  7574. }
  7575. }
  7576. return result;
  7577. }
  7578. /**
  7579. * Creates a new array concatenating `array` with any additional arrays
  7580. * and/or values.
  7581. *
  7582. * @static
  7583. * @memberOf _
  7584. * @since 4.0.0
  7585. * @category Array
  7586. * @param {Array} array The array to concatenate.
  7587. * @param {...*} [values] The values to concatenate.
  7588. * @returns {Array} Returns the new concatenated array.
  7589. * @example
  7590. *
  7591. * var array = [1];
  7592. * var other = _.concat(array, 2, [3], [[4]]);
  7593. *
  7594. * console.log(other);
  7595. * // => [1, 2, 3, [4]]
  7596. *
  7597. * console.log(array);
  7598. * // => [1]
  7599. */
  7600. function concat() {
  7601. var length = arguments.length;
  7602. if (!length) {
  7603. return [];
  7604. }
  7605. var args = Array(length - 1),
  7606. array = arguments[0],
  7607. index = length;
  7608. while (index--) {
  7609. args[index - 1] = arguments[index];
  7610. }
  7611. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7612. }
  7613. /**
  7614. * Creates an array of `array` values not included in the other given arrays
  7615. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7616. * for equality comparisons. The order and references of result values are
  7617. * determined by the first array.
  7618. *
  7619. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7620. *
  7621. * @static
  7622. * @memberOf _
  7623. * @since 0.1.0
  7624. * @category Array
  7625. * @param {Array} array The array to inspect.
  7626. * @param {...Array} [values] The values to exclude.
  7627. * @returns {Array} Returns the new array of filtered values.
  7628. * @see _.without, _.xor
  7629. * @example
  7630. *
  7631. * _.difference([2, 1], [2, 3]);
  7632. * // => [1]
  7633. */
  7634. var difference = baseRest(function(array, values) {
  7635. return isArrayLikeObject(array)
  7636. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7637. : [];
  7638. });
  7639. /**
  7640. * This method is like `_.difference` except that it accepts `iteratee` which
  7641. * is invoked for each element of `array` and `values` to generate the criterion
  7642. * by which they're compared. The order and references of result values are
  7643. * determined by the first array. The iteratee is invoked with one argument:
  7644. * (value).
  7645. *
  7646. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7647. *
  7648. * @static
  7649. * @memberOf _
  7650. * @since 4.0.0
  7651. * @category Array
  7652. * @param {Array} array The array to inspect.
  7653. * @param {...Array} [values] The values to exclude.
  7654. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7655. * @returns {Array} Returns the new array of filtered values.
  7656. * @example
  7657. *
  7658. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7659. * // => [1.2]
  7660. *
  7661. * // The `_.property` iteratee shorthand.
  7662. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7663. * // => [{ 'x': 2 }]
  7664. */
  7665. var differenceBy = baseRest(function(array, values) {
  7666. var iteratee = last(values);
  7667. if (isArrayLikeObject(iteratee)) {
  7668. iteratee = undefined;
  7669. }
  7670. return isArrayLikeObject(array)
  7671. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7672. : [];
  7673. });
  7674. /**
  7675. * This method is like `_.difference` except that it accepts `comparator`
  7676. * which is invoked to compare elements of `array` to `values`. The order and
  7677. * references of result values are determined by the first array. The comparator
  7678. * is invoked with two arguments: (arrVal, othVal).
  7679. *
  7680. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7681. *
  7682. * @static
  7683. * @memberOf _
  7684. * @since 4.0.0
  7685. * @category Array
  7686. * @param {Array} array The array to inspect.
  7687. * @param {...Array} [values] The values to exclude.
  7688. * @param {Function} [comparator] The comparator invoked per element.
  7689. * @returns {Array} Returns the new array of filtered values.
  7690. * @example
  7691. *
  7692. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7693. *
  7694. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7695. * // => [{ 'x': 2, 'y': 1 }]
  7696. */
  7697. var differenceWith = baseRest(function(array, values) {
  7698. var comparator = last(values);
  7699. if (isArrayLikeObject(comparator)) {
  7700. comparator = undefined;
  7701. }
  7702. return isArrayLikeObject(array)
  7703. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7704. : [];
  7705. });
  7706. /**
  7707. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7708. *
  7709. * @static
  7710. * @memberOf _
  7711. * @since 0.5.0
  7712. * @category Array
  7713. * @param {Array} array The array to query.
  7714. * @param {number} [n=1] The number of elements to drop.
  7715. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7716. * @returns {Array} Returns the slice of `array`.
  7717. * @example
  7718. *
  7719. * _.drop([1, 2, 3]);
  7720. * // => [2, 3]
  7721. *
  7722. * _.drop([1, 2, 3], 2);
  7723. * // => [3]
  7724. *
  7725. * _.drop([1, 2, 3], 5);
  7726. * // => []
  7727. *
  7728. * _.drop([1, 2, 3], 0);
  7729. * // => [1, 2, 3]
  7730. */
  7731. function drop(array, n, guard) {
  7732. var length = array == null ? 0 : array.length;
  7733. if (!length) {
  7734. return [];
  7735. }
  7736. n = (guard || n === undefined) ? 1 : toInteger(n);
  7737. return baseSlice(array, n < 0 ? 0 : n, length);
  7738. }
  7739. /**
  7740. * Creates a slice of `array` with `n` elements dropped from the end.
  7741. *
  7742. * @static
  7743. * @memberOf _
  7744. * @since 3.0.0
  7745. * @category Array
  7746. * @param {Array} array The array to query.
  7747. * @param {number} [n=1] The number of elements to drop.
  7748. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7749. * @returns {Array} Returns the slice of `array`.
  7750. * @example
  7751. *
  7752. * _.dropRight([1, 2, 3]);
  7753. * // => [1, 2]
  7754. *
  7755. * _.dropRight([1, 2, 3], 2);
  7756. * // => [1]
  7757. *
  7758. * _.dropRight([1, 2, 3], 5);
  7759. * // => []
  7760. *
  7761. * _.dropRight([1, 2, 3], 0);
  7762. * // => [1, 2, 3]
  7763. */
  7764. function dropRight(array, n, guard) {
  7765. var length = array == null ? 0 : array.length;
  7766. if (!length) {
  7767. return [];
  7768. }
  7769. n = (guard || n === undefined) ? 1 : toInteger(n);
  7770. n = length - n;
  7771. return baseSlice(array, 0, n < 0 ? 0 : n);
  7772. }
  7773. /**
  7774. * Creates a slice of `array` excluding elements dropped from the end.
  7775. * Elements are dropped until `predicate` returns falsey. The predicate is
  7776. * invoked with three arguments: (value, index, array).
  7777. *
  7778. * @static
  7779. * @memberOf _
  7780. * @since 3.0.0
  7781. * @category Array
  7782. * @param {Array} array The array to query.
  7783. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7784. * @returns {Array} Returns the slice of `array`.
  7785. * @example
  7786. *
  7787. * var users = [
  7788. * { 'user': 'barney', 'active': true },
  7789. * { 'user': 'fred', 'active': false },
  7790. * { 'user': 'pebbles', 'active': false }
  7791. * ];
  7792. *
  7793. * _.dropRightWhile(users, function(o) { return !o.active; });
  7794. * // => objects for ['barney']
  7795. *
  7796. * // The `_.matches` iteratee shorthand.
  7797. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7798. * // => objects for ['barney', 'fred']
  7799. *
  7800. * // The `_.matchesProperty` iteratee shorthand.
  7801. * _.dropRightWhile(users, ['active', false]);
  7802. * // => objects for ['barney']
  7803. *
  7804. * // The `_.property` iteratee shorthand.
  7805. * _.dropRightWhile(users, 'active');
  7806. * // => objects for ['barney', 'fred', 'pebbles']
  7807. */
  7808. function dropRightWhile(array, predicate) {
  7809. return (array && array.length)
  7810. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7811. : [];
  7812. }
  7813. /**
  7814. * Creates a slice of `array` excluding elements dropped from the beginning.
  7815. * Elements are dropped until `predicate` returns falsey. The predicate is
  7816. * invoked with three arguments: (value, index, array).
  7817. *
  7818. * @static
  7819. * @memberOf _
  7820. * @since 3.0.0
  7821. * @category Array
  7822. * @param {Array} array The array to query.
  7823. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7824. * @returns {Array} Returns the slice of `array`.
  7825. * @example
  7826. *
  7827. * var users = [
  7828. * { 'user': 'barney', 'active': false },
  7829. * { 'user': 'fred', 'active': false },
  7830. * { 'user': 'pebbles', 'active': true }
  7831. * ];
  7832. *
  7833. * _.dropWhile(users, function(o) { return !o.active; });
  7834. * // => objects for ['pebbles']
  7835. *
  7836. * // The `_.matches` iteratee shorthand.
  7837. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7838. * // => objects for ['fred', 'pebbles']
  7839. *
  7840. * // The `_.matchesProperty` iteratee shorthand.
  7841. * _.dropWhile(users, ['active', false]);
  7842. * // => objects for ['pebbles']
  7843. *
  7844. * // The `_.property` iteratee shorthand.
  7845. * _.dropWhile(users, 'active');
  7846. * // => objects for ['barney', 'fred', 'pebbles']
  7847. */
  7848. function dropWhile(array, predicate) {
  7849. return (array && array.length)
  7850. ? baseWhile(array, getIteratee(predicate, 3), true)
  7851. : [];
  7852. }
  7853. /**
  7854. * Fills elements of `array` with `value` from `start` up to, but not
  7855. * including, `end`.
  7856. *
  7857. * **Note:** This method mutates `array`.
  7858. *
  7859. * @static
  7860. * @memberOf _
  7861. * @since 3.2.0
  7862. * @category Array
  7863. * @param {Array} array The array to fill.
  7864. * @param {*} value The value to fill `array` with.
  7865. * @param {number} [start=0] The start position.
  7866. * @param {number} [end=array.length] The end position.
  7867. * @returns {Array} Returns `array`.
  7868. * @example
  7869. *
  7870. * var array = [1, 2, 3];
  7871. *
  7872. * _.fill(array, 'a');
  7873. * console.log(array);
  7874. * // => ['a', 'a', 'a']
  7875. *
  7876. * _.fill(Array(3), 2);
  7877. * // => [2, 2, 2]
  7878. *
  7879. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7880. * // => [4, '*', '*', 10]
  7881. */
  7882. function fill(array, value, start, end) {
  7883. var length = array == null ? 0 : array.length;
  7884. if (!length) {
  7885. return [];
  7886. }
  7887. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7888. start = 0;
  7889. end = length;
  7890. }
  7891. return baseFill(array, value, start, end);
  7892. }
  7893. /**
  7894. * This method is like `_.find` except that it returns the index of the first
  7895. * element `predicate` returns truthy for instead of the element itself.
  7896. *
  7897. * @static
  7898. * @memberOf _
  7899. * @since 1.1.0
  7900. * @category Array
  7901. * @param {Array} array The array to inspect.
  7902. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7903. * @param {number} [fromIndex=0] The index to search from.
  7904. * @returns {number} Returns the index of the found element, else `-1`.
  7905. * @example
  7906. *
  7907. * var users = [
  7908. * { 'user': 'barney', 'active': false },
  7909. * { 'user': 'fred', 'active': false },
  7910. * { 'user': 'pebbles', 'active': true }
  7911. * ];
  7912. *
  7913. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7914. * // => 0
  7915. *
  7916. * // The `_.matches` iteratee shorthand.
  7917. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7918. * // => 1
  7919. *
  7920. * // The `_.matchesProperty` iteratee shorthand.
  7921. * _.findIndex(users, ['active', false]);
  7922. * // => 0
  7923. *
  7924. * // The `_.property` iteratee shorthand.
  7925. * _.findIndex(users, 'active');
  7926. * // => 2
  7927. */
  7928. function findIndex(array, predicate, fromIndex) {
  7929. var length = array == null ? 0 : array.length;
  7930. if (!length) {
  7931. return -1;
  7932. }
  7933. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7934. if (index < 0) {
  7935. index = nativeMax(length + index, 0);
  7936. }
  7937. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7938. }
  7939. /**
  7940. * This method is like `_.findIndex` except that it iterates over elements
  7941. * of `collection` from right to left.
  7942. *
  7943. * @static
  7944. * @memberOf _
  7945. * @since 2.0.0
  7946. * @category Array
  7947. * @param {Array} array The array to inspect.
  7948. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7949. * @param {number} [fromIndex=array.length-1] The index to search from.
  7950. * @returns {number} Returns the index of the found element, else `-1`.
  7951. * @example
  7952. *
  7953. * var users = [
  7954. * { 'user': 'barney', 'active': true },
  7955. * { 'user': 'fred', 'active': false },
  7956. * { 'user': 'pebbles', 'active': false }
  7957. * ];
  7958. *
  7959. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7960. * // => 2
  7961. *
  7962. * // The `_.matches` iteratee shorthand.
  7963. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7964. * // => 0
  7965. *
  7966. * // The `_.matchesProperty` iteratee shorthand.
  7967. * _.findLastIndex(users, ['active', false]);
  7968. * // => 2
  7969. *
  7970. * // The `_.property` iteratee shorthand.
  7971. * _.findLastIndex(users, 'active');
  7972. * // => 0
  7973. */
  7974. function findLastIndex(array, predicate, fromIndex) {
  7975. var length = array == null ? 0 : array.length;
  7976. if (!length) {
  7977. return -1;
  7978. }
  7979. var index = length - 1;
  7980. if (fromIndex !== undefined) {
  7981. index = toInteger(fromIndex);
  7982. index = fromIndex < 0
  7983. ? nativeMax(length + index, 0)
  7984. : nativeMin(index, length - 1);
  7985. }
  7986. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7987. }
  7988. /**
  7989. * Flattens `array` a single level deep.
  7990. *
  7991. * @static
  7992. * @memberOf _
  7993. * @since 0.1.0
  7994. * @category Array
  7995. * @param {Array} array The array to flatten.
  7996. * @returns {Array} Returns the new flattened array.
  7997. * @example
  7998. *
  7999. * _.flatten([1, [2, [3, [4]], 5]]);
  8000. * // => [1, 2, [3, [4]], 5]
  8001. */
  8002. function flatten(array) {
  8003. var length = array == null ? 0 : array.length;
  8004. return length ? baseFlatten(array, 1) : [];
  8005. }
  8006. /**
  8007. * Recursively flattens `array`.
  8008. *
  8009. * @static
  8010. * @memberOf _
  8011. * @since 3.0.0
  8012. * @category Array
  8013. * @param {Array} array The array to flatten.
  8014. * @returns {Array} Returns the new flattened array.
  8015. * @example
  8016. *
  8017. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8018. * // => [1, 2, 3, 4, 5]
  8019. */
  8020. function flattenDeep(array) {
  8021. var length = array == null ? 0 : array.length;
  8022. return length ? baseFlatten(array, INFINITY) : [];
  8023. }
  8024. /**
  8025. * Recursively flatten `array` up to `depth` times.
  8026. *
  8027. * @static
  8028. * @memberOf _
  8029. * @since 4.4.0
  8030. * @category Array
  8031. * @param {Array} array The array to flatten.
  8032. * @param {number} [depth=1] The maximum recursion depth.
  8033. * @returns {Array} Returns the new flattened array.
  8034. * @example
  8035. *
  8036. * var array = [1, [2, [3, [4]], 5]];
  8037. *
  8038. * _.flattenDepth(array, 1);
  8039. * // => [1, 2, [3, [4]], 5]
  8040. *
  8041. * _.flattenDepth(array, 2);
  8042. * // => [1, 2, 3, [4], 5]
  8043. */
  8044. function flattenDepth(array, depth) {
  8045. var length = array == null ? 0 : array.length;
  8046. if (!length) {
  8047. return [];
  8048. }
  8049. depth = depth === undefined ? 1 : toInteger(depth);
  8050. return baseFlatten(array, depth);
  8051. }
  8052. /**
  8053. * The inverse of `_.toPairs`; this method returns an object composed
  8054. * from key-value `pairs`.
  8055. *
  8056. * @static
  8057. * @memberOf _
  8058. * @since 4.0.0
  8059. * @category Array
  8060. * @param {Array} pairs The key-value pairs.
  8061. * @returns {Object} Returns the new object.
  8062. * @example
  8063. *
  8064. * _.fromPairs([['a', 1], ['b', 2]]);
  8065. * // => { 'a': 1, 'b': 2 }
  8066. */
  8067. function fromPairs(pairs) {
  8068. var index = -1,
  8069. length = pairs == null ? 0 : pairs.length,
  8070. result = {};
  8071. while (++index < length) {
  8072. var pair = pairs[index];
  8073. result[pair[0]] = pair[1];
  8074. }
  8075. return result;
  8076. }
  8077. /**
  8078. * Gets the first element of `array`.
  8079. *
  8080. * @static
  8081. * @memberOf _
  8082. * @since 0.1.0
  8083. * @alias first
  8084. * @category Array
  8085. * @param {Array} array The array to query.
  8086. * @returns {*} Returns the first element of `array`.
  8087. * @example
  8088. *
  8089. * _.head([1, 2, 3]);
  8090. * // => 1
  8091. *
  8092. * _.head([]);
  8093. * // => undefined
  8094. */
  8095. function head(array) {
  8096. return (array && array.length) ? array[0] : undefined;
  8097. }
  8098. /**
  8099. * Gets the index at which the first occurrence of `value` is found in `array`
  8100. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8101. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8102. * offset from the end of `array`.
  8103. *
  8104. * @static
  8105. * @memberOf _
  8106. * @since 0.1.0
  8107. * @category Array
  8108. * @param {Array} array The array to inspect.
  8109. * @param {*} value The value to search for.
  8110. * @param {number} [fromIndex=0] The index to search from.
  8111. * @returns {number} Returns the index of the matched value, else `-1`.
  8112. * @example
  8113. *
  8114. * _.indexOf([1, 2, 1, 2], 2);
  8115. * // => 1
  8116. *
  8117. * // Search from the `fromIndex`.
  8118. * _.indexOf([1, 2, 1, 2], 2, 2);
  8119. * // => 3
  8120. */
  8121. function indexOf(array, value, fromIndex) {
  8122. var length = array == null ? 0 : array.length;
  8123. if (!length) {
  8124. return -1;
  8125. }
  8126. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8127. if (index < 0) {
  8128. index = nativeMax(length + index, 0);
  8129. }
  8130. return baseIndexOf(array, value, index);
  8131. }
  8132. /**
  8133. * Gets all but the last element of `array`.
  8134. *
  8135. * @static
  8136. * @memberOf _
  8137. * @since 0.1.0
  8138. * @category Array
  8139. * @param {Array} array The array to query.
  8140. * @returns {Array} Returns the slice of `array`.
  8141. * @example
  8142. *
  8143. * _.initial([1, 2, 3]);
  8144. * // => [1, 2]
  8145. */
  8146. function initial(array) {
  8147. var length = array == null ? 0 : array.length;
  8148. return length ? baseSlice(array, 0, -1) : [];
  8149. }
  8150. /**
  8151. * Creates an array of unique values that are included in all given arrays
  8152. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8153. * for equality comparisons. The order and references of result values are
  8154. * determined by the first array.
  8155. *
  8156. * @static
  8157. * @memberOf _
  8158. * @since 0.1.0
  8159. * @category Array
  8160. * @param {...Array} [arrays] The arrays to inspect.
  8161. * @returns {Array} Returns the new array of intersecting values.
  8162. * @example
  8163. *
  8164. * _.intersection([2, 1], [2, 3]);
  8165. * // => [2]
  8166. */
  8167. var intersection = baseRest(function(arrays) {
  8168. var mapped = arrayMap(arrays, castArrayLikeObject);
  8169. return (mapped.length && mapped[0] === arrays[0])
  8170. ? baseIntersection(mapped)
  8171. : [];
  8172. });
  8173. /**
  8174. * This method is like `_.intersection` except that it accepts `iteratee`
  8175. * which is invoked for each element of each `arrays` to generate the criterion
  8176. * by which they're compared. The order and references of result values are
  8177. * determined by the first array. The iteratee is invoked with one argument:
  8178. * (value).
  8179. *
  8180. * @static
  8181. * @memberOf _
  8182. * @since 4.0.0
  8183. * @category Array
  8184. * @param {...Array} [arrays] The arrays to inspect.
  8185. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8186. * @returns {Array} Returns the new array of intersecting values.
  8187. * @example
  8188. *
  8189. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8190. * // => [2.1]
  8191. *
  8192. * // The `_.property` iteratee shorthand.
  8193. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8194. * // => [{ 'x': 1 }]
  8195. */
  8196. var intersectionBy = baseRest(function(arrays) {
  8197. var iteratee = last(arrays),
  8198. mapped = arrayMap(arrays, castArrayLikeObject);
  8199. if (iteratee === last(mapped)) {
  8200. iteratee = undefined;
  8201. } else {
  8202. mapped.pop();
  8203. }
  8204. return (mapped.length && mapped[0] === arrays[0])
  8205. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8206. : [];
  8207. });
  8208. /**
  8209. * This method is like `_.intersection` except that it accepts `comparator`
  8210. * which is invoked to compare elements of `arrays`. The order and references
  8211. * of result values are determined by the first array. The comparator is
  8212. * invoked with two arguments: (arrVal, othVal).
  8213. *
  8214. * @static
  8215. * @memberOf _
  8216. * @since 4.0.0
  8217. * @category Array
  8218. * @param {...Array} [arrays] The arrays to inspect.
  8219. * @param {Function} [comparator] The comparator invoked per element.
  8220. * @returns {Array} Returns the new array of intersecting values.
  8221. * @example
  8222. *
  8223. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8224. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8225. *
  8226. * _.intersectionWith(objects, others, _.isEqual);
  8227. * // => [{ 'x': 1, 'y': 2 }]
  8228. */
  8229. var intersectionWith = baseRest(function(arrays) {
  8230. var comparator = last(arrays),
  8231. mapped = arrayMap(arrays, castArrayLikeObject);
  8232. comparator = typeof comparator == 'function' ? comparator : undefined;
  8233. if (comparator) {
  8234. mapped.pop();
  8235. }
  8236. return (mapped.length && mapped[0] === arrays[0])
  8237. ? baseIntersection(mapped, undefined, comparator)
  8238. : [];
  8239. });
  8240. /**
  8241. * Converts all elements in `array` into a string separated by `separator`.
  8242. *
  8243. * @static
  8244. * @memberOf _
  8245. * @since 4.0.0
  8246. * @category Array
  8247. * @param {Array} array The array to convert.
  8248. * @param {string} [separator=','] The element separator.
  8249. * @returns {string} Returns the joined string.
  8250. * @example
  8251. *
  8252. * _.join(['a', 'b', 'c'], '~');
  8253. * // => 'a~b~c'
  8254. */
  8255. function join(array, separator) {
  8256. return array == null ? '' : nativeJoin.call(array, separator);
  8257. }
  8258. /**
  8259. * Gets the last element of `array`.
  8260. *
  8261. * @static
  8262. * @memberOf _
  8263. * @since 0.1.0
  8264. * @category Array
  8265. * @param {Array} array The array to query.
  8266. * @returns {*} Returns the last element of `array`.
  8267. * @example
  8268. *
  8269. * _.last([1, 2, 3]);
  8270. * // => 3
  8271. */
  8272. function last(array) {
  8273. var length = array == null ? 0 : array.length;
  8274. return length ? array[length - 1] : undefined;
  8275. }
  8276. /**
  8277. * This method is like `_.indexOf` except that it iterates over elements of
  8278. * `array` from right to left.
  8279. *
  8280. * @static
  8281. * @memberOf _
  8282. * @since 0.1.0
  8283. * @category Array
  8284. * @param {Array} array The array to inspect.
  8285. * @param {*} value The value to search for.
  8286. * @param {number} [fromIndex=array.length-1] The index to search from.
  8287. * @returns {number} Returns the index of the matched value, else `-1`.
  8288. * @example
  8289. *
  8290. * _.lastIndexOf([1, 2, 1, 2], 2);
  8291. * // => 3
  8292. *
  8293. * // Search from the `fromIndex`.
  8294. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8295. * // => 1
  8296. */
  8297. function lastIndexOf(array, value, fromIndex) {
  8298. var length = array == null ? 0 : array.length;
  8299. if (!length) {
  8300. return -1;
  8301. }
  8302. var index = length;
  8303. if (fromIndex !== undefined) {
  8304. index = toInteger(fromIndex);
  8305. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8306. }
  8307. return value === value
  8308. ? strictLastIndexOf(array, value, index)
  8309. : baseFindIndex(array, baseIsNaN, index, true);
  8310. }
  8311. /**
  8312. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8313. * element from the end is returned.
  8314. *
  8315. * @static
  8316. * @memberOf _
  8317. * @since 4.11.0
  8318. * @category Array
  8319. * @param {Array} array The array to query.
  8320. * @param {number} [n=0] The index of the element to return.
  8321. * @returns {*} Returns the nth element of `array`.
  8322. * @example
  8323. *
  8324. * var array = ['a', 'b', 'c', 'd'];
  8325. *
  8326. * _.nth(array, 1);
  8327. * // => 'b'
  8328. *
  8329. * _.nth(array, -2);
  8330. * // => 'c';
  8331. */
  8332. function nth(array, n) {
  8333. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8334. }
  8335. /**
  8336. * Removes all given values from `array` using
  8337. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8338. * for equality comparisons.
  8339. *
  8340. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8341. * to remove elements from an array by predicate.
  8342. *
  8343. * @static
  8344. * @memberOf _
  8345. * @since 2.0.0
  8346. * @category Array
  8347. * @param {Array} array The array to modify.
  8348. * @param {...*} [values] The values to remove.
  8349. * @returns {Array} Returns `array`.
  8350. * @example
  8351. *
  8352. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8353. *
  8354. * _.pull(array, 'a', 'c');
  8355. * console.log(array);
  8356. * // => ['b', 'b']
  8357. */
  8358. var pull = baseRest(pullAll);
  8359. /**
  8360. * This method is like `_.pull` except that it accepts an array of values to remove.
  8361. *
  8362. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8363. *
  8364. * @static
  8365. * @memberOf _
  8366. * @since 4.0.0
  8367. * @category Array
  8368. * @param {Array} array The array to modify.
  8369. * @param {Array} values The values to remove.
  8370. * @returns {Array} Returns `array`.
  8371. * @example
  8372. *
  8373. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8374. *
  8375. * _.pullAll(array, ['a', 'c']);
  8376. * console.log(array);
  8377. * // => ['b', 'b']
  8378. */
  8379. function pullAll(array, values) {
  8380. return (array && array.length && values && values.length)
  8381. ? basePullAll(array, values)
  8382. : array;
  8383. }
  8384. /**
  8385. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8386. * invoked for each element of `array` and `values` to generate the criterion
  8387. * by which they're compared. The iteratee is invoked with one argument: (value).
  8388. *
  8389. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8390. *
  8391. * @static
  8392. * @memberOf _
  8393. * @since 4.0.0
  8394. * @category Array
  8395. * @param {Array} array The array to modify.
  8396. * @param {Array} values The values to remove.
  8397. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8398. * @returns {Array} Returns `array`.
  8399. * @example
  8400. *
  8401. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8402. *
  8403. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8404. * console.log(array);
  8405. * // => [{ 'x': 2 }]
  8406. */
  8407. function pullAllBy(array, values, iteratee) {
  8408. return (array && array.length && values && values.length)
  8409. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8410. : array;
  8411. }
  8412. /**
  8413. * This method is like `_.pullAll` except that it accepts `comparator` which
  8414. * is invoked to compare elements of `array` to `values`. The comparator is
  8415. * invoked with two arguments: (arrVal, othVal).
  8416. *
  8417. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8418. *
  8419. * @static
  8420. * @memberOf _
  8421. * @since 4.6.0
  8422. * @category Array
  8423. * @param {Array} array The array to modify.
  8424. * @param {Array} values The values to remove.
  8425. * @param {Function} [comparator] The comparator invoked per element.
  8426. * @returns {Array} Returns `array`.
  8427. * @example
  8428. *
  8429. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8430. *
  8431. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8432. * console.log(array);
  8433. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8434. */
  8435. function pullAllWith(array, values, comparator) {
  8436. return (array && array.length && values && values.length)
  8437. ? basePullAll(array, values, undefined, comparator)
  8438. : array;
  8439. }
  8440. /**
  8441. * Removes elements from `array` corresponding to `indexes` and returns an
  8442. * array of removed elements.
  8443. *
  8444. * **Note:** Unlike `_.at`, this method mutates `array`.
  8445. *
  8446. * @static
  8447. * @memberOf _
  8448. * @since 3.0.0
  8449. * @category Array
  8450. * @param {Array} array The array to modify.
  8451. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8452. * @returns {Array} Returns the new array of removed elements.
  8453. * @example
  8454. *
  8455. * var array = ['a', 'b', 'c', 'd'];
  8456. * var pulled = _.pullAt(array, [1, 3]);
  8457. *
  8458. * console.log(array);
  8459. * // => ['a', 'c']
  8460. *
  8461. * console.log(pulled);
  8462. * // => ['b', 'd']
  8463. */
  8464. var pullAt = flatRest(function(array, indexes) {
  8465. var length = array == null ? 0 : array.length,
  8466. result = baseAt(array, indexes);
  8467. basePullAt(array, arrayMap(indexes, function(index) {
  8468. return isIndex(index, length) ? +index : index;
  8469. }).sort(compareAscending));
  8470. return result;
  8471. });
  8472. /**
  8473. * Removes all elements from `array` that `predicate` returns truthy for
  8474. * and returns an array of the removed elements. The predicate is invoked
  8475. * with three arguments: (value, index, array).
  8476. *
  8477. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8478. * to pull elements from an array by value.
  8479. *
  8480. * @static
  8481. * @memberOf _
  8482. * @since 2.0.0
  8483. * @category Array
  8484. * @param {Array} array The array to modify.
  8485. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8486. * @returns {Array} Returns the new array of removed elements.
  8487. * @example
  8488. *
  8489. * var array = [1, 2, 3, 4];
  8490. * var evens = _.remove(array, function(n) {
  8491. * return n % 2 == 0;
  8492. * });
  8493. *
  8494. * console.log(array);
  8495. * // => [1, 3]
  8496. *
  8497. * console.log(evens);
  8498. * // => [2, 4]
  8499. */
  8500. function remove(array, predicate) {
  8501. var result = [];
  8502. if (!(array && array.length)) {
  8503. return result;
  8504. }
  8505. var index = -1,
  8506. indexes = [],
  8507. length = array.length;
  8508. predicate = getIteratee(predicate, 3);
  8509. while (++index < length) {
  8510. var value = array[index];
  8511. if (predicate(value, index, array)) {
  8512. result.push(value);
  8513. indexes.push(index);
  8514. }
  8515. }
  8516. basePullAt(array, indexes);
  8517. return result;
  8518. }
  8519. /**
  8520. * Reverses `array` so that the first element becomes the last, the second
  8521. * element becomes the second to last, and so on.
  8522. *
  8523. * **Note:** This method mutates `array` and is based on
  8524. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8525. *
  8526. * @static
  8527. * @memberOf _
  8528. * @since 4.0.0
  8529. * @category Array
  8530. * @param {Array} array The array to modify.
  8531. * @returns {Array} Returns `array`.
  8532. * @example
  8533. *
  8534. * var array = [1, 2, 3];
  8535. *
  8536. * _.reverse(array);
  8537. * // => [3, 2, 1]
  8538. *
  8539. * console.log(array);
  8540. * // => [3, 2, 1]
  8541. */
  8542. function reverse(array) {
  8543. return array == null ? array : nativeReverse.call(array);
  8544. }
  8545. /**
  8546. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8547. *
  8548. * **Note:** This method is used instead of
  8549. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8550. * returned.
  8551. *
  8552. * @static
  8553. * @memberOf _
  8554. * @since 3.0.0
  8555. * @category Array
  8556. * @param {Array} array The array to slice.
  8557. * @param {number} [start=0] The start position.
  8558. * @param {number} [end=array.length] The end position.
  8559. * @returns {Array} Returns the slice of `array`.
  8560. */
  8561. function slice(array, start, end) {
  8562. var length = array == null ? 0 : array.length;
  8563. if (!length) {
  8564. return [];
  8565. }
  8566. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8567. start = 0;
  8568. end = length;
  8569. }
  8570. else {
  8571. start = start == null ? 0 : toInteger(start);
  8572. end = end === undefined ? length : toInteger(end);
  8573. }
  8574. return baseSlice(array, start, end);
  8575. }
  8576. /**
  8577. * Uses a binary search to determine the lowest index at which `value`
  8578. * should be inserted into `array` in order to maintain its sort order.
  8579. *
  8580. * @static
  8581. * @memberOf _
  8582. * @since 0.1.0
  8583. * @category Array
  8584. * @param {Array} array The sorted array to inspect.
  8585. * @param {*} value The value to evaluate.
  8586. * @returns {number} Returns the index at which `value` should be inserted
  8587. * into `array`.
  8588. * @example
  8589. *
  8590. * _.sortedIndex([30, 50], 40);
  8591. * // => 1
  8592. */
  8593. function sortedIndex(array, value) {
  8594. return baseSortedIndex(array, value);
  8595. }
  8596. /**
  8597. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8598. * which is invoked for `value` and each element of `array` to compute their
  8599. * sort ranking. The iteratee is invoked with one argument: (value).
  8600. *
  8601. * @static
  8602. * @memberOf _
  8603. * @since 4.0.0
  8604. * @category Array
  8605. * @param {Array} array The sorted array to inspect.
  8606. * @param {*} value The value to evaluate.
  8607. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8608. * @returns {number} Returns the index at which `value` should be inserted
  8609. * into `array`.
  8610. * @example
  8611. *
  8612. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8613. *
  8614. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8615. * // => 0
  8616. *
  8617. * // The `_.property` iteratee shorthand.
  8618. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8619. * // => 0
  8620. */
  8621. function sortedIndexBy(array, value, iteratee) {
  8622. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8623. }
  8624. /**
  8625. * This method is like `_.indexOf` except that it performs a binary
  8626. * search on a sorted `array`.
  8627. *
  8628. * @static
  8629. * @memberOf _
  8630. * @since 4.0.0
  8631. * @category Array
  8632. * @param {Array} array The array to inspect.
  8633. * @param {*} value The value to search for.
  8634. * @returns {number} Returns the index of the matched value, else `-1`.
  8635. * @example
  8636. *
  8637. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8638. * // => 1
  8639. */
  8640. function sortedIndexOf(array, value) {
  8641. var length = array == null ? 0 : array.length;
  8642. if (length) {
  8643. var index = baseSortedIndex(array, value);
  8644. if (index < length && eq(array[index], value)) {
  8645. return index;
  8646. }
  8647. }
  8648. return -1;
  8649. }
  8650. /**
  8651. * This method is like `_.sortedIndex` except that it returns the highest
  8652. * index at which `value` should be inserted into `array` in order to
  8653. * maintain its sort order.
  8654. *
  8655. * @static
  8656. * @memberOf _
  8657. * @since 3.0.0
  8658. * @category Array
  8659. * @param {Array} array The sorted array to inspect.
  8660. * @param {*} value The value to evaluate.
  8661. * @returns {number} Returns the index at which `value` should be inserted
  8662. * into `array`.
  8663. * @example
  8664. *
  8665. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8666. * // => 4
  8667. */
  8668. function sortedLastIndex(array, value) {
  8669. return baseSortedIndex(array, value, true);
  8670. }
  8671. /**
  8672. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8673. * which is invoked for `value` and each element of `array` to compute their
  8674. * sort ranking. The iteratee is invoked with one argument: (value).
  8675. *
  8676. * @static
  8677. * @memberOf _
  8678. * @since 4.0.0
  8679. * @category Array
  8680. * @param {Array} array The sorted array to inspect.
  8681. * @param {*} value The value to evaluate.
  8682. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8683. * @returns {number} Returns the index at which `value` should be inserted
  8684. * into `array`.
  8685. * @example
  8686. *
  8687. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8688. *
  8689. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8690. * // => 1
  8691. *
  8692. * // The `_.property` iteratee shorthand.
  8693. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8694. * // => 1
  8695. */
  8696. function sortedLastIndexBy(array, value, iteratee) {
  8697. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8698. }
  8699. /**
  8700. * This method is like `_.lastIndexOf` except that it performs a binary
  8701. * search on a sorted `array`.
  8702. *
  8703. * @static
  8704. * @memberOf _
  8705. * @since 4.0.0
  8706. * @category Array
  8707. * @param {Array} array The array to inspect.
  8708. * @param {*} value The value to search for.
  8709. * @returns {number} Returns the index of the matched value, else `-1`.
  8710. * @example
  8711. *
  8712. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8713. * // => 3
  8714. */
  8715. function sortedLastIndexOf(array, value) {
  8716. var length = array == null ? 0 : array.length;
  8717. if (length) {
  8718. var index = baseSortedIndex(array, value, true) - 1;
  8719. if (eq(array[index], value)) {
  8720. return index;
  8721. }
  8722. }
  8723. return -1;
  8724. }
  8725. /**
  8726. * This method is like `_.uniq` except that it's designed and optimized
  8727. * for sorted arrays.
  8728. *
  8729. * @static
  8730. * @memberOf _
  8731. * @since 4.0.0
  8732. * @category Array
  8733. * @param {Array} array The array to inspect.
  8734. * @returns {Array} Returns the new duplicate free array.
  8735. * @example
  8736. *
  8737. * _.sortedUniq([1, 1, 2]);
  8738. * // => [1, 2]
  8739. */
  8740. function sortedUniq(array) {
  8741. return (array && array.length)
  8742. ? baseSortedUniq(array)
  8743. : [];
  8744. }
  8745. /**
  8746. * This method is like `_.uniqBy` except that it's designed and optimized
  8747. * for sorted arrays.
  8748. *
  8749. * @static
  8750. * @memberOf _
  8751. * @since 4.0.0
  8752. * @category Array
  8753. * @param {Array} array The array to inspect.
  8754. * @param {Function} [iteratee] The iteratee invoked per element.
  8755. * @returns {Array} Returns the new duplicate free array.
  8756. * @example
  8757. *
  8758. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8759. * // => [1.1, 2.3]
  8760. */
  8761. function sortedUniqBy(array, iteratee) {
  8762. return (array && array.length)
  8763. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8764. : [];
  8765. }
  8766. /**
  8767. * Gets all but the first element of `array`.
  8768. *
  8769. * @static
  8770. * @memberOf _
  8771. * @since 4.0.0
  8772. * @category Array
  8773. * @param {Array} array The array to query.
  8774. * @returns {Array} Returns the slice of `array`.
  8775. * @example
  8776. *
  8777. * _.tail([1, 2, 3]);
  8778. * // => [2, 3]
  8779. */
  8780. function tail(array) {
  8781. var length = array == null ? 0 : array.length;
  8782. return length ? baseSlice(array, 1, length) : [];
  8783. }
  8784. /**
  8785. * Creates a slice of `array` with `n` elements taken from the beginning.
  8786. *
  8787. * @static
  8788. * @memberOf _
  8789. * @since 0.1.0
  8790. * @category Array
  8791. * @param {Array} array The array to query.
  8792. * @param {number} [n=1] The number of elements to take.
  8793. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8794. * @returns {Array} Returns the slice of `array`.
  8795. * @example
  8796. *
  8797. * _.take([1, 2, 3]);
  8798. * // => [1]
  8799. *
  8800. * _.take([1, 2, 3], 2);
  8801. * // => [1, 2]
  8802. *
  8803. * _.take([1, 2, 3], 5);
  8804. * // => [1, 2, 3]
  8805. *
  8806. * _.take([1, 2, 3], 0);
  8807. * // => []
  8808. */
  8809. function take(array, n, guard) {
  8810. if (!(array && array.length)) {
  8811. return [];
  8812. }
  8813. n = (guard || n === undefined) ? 1 : toInteger(n);
  8814. return baseSlice(array, 0, n < 0 ? 0 : n);
  8815. }
  8816. /**
  8817. * Creates a slice of `array` with `n` elements taken from the end.
  8818. *
  8819. * @static
  8820. * @memberOf _
  8821. * @since 3.0.0
  8822. * @category Array
  8823. * @param {Array} array The array to query.
  8824. * @param {number} [n=1] The number of elements to take.
  8825. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8826. * @returns {Array} Returns the slice of `array`.
  8827. * @example
  8828. *
  8829. * _.takeRight([1, 2, 3]);
  8830. * // => [3]
  8831. *
  8832. * _.takeRight([1, 2, 3], 2);
  8833. * // => [2, 3]
  8834. *
  8835. * _.takeRight([1, 2, 3], 5);
  8836. * // => [1, 2, 3]
  8837. *
  8838. * _.takeRight([1, 2, 3], 0);
  8839. * // => []
  8840. */
  8841. function takeRight(array, n, guard) {
  8842. var length = array == null ? 0 : array.length;
  8843. if (!length) {
  8844. return [];
  8845. }
  8846. n = (guard || n === undefined) ? 1 : toInteger(n);
  8847. n = length - n;
  8848. return baseSlice(array, n < 0 ? 0 : n, length);
  8849. }
  8850. /**
  8851. * Creates a slice of `array` with elements taken from the end. Elements are
  8852. * taken until `predicate` returns falsey. The predicate is invoked with
  8853. * three arguments: (value, index, array).
  8854. *
  8855. * @static
  8856. * @memberOf _
  8857. * @since 3.0.0
  8858. * @category Array
  8859. * @param {Array} array The array to query.
  8860. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8861. * @returns {Array} Returns the slice of `array`.
  8862. * @example
  8863. *
  8864. * var users = [
  8865. * { 'user': 'barney', 'active': true },
  8866. * { 'user': 'fred', 'active': false },
  8867. * { 'user': 'pebbles', 'active': false }
  8868. * ];
  8869. *
  8870. * _.takeRightWhile(users, function(o) { return !o.active; });
  8871. * // => objects for ['fred', 'pebbles']
  8872. *
  8873. * // The `_.matches` iteratee shorthand.
  8874. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8875. * // => objects for ['pebbles']
  8876. *
  8877. * // The `_.matchesProperty` iteratee shorthand.
  8878. * _.takeRightWhile(users, ['active', false]);
  8879. * // => objects for ['fred', 'pebbles']
  8880. *
  8881. * // The `_.property` iteratee shorthand.
  8882. * _.takeRightWhile(users, 'active');
  8883. * // => []
  8884. */
  8885. function takeRightWhile(array, predicate) {
  8886. return (array && array.length)
  8887. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8888. : [];
  8889. }
  8890. /**
  8891. * Creates a slice of `array` with elements taken from the beginning. Elements
  8892. * are taken until `predicate` returns falsey. The predicate is invoked with
  8893. * three arguments: (value, index, array).
  8894. *
  8895. * @static
  8896. * @memberOf _
  8897. * @since 3.0.0
  8898. * @category Array
  8899. * @param {Array} array The array to query.
  8900. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8901. * @returns {Array} Returns the slice of `array`.
  8902. * @example
  8903. *
  8904. * var users = [
  8905. * { 'user': 'barney', 'active': false },
  8906. * { 'user': 'fred', 'active': false },
  8907. * { 'user': 'pebbles', 'active': true }
  8908. * ];
  8909. *
  8910. * _.takeWhile(users, function(o) { return !o.active; });
  8911. * // => objects for ['barney', 'fred']
  8912. *
  8913. * // The `_.matches` iteratee shorthand.
  8914. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8915. * // => objects for ['barney']
  8916. *
  8917. * // The `_.matchesProperty` iteratee shorthand.
  8918. * _.takeWhile(users, ['active', false]);
  8919. * // => objects for ['barney', 'fred']
  8920. *
  8921. * // The `_.property` iteratee shorthand.
  8922. * _.takeWhile(users, 'active');
  8923. * // => []
  8924. */
  8925. function takeWhile(array, predicate) {
  8926. return (array && array.length)
  8927. ? baseWhile(array, getIteratee(predicate, 3))
  8928. : [];
  8929. }
  8930. /**
  8931. * Creates an array of unique values, in order, from all given arrays using
  8932. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8933. * for equality comparisons.
  8934. *
  8935. * @static
  8936. * @memberOf _
  8937. * @since 0.1.0
  8938. * @category Array
  8939. * @param {...Array} [arrays] The arrays to inspect.
  8940. * @returns {Array} Returns the new array of combined values.
  8941. * @example
  8942. *
  8943. * _.union([2], [1, 2]);
  8944. * // => [2, 1]
  8945. */
  8946. var union = baseRest(function(arrays) {
  8947. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8948. });
  8949. /**
  8950. * This method is like `_.union` except that it accepts `iteratee` which is
  8951. * invoked for each element of each `arrays` to generate the criterion by
  8952. * which uniqueness is computed. Result values are chosen from the first
  8953. * array in which the value occurs. The iteratee is invoked with one argument:
  8954. * (value).
  8955. *
  8956. * @static
  8957. * @memberOf _
  8958. * @since 4.0.0
  8959. * @category Array
  8960. * @param {...Array} [arrays] The arrays to inspect.
  8961. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8962. * @returns {Array} Returns the new array of combined values.
  8963. * @example
  8964. *
  8965. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8966. * // => [2.1, 1.2]
  8967. *
  8968. * // The `_.property` iteratee shorthand.
  8969. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8970. * // => [{ 'x': 1 }, { 'x': 2 }]
  8971. */
  8972. var unionBy = baseRest(function(arrays) {
  8973. var iteratee = last(arrays);
  8974. if (isArrayLikeObject(iteratee)) {
  8975. iteratee = undefined;
  8976. }
  8977. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8978. });
  8979. /**
  8980. * This method is like `_.union` except that it accepts `comparator` which
  8981. * is invoked to compare elements of `arrays`. Result values are chosen from
  8982. * the first array in which the value occurs. The comparator is invoked
  8983. * with two arguments: (arrVal, othVal).
  8984. *
  8985. * @static
  8986. * @memberOf _
  8987. * @since 4.0.0
  8988. * @category Array
  8989. * @param {...Array} [arrays] The arrays to inspect.
  8990. * @param {Function} [comparator] The comparator invoked per element.
  8991. * @returns {Array} Returns the new array of combined values.
  8992. * @example
  8993. *
  8994. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8995. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8996. *
  8997. * _.unionWith(objects, others, _.isEqual);
  8998. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8999. */
  9000. var unionWith = baseRest(function(arrays) {
  9001. var comparator = last(arrays);
  9002. comparator = typeof comparator == 'function' ? comparator : undefined;
  9003. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9004. });
  9005. /**
  9006. * Creates a duplicate-free version of an array, using
  9007. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9008. * for equality comparisons, in which only the first occurrence of each element
  9009. * is kept. The order of result values is determined by the order they occur
  9010. * in the array.
  9011. *
  9012. * @static
  9013. * @memberOf _
  9014. * @since 0.1.0
  9015. * @category Array
  9016. * @param {Array} array The array to inspect.
  9017. * @returns {Array} Returns the new duplicate free array.
  9018. * @example
  9019. *
  9020. * _.uniq([2, 1, 2]);
  9021. * // => [2, 1]
  9022. */
  9023. function uniq(array) {
  9024. return (array && array.length) ? baseUniq(array) : [];
  9025. }
  9026. /**
  9027. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9028. * invoked for each element in `array` to generate the criterion by which
  9029. * uniqueness is computed. The order of result values is determined by the
  9030. * order they occur in the array. The iteratee is invoked with one argument:
  9031. * (value).
  9032. *
  9033. * @static
  9034. * @memberOf _
  9035. * @since 4.0.0
  9036. * @category Array
  9037. * @param {Array} array The array to inspect.
  9038. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9039. * @returns {Array} Returns the new duplicate free array.
  9040. * @example
  9041. *
  9042. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9043. * // => [2.1, 1.2]
  9044. *
  9045. * // The `_.property` iteratee shorthand.
  9046. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9047. * // => [{ 'x': 1 }, { 'x': 2 }]
  9048. */
  9049. function uniqBy(array, iteratee) {
  9050. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9051. }
  9052. /**
  9053. * This method is like `_.uniq` except that it accepts `comparator` which
  9054. * is invoked to compare elements of `array`. The order of result values is
  9055. * determined by the order they occur in the array.The comparator is invoked
  9056. * with two arguments: (arrVal, othVal).
  9057. *
  9058. * @static
  9059. * @memberOf _
  9060. * @since 4.0.0
  9061. * @category Array
  9062. * @param {Array} array The array to inspect.
  9063. * @param {Function} [comparator] The comparator invoked per element.
  9064. * @returns {Array} Returns the new duplicate free array.
  9065. * @example
  9066. *
  9067. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9068. *
  9069. * _.uniqWith(objects, _.isEqual);
  9070. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9071. */
  9072. function uniqWith(array, comparator) {
  9073. comparator = typeof comparator == 'function' ? comparator : undefined;
  9074. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9075. }
  9076. /**
  9077. * This method is like `_.zip` except that it accepts an array of grouped
  9078. * elements and creates an array regrouping the elements to their pre-zip
  9079. * configuration.
  9080. *
  9081. * @static
  9082. * @memberOf _
  9083. * @since 1.2.0
  9084. * @category Array
  9085. * @param {Array} array The array of grouped elements to process.
  9086. * @returns {Array} Returns the new array of regrouped elements.
  9087. * @example
  9088. *
  9089. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9090. * // => [['a', 1, true], ['b', 2, false]]
  9091. *
  9092. * _.unzip(zipped);
  9093. * // => [['a', 'b'], [1, 2], [true, false]]
  9094. */
  9095. function unzip(array) {
  9096. if (!(array && array.length)) {
  9097. return [];
  9098. }
  9099. var length = 0;
  9100. array = arrayFilter(array, function(group) {
  9101. if (isArrayLikeObject(group)) {
  9102. length = nativeMax(group.length, length);
  9103. return true;
  9104. }
  9105. });
  9106. return baseTimes(length, function(index) {
  9107. return arrayMap(array, baseProperty(index));
  9108. });
  9109. }
  9110. /**
  9111. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9112. * how regrouped values should be combined. The iteratee is invoked with the
  9113. * elements of each group: (...group).
  9114. *
  9115. * @static
  9116. * @memberOf _
  9117. * @since 3.8.0
  9118. * @category Array
  9119. * @param {Array} array The array of grouped elements to process.
  9120. * @param {Function} [iteratee=_.identity] The function to combine
  9121. * regrouped values.
  9122. * @returns {Array} Returns the new array of regrouped elements.
  9123. * @example
  9124. *
  9125. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9126. * // => [[1, 10, 100], [2, 20, 200]]
  9127. *
  9128. * _.unzipWith(zipped, _.add);
  9129. * // => [3, 30, 300]
  9130. */
  9131. function unzipWith(array, iteratee) {
  9132. if (!(array && array.length)) {
  9133. return [];
  9134. }
  9135. var result = unzip(array);
  9136. if (iteratee == null) {
  9137. return result;
  9138. }
  9139. return arrayMap(result, function(group) {
  9140. return apply(iteratee, undefined, group);
  9141. });
  9142. }
  9143. /**
  9144. * Creates an array excluding all given values using
  9145. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9146. * for equality comparisons.
  9147. *
  9148. * **Note:** Unlike `_.pull`, this method returns a new array.
  9149. *
  9150. * @static
  9151. * @memberOf _
  9152. * @since 0.1.0
  9153. * @category Array
  9154. * @param {Array} array The array to inspect.
  9155. * @param {...*} [values] The values to exclude.
  9156. * @returns {Array} Returns the new array of filtered values.
  9157. * @see _.difference, _.xor
  9158. * @example
  9159. *
  9160. * _.without([2, 1, 2, 3], 1, 2);
  9161. * // => [3]
  9162. */
  9163. var without = baseRest(function(array, values) {
  9164. return isArrayLikeObject(array)
  9165. ? baseDifference(array, values)
  9166. : [];
  9167. });
  9168. /**
  9169. * Creates an array of unique values that is the
  9170. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9171. * of the given arrays. The order of result values is determined by the order
  9172. * they occur in the arrays.
  9173. *
  9174. * @static
  9175. * @memberOf _
  9176. * @since 2.4.0
  9177. * @category Array
  9178. * @param {...Array} [arrays] The arrays to inspect.
  9179. * @returns {Array} Returns the new array of filtered values.
  9180. * @see _.difference, _.without
  9181. * @example
  9182. *
  9183. * _.xor([2, 1], [2, 3]);
  9184. * // => [1, 3]
  9185. */
  9186. var xor = baseRest(function(arrays) {
  9187. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9188. });
  9189. /**
  9190. * This method is like `_.xor` except that it accepts `iteratee` which is
  9191. * invoked for each element of each `arrays` to generate the criterion by
  9192. * which by which they're compared. The order of result values is determined
  9193. * by the order they occur in the arrays. The iteratee is invoked with one
  9194. * argument: (value).
  9195. *
  9196. * @static
  9197. * @memberOf _
  9198. * @since 4.0.0
  9199. * @category Array
  9200. * @param {...Array} [arrays] The arrays to inspect.
  9201. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9202. * @returns {Array} Returns the new array of filtered values.
  9203. * @example
  9204. *
  9205. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9206. * // => [1.2, 3.4]
  9207. *
  9208. * // The `_.property` iteratee shorthand.
  9209. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9210. * // => [{ 'x': 2 }]
  9211. */
  9212. var xorBy = baseRest(function(arrays) {
  9213. var iteratee = last(arrays);
  9214. if (isArrayLikeObject(iteratee)) {
  9215. iteratee = undefined;
  9216. }
  9217. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9218. });
  9219. /**
  9220. * This method is like `_.xor` except that it accepts `comparator` which is
  9221. * invoked to compare elements of `arrays`. The order of result values is
  9222. * determined by the order they occur in the arrays. The comparator is invoked
  9223. * with two arguments: (arrVal, othVal).
  9224. *
  9225. * @static
  9226. * @memberOf _
  9227. * @since 4.0.0
  9228. * @category Array
  9229. * @param {...Array} [arrays] The arrays to inspect.
  9230. * @param {Function} [comparator] The comparator invoked per element.
  9231. * @returns {Array} Returns the new array of filtered values.
  9232. * @example
  9233. *
  9234. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9235. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9236. *
  9237. * _.xorWith(objects, others, _.isEqual);
  9238. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9239. */
  9240. var xorWith = baseRest(function(arrays) {
  9241. var comparator = last(arrays);
  9242. comparator = typeof comparator == 'function' ? comparator : undefined;
  9243. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9244. });
  9245. /**
  9246. * Creates an array of grouped elements, the first of which contains the
  9247. * first elements of the given arrays, the second of which contains the
  9248. * second elements of the given arrays, and so on.
  9249. *
  9250. * @static
  9251. * @memberOf _
  9252. * @since 0.1.0
  9253. * @category Array
  9254. * @param {...Array} [arrays] The arrays to process.
  9255. * @returns {Array} Returns the new array of grouped elements.
  9256. * @example
  9257. *
  9258. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9259. * // => [['a', 1, true], ['b', 2, false]]
  9260. */
  9261. var zip = baseRest(unzip);
  9262. /**
  9263. * This method is like `_.fromPairs` except that it accepts two arrays,
  9264. * one of property identifiers and one of corresponding values.
  9265. *
  9266. * @static
  9267. * @memberOf _
  9268. * @since 0.4.0
  9269. * @category Array
  9270. * @param {Array} [props=[]] The property identifiers.
  9271. * @param {Array} [values=[]] The property values.
  9272. * @returns {Object} Returns the new object.
  9273. * @example
  9274. *
  9275. * _.zipObject(['a', 'b'], [1, 2]);
  9276. * // => { 'a': 1, 'b': 2 }
  9277. */
  9278. function zipObject(props, values) {
  9279. return baseZipObject(props || [], values || [], assignValue);
  9280. }
  9281. /**
  9282. * This method is like `_.zipObject` except that it supports property paths.
  9283. *
  9284. * @static
  9285. * @memberOf _
  9286. * @since 4.1.0
  9287. * @category Array
  9288. * @param {Array} [props=[]] The property identifiers.
  9289. * @param {Array} [values=[]] The property values.
  9290. * @returns {Object} Returns the new object.
  9291. * @example
  9292. *
  9293. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9294. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9295. */
  9296. function zipObjectDeep(props, values) {
  9297. return baseZipObject(props || [], values || [], baseSet);
  9298. }
  9299. /**
  9300. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9301. * how grouped values should be combined. The iteratee is invoked with the
  9302. * elements of each group: (...group).
  9303. *
  9304. * @static
  9305. * @memberOf _
  9306. * @since 3.8.0
  9307. * @category Array
  9308. * @param {...Array} [arrays] The arrays to process.
  9309. * @param {Function} [iteratee=_.identity] The function to combine
  9310. * grouped values.
  9311. * @returns {Array} Returns the new array of grouped elements.
  9312. * @example
  9313. *
  9314. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9315. * return a + b + c;
  9316. * });
  9317. * // => [111, 222]
  9318. */
  9319. var zipWith = baseRest(function(arrays) {
  9320. var length = arrays.length,
  9321. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9322. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9323. return unzipWith(arrays, iteratee);
  9324. });
  9325. /*------------------------------------------------------------------------*/
  9326. /**
  9327. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9328. * chain sequences enabled. The result of such sequences must be unwrapped
  9329. * with `_#value`.
  9330. *
  9331. * @static
  9332. * @memberOf _
  9333. * @since 1.3.0
  9334. * @category Seq
  9335. * @param {*} value The value to wrap.
  9336. * @returns {Object} Returns the new `lodash` wrapper instance.
  9337. * @example
  9338. *
  9339. * var users = [
  9340. * { 'user': 'barney', 'age': 36 },
  9341. * { 'user': 'fred', 'age': 40 },
  9342. * { 'user': 'pebbles', 'age': 1 }
  9343. * ];
  9344. *
  9345. * var youngest = _
  9346. * .chain(users)
  9347. * .sortBy('age')
  9348. * .map(function(o) {
  9349. * return o.user + ' is ' + o.age;
  9350. * })
  9351. * .head()
  9352. * .value();
  9353. * // => 'pebbles is 1'
  9354. */
  9355. function chain(value) {
  9356. var result = lodash(value);
  9357. result.__chain__ = true;
  9358. return result;
  9359. }
  9360. /**
  9361. * This method invokes `interceptor` and returns `value`. The interceptor
  9362. * is invoked with one argument; (value). The purpose of this method is to
  9363. * "tap into" a method chain sequence in order to modify intermediate results.
  9364. *
  9365. * @static
  9366. * @memberOf _
  9367. * @since 0.1.0
  9368. * @category Seq
  9369. * @param {*} value The value to provide to `interceptor`.
  9370. * @param {Function} interceptor The function to invoke.
  9371. * @returns {*} Returns `value`.
  9372. * @example
  9373. *
  9374. * _([1, 2, 3])
  9375. * .tap(function(array) {
  9376. * // Mutate input array.
  9377. * array.pop();
  9378. * })
  9379. * .reverse()
  9380. * .value();
  9381. * // => [2, 1]
  9382. */
  9383. function tap(value, interceptor) {
  9384. interceptor(value);
  9385. return value;
  9386. }
  9387. /**
  9388. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9389. * The purpose of this method is to "pass thru" values replacing intermediate
  9390. * results in a method chain sequence.
  9391. *
  9392. * @static
  9393. * @memberOf _
  9394. * @since 3.0.0
  9395. * @category Seq
  9396. * @param {*} value The value to provide to `interceptor`.
  9397. * @param {Function} interceptor The function to invoke.
  9398. * @returns {*} Returns the result of `interceptor`.
  9399. * @example
  9400. *
  9401. * _(' abc ')
  9402. * .chain()
  9403. * .trim()
  9404. * .thru(function(value) {
  9405. * return [value];
  9406. * })
  9407. * .value();
  9408. * // => ['abc']
  9409. */
  9410. function thru(value, interceptor) {
  9411. return interceptor(value);
  9412. }
  9413. /**
  9414. * This method is the wrapper version of `_.at`.
  9415. *
  9416. * @name at
  9417. * @memberOf _
  9418. * @since 1.0.0
  9419. * @category Seq
  9420. * @param {...(string|string[])} [paths] The property paths to pick.
  9421. * @returns {Object} Returns the new `lodash` wrapper instance.
  9422. * @example
  9423. *
  9424. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9425. *
  9426. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9427. * // => [3, 4]
  9428. */
  9429. var wrapperAt = flatRest(function(paths) {
  9430. var length = paths.length,
  9431. start = length ? paths[0] : 0,
  9432. value = this.__wrapped__,
  9433. interceptor = function(object) { return baseAt(object, paths); };
  9434. if (length > 1 || this.__actions__.length ||
  9435. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9436. return this.thru(interceptor);
  9437. }
  9438. value = value.slice(start, +start + (length ? 1 : 0));
  9439. value.__actions__.push({
  9440. 'func': thru,
  9441. 'args': [interceptor],
  9442. 'thisArg': undefined
  9443. });
  9444. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9445. if (length && !array.length) {
  9446. array.push(undefined);
  9447. }
  9448. return array;
  9449. });
  9450. });
  9451. /**
  9452. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9453. *
  9454. * @name chain
  9455. * @memberOf _
  9456. * @since 0.1.0
  9457. * @category Seq
  9458. * @returns {Object} Returns the new `lodash` wrapper instance.
  9459. * @example
  9460. *
  9461. * var users = [
  9462. * { 'user': 'barney', 'age': 36 },
  9463. * { 'user': 'fred', 'age': 40 }
  9464. * ];
  9465. *
  9466. * // A sequence without explicit chaining.
  9467. * _(users).head();
  9468. * // => { 'user': 'barney', 'age': 36 }
  9469. *
  9470. * // A sequence with explicit chaining.
  9471. * _(users)
  9472. * .chain()
  9473. * .head()
  9474. * .pick('user')
  9475. * .value();
  9476. * // => { 'user': 'barney' }
  9477. */
  9478. function wrapperChain() {
  9479. return chain(this);
  9480. }
  9481. /**
  9482. * Executes the chain sequence and returns the wrapped result.
  9483. *
  9484. * @name commit
  9485. * @memberOf _
  9486. * @since 3.2.0
  9487. * @category Seq
  9488. * @returns {Object} Returns the new `lodash` wrapper instance.
  9489. * @example
  9490. *
  9491. * var array = [1, 2];
  9492. * var wrapped = _(array).push(3);
  9493. *
  9494. * console.log(array);
  9495. * // => [1, 2]
  9496. *
  9497. * wrapped = wrapped.commit();
  9498. * console.log(array);
  9499. * // => [1, 2, 3]
  9500. *
  9501. * wrapped.last();
  9502. * // => 3
  9503. *
  9504. * console.log(array);
  9505. * // => [1, 2, 3]
  9506. */
  9507. function wrapperCommit() {
  9508. return new LodashWrapper(this.value(), this.__chain__);
  9509. }
  9510. /**
  9511. * Gets the next value on a wrapped object following the
  9512. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9513. *
  9514. * @name next
  9515. * @memberOf _
  9516. * @since 4.0.0
  9517. * @category Seq
  9518. * @returns {Object} Returns the next iterator value.
  9519. * @example
  9520. *
  9521. * var wrapped = _([1, 2]);
  9522. *
  9523. * wrapped.next();
  9524. * // => { 'done': false, 'value': 1 }
  9525. *
  9526. * wrapped.next();
  9527. * // => { 'done': false, 'value': 2 }
  9528. *
  9529. * wrapped.next();
  9530. * // => { 'done': true, 'value': undefined }
  9531. */
  9532. function wrapperNext() {
  9533. if (this.__values__ === undefined) {
  9534. this.__values__ = toArray(this.value());
  9535. }
  9536. var done = this.__index__ >= this.__values__.length,
  9537. value = done ? undefined : this.__values__[this.__index__++];
  9538. return { 'done': done, 'value': value };
  9539. }
  9540. /**
  9541. * Enables the wrapper to be iterable.
  9542. *
  9543. * @name Symbol.iterator
  9544. * @memberOf _
  9545. * @since 4.0.0
  9546. * @category Seq
  9547. * @returns {Object} Returns the wrapper object.
  9548. * @example
  9549. *
  9550. * var wrapped = _([1, 2]);
  9551. *
  9552. * wrapped[Symbol.iterator]() === wrapped;
  9553. * // => true
  9554. *
  9555. * Array.from(wrapped);
  9556. * // => [1, 2]
  9557. */
  9558. function wrapperToIterator() {
  9559. return this;
  9560. }
  9561. /**
  9562. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9563. *
  9564. * @name plant
  9565. * @memberOf _
  9566. * @since 3.2.0
  9567. * @category Seq
  9568. * @param {*} value The value to plant.
  9569. * @returns {Object} Returns the new `lodash` wrapper instance.
  9570. * @example
  9571. *
  9572. * function square(n) {
  9573. * return n * n;
  9574. * }
  9575. *
  9576. * var wrapped = _([1, 2]).map(square);
  9577. * var other = wrapped.plant([3, 4]);
  9578. *
  9579. * other.value();
  9580. * // => [9, 16]
  9581. *
  9582. * wrapped.value();
  9583. * // => [1, 4]
  9584. */
  9585. function wrapperPlant(value) {
  9586. var result,
  9587. parent = this;
  9588. while (parent instanceof baseLodash) {
  9589. var clone = wrapperClone(parent);
  9590. clone.__index__ = 0;
  9591. clone.__values__ = undefined;
  9592. if (result) {
  9593. previous.__wrapped__ = clone;
  9594. } else {
  9595. result = clone;
  9596. }
  9597. var previous = clone;
  9598. parent = parent.__wrapped__;
  9599. }
  9600. previous.__wrapped__ = value;
  9601. return result;
  9602. }
  9603. /**
  9604. * This method is the wrapper version of `_.reverse`.
  9605. *
  9606. * **Note:** This method mutates the wrapped array.
  9607. *
  9608. * @name reverse
  9609. * @memberOf _
  9610. * @since 0.1.0
  9611. * @category Seq
  9612. * @returns {Object} Returns the new `lodash` wrapper instance.
  9613. * @example
  9614. *
  9615. * var array = [1, 2, 3];
  9616. *
  9617. * _(array).reverse().value()
  9618. * // => [3, 2, 1]
  9619. *
  9620. * console.log(array);
  9621. * // => [3, 2, 1]
  9622. */
  9623. function wrapperReverse() {
  9624. var value = this.__wrapped__;
  9625. if (value instanceof LazyWrapper) {
  9626. var wrapped = value;
  9627. if (this.__actions__.length) {
  9628. wrapped = new LazyWrapper(this);
  9629. }
  9630. wrapped = wrapped.reverse();
  9631. wrapped.__actions__.push({
  9632. 'func': thru,
  9633. 'args': [reverse],
  9634. 'thisArg': undefined
  9635. });
  9636. return new LodashWrapper(wrapped, this.__chain__);
  9637. }
  9638. return this.thru(reverse);
  9639. }
  9640. /**
  9641. * Executes the chain sequence to resolve the unwrapped value.
  9642. *
  9643. * @name value
  9644. * @memberOf _
  9645. * @since 0.1.0
  9646. * @alias toJSON, valueOf
  9647. * @category Seq
  9648. * @returns {*} Returns the resolved unwrapped value.
  9649. * @example
  9650. *
  9651. * _([1, 2, 3]).value();
  9652. * // => [1, 2, 3]
  9653. */
  9654. function wrapperValue() {
  9655. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9656. }
  9657. /*------------------------------------------------------------------------*/
  9658. /**
  9659. * Creates an object composed of keys generated from the results of running
  9660. * each element of `collection` thru `iteratee`. The corresponding value of
  9661. * each key is the number of times the key was returned by `iteratee`. The
  9662. * iteratee is invoked with one argument: (value).
  9663. *
  9664. * @static
  9665. * @memberOf _
  9666. * @since 0.5.0
  9667. * @category Collection
  9668. * @param {Array|Object} collection The collection to iterate over.
  9669. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9670. * @returns {Object} Returns the composed aggregate object.
  9671. * @example
  9672. *
  9673. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9674. * // => { '4': 1, '6': 2 }
  9675. *
  9676. * // The `_.property` iteratee shorthand.
  9677. * _.countBy(['one', 'two', 'three'], 'length');
  9678. * // => { '3': 2, '5': 1 }
  9679. */
  9680. var countBy = createAggregator(function(result, value, key) {
  9681. if (hasOwnProperty.call(result, key)) {
  9682. ++result[key];
  9683. } else {
  9684. baseAssignValue(result, key, 1);
  9685. }
  9686. });
  9687. /**
  9688. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9689. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9690. * invoked with three arguments: (value, index|key, collection).
  9691. *
  9692. * **Note:** This method returns `true` for
  9693. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9694. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9695. * elements of empty collections.
  9696. *
  9697. * @static
  9698. * @memberOf _
  9699. * @since 0.1.0
  9700. * @category Collection
  9701. * @param {Array|Object} collection The collection to iterate over.
  9702. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9703. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9704. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9705. * else `false`.
  9706. * @example
  9707. *
  9708. * _.every([true, 1, null, 'yes'], Boolean);
  9709. * // => false
  9710. *
  9711. * var users = [
  9712. * { 'user': 'barney', 'age': 36, 'active': false },
  9713. * { 'user': 'fred', 'age': 40, 'active': false }
  9714. * ];
  9715. *
  9716. * // The `_.matches` iteratee shorthand.
  9717. * _.every(users, { 'user': 'barney', 'active': false });
  9718. * // => false
  9719. *
  9720. * // The `_.matchesProperty` iteratee shorthand.
  9721. * _.every(users, ['active', false]);
  9722. * // => true
  9723. *
  9724. * // The `_.property` iteratee shorthand.
  9725. * _.every(users, 'active');
  9726. * // => false
  9727. */
  9728. function every(collection, predicate, guard) {
  9729. var func = isArray(collection) ? arrayEvery : baseEvery;
  9730. if (guard && isIterateeCall(collection, predicate, guard)) {
  9731. predicate = undefined;
  9732. }
  9733. return func(collection, getIteratee(predicate, 3));
  9734. }
  9735. /**
  9736. * Iterates over elements of `collection`, returning an array of all elements
  9737. * `predicate` returns truthy for. The predicate is invoked with three
  9738. * arguments: (value, index|key, collection).
  9739. *
  9740. * **Note:** Unlike `_.remove`, this method returns a new array.
  9741. *
  9742. * @static
  9743. * @memberOf _
  9744. * @since 0.1.0
  9745. * @category Collection
  9746. * @param {Array|Object} collection The collection to iterate over.
  9747. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9748. * @returns {Array} Returns the new filtered array.
  9749. * @see _.reject
  9750. * @example
  9751. *
  9752. * var users = [
  9753. * { 'user': 'barney', 'age': 36, 'active': true },
  9754. * { 'user': 'fred', 'age': 40, 'active': false }
  9755. * ];
  9756. *
  9757. * _.filter(users, function(o) { return !o.active; });
  9758. * // => objects for ['fred']
  9759. *
  9760. * // The `_.matches` iteratee shorthand.
  9761. * _.filter(users, { 'age': 36, 'active': true });
  9762. * // => objects for ['barney']
  9763. *
  9764. * // The `_.matchesProperty` iteratee shorthand.
  9765. * _.filter(users, ['active', false]);
  9766. * // => objects for ['fred']
  9767. *
  9768. * // The `_.property` iteratee shorthand.
  9769. * _.filter(users, 'active');
  9770. * // => objects for ['barney']
  9771. *
  9772. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9773. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9774. * // => objects for ['fred', 'barney']
  9775. */
  9776. function filter(collection, predicate) {
  9777. var func = isArray(collection) ? arrayFilter : baseFilter;
  9778. return func(collection, getIteratee(predicate, 3));
  9779. }
  9780. /**
  9781. * Iterates over elements of `collection`, returning the first element
  9782. * `predicate` returns truthy for. The predicate is invoked with three
  9783. * arguments: (value, index|key, collection).
  9784. *
  9785. * @static
  9786. * @memberOf _
  9787. * @since 0.1.0
  9788. * @category Collection
  9789. * @param {Array|Object} collection The collection to inspect.
  9790. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9791. * @param {number} [fromIndex=0] The index to search from.
  9792. * @returns {*} Returns the matched element, else `undefined`.
  9793. * @example
  9794. *
  9795. * var users = [
  9796. * { 'user': 'barney', 'age': 36, 'active': true },
  9797. * { 'user': 'fred', 'age': 40, 'active': false },
  9798. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9799. * ];
  9800. *
  9801. * _.find(users, function(o) { return o.age < 40; });
  9802. * // => object for 'barney'
  9803. *
  9804. * // The `_.matches` iteratee shorthand.
  9805. * _.find(users, { 'age': 1, 'active': true });
  9806. * // => object for 'pebbles'
  9807. *
  9808. * // The `_.matchesProperty` iteratee shorthand.
  9809. * _.find(users, ['active', false]);
  9810. * // => object for 'fred'
  9811. *
  9812. * // The `_.property` iteratee shorthand.
  9813. * _.find(users, 'active');
  9814. * // => object for 'barney'
  9815. */
  9816. var find = createFind(findIndex);
  9817. /**
  9818. * This method is like `_.find` except that it iterates over elements of
  9819. * `collection` from right to left.
  9820. *
  9821. * @static
  9822. * @memberOf _
  9823. * @since 2.0.0
  9824. * @category Collection
  9825. * @param {Array|Object} collection The collection to inspect.
  9826. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9827. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9828. * @returns {*} Returns the matched element, else `undefined`.
  9829. * @example
  9830. *
  9831. * _.findLast([1, 2, 3, 4], function(n) {
  9832. * return n % 2 == 1;
  9833. * });
  9834. * // => 3
  9835. */
  9836. var findLast = createFind(findLastIndex);
  9837. /**
  9838. * Creates a flattened array of values by running each element in `collection`
  9839. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9840. * with three arguments: (value, index|key, collection).
  9841. *
  9842. * @static
  9843. * @memberOf _
  9844. * @since 4.0.0
  9845. * @category Collection
  9846. * @param {Array|Object} collection The collection to iterate over.
  9847. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9848. * @returns {Array} Returns the new flattened array.
  9849. * @example
  9850. *
  9851. * function duplicate(n) {
  9852. * return [n, n];
  9853. * }
  9854. *
  9855. * _.flatMap([1, 2], duplicate);
  9856. * // => [1, 1, 2, 2]
  9857. */
  9858. function flatMap(collection, iteratee) {
  9859. return baseFlatten(map(collection, iteratee), 1);
  9860. }
  9861. /**
  9862. * This method is like `_.flatMap` except that it recursively flattens the
  9863. * mapped results.
  9864. *
  9865. * @static
  9866. * @memberOf _
  9867. * @since 4.7.0
  9868. * @category Collection
  9869. * @param {Array|Object} collection The collection to iterate over.
  9870. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9871. * @returns {Array} Returns the new flattened array.
  9872. * @example
  9873. *
  9874. * function duplicate(n) {
  9875. * return [[[n, n]]];
  9876. * }
  9877. *
  9878. * _.flatMapDeep([1, 2], duplicate);
  9879. * // => [1, 1, 2, 2]
  9880. */
  9881. function flatMapDeep(collection, iteratee) {
  9882. return baseFlatten(map(collection, iteratee), INFINITY);
  9883. }
  9884. /**
  9885. * This method is like `_.flatMap` except that it recursively flattens the
  9886. * mapped results up to `depth` times.
  9887. *
  9888. * @static
  9889. * @memberOf _
  9890. * @since 4.7.0
  9891. * @category Collection
  9892. * @param {Array|Object} collection The collection to iterate over.
  9893. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9894. * @param {number} [depth=1] The maximum recursion depth.
  9895. * @returns {Array} Returns the new flattened array.
  9896. * @example
  9897. *
  9898. * function duplicate(n) {
  9899. * return [[[n, n]]];
  9900. * }
  9901. *
  9902. * _.flatMapDepth([1, 2], duplicate, 2);
  9903. * // => [[1, 1], [2, 2]]
  9904. */
  9905. function flatMapDepth(collection, iteratee, depth) {
  9906. depth = depth === undefined ? 1 : toInteger(depth);
  9907. return baseFlatten(map(collection, iteratee), depth);
  9908. }
  9909. /**
  9910. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9911. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9912. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9913. *
  9914. * **Note:** As with other "Collections" methods, objects with a "length"
  9915. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9916. * or `_.forOwn` for object iteration.
  9917. *
  9918. * @static
  9919. * @memberOf _
  9920. * @since 0.1.0
  9921. * @alias each
  9922. * @category Collection
  9923. * @param {Array|Object} collection The collection to iterate over.
  9924. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9925. * @returns {Array|Object} Returns `collection`.
  9926. * @see _.forEachRight
  9927. * @example
  9928. *
  9929. * _.forEach([1, 2], function(value) {
  9930. * console.log(value);
  9931. * });
  9932. * // => Logs `1` then `2`.
  9933. *
  9934. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9935. * console.log(key);
  9936. * });
  9937. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9938. */
  9939. function forEach(collection, iteratee) {
  9940. var func = isArray(collection) ? arrayEach : baseEach;
  9941. return func(collection, getIteratee(iteratee, 3));
  9942. }
  9943. /**
  9944. * This method is like `_.forEach` except that it iterates over elements of
  9945. * `collection` from right to left.
  9946. *
  9947. * @static
  9948. * @memberOf _
  9949. * @since 2.0.0
  9950. * @alias eachRight
  9951. * @category Collection
  9952. * @param {Array|Object} collection The collection to iterate over.
  9953. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9954. * @returns {Array|Object} Returns `collection`.
  9955. * @see _.forEach
  9956. * @example
  9957. *
  9958. * _.forEachRight([1, 2], function(value) {
  9959. * console.log(value);
  9960. * });
  9961. * // => Logs `2` then `1`.
  9962. */
  9963. function forEachRight(collection, iteratee) {
  9964. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9965. return func(collection, getIteratee(iteratee, 3));
  9966. }
  9967. /**
  9968. * Creates an object composed of keys generated from the results of running
  9969. * each element of `collection` thru `iteratee`. The order of grouped values
  9970. * is determined by the order they occur in `collection`. The corresponding
  9971. * value of each key is an array of elements responsible for generating the
  9972. * key. The iteratee is invoked with one argument: (value).
  9973. *
  9974. * @static
  9975. * @memberOf _
  9976. * @since 0.1.0
  9977. * @category Collection
  9978. * @param {Array|Object} collection The collection to iterate over.
  9979. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9980. * @returns {Object} Returns the composed aggregate object.
  9981. * @example
  9982. *
  9983. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9984. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9985. *
  9986. * // The `_.property` iteratee shorthand.
  9987. * _.groupBy(['one', 'two', 'three'], 'length');
  9988. * // => { '3': ['one', 'two'], '5': ['three'] }
  9989. */
  9990. var groupBy = createAggregator(function(result, value, key) {
  9991. if (hasOwnProperty.call(result, key)) {
  9992. result[key].push(value);
  9993. } else {
  9994. baseAssignValue(result, key, [value]);
  9995. }
  9996. });
  9997. /**
  9998. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9999. * checked for a substring of `value`, otherwise
  10000. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10001. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10002. * the offset from the end of `collection`.
  10003. *
  10004. * @static
  10005. * @memberOf _
  10006. * @since 0.1.0
  10007. * @category Collection
  10008. * @param {Array|Object|string} collection The collection to inspect.
  10009. * @param {*} value The value to search for.
  10010. * @param {number} [fromIndex=0] The index to search from.
  10011. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10012. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10013. * @example
  10014. *
  10015. * _.includes([1, 2, 3], 1);
  10016. * // => true
  10017. *
  10018. * _.includes([1, 2, 3], 1, 2);
  10019. * // => false
  10020. *
  10021. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10022. * // => true
  10023. *
  10024. * _.includes('abcd', 'bc');
  10025. * // => true
  10026. */
  10027. function includes(collection, value, fromIndex, guard) {
  10028. collection = isArrayLike(collection) ? collection : values(collection);
  10029. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10030. var length = collection.length;
  10031. if (fromIndex < 0) {
  10032. fromIndex = nativeMax(length + fromIndex, 0);
  10033. }
  10034. return isString(collection)
  10035. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10036. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10037. }
  10038. /**
  10039. * Invokes the method at `path` of each element in `collection`, returning
  10040. * an array of the results of each invoked method. Any additional arguments
  10041. * are provided to each invoked method. If `path` is a function, it's invoked
  10042. * for, and `this` bound to, each element in `collection`.
  10043. *
  10044. * @static
  10045. * @memberOf _
  10046. * @since 4.0.0
  10047. * @category Collection
  10048. * @param {Array|Object} collection The collection to iterate over.
  10049. * @param {Array|Function|string} path The path of the method to invoke or
  10050. * the function invoked per iteration.
  10051. * @param {...*} [args] The arguments to invoke each method with.
  10052. * @returns {Array} Returns the array of results.
  10053. * @example
  10054. *
  10055. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10056. * // => [[1, 5, 7], [1, 2, 3]]
  10057. *
  10058. * _.invokeMap([123, 456], String.prototype.split, '');
  10059. * // => [['1', '2', '3'], ['4', '5', '6']]
  10060. */
  10061. var invokeMap = baseRest(function(collection, path, args) {
  10062. var index = -1,
  10063. isFunc = typeof path == 'function',
  10064. result = isArrayLike(collection) ? Array(collection.length) : [];
  10065. baseEach(collection, function(value) {
  10066. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10067. });
  10068. return result;
  10069. });
  10070. /**
  10071. * Creates an object composed of keys generated from the results of running
  10072. * each element of `collection` thru `iteratee`. The corresponding value of
  10073. * each key is the last element responsible for generating the key. The
  10074. * iteratee is invoked with one argument: (value).
  10075. *
  10076. * @static
  10077. * @memberOf _
  10078. * @since 4.0.0
  10079. * @category Collection
  10080. * @param {Array|Object} collection The collection to iterate over.
  10081. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10082. * @returns {Object} Returns the composed aggregate object.
  10083. * @example
  10084. *
  10085. * var array = [
  10086. * { 'dir': 'left', 'code': 97 },
  10087. * { 'dir': 'right', 'code': 100 }
  10088. * ];
  10089. *
  10090. * _.keyBy(array, function(o) {
  10091. * return String.fromCharCode(o.code);
  10092. * });
  10093. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10094. *
  10095. * _.keyBy(array, 'dir');
  10096. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10097. */
  10098. var keyBy = createAggregator(function(result, value, key) {
  10099. baseAssignValue(result, key, value);
  10100. });
  10101. /**
  10102. * Creates an array of values by running each element in `collection` thru
  10103. * `iteratee`. The iteratee is invoked with three arguments:
  10104. * (value, index|key, collection).
  10105. *
  10106. * Many lodash methods are guarded to work as iteratees for methods like
  10107. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10108. *
  10109. * The guarded methods are:
  10110. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10111. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10112. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10113. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10114. *
  10115. * @static
  10116. * @memberOf _
  10117. * @since 0.1.0
  10118. * @category Collection
  10119. * @param {Array|Object} collection The collection to iterate over.
  10120. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10121. * @returns {Array} Returns the new mapped array.
  10122. * @example
  10123. *
  10124. * function square(n) {
  10125. * return n * n;
  10126. * }
  10127. *
  10128. * _.map([4, 8], square);
  10129. * // => [16, 64]
  10130. *
  10131. * _.map({ 'a': 4, 'b': 8 }, square);
  10132. * // => [16, 64] (iteration order is not guaranteed)
  10133. *
  10134. * var users = [
  10135. * { 'user': 'barney' },
  10136. * { 'user': 'fred' }
  10137. * ];
  10138. *
  10139. * // The `_.property` iteratee shorthand.
  10140. * _.map(users, 'user');
  10141. * // => ['barney', 'fred']
  10142. */
  10143. function map(collection, iteratee) {
  10144. var func = isArray(collection) ? arrayMap : baseMap;
  10145. return func(collection, getIteratee(iteratee, 3));
  10146. }
  10147. /**
  10148. * This method is like `_.sortBy` except that it allows specifying the sort
  10149. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10150. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10151. * descending or "asc" for ascending sort order of corresponding values.
  10152. *
  10153. * @static
  10154. * @memberOf _
  10155. * @since 4.0.0
  10156. * @category Collection
  10157. * @param {Array|Object} collection The collection to iterate over.
  10158. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10159. * The iteratees to sort by.
  10160. * @param {string[]} [orders] The sort orders of `iteratees`.
  10161. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10162. * @returns {Array} Returns the new sorted array.
  10163. * @example
  10164. *
  10165. * var users = [
  10166. * { 'user': 'fred', 'age': 48 },
  10167. * { 'user': 'barney', 'age': 34 },
  10168. * { 'user': 'fred', 'age': 40 },
  10169. * { 'user': 'barney', 'age': 36 }
  10170. * ];
  10171. *
  10172. * // Sort by `user` in ascending order and by `age` in descending order.
  10173. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10174. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10175. */
  10176. function orderBy(collection, iteratees, orders, guard) {
  10177. if (collection == null) {
  10178. return [];
  10179. }
  10180. if (!isArray(iteratees)) {
  10181. iteratees = iteratees == null ? [] : [iteratees];
  10182. }
  10183. orders = guard ? undefined : orders;
  10184. if (!isArray(orders)) {
  10185. orders = orders == null ? [] : [orders];
  10186. }
  10187. return baseOrderBy(collection, iteratees, orders);
  10188. }
  10189. /**
  10190. * Creates an array of elements split into two groups, the first of which
  10191. * contains elements `predicate` returns truthy for, the second of which
  10192. * contains elements `predicate` returns falsey for. The predicate is
  10193. * invoked with one argument: (value).
  10194. *
  10195. * @static
  10196. * @memberOf _
  10197. * @since 3.0.0
  10198. * @category Collection
  10199. * @param {Array|Object} collection The collection to iterate over.
  10200. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10201. * @returns {Array} Returns the array of grouped elements.
  10202. * @example
  10203. *
  10204. * var users = [
  10205. * { 'user': 'barney', 'age': 36, 'active': false },
  10206. * { 'user': 'fred', 'age': 40, 'active': true },
  10207. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10208. * ];
  10209. *
  10210. * _.partition(users, function(o) { return o.active; });
  10211. * // => objects for [['fred'], ['barney', 'pebbles']]
  10212. *
  10213. * // The `_.matches` iteratee shorthand.
  10214. * _.partition(users, { 'age': 1, 'active': false });
  10215. * // => objects for [['pebbles'], ['barney', 'fred']]
  10216. *
  10217. * // The `_.matchesProperty` iteratee shorthand.
  10218. * _.partition(users, ['active', false]);
  10219. * // => objects for [['barney', 'pebbles'], ['fred']]
  10220. *
  10221. * // The `_.property` iteratee shorthand.
  10222. * _.partition(users, 'active');
  10223. * // => objects for [['fred'], ['barney', 'pebbles']]
  10224. */
  10225. var partition = createAggregator(function(result, value, key) {
  10226. result[key ? 0 : 1].push(value);
  10227. }, function() { return [[], []]; });
  10228. /**
  10229. * Reduces `collection` to a value which is the accumulated result of running
  10230. * each element in `collection` thru `iteratee`, where each successive
  10231. * invocation is supplied the return value of the previous. If `accumulator`
  10232. * is not given, the first element of `collection` is used as the initial
  10233. * value. The iteratee is invoked with four arguments:
  10234. * (accumulator, value, index|key, collection).
  10235. *
  10236. * Many lodash methods are guarded to work as iteratees for methods like
  10237. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10238. *
  10239. * The guarded methods are:
  10240. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10241. * and `sortBy`
  10242. *
  10243. * @static
  10244. * @memberOf _
  10245. * @since 0.1.0
  10246. * @category Collection
  10247. * @param {Array|Object} collection The collection to iterate over.
  10248. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10249. * @param {*} [accumulator] The initial value.
  10250. * @returns {*} Returns the accumulated value.
  10251. * @see _.reduceRight
  10252. * @example
  10253. *
  10254. * _.reduce([1, 2], function(sum, n) {
  10255. * return sum + n;
  10256. * }, 0);
  10257. * // => 3
  10258. *
  10259. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10260. * (result[value] || (result[value] = [])).push(key);
  10261. * return result;
  10262. * }, {});
  10263. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10264. */
  10265. function reduce(collection, iteratee, accumulator) {
  10266. var func = isArray(collection) ? arrayReduce : baseReduce,
  10267. initAccum = arguments.length < 3;
  10268. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10269. }
  10270. /**
  10271. * This method is like `_.reduce` except that it iterates over elements of
  10272. * `collection` from right to left.
  10273. *
  10274. * @static
  10275. * @memberOf _
  10276. * @since 0.1.0
  10277. * @category Collection
  10278. * @param {Array|Object} collection The collection to iterate over.
  10279. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10280. * @param {*} [accumulator] The initial value.
  10281. * @returns {*} Returns the accumulated value.
  10282. * @see _.reduce
  10283. * @example
  10284. *
  10285. * var array = [[0, 1], [2, 3], [4, 5]];
  10286. *
  10287. * _.reduceRight(array, function(flattened, other) {
  10288. * return flattened.concat(other);
  10289. * }, []);
  10290. * // => [4, 5, 2, 3, 0, 1]
  10291. */
  10292. function reduceRight(collection, iteratee, accumulator) {
  10293. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10294. initAccum = arguments.length < 3;
  10295. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10296. }
  10297. /**
  10298. * The opposite of `_.filter`; this method returns the elements of `collection`
  10299. * that `predicate` does **not** return truthy for.
  10300. *
  10301. * @static
  10302. * @memberOf _
  10303. * @since 0.1.0
  10304. * @category Collection
  10305. * @param {Array|Object} collection The collection to iterate over.
  10306. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10307. * @returns {Array} Returns the new filtered array.
  10308. * @see _.filter
  10309. * @example
  10310. *
  10311. * var users = [
  10312. * { 'user': 'barney', 'age': 36, 'active': false },
  10313. * { 'user': 'fred', 'age': 40, 'active': true }
  10314. * ];
  10315. *
  10316. * _.reject(users, function(o) { return !o.active; });
  10317. * // => objects for ['fred']
  10318. *
  10319. * // The `_.matches` iteratee shorthand.
  10320. * _.reject(users, { 'age': 40, 'active': true });
  10321. * // => objects for ['barney']
  10322. *
  10323. * // The `_.matchesProperty` iteratee shorthand.
  10324. * _.reject(users, ['active', false]);
  10325. * // => objects for ['fred']
  10326. *
  10327. * // The `_.property` iteratee shorthand.
  10328. * _.reject(users, 'active');
  10329. * // => objects for ['barney']
  10330. */
  10331. function reject(collection, predicate) {
  10332. var func = isArray(collection) ? arrayFilter : baseFilter;
  10333. return func(collection, negate(getIteratee(predicate, 3)));
  10334. }
  10335. /**
  10336. * Gets a random element from `collection`.
  10337. *
  10338. * @static
  10339. * @memberOf _
  10340. * @since 2.0.0
  10341. * @category Collection
  10342. * @param {Array|Object} collection The collection to sample.
  10343. * @returns {*} Returns the random element.
  10344. * @example
  10345. *
  10346. * _.sample([1, 2, 3, 4]);
  10347. * // => 2
  10348. */
  10349. function sample(collection) {
  10350. var func = isArray(collection) ? arraySample : baseSample;
  10351. return func(collection);
  10352. }
  10353. /**
  10354. * Gets `n` random elements at unique keys from `collection` up to the
  10355. * size of `collection`.
  10356. *
  10357. * @static
  10358. * @memberOf _
  10359. * @since 4.0.0
  10360. * @category Collection
  10361. * @param {Array|Object} collection The collection to sample.
  10362. * @param {number} [n=1] The number of elements to sample.
  10363. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10364. * @returns {Array} Returns the random elements.
  10365. * @example
  10366. *
  10367. * _.sampleSize([1, 2, 3], 2);
  10368. * // => [3, 1]
  10369. *
  10370. * _.sampleSize([1, 2, 3], 4);
  10371. * // => [2, 3, 1]
  10372. */
  10373. function sampleSize(collection, n, guard) {
  10374. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10375. n = 1;
  10376. } else {
  10377. n = toInteger(n);
  10378. }
  10379. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10380. return func(collection, n);
  10381. }
  10382. /**
  10383. * Creates an array of shuffled values, using a version of the
  10384. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10385. *
  10386. * @static
  10387. * @memberOf _
  10388. * @since 0.1.0
  10389. * @category Collection
  10390. * @param {Array|Object} collection The collection to shuffle.
  10391. * @returns {Array} Returns the new shuffled array.
  10392. * @example
  10393. *
  10394. * _.shuffle([1, 2, 3, 4]);
  10395. * // => [4, 1, 3, 2]
  10396. */
  10397. function shuffle(collection) {
  10398. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10399. return func(collection);
  10400. }
  10401. /**
  10402. * Gets the size of `collection` by returning its length for array-like
  10403. * values or the number of own enumerable string keyed properties for objects.
  10404. *
  10405. * @static
  10406. * @memberOf _
  10407. * @since 0.1.0
  10408. * @category Collection
  10409. * @param {Array|Object|string} collection The collection to inspect.
  10410. * @returns {number} Returns the collection size.
  10411. * @example
  10412. *
  10413. * _.size([1, 2, 3]);
  10414. * // => 3
  10415. *
  10416. * _.size({ 'a': 1, 'b': 2 });
  10417. * // => 2
  10418. *
  10419. * _.size('pebbles');
  10420. * // => 7
  10421. */
  10422. function size(collection) {
  10423. if (collection == null) {
  10424. return 0;
  10425. }
  10426. if (isArrayLike(collection)) {
  10427. return isString(collection) ? stringSize(collection) : collection.length;
  10428. }
  10429. var tag = getTag(collection);
  10430. if (tag == mapTag || tag == setTag) {
  10431. return collection.size;
  10432. }
  10433. return baseKeys(collection).length;
  10434. }
  10435. /**
  10436. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10437. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10438. * invoked with three arguments: (value, index|key, collection).
  10439. *
  10440. * @static
  10441. * @memberOf _
  10442. * @since 0.1.0
  10443. * @category Collection
  10444. * @param {Array|Object} collection The collection to iterate over.
  10445. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10446. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10447. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10448. * else `false`.
  10449. * @example
  10450. *
  10451. * _.some([null, 0, 'yes', false], Boolean);
  10452. * // => true
  10453. *
  10454. * var users = [
  10455. * { 'user': 'barney', 'active': true },
  10456. * { 'user': 'fred', 'active': false }
  10457. * ];
  10458. *
  10459. * // The `_.matches` iteratee shorthand.
  10460. * _.some(users, { 'user': 'barney', 'active': false });
  10461. * // => false
  10462. *
  10463. * // The `_.matchesProperty` iteratee shorthand.
  10464. * _.some(users, ['active', false]);
  10465. * // => true
  10466. *
  10467. * // The `_.property` iteratee shorthand.
  10468. * _.some(users, 'active');
  10469. * // => true
  10470. */
  10471. function some(collection, predicate, guard) {
  10472. var func = isArray(collection) ? arraySome : baseSome;
  10473. if (guard && isIterateeCall(collection, predicate, guard)) {
  10474. predicate = undefined;
  10475. }
  10476. return func(collection, getIteratee(predicate, 3));
  10477. }
  10478. /**
  10479. * Creates an array of elements, sorted in ascending order by the results of
  10480. * running each element in a collection thru each iteratee. This method
  10481. * performs a stable sort, that is, it preserves the original sort order of
  10482. * equal elements. The iteratees are invoked with one argument: (value).
  10483. *
  10484. * @static
  10485. * @memberOf _
  10486. * @since 0.1.0
  10487. * @category Collection
  10488. * @param {Array|Object} collection The collection to iterate over.
  10489. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10490. * The iteratees to sort by.
  10491. * @returns {Array} Returns the new sorted array.
  10492. * @example
  10493. *
  10494. * var users = [
  10495. * { 'user': 'fred', 'age': 48 },
  10496. * { 'user': 'barney', 'age': 36 },
  10497. * { 'user': 'fred', 'age': 30 },
  10498. * { 'user': 'barney', 'age': 34 }
  10499. * ];
  10500. *
  10501. * _.sortBy(users, [function(o) { return o.user; }]);
  10502. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10503. *
  10504. * _.sortBy(users, ['user', 'age']);
  10505. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10506. */
  10507. var sortBy = baseRest(function(collection, iteratees) {
  10508. if (collection == null) {
  10509. return [];
  10510. }
  10511. var length = iteratees.length;
  10512. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10513. iteratees = [];
  10514. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10515. iteratees = [iteratees[0]];
  10516. }
  10517. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10518. });
  10519. /*------------------------------------------------------------------------*/
  10520. /**
  10521. * Gets the timestamp of the number of milliseconds that have elapsed since
  10522. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10523. *
  10524. * @static
  10525. * @memberOf _
  10526. * @since 2.4.0
  10527. * @category Date
  10528. * @returns {number} Returns the timestamp.
  10529. * @example
  10530. *
  10531. * _.defer(function(stamp) {
  10532. * console.log(_.now() - stamp);
  10533. * }, _.now());
  10534. * // => Logs the number of milliseconds it took for the deferred invocation.
  10535. */
  10536. var now = ctxNow || function() {
  10537. return root.Date.now();
  10538. };
  10539. /*------------------------------------------------------------------------*/
  10540. /**
  10541. * The opposite of `_.before`; this method creates a function that invokes
  10542. * `func` once it's called `n` or more times.
  10543. *
  10544. * @static
  10545. * @memberOf _
  10546. * @since 0.1.0
  10547. * @category Function
  10548. * @param {number} n The number of calls before `func` is invoked.
  10549. * @param {Function} func The function to restrict.
  10550. * @returns {Function} Returns the new restricted function.
  10551. * @example
  10552. *
  10553. * var saves = ['profile', 'settings'];
  10554. *
  10555. * var done = _.after(saves.length, function() {
  10556. * console.log('done saving!');
  10557. * });
  10558. *
  10559. * _.forEach(saves, function(type) {
  10560. * asyncSave({ 'type': type, 'complete': done });
  10561. * });
  10562. * // => Logs 'done saving!' after the two async saves have completed.
  10563. */
  10564. function after(n, func) {
  10565. if (typeof func != 'function') {
  10566. throw new TypeError(FUNC_ERROR_TEXT);
  10567. }
  10568. n = toInteger(n);
  10569. return function() {
  10570. if (--n < 1) {
  10571. return func.apply(this, arguments);
  10572. }
  10573. };
  10574. }
  10575. /**
  10576. * Creates a function that invokes `func`, with up to `n` arguments,
  10577. * ignoring any additional arguments.
  10578. *
  10579. * @static
  10580. * @memberOf _
  10581. * @since 3.0.0
  10582. * @category Function
  10583. * @param {Function} func The function to cap arguments for.
  10584. * @param {number} [n=func.length] The arity cap.
  10585. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10586. * @returns {Function} Returns the new capped function.
  10587. * @example
  10588. *
  10589. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10590. * // => [6, 8, 10]
  10591. */
  10592. function ary(func, n, guard) {
  10593. n = guard ? undefined : n;
  10594. n = (func && n == null) ? func.length : n;
  10595. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10596. }
  10597. /**
  10598. * Creates a function that invokes `func`, with the `this` binding and arguments
  10599. * of the created function, while it's called less than `n` times. Subsequent
  10600. * calls to the created function return the result of the last `func` invocation.
  10601. *
  10602. * @static
  10603. * @memberOf _
  10604. * @since 3.0.0
  10605. * @category Function
  10606. * @param {number} n The number of calls at which `func` is no longer invoked.
  10607. * @param {Function} func The function to restrict.
  10608. * @returns {Function} Returns the new restricted function.
  10609. * @example
  10610. *
  10611. * jQuery(element).on('click', _.before(5, addContactToList));
  10612. * // => Allows adding up to 4 contacts to the list.
  10613. */
  10614. function before(n, func) {
  10615. var result;
  10616. if (typeof func != 'function') {
  10617. throw new TypeError(FUNC_ERROR_TEXT);
  10618. }
  10619. n = toInteger(n);
  10620. return function() {
  10621. if (--n > 0) {
  10622. result = func.apply(this, arguments);
  10623. }
  10624. if (n <= 1) {
  10625. func = undefined;
  10626. }
  10627. return result;
  10628. };
  10629. }
  10630. /**
  10631. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10632. * and `partials` prepended to the arguments it receives.
  10633. *
  10634. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10635. * may be used as a placeholder for partially applied arguments.
  10636. *
  10637. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10638. * property of bound functions.
  10639. *
  10640. * @static
  10641. * @memberOf _
  10642. * @since 0.1.0
  10643. * @category Function
  10644. * @param {Function} func The function to bind.
  10645. * @param {*} thisArg The `this` binding of `func`.
  10646. * @param {...*} [partials] The arguments to be partially applied.
  10647. * @returns {Function} Returns the new bound function.
  10648. * @example
  10649. *
  10650. * function greet(greeting, punctuation) {
  10651. * return greeting + ' ' + this.user + punctuation;
  10652. * }
  10653. *
  10654. * var object = { 'user': 'fred' };
  10655. *
  10656. * var bound = _.bind(greet, object, 'hi');
  10657. * bound('!');
  10658. * // => 'hi fred!'
  10659. *
  10660. * // Bound with placeholders.
  10661. * var bound = _.bind(greet, object, _, '!');
  10662. * bound('hi');
  10663. * // => 'hi fred!'
  10664. */
  10665. var bind = baseRest(function(func, thisArg, partials) {
  10666. var bitmask = WRAP_BIND_FLAG;
  10667. if (partials.length) {
  10668. var holders = replaceHolders(partials, getHolder(bind));
  10669. bitmask |= WRAP_PARTIAL_FLAG;
  10670. }
  10671. return createWrap(func, bitmask, thisArg, partials, holders);
  10672. });
  10673. /**
  10674. * Creates a function that invokes the method at `object[key]` with `partials`
  10675. * prepended to the arguments it receives.
  10676. *
  10677. * This method differs from `_.bind` by allowing bound functions to reference
  10678. * methods that may be redefined or don't yet exist. See
  10679. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10680. * for more details.
  10681. *
  10682. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10683. * builds, may be used as a placeholder for partially applied arguments.
  10684. *
  10685. * @static
  10686. * @memberOf _
  10687. * @since 0.10.0
  10688. * @category Function
  10689. * @param {Object} object The object to invoke the method on.
  10690. * @param {string} key The key of the method.
  10691. * @param {...*} [partials] The arguments to be partially applied.
  10692. * @returns {Function} Returns the new bound function.
  10693. * @example
  10694. *
  10695. * var object = {
  10696. * 'user': 'fred',
  10697. * 'greet': function(greeting, punctuation) {
  10698. * return greeting + ' ' + this.user + punctuation;
  10699. * }
  10700. * };
  10701. *
  10702. * var bound = _.bindKey(object, 'greet', 'hi');
  10703. * bound('!');
  10704. * // => 'hi fred!'
  10705. *
  10706. * object.greet = function(greeting, punctuation) {
  10707. * return greeting + 'ya ' + this.user + punctuation;
  10708. * };
  10709. *
  10710. * bound('!');
  10711. * // => 'hiya fred!'
  10712. *
  10713. * // Bound with placeholders.
  10714. * var bound = _.bindKey(object, 'greet', _, '!');
  10715. * bound('hi');
  10716. * // => 'hiya fred!'
  10717. */
  10718. var bindKey = baseRest(function(object, key, partials) {
  10719. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10720. if (partials.length) {
  10721. var holders = replaceHolders(partials, getHolder(bindKey));
  10722. bitmask |= WRAP_PARTIAL_FLAG;
  10723. }
  10724. return createWrap(key, bitmask, object, partials, holders);
  10725. });
  10726. /**
  10727. * Creates a function that accepts arguments of `func` and either invokes
  10728. * `func` returning its result, if at least `arity` number of arguments have
  10729. * been provided, or returns a function that accepts the remaining `func`
  10730. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10731. * is not sufficient.
  10732. *
  10733. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10734. * may be used as a placeholder for provided arguments.
  10735. *
  10736. * **Note:** This method doesn't set the "length" property of curried functions.
  10737. *
  10738. * @static
  10739. * @memberOf _
  10740. * @since 2.0.0
  10741. * @category Function
  10742. * @param {Function} func The function to curry.
  10743. * @param {number} [arity=func.length] The arity of `func`.
  10744. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10745. * @returns {Function} Returns the new curried function.
  10746. * @example
  10747. *
  10748. * var abc = function(a, b, c) {
  10749. * return [a, b, c];
  10750. * };
  10751. *
  10752. * var curried = _.curry(abc);
  10753. *
  10754. * curried(1)(2)(3);
  10755. * // => [1, 2, 3]
  10756. *
  10757. * curried(1, 2)(3);
  10758. * // => [1, 2, 3]
  10759. *
  10760. * curried(1, 2, 3);
  10761. * // => [1, 2, 3]
  10762. *
  10763. * // Curried with placeholders.
  10764. * curried(1)(_, 3)(2);
  10765. * // => [1, 2, 3]
  10766. */
  10767. function curry(func, arity, guard) {
  10768. arity = guard ? undefined : arity;
  10769. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10770. result.placeholder = curry.placeholder;
  10771. return result;
  10772. }
  10773. /**
  10774. * This method is like `_.curry` except that arguments are applied to `func`
  10775. * in the manner of `_.partialRight` instead of `_.partial`.
  10776. *
  10777. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10778. * builds, may be used as a placeholder for provided arguments.
  10779. *
  10780. * **Note:** This method doesn't set the "length" property of curried functions.
  10781. *
  10782. * @static
  10783. * @memberOf _
  10784. * @since 3.0.0
  10785. * @category Function
  10786. * @param {Function} func The function to curry.
  10787. * @param {number} [arity=func.length] The arity of `func`.
  10788. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10789. * @returns {Function} Returns the new curried function.
  10790. * @example
  10791. *
  10792. * var abc = function(a, b, c) {
  10793. * return [a, b, c];
  10794. * };
  10795. *
  10796. * var curried = _.curryRight(abc);
  10797. *
  10798. * curried(3)(2)(1);
  10799. * // => [1, 2, 3]
  10800. *
  10801. * curried(2, 3)(1);
  10802. * // => [1, 2, 3]
  10803. *
  10804. * curried(1, 2, 3);
  10805. * // => [1, 2, 3]
  10806. *
  10807. * // Curried with placeholders.
  10808. * curried(3)(1, _)(2);
  10809. * // => [1, 2, 3]
  10810. */
  10811. function curryRight(func, arity, guard) {
  10812. arity = guard ? undefined : arity;
  10813. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10814. result.placeholder = curryRight.placeholder;
  10815. return result;
  10816. }
  10817. /**
  10818. * Creates a debounced function that delays invoking `func` until after `wait`
  10819. * milliseconds have elapsed since the last time the debounced function was
  10820. * invoked. The debounced function comes with a `cancel` method to cancel
  10821. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10822. * Provide `options` to indicate whether `func` should be invoked on the
  10823. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10824. * with the last arguments provided to the debounced function. Subsequent
  10825. * calls to the debounced function return the result of the last `func`
  10826. * invocation.
  10827. *
  10828. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10829. * invoked on the trailing edge of the timeout only if the debounced function
  10830. * is invoked more than once during the `wait` timeout.
  10831. *
  10832. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10833. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10834. *
  10835. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10836. * for details over the differences between `_.debounce` and `_.throttle`.
  10837. *
  10838. * @static
  10839. * @memberOf _
  10840. * @since 0.1.0
  10841. * @category Function
  10842. * @param {Function} func The function to debounce.
  10843. * @param {number} [wait=0] The number of milliseconds to delay.
  10844. * @param {Object} [options={}] The options object.
  10845. * @param {boolean} [options.leading=false]
  10846. * Specify invoking on the leading edge of the timeout.
  10847. * @param {number} [options.maxWait]
  10848. * The maximum time `func` is allowed to be delayed before it's invoked.
  10849. * @param {boolean} [options.trailing=true]
  10850. * Specify invoking on the trailing edge of the timeout.
  10851. * @returns {Function} Returns the new debounced function.
  10852. * @example
  10853. *
  10854. * // Avoid costly calculations while the window size is in flux.
  10855. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10856. *
  10857. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10858. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10859. * 'leading': true,
  10860. * 'trailing': false
  10861. * }));
  10862. *
  10863. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10864. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10865. * var source = new EventSource('/stream');
  10866. * jQuery(source).on('message', debounced);
  10867. *
  10868. * // Cancel the trailing debounced invocation.
  10869. * jQuery(window).on('popstate', debounced.cancel);
  10870. */
  10871. function debounce(func, wait, options) {
  10872. var lastArgs,
  10873. lastThis,
  10874. maxWait,
  10875. result,
  10876. timerId,
  10877. lastCallTime,
  10878. lastInvokeTime = 0,
  10879. leading = false,
  10880. maxing = false,
  10881. trailing = true;
  10882. if (typeof func != 'function') {
  10883. throw new TypeError(FUNC_ERROR_TEXT);
  10884. }
  10885. wait = toNumber(wait) || 0;
  10886. if (isObject(options)) {
  10887. leading = !!options.leading;
  10888. maxing = 'maxWait' in options;
  10889. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10890. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10891. }
  10892. function invokeFunc(time) {
  10893. var args = lastArgs,
  10894. thisArg = lastThis;
  10895. lastArgs = lastThis = undefined;
  10896. lastInvokeTime = time;
  10897. result = func.apply(thisArg, args);
  10898. return result;
  10899. }
  10900. function leadingEdge(time) {
  10901. // Reset any `maxWait` timer.
  10902. lastInvokeTime = time;
  10903. // Start the timer for the trailing edge.
  10904. timerId = setTimeout(timerExpired, wait);
  10905. // Invoke the leading edge.
  10906. return leading ? invokeFunc(time) : result;
  10907. }
  10908. function remainingWait(time) {
  10909. var timeSinceLastCall = time - lastCallTime,
  10910. timeSinceLastInvoke = time - lastInvokeTime,
  10911. timeWaiting = wait - timeSinceLastCall;
  10912. return maxing
  10913. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10914. : timeWaiting;
  10915. }
  10916. function shouldInvoke(time) {
  10917. var timeSinceLastCall = time - lastCallTime,
  10918. timeSinceLastInvoke = time - lastInvokeTime;
  10919. // Either this is the first call, activity has stopped and we're at the
  10920. // trailing edge, the system time has gone backwards and we're treating
  10921. // it as the trailing edge, or we've hit the `maxWait` limit.
  10922. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10923. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10924. }
  10925. function timerExpired() {
  10926. var time = now();
  10927. if (shouldInvoke(time)) {
  10928. return trailingEdge(time);
  10929. }
  10930. // Restart the timer.
  10931. timerId = setTimeout(timerExpired, remainingWait(time));
  10932. }
  10933. function trailingEdge(time) {
  10934. timerId = undefined;
  10935. // Only invoke if we have `lastArgs` which means `func` has been
  10936. // debounced at least once.
  10937. if (trailing && lastArgs) {
  10938. return invokeFunc(time);
  10939. }
  10940. lastArgs = lastThis = undefined;
  10941. return result;
  10942. }
  10943. function cancel() {
  10944. if (timerId !== undefined) {
  10945. clearTimeout(timerId);
  10946. }
  10947. lastInvokeTime = 0;
  10948. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10949. }
  10950. function flush() {
  10951. return timerId === undefined ? result : trailingEdge(now());
  10952. }
  10953. function debounced() {
  10954. var time = now(),
  10955. isInvoking = shouldInvoke(time);
  10956. lastArgs = arguments;
  10957. lastThis = this;
  10958. lastCallTime = time;
  10959. if (isInvoking) {
  10960. if (timerId === undefined) {
  10961. return leadingEdge(lastCallTime);
  10962. }
  10963. if (maxing) {
  10964. // Handle invocations in a tight loop.
  10965. clearTimeout(timerId);
  10966. timerId = setTimeout(timerExpired, wait);
  10967. return invokeFunc(lastCallTime);
  10968. }
  10969. }
  10970. if (timerId === undefined) {
  10971. timerId = setTimeout(timerExpired, wait);
  10972. }
  10973. return result;
  10974. }
  10975. debounced.cancel = cancel;
  10976. debounced.flush = flush;
  10977. return debounced;
  10978. }
  10979. /**
  10980. * Defers invoking the `func` until the current call stack has cleared. Any
  10981. * additional arguments are provided to `func` when it's invoked.
  10982. *
  10983. * @static
  10984. * @memberOf _
  10985. * @since 0.1.0
  10986. * @category Function
  10987. * @param {Function} func The function to defer.
  10988. * @param {...*} [args] The arguments to invoke `func` with.
  10989. * @returns {number} Returns the timer id.
  10990. * @example
  10991. *
  10992. * _.defer(function(text) {
  10993. * console.log(text);
  10994. * }, 'deferred');
  10995. * // => Logs 'deferred' after one millisecond.
  10996. */
  10997. var defer = baseRest(function(func, args) {
  10998. return baseDelay(func, 1, args);
  10999. });
  11000. /**
  11001. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11002. * provided to `func` when it's invoked.
  11003. *
  11004. * @static
  11005. * @memberOf _
  11006. * @since 0.1.0
  11007. * @category Function
  11008. * @param {Function} func The function to delay.
  11009. * @param {number} wait The number of milliseconds to delay invocation.
  11010. * @param {...*} [args] The arguments to invoke `func` with.
  11011. * @returns {number} Returns the timer id.
  11012. * @example
  11013. *
  11014. * _.delay(function(text) {
  11015. * console.log(text);
  11016. * }, 1000, 'later');
  11017. * // => Logs 'later' after one second.
  11018. */
  11019. var delay = baseRest(function(func, wait, args) {
  11020. return baseDelay(func, toNumber(wait) || 0, args);
  11021. });
  11022. /**
  11023. * Creates a function that invokes `func` with arguments reversed.
  11024. *
  11025. * @static
  11026. * @memberOf _
  11027. * @since 4.0.0
  11028. * @category Function
  11029. * @param {Function} func The function to flip arguments for.
  11030. * @returns {Function} Returns the new flipped function.
  11031. * @example
  11032. *
  11033. * var flipped = _.flip(function() {
  11034. * return _.toArray(arguments);
  11035. * });
  11036. *
  11037. * flipped('a', 'b', 'c', 'd');
  11038. * // => ['d', 'c', 'b', 'a']
  11039. */
  11040. function flip(func) {
  11041. return createWrap(func, WRAP_FLIP_FLAG);
  11042. }
  11043. /**
  11044. * Creates a function that memoizes the result of `func`. If `resolver` is
  11045. * provided, it determines the cache key for storing the result based on the
  11046. * arguments provided to the memoized function. By default, the first argument
  11047. * provided to the memoized function is used as the map cache key. The `func`
  11048. * is invoked with the `this` binding of the memoized function.
  11049. *
  11050. * **Note:** The cache is exposed as the `cache` property on the memoized
  11051. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11052. * constructor with one whose instances implement the
  11053. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11054. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11055. *
  11056. * @static
  11057. * @memberOf _
  11058. * @since 0.1.0
  11059. * @category Function
  11060. * @param {Function} func The function to have its output memoized.
  11061. * @param {Function} [resolver] The function to resolve the cache key.
  11062. * @returns {Function} Returns the new memoized function.
  11063. * @example
  11064. *
  11065. * var object = { 'a': 1, 'b': 2 };
  11066. * var other = { 'c': 3, 'd': 4 };
  11067. *
  11068. * var values = _.memoize(_.values);
  11069. * values(object);
  11070. * // => [1, 2]
  11071. *
  11072. * values(other);
  11073. * // => [3, 4]
  11074. *
  11075. * object.a = 2;
  11076. * values(object);
  11077. * // => [1, 2]
  11078. *
  11079. * // Modify the result cache.
  11080. * values.cache.set(object, ['a', 'b']);
  11081. * values(object);
  11082. * // => ['a', 'b']
  11083. *
  11084. * // Replace `_.memoize.Cache`.
  11085. * _.memoize.Cache = WeakMap;
  11086. */
  11087. function memoize(func, resolver) {
  11088. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11089. throw new TypeError(FUNC_ERROR_TEXT);
  11090. }
  11091. var memoized = function() {
  11092. var args = arguments,
  11093. key = resolver ? resolver.apply(this, args) : args[0],
  11094. cache = memoized.cache;
  11095. if (cache.has(key)) {
  11096. return cache.get(key);
  11097. }
  11098. var result = func.apply(this, args);
  11099. memoized.cache = cache.set(key, result) || cache;
  11100. return result;
  11101. };
  11102. memoized.cache = new (memoize.Cache || MapCache);
  11103. return memoized;
  11104. }
  11105. // Expose `MapCache`.
  11106. memoize.Cache = MapCache;
  11107. /**
  11108. * Creates a function that negates the result of the predicate `func`. The
  11109. * `func` predicate is invoked with the `this` binding and arguments of the
  11110. * created function.
  11111. *
  11112. * @static
  11113. * @memberOf _
  11114. * @since 3.0.0
  11115. * @category Function
  11116. * @param {Function} predicate The predicate to negate.
  11117. * @returns {Function} Returns the new negated function.
  11118. * @example
  11119. *
  11120. * function isEven(n) {
  11121. * return n % 2 == 0;
  11122. * }
  11123. *
  11124. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11125. * // => [1, 3, 5]
  11126. */
  11127. function negate(predicate) {
  11128. if (typeof predicate != 'function') {
  11129. throw new TypeError(FUNC_ERROR_TEXT);
  11130. }
  11131. return function() {
  11132. var args = arguments;
  11133. switch (args.length) {
  11134. case 0: return !predicate.call(this);
  11135. case 1: return !predicate.call(this, args[0]);
  11136. case 2: return !predicate.call(this, args[0], args[1]);
  11137. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11138. }
  11139. return !predicate.apply(this, args);
  11140. };
  11141. }
  11142. /**
  11143. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11144. * to the function return the value of the first invocation. The `func` is
  11145. * invoked with the `this` binding and arguments of the created function.
  11146. *
  11147. * @static
  11148. * @memberOf _
  11149. * @since 0.1.0
  11150. * @category Function
  11151. * @param {Function} func The function to restrict.
  11152. * @returns {Function} Returns the new restricted function.
  11153. * @example
  11154. *
  11155. * var initialize = _.once(createApplication);
  11156. * initialize();
  11157. * initialize();
  11158. * // => `createApplication` is invoked once
  11159. */
  11160. function once(func) {
  11161. return before(2, func);
  11162. }
  11163. /**
  11164. * Creates a function that invokes `func` with its arguments transformed.
  11165. *
  11166. * @static
  11167. * @since 4.0.0
  11168. * @memberOf _
  11169. * @category Function
  11170. * @param {Function} func The function to wrap.
  11171. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11172. * The argument transforms.
  11173. * @returns {Function} Returns the new function.
  11174. * @example
  11175. *
  11176. * function doubled(n) {
  11177. * return n * 2;
  11178. * }
  11179. *
  11180. * function square(n) {
  11181. * return n * n;
  11182. * }
  11183. *
  11184. * var func = _.overArgs(function(x, y) {
  11185. * return [x, y];
  11186. * }, [square, doubled]);
  11187. *
  11188. * func(9, 3);
  11189. * // => [81, 6]
  11190. *
  11191. * func(10, 5);
  11192. * // => [100, 10]
  11193. */
  11194. var overArgs = castRest(function(func, transforms) {
  11195. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11196. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11197. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11198. var funcsLength = transforms.length;
  11199. return baseRest(function(args) {
  11200. var index = -1,
  11201. length = nativeMin(args.length, funcsLength);
  11202. while (++index < length) {
  11203. args[index] = transforms[index].call(this, args[index]);
  11204. }
  11205. return apply(func, this, args);
  11206. });
  11207. });
  11208. /**
  11209. * Creates a function that invokes `func` with `partials` prepended to the
  11210. * arguments it receives. This method is like `_.bind` except it does **not**
  11211. * alter the `this` binding.
  11212. *
  11213. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11214. * builds, may be used as a placeholder for partially applied arguments.
  11215. *
  11216. * **Note:** This method doesn't set the "length" property of partially
  11217. * applied functions.
  11218. *
  11219. * @static
  11220. * @memberOf _
  11221. * @since 0.2.0
  11222. * @category Function
  11223. * @param {Function} func The function to partially apply arguments to.
  11224. * @param {...*} [partials] The arguments to be partially applied.
  11225. * @returns {Function} Returns the new partially applied function.
  11226. * @example
  11227. *
  11228. * function greet(greeting, name) {
  11229. * return greeting + ' ' + name;
  11230. * }
  11231. *
  11232. * var sayHelloTo = _.partial(greet, 'hello');
  11233. * sayHelloTo('fred');
  11234. * // => 'hello fred'
  11235. *
  11236. * // Partially applied with placeholders.
  11237. * var greetFred = _.partial(greet, _, 'fred');
  11238. * greetFred('hi');
  11239. * // => 'hi fred'
  11240. */
  11241. var partial = baseRest(function(func, partials) {
  11242. var holders = replaceHolders(partials, getHolder(partial));
  11243. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11244. });
  11245. /**
  11246. * This method is like `_.partial` except that partially applied arguments
  11247. * are appended to the arguments it receives.
  11248. *
  11249. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11250. * builds, may be used as a placeholder for partially applied arguments.
  11251. *
  11252. * **Note:** This method doesn't set the "length" property of partially
  11253. * applied functions.
  11254. *
  11255. * @static
  11256. * @memberOf _
  11257. * @since 1.0.0
  11258. * @category Function
  11259. * @param {Function} func The function to partially apply arguments to.
  11260. * @param {...*} [partials] The arguments to be partially applied.
  11261. * @returns {Function} Returns the new partially applied function.
  11262. * @example
  11263. *
  11264. * function greet(greeting, name) {
  11265. * return greeting + ' ' + name;
  11266. * }
  11267. *
  11268. * var greetFred = _.partialRight(greet, 'fred');
  11269. * greetFred('hi');
  11270. * // => 'hi fred'
  11271. *
  11272. * // Partially applied with placeholders.
  11273. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11274. * sayHelloTo('fred');
  11275. * // => 'hello fred'
  11276. */
  11277. var partialRight = baseRest(function(func, partials) {
  11278. var holders = replaceHolders(partials, getHolder(partialRight));
  11279. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11280. });
  11281. /**
  11282. * Creates a function that invokes `func` with arguments arranged according
  11283. * to the specified `indexes` where the argument value at the first index is
  11284. * provided as the first argument, the argument value at the second index is
  11285. * provided as the second argument, and so on.
  11286. *
  11287. * @static
  11288. * @memberOf _
  11289. * @since 3.0.0
  11290. * @category Function
  11291. * @param {Function} func The function to rearrange arguments for.
  11292. * @param {...(number|number[])} indexes The arranged argument indexes.
  11293. * @returns {Function} Returns the new function.
  11294. * @example
  11295. *
  11296. * var rearged = _.rearg(function(a, b, c) {
  11297. * return [a, b, c];
  11298. * }, [2, 0, 1]);
  11299. *
  11300. * rearged('b', 'c', 'a')
  11301. * // => ['a', 'b', 'c']
  11302. */
  11303. var rearg = flatRest(function(func, indexes) {
  11304. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11305. });
  11306. /**
  11307. * Creates a function that invokes `func` with the `this` binding of the
  11308. * created function and arguments from `start` and beyond provided as
  11309. * an array.
  11310. *
  11311. * **Note:** This method is based on the
  11312. * [rest parameter](https://mdn.io/rest_parameters).
  11313. *
  11314. * @static
  11315. * @memberOf _
  11316. * @since 4.0.0
  11317. * @category Function
  11318. * @param {Function} func The function to apply a rest parameter to.
  11319. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11320. * @returns {Function} Returns the new function.
  11321. * @example
  11322. *
  11323. * var say = _.rest(function(what, names) {
  11324. * return what + ' ' + _.initial(names).join(', ') +
  11325. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11326. * });
  11327. *
  11328. * say('hello', 'fred', 'barney', 'pebbles');
  11329. * // => 'hello fred, barney, & pebbles'
  11330. */
  11331. function rest(func, start) {
  11332. if (typeof func != 'function') {
  11333. throw new TypeError(FUNC_ERROR_TEXT);
  11334. }
  11335. start = start === undefined ? start : toInteger(start);
  11336. return baseRest(func, start);
  11337. }
  11338. /**
  11339. * Creates a function that invokes `func` with the `this` binding of the
  11340. * create function and an array of arguments much like
  11341. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11342. *
  11343. * **Note:** This method is based on the
  11344. * [spread operator](https://mdn.io/spread_operator).
  11345. *
  11346. * @static
  11347. * @memberOf _
  11348. * @since 3.2.0
  11349. * @category Function
  11350. * @param {Function} func The function to spread arguments over.
  11351. * @param {number} [start=0] The start position of the spread.
  11352. * @returns {Function} Returns the new function.
  11353. * @example
  11354. *
  11355. * var say = _.spread(function(who, what) {
  11356. * return who + ' says ' + what;
  11357. * });
  11358. *
  11359. * say(['fred', 'hello']);
  11360. * // => 'fred says hello'
  11361. *
  11362. * var numbers = Promise.all([
  11363. * Promise.resolve(40),
  11364. * Promise.resolve(36)
  11365. * ]);
  11366. *
  11367. * numbers.then(_.spread(function(x, y) {
  11368. * return x + y;
  11369. * }));
  11370. * // => a Promise of 76
  11371. */
  11372. function spread(func, start) {
  11373. if (typeof func != 'function') {
  11374. throw new TypeError(FUNC_ERROR_TEXT);
  11375. }
  11376. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11377. return baseRest(function(args) {
  11378. var array = args[start],
  11379. otherArgs = castSlice(args, 0, start);
  11380. if (array) {
  11381. arrayPush(otherArgs, array);
  11382. }
  11383. return apply(func, this, otherArgs);
  11384. });
  11385. }
  11386. /**
  11387. * Creates a throttled function that only invokes `func` at most once per
  11388. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11389. * method to cancel delayed `func` invocations and a `flush` method to
  11390. * immediately invoke them. Provide `options` to indicate whether `func`
  11391. * should be invoked on the leading and/or trailing edge of the `wait`
  11392. * timeout. The `func` is invoked with the last arguments provided to the
  11393. * throttled function. Subsequent calls to the throttled function return the
  11394. * result of the last `func` invocation.
  11395. *
  11396. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11397. * invoked on the trailing edge of the timeout only if the throttled function
  11398. * is invoked more than once during the `wait` timeout.
  11399. *
  11400. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11401. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11402. *
  11403. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11404. * for details over the differences between `_.throttle` and `_.debounce`.
  11405. *
  11406. * @static
  11407. * @memberOf _
  11408. * @since 0.1.0
  11409. * @category Function
  11410. * @param {Function} func The function to throttle.
  11411. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11412. * @param {Object} [options={}] The options object.
  11413. * @param {boolean} [options.leading=true]
  11414. * Specify invoking on the leading edge of the timeout.
  11415. * @param {boolean} [options.trailing=true]
  11416. * Specify invoking on the trailing edge of the timeout.
  11417. * @returns {Function} Returns the new throttled function.
  11418. * @example
  11419. *
  11420. * // Avoid excessively updating the position while scrolling.
  11421. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11422. *
  11423. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11424. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11425. * jQuery(element).on('click', throttled);
  11426. *
  11427. * // Cancel the trailing throttled invocation.
  11428. * jQuery(window).on('popstate', throttled.cancel);
  11429. */
  11430. function throttle(func, wait, options) {
  11431. var leading = true,
  11432. trailing = true;
  11433. if (typeof func != 'function') {
  11434. throw new TypeError(FUNC_ERROR_TEXT);
  11435. }
  11436. if (isObject(options)) {
  11437. leading = 'leading' in options ? !!options.leading : leading;
  11438. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11439. }
  11440. return debounce(func, wait, {
  11441. 'leading': leading,
  11442. 'maxWait': wait,
  11443. 'trailing': trailing
  11444. });
  11445. }
  11446. /**
  11447. * Creates a function that accepts up to one argument, ignoring any
  11448. * additional arguments.
  11449. *
  11450. * @static
  11451. * @memberOf _
  11452. * @since 4.0.0
  11453. * @category Function
  11454. * @param {Function} func The function to cap arguments for.
  11455. * @returns {Function} Returns the new capped function.
  11456. * @example
  11457. *
  11458. * _.map(['6', '8', '10'], _.unary(parseInt));
  11459. * // => [6, 8, 10]
  11460. */
  11461. function unary(func) {
  11462. return ary(func, 1);
  11463. }
  11464. /**
  11465. * Creates a function that provides `value` to `wrapper` as its first
  11466. * argument. Any additional arguments provided to the function are appended
  11467. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11468. * binding of the created function.
  11469. *
  11470. * @static
  11471. * @memberOf _
  11472. * @since 0.1.0
  11473. * @category Function
  11474. * @param {*} value The value to wrap.
  11475. * @param {Function} [wrapper=identity] The wrapper function.
  11476. * @returns {Function} Returns the new function.
  11477. * @example
  11478. *
  11479. * var p = _.wrap(_.escape, function(func, text) {
  11480. * return '<p>' + func(text) + '</p>';
  11481. * });
  11482. *
  11483. * p('fred, barney, & pebbles');
  11484. * // => '<p>fred, barney, &amp; pebbles</p>'
  11485. */
  11486. function wrap(value, wrapper) {
  11487. return partial(castFunction(wrapper), value);
  11488. }
  11489. /*------------------------------------------------------------------------*/
  11490. /**
  11491. * Casts `value` as an array if it's not one.
  11492. *
  11493. * @static
  11494. * @memberOf _
  11495. * @since 4.4.0
  11496. * @category Lang
  11497. * @param {*} value The value to inspect.
  11498. * @returns {Array} Returns the cast array.
  11499. * @example
  11500. *
  11501. * _.castArray(1);
  11502. * // => [1]
  11503. *
  11504. * _.castArray({ 'a': 1 });
  11505. * // => [{ 'a': 1 }]
  11506. *
  11507. * _.castArray('abc');
  11508. * // => ['abc']
  11509. *
  11510. * _.castArray(null);
  11511. * // => [null]
  11512. *
  11513. * _.castArray(undefined);
  11514. * // => [undefined]
  11515. *
  11516. * _.castArray();
  11517. * // => []
  11518. *
  11519. * var array = [1, 2, 3];
  11520. * console.log(_.castArray(array) === array);
  11521. * // => true
  11522. */
  11523. function castArray() {
  11524. if (!arguments.length) {
  11525. return [];
  11526. }
  11527. var value = arguments[0];
  11528. return isArray(value) ? value : [value];
  11529. }
  11530. /**
  11531. * Creates a shallow clone of `value`.
  11532. *
  11533. * **Note:** This method is loosely based on the
  11534. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11535. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11536. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11537. * arrays. The own enumerable properties of `arguments` objects are cloned
  11538. * as plain objects. An empty object is returned for uncloneable values such
  11539. * as error objects, functions, DOM nodes, and WeakMaps.
  11540. *
  11541. * @static
  11542. * @memberOf _
  11543. * @since 0.1.0
  11544. * @category Lang
  11545. * @param {*} value The value to clone.
  11546. * @returns {*} Returns the cloned value.
  11547. * @see _.cloneDeep
  11548. * @example
  11549. *
  11550. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11551. *
  11552. * var shallow = _.clone(objects);
  11553. * console.log(shallow[0] === objects[0]);
  11554. * // => true
  11555. */
  11556. function clone(value) {
  11557. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11558. }
  11559. /**
  11560. * This method is like `_.clone` except that it accepts `customizer` which
  11561. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11562. * cloning is handled by the method instead. The `customizer` is invoked with
  11563. * up to four arguments; (value [, index|key, object, stack]).
  11564. *
  11565. * @static
  11566. * @memberOf _
  11567. * @since 4.0.0
  11568. * @category Lang
  11569. * @param {*} value The value to clone.
  11570. * @param {Function} [customizer] The function to customize cloning.
  11571. * @returns {*} Returns the cloned value.
  11572. * @see _.cloneDeepWith
  11573. * @example
  11574. *
  11575. * function customizer(value) {
  11576. * if (_.isElement(value)) {
  11577. * return value.cloneNode(false);
  11578. * }
  11579. * }
  11580. *
  11581. * var el = _.cloneWith(document.body, customizer);
  11582. *
  11583. * console.log(el === document.body);
  11584. * // => false
  11585. * console.log(el.nodeName);
  11586. * // => 'BODY'
  11587. * console.log(el.childNodes.length);
  11588. * // => 0
  11589. */
  11590. function cloneWith(value, customizer) {
  11591. customizer = typeof customizer == 'function' ? customizer : undefined;
  11592. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11593. }
  11594. /**
  11595. * This method is like `_.clone` except that it recursively clones `value`.
  11596. *
  11597. * @static
  11598. * @memberOf _
  11599. * @since 1.0.0
  11600. * @category Lang
  11601. * @param {*} value The value to recursively clone.
  11602. * @returns {*} Returns the deep cloned value.
  11603. * @see _.clone
  11604. * @example
  11605. *
  11606. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11607. *
  11608. * var deep = _.cloneDeep(objects);
  11609. * console.log(deep[0] === objects[0]);
  11610. * // => false
  11611. */
  11612. function cloneDeep(value) {
  11613. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11614. }
  11615. /**
  11616. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11617. *
  11618. * @static
  11619. * @memberOf _
  11620. * @since 4.0.0
  11621. * @category Lang
  11622. * @param {*} value The value to recursively clone.
  11623. * @param {Function} [customizer] The function to customize cloning.
  11624. * @returns {*} Returns the deep cloned value.
  11625. * @see _.cloneWith
  11626. * @example
  11627. *
  11628. * function customizer(value) {
  11629. * if (_.isElement(value)) {
  11630. * return value.cloneNode(true);
  11631. * }
  11632. * }
  11633. *
  11634. * var el = _.cloneDeepWith(document.body, customizer);
  11635. *
  11636. * console.log(el === document.body);
  11637. * // => false
  11638. * console.log(el.nodeName);
  11639. * // => 'BODY'
  11640. * console.log(el.childNodes.length);
  11641. * // => 20
  11642. */
  11643. function cloneDeepWith(value, customizer) {
  11644. customizer = typeof customizer == 'function' ? customizer : undefined;
  11645. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11646. }
  11647. /**
  11648. * Checks if `object` conforms to `source` by invoking the predicate
  11649. * properties of `source` with the corresponding property values of `object`.
  11650. *
  11651. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11652. * partially applied.
  11653. *
  11654. * @static
  11655. * @memberOf _
  11656. * @since 4.14.0
  11657. * @category Lang
  11658. * @param {Object} object The object to inspect.
  11659. * @param {Object} source The object of property predicates to conform to.
  11660. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11661. * @example
  11662. *
  11663. * var object = { 'a': 1, 'b': 2 };
  11664. *
  11665. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11666. * // => true
  11667. *
  11668. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11669. * // => false
  11670. */
  11671. function conformsTo(object, source) {
  11672. return source == null || baseConformsTo(object, source, keys(source));
  11673. }
  11674. /**
  11675. * Performs a
  11676. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11677. * comparison between two values to determine if they are equivalent.
  11678. *
  11679. * @static
  11680. * @memberOf _
  11681. * @since 4.0.0
  11682. * @category Lang
  11683. * @param {*} value The value to compare.
  11684. * @param {*} other The other value to compare.
  11685. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11686. * @example
  11687. *
  11688. * var object = { 'a': 1 };
  11689. * var other = { 'a': 1 };
  11690. *
  11691. * _.eq(object, object);
  11692. * // => true
  11693. *
  11694. * _.eq(object, other);
  11695. * // => false
  11696. *
  11697. * _.eq('a', 'a');
  11698. * // => true
  11699. *
  11700. * _.eq('a', Object('a'));
  11701. * // => false
  11702. *
  11703. * _.eq(NaN, NaN);
  11704. * // => true
  11705. */
  11706. function eq(value, other) {
  11707. return value === other || (value !== value && other !== other);
  11708. }
  11709. /**
  11710. * Checks if `value` is greater than `other`.
  11711. *
  11712. * @static
  11713. * @memberOf _
  11714. * @since 3.9.0
  11715. * @category Lang
  11716. * @param {*} value The value to compare.
  11717. * @param {*} other The other value to compare.
  11718. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11719. * else `false`.
  11720. * @see _.lt
  11721. * @example
  11722. *
  11723. * _.gt(3, 1);
  11724. * // => true
  11725. *
  11726. * _.gt(3, 3);
  11727. * // => false
  11728. *
  11729. * _.gt(1, 3);
  11730. * // => false
  11731. */
  11732. var gt = createRelationalOperation(baseGt);
  11733. /**
  11734. * Checks if `value` is greater than or equal to `other`.
  11735. *
  11736. * @static
  11737. * @memberOf _
  11738. * @since 3.9.0
  11739. * @category Lang
  11740. * @param {*} value The value to compare.
  11741. * @param {*} other The other value to compare.
  11742. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11743. * `other`, else `false`.
  11744. * @see _.lte
  11745. * @example
  11746. *
  11747. * _.gte(3, 1);
  11748. * // => true
  11749. *
  11750. * _.gte(3, 3);
  11751. * // => true
  11752. *
  11753. * _.gte(1, 3);
  11754. * // => false
  11755. */
  11756. var gte = createRelationalOperation(function(value, other) {
  11757. return value >= other;
  11758. });
  11759. /**
  11760. * Checks if `value` is likely an `arguments` object.
  11761. *
  11762. * @static
  11763. * @memberOf _
  11764. * @since 0.1.0
  11765. * @category Lang
  11766. * @param {*} value The value to check.
  11767. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11768. * else `false`.
  11769. * @example
  11770. *
  11771. * _.isArguments(function() { return arguments; }());
  11772. * // => true
  11773. *
  11774. * _.isArguments([1, 2, 3]);
  11775. * // => false
  11776. */
  11777. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11778. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11779. !propertyIsEnumerable.call(value, 'callee');
  11780. };
  11781. /**
  11782. * Checks if `value` is classified as an `Array` object.
  11783. *
  11784. * @static
  11785. * @memberOf _
  11786. * @since 0.1.0
  11787. * @category Lang
  11788. * @param {*} value The value to check.
  11789. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11790. * @example
  11791. *
  11792. * _.isArray([1, 2, 3]);
  11793. * // => true
  11794. *
  11795. * _.isArray(document.body.children);
  11796. * // => false
  11797. *
  11798. * _.isArray('abc');
  11799. * // => false
  11800. *
  11801. * _.isArray(_.noop);
  11802. * // => false
  11803. */
  11804. var isArray = Array.isArray;
  11805. /**
  11806. * Checks if `value` is classified as an `ArrayBuffer` object.
  11807. *
  11808. * @static
  11809. * @memberOf _
  11810. * @since 4.3.0
  11811. * @category Lang
  11812. * @param {*} value The value to check.
  11813. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11814. * @example
  11815. *
  11816. * _.isArrayBuffer(new ArrayBuffer(2));
  11817. * // => true
  11818. *
  11819. * _.isArrayBuffer(new Array(2));
  11820. * // => false
  11821. */
  11822. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11823. /**
  11824. * Checks if `value` is array-like. A value is considered array-like if it's
  11825. * not a function and has a `value.length` that's an integer greater than or
  11826. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11827. *
  11828. * @static
  11829. * @memberOf _
  11830. * @since 4.0.0
  11831. * @category Lang
  11832. * @param {*} value The value to check.
  11833. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11834. * @example
  11835. *
  11836. * _.isArrayLike([1, 2, 3]);
  11837. * // => true
  11838. *
  11839. * _.isArrayLike(document.body.children);
  11840. * // => true
  11841. *
  11842. * _.isArrayLike('abc');
  11843. * // => true
  11844. *
  11845. * _.isArrayLike(_.noop);
  11846. * // => false
  11847. */
  11848. function isArrayLike(value) {
  11849. return value != null && isLength(value.length) && !isFunction(value);
  11850. }
  11851. /**
  11852. * This method is like `_.isArrayLike` except that it also checks if `value`
  11853. * is an object.
  11854. *
  11855. * @static
  11856. * @memberOf _
  11857. * @since 4.0.0
  11858. * @category Lang
  11859. * @param {*} value The value to check.
  11860. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11861. * else `false`.
  11862. * @example
  11863. *
  11864. * _.isArrayLikeObject([1, 2, 3]);
  11865. * // => true
  11866. *
  11867. * _.isArrayLikeObject(document.body.children);
  11868. * // => true
  11869. *
  11870. * _.isArrayLikeObject('abc');
  11871. * // => false
  11872. *
  11873. * _.isArrayLikeObject(_.noop);
  11874. * // => false
  11875. */
  11876. function isArrayLikeObject(value) {
  11877. return isObjectLike(value) && isArrayLike(value);
  11878. }
  11879. /**
  11880. * Checks if `value` is classified as a boolean primitive or object.
  11881. *
  11882. * @static
  11883. * @memberOf _
  11884. * @since 0.1.0
  11885. * @category Lang
  11886. * @param {*} value The value to check.
  11887. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11888. * @example
  11889. *
  11890. * _.isBoolean(false);
  11891. * // => true
  11892. *
  11893. * _.isBoolean(null);
  11894. * // => false
  11895. */
  11896. function isBoolean(value) {
  11897. return value === true || value === false ||
  11898. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11899. }
  11900. /**
  11901. * Checks if `value` is a buffer.
  11902. *
  11903. * @static
  11904. * @memberOf _
  11905. * @since 4.3.0
  11906. * @category Lang
  11907. * @param {*} value The value to check.
  11908. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11909. * @example
  11910. *
  11911. * _.isBuffer(new Buffer(2));
  11912. * // => true
  11913. *
  11914. * _.isBuffer(new Uint8Array(2));
  11915. * // => false
  11916. */
  11917. var isBuffer = nativeIsBuffer || stubFalse;
  11918. /**
  11919. * Checks if `value` is classified as a `Date` object.
  11920. *
  11921. * @static
  11922. * @memberOf _
  11923. * @since 0.1.0
  11924. * @category Lang
  11925. * @param {*} value The value to check.
  11926. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11927. * @example
  11928. *
  11929. * _.isDate(new Date);
  11930. * // => true
  11931. *
  11932. * _.isDate('Mon April 23 2012');
  11933. * // => false
  11934. */
  11935. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11936. /**
  11937. * Checks if `value` is likely a DOM element.
  11938. *
  11939. * @static
  11940. * @memberOf _
  11941. * @since 0.1.0
  11942. * @category Lang
  11943. * @param {*} value The value to check.
  11944. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11945. * @example
  11946. *
  11947. * _.isElement(document.body);
  11948. * // => true
  11949. *
  11950. * _.isElement('<body>');
  11951. * // => false
  11952. */
  11953. function isElement(value) {
  11954. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11955. }
  11956. /**
  11957. * Checks if `value` is an empty object, collection, map, or set.
  11958. *
  11959. * Objects are considered empty if they have no own enumerable string keyed
  11960. * properties.
  11961. *
  11962. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11963. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11964. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11965. *
  11966. * @static
  11967. * @memberOf _
  11968. * @since 0.1.0
  11969. * @category Lang
  11970. * @param {*} value The value to check.
  11971. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11972. * @example
  11973. *
  11974. * _.isEmpty(null);
  11975. * // => true
  11976. *
  11977. * _.isEmpty(true);
  11978. * // => true
  11979. *
  11980. * _.isEmpty(1);
  11981. * // => true
  11982. *
  11983. * _.isEmpty([1, 2, 3]);
  11984. * // => false
  11985. *
  11986. * _.isEmpty({ 'a': 1 });
  11987. * // => false
  11988. */
  11989. function isEmpty(value) {
  11990. if (value == null) {
  11991. return true;
  11992. }
  11993. if (isArrayLike(value) &&
  11994. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11995. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11996. return !value.length;
  11997. }
  11998. var tag = getTag(value);
  11999. if (tag == mapTag || tag == setTag) {
  12000. return !value.size;
  12001. }
  12002. if (isPrototype(value)) {
  12003. return !baseKeys(value).length;
  12004. }
  12005. for (var key in value) {
  12006. if (hasOwnProperty.call(value, key)) {
  12007. return false;
  12008. }
  12009. }
  12010. return true;
  12011. }
  12012. /**
  12013. * Performs a deep comparison between two values to determine if they are
  12014. * equivalent.
  12015. *
  12016. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12017. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12018. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12019. * by their own, not inherited, enumerable properties. Functions and DOM
  12020. * nodes are compared by strict equality, i.e. `===`.
  12021. *
  12022. * @static
  12023. * @memberOf _
  12024. * @since 0.1.0
  12025. * @category Lang
  12026. * @param {*} value The value to compare.
  12027. * @param {*} other The other value to compare.
  12028. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12029. * @example
  12030. *
  12031. * var object = { 'a': 1 };
  12032. * var other = { 'a': 1 };
  12033. *
  12034. * _.isEqual(object, other);
  12035. * // => true
  12036. *
  12037. * object === other;
  12038. * // => false
  12039. */
  12040. function isEqual(value, other) {
  12041. return baseIsEqual(value, other);
  12042. }
  12043. /**
  12044. * This method is like `_.isEqual` except that it accepts `customizer` which
  12045. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12046. * are handled by the method instead. The `customizer` is invoked with up to
  12047. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12048. *
  12049. * @static
  12050. * @memberOf _
  12051. * @since 4.0.0
  12052. * @category Lang
  12053. * @param {*} value The value to compare.
  12054. * @param {*} other The other value to compare.
  12055. * @param {Function} [customizer] The function to customize comparisons.
  12056. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12057. * @example
  12058. *
  12059. * function isGreeting(value) {
  12060. * return /^h(?:i|ello)$/.test(value);
  12061. * }
  12062. *
  12063. * function customizer(objValue, othValue) {
  12064. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12065. * return true;
  12066. * }
  12067. * }
  12068. *
  12069. * var array = ['hello', 'goodbye'];
  12070. * var other = ['hi', 'goodbye'];
  12071. *
  12072. * _.isEqualWith(array, other, customizer);
  12073. * // => true
  12074. */
  12075. function isEqualWith(value, other, customizer) {
  12076. customizer = typeof customizer == 'function' ? customizer : undefined;
  12077. var result = customizer ? customizer(value, other) : undefined;
  12078. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12079. }
  12080. /**
  12081. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12082. * `SyntaxError`, `TypeError`, or `URIError` object.
  12083. *
  12084. * @static
  12085. * @memberOf _
  12086. * @since 3.0.0
  12087. * @category Lang
  12088. * @param {*} value The value to check.
  12089. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12090. * @example
  12091. *
  12092. * _.isError(new Error);
  12093. * // => true
  12094. *
  12095. * _.isError(Error);
  12096. * // => false
  12097. */
  12098. function isError(value) {
  12099. if (!isObjectLike(value)) {
  12100. return false;
  12101. }
  12102. var tag = baseGetTag(value);
  12103. return tag == errorTag || tag == domExcTag ||
  12104. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12105. }
  12106. /**
  12107. * Checks if `value` is a finite primitive number.
  12108. *
  12109. * **Note:** This method is based on
  12110. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12111. *
  12112. * @static
  12113. * @memberOf _
  12114. * @since 0.1.0
  12115. * @category Lang
  12116. * @param {*} value The value to check.
  12117. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12118. * @example
  12119. *
  12120. * _.isFinite(3);
  12121. * // => true
  12122. *
  12123. * _.isFinite(Number.MIN_VALUE);
  12124. * // => true
  12125. *
  12126. * _.isFinite(Infinity);
  12127. * // => false
  12128. *
  12129. * _.isFinite('3');
  12130. * // => false
  12131. */
  12132. function isFinite(value) {
  12133. return typeof value == 'number' && nativeIsFinite(value);
  12134. }
  12135. /**
  12136. * Checks if `value` is classified as a `Function` object.
  12137. *
  12138. * @static
  12139. * @memberOf _
  12140. * @since 0.1.0
  12141. * @category Lang
  12142. * @param {*} value The value to check.
  12143. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12144. * @example
  12145. *
  12146. * _.isFunction(_);
  12147. * // => true
  12148. *
  12149. * _.isFunction(/abc/);
  12150. * // => false
  12151. */
  12152. function isFunction(value) {
  12153. if (!isObject(value)) {
  12154. return false;
  12155. }
  12156. // The use of `Object#toString` avoids issues with the `typeof` operator
  12157. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12158. var tag = baseGetTag(value);
  12159. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12160. }
  12161. /**
  12162. * Checks if `value` is an integer.
  12163. *
  12164. * **Note:** This method is based on
  12165. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12166. *
  12167. * @static
  12168. * @memberOf _
  12169. * @since 4.0.0
  12170. * @category Lang
  12171. * @param {*} value The value to check.
  12172. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12173. * @example
  12174. *
  12175. * _.isInteger(3);
  12176. * // => true
  12177. *
  12178. * _.isInteger(Number.MIN_VALUE);
  12179. * // => false
  12180. *
  12181. * _.isInteger(Infinity);
  12182. * // => false
  12183. *
  12184. * _.isInteger('3');
  12185. * // => false
  12186. */
  12187. function isInteger(value) {
  12188. return typeof value == 'number' && value == toInteger(value);
  12189. }
  12190. /**
  12191. * Checks if `value` is a valid array-like length.
  12192. *
  12193. * **Note:** This method is loosely based on
  12194. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12195. *
  12196. * @static
  12197. * @memberOf _
  12198. * @since 4.0.0
  12199. * @category Lang
  12200. * @param {*} value The value to check.
  12201. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12202. * @example
  12203. *
  12204. * _.isLength(3);
  12205. * // => true
  12206. *
  12207. * _.isLength(Number.MIN_VALUE);
  12208. * // => false
  12209. *
  12210. * _.isLength(Infinity);
  12211. * // => false
  12212. *
  12213. * _.isLength('3');
  12214. * // => false
  12215. */
  12216. function isLength(value) {
  12217. return typeof value == 'number' &&
  12218. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12219. }
  12220. /**
  12221. * Checks if `value` is the
  12222. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12223. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12224. *
  12225. * @static
  12226. * @memberOf _
  12227. * @since 0.1.0
  12228. * @category Lang
  12229. * @param {*} value The value to check.
  12230. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12231. * @example
  12232. *
  12233. * _.isObject({});
  12234. * // => true
  12235. *
  12236. * _.isObject([1, 2, 3]);
  12237. * // => true
  12238. *
  12239. * _.isObject(_.noop);
  12240. * // => true
  12241. *
  12242. * _.isObject(null);
  12243. * // => false
  12244. */
  12245. function isObject(value) {
  12246. var type = typeof value;
  12247. return value != null && (type == 'object' || type == 'function');
  12248. }
  12249. /**
  12250. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12251. * and has a `typeof` result of "object".
  12252. *
  12253. * @static
  12254. * @memberOf _
  12255. * @since 4.0.0
  12256. * @category Lang
  12257. * @param {*} value The value to check.
  12258. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12259. * @example
  12260. *
  12261. * _.isObjectLike({});
  12262. * // => true
  12263. *
  12264. * _.isObjectLike([1, 2, 3]);
  12265. * // => true
  12266. *
  12267. * _.isObjectLike(_.noop);
  12268. * // => false
  12269. *
  12270. * _.isObjectLike(null);
  12271. * // => false
  12272. */
  12273. function isObjectLike(value) {
  12274. return value != null && typeof value == 'object';
  12275. }
  12276. /**
  12277. * Checks if `value` is classified as a `Map` object.
  12278. *
  12279. * @static
  12280. * @memberOf _
  12281. * @since 4.3.0
  12282. * @category Lang
  12283. * @param {*} value The value to check.
  12284. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12285. * @example
  12286. *
  12287. * _.isMap(new Map);
  12288. * // => true
  12289. *
  12290. * _.isMap(new WeakMap);
  12291. * // => false
  12292. */
  12293. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12294. /**
  12295. * Performs a partial deep comparison between `object` and `source` to
  12296. * determine if `object` contains equivalent property values.
  12297. *
  12298. * **Note:** This method is equivalent to `_.matches` when `source` is
  12299. * partially applied.
  12300. *
  12301. * Partial comparisons will match empty array and empty object `source`
  12302. * values against any array or object value, respectively. See `_.isEqual`
  12303. * for a list of supported value comparisons.
  12304. *
  12305. * @static
  12306. * @memberOf _
  12307. * @since 3.0.0
  12308. * @category Lang
  12309. * @param {Object} object The object to inspect.
  12310. * @param {Object} source The object of property values to match.
  12311. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12312. * @example
  12313. *
  12314. * var object = { 'a': 1, 'b': 2 };
  12315. *
  12316. * _.isMatch(object, { 'b': 2 });
  12317. * // => true
  12318. *
  12319. * _.isMatch(object, { 'b': 1 });
  12320. * // => false
  12321. */
  12322. function isMatch(object, source) {
  12323. return object === source || baseIsMatch(object, source, getMatchData(source));
  12324. }
  12325. /**
  12326. * This method is like `_.isMatch` except that it accepts `customizer` which
  12327. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12328. * are handled by the method instead. The `customizer` is invoked with five
  12329. * arguments: (objValue, srcValue, index|key, object, source).
  12330. *
  12331. * @static
  12332. * @memberOf _
  12333. * @since 4.0.0
  12334. * @category Lang
  12335. * @param {Object} object The object to inspect.
  12336. * @param {Object} source The object of property values to match.
  12337. * @param {Function} [customizer] The function to customize comparisons.
  12338. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12339. * @example
  12340. *
  12341. * function isGreeting(value) {
  12342. * return /^h(?:i|ello)$/.test(value);
  12343. * }
  12344. *
  12345. * function customizer(objValue, srcValue) {
  12346. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12347. * return true;
  12348. * }
  12349. * }
  12350. *
  12351. * var object = { 'greeting': 'hello' };
  12352. * var source = { 'greeting': 'hi' };
  12353. *
  12354. * _.isMatchWith(object, source, customizer);
  12355. * // => true
  12356. */
  12357. function isMatchWith(object, source, customizer) {
  12358. customizer = typeof customizer == 'function' ? customizer : undefined;
  12359. return baseIsMatch(object, source, getMatchData(source), customizer);
  12360. }
  12361. /**
  12362. * Checks if `value` is `NaN`.
  12363. *
  12364. * **Note:** This method is based on
  12365. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12366. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12367. * `undefined` and other non-number values.
  12368. *
  12369. * @static
  12370. * @memberOf _
  12371. * @since 0.1.0
  12372. * @category Lang
  12373. * @param {*} value The value to check.
  12374. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12375. * @example
  12376. *
  12377. * _.isNaN(NaN);
  12378. * // => true
  12379. *
  12380. * _.isNaN(new Number(NaN));
  12381. * // => true
  12382. *
  12383. * isNaN(undefined);
  12384. * // => true
  12385. *
  12386. * _.isNaN(undefined);
  12387. * // => false
  12388. */
  12389. function isNaN(value) {
  12390. // An `NaN` primitive is the only value that is not equal to itself.
  12391. // Perform the `toStringTag` check first to avoid errors with some
  12392. // ActiveX objects in IE.
  12393. return isNumber(value) && value != +value;
  12394. }
  12395. /**
  12396. * Checks if `value` is a pristine native function.
  12397. *
  12398. * **Note:** This method can't reliably detect native functions in the presence
  12399. * of the core-js package because core-js circumvents this kind of detection.
  12400. * Despite multiple requests, the core-js maintainer has made it clear: any
  12401. * attempt to fix the detection will be obstructed. As a result, we're left
  12402. * with little choice but to throw an error. Unfortunately, this also affects
  12403. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12404. * which rely on core-js.
  12405. *
  12406. * @static
  12407. * @memberOf _
  12408. * @since 3.0.0
  12409. * @category Lang
  12410. * @param {*} value The value to check.
  12411. * @returns {boolean} Returns `true` if `value` is a native function,
  12412. * else `false`.
  12413. * @example
  12414. *
  12415. * _.isNative(Array.prototype.push);
  12416. * // => true
  12417. *
  12418. * _.isNative(_);
  12419. * // => false
  12420. */
  12421. function isNative(value) {
  12422. if (isMaskable(value)) {
  12423. throw new Error(CORE_ERROR_TEXT);
  12424. }
  12425. return baseIsNative(value);
  12426. }
  12427. /**
  12428. * Checks if `value` is `null`.
  12429. *
  12430. * @static
  12431. * @memberOf _
  12432. * @since 0.1.0
  12433. * @category Lang
  12434. * @param {*} value The value to check.
  12435. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12436. * @example
  12437. *
  12438. * _.isNull(null);
  12439. * // => true
  12440. *
  12441. * _.isNull(void 0);
  12442. * // => false
  12443. */
  12444. function isNull(value) {
  12445. return value === null;
  12446. }
  12447. /**
  12448. * Checks if `value` is `null` or `undefined`.
  12449. *
  12450. * @static
  12451. * @memberOf _
  12452. * @since 4.0.0
  12453. * @category Lang
  12454. * @param {*} value The value to check.
  12455. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12456. * @example
  12457. *
  12458. * _.isNil(null);
  12459. * // => true
  12460. *
  12461. * _.isNil(void 0);
  12462. * // => true
  12463. *
  12464. * _.isNil(NaN);
  12465. * // => false
  12466. */
  12467. function isNil(value) {
  12468. return value == null;
  12469. }
  12470. /**
  12471. * Checks if `value` is classified as a `Number` primitive or object.
  12472. *
  12473. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12474. * classified as numbers, use the `_.isFinite` method.
  12475. *
  12476. * @static
  12477. * @memberOf _
  12478. * @since 0.1.0
  12479. * @category Lang
  12480. * @param {*} value The value to check.
  12481. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12482. * @example
  12483. *
  12484. * _.isNumber(3);
  12485. * // => true
  12486. *
  12487. * _.isNumber(Number.MIN_VALUE);
  12488. * // => true
  12489. *
  12490. * _.isNumber(Infinity);
  12491. * // => true
  12492. *
  12493. * _.isNumber('3');
  12494. * // => false
  12495. */
  12496. function isNumber(value) {
  12497. return typeof value == 'number' ||
  12498. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12499. }
  12500. /**
  12501. * Checks if `value` is a plain object, that is, an object created by the
  12502. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12503. *
  12504. * @static
  12505. * @memberOf _
  12506. * @since 0.8.0
  12507. * @category Lang
  12508. * @param {*} value The value to check.
  12509. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12510. * @example
  12511. *
  12512. * function Foo() {
  12513. * this.a = 1;
  12514. * }
  12515. *
  12516. * _.isPlainObject(new Foo);
  12517. * // => false
  12518. *
  12519. * _.isPlainObject([1, 2, 3]);
  12520. * // => false
  12521. *
  12522. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12523. * // => true
  12524. *
  12525. * _.isPlainObject(Object.create(null));
  12526. * // => true
  12527. */
  12528. function isPlainObject(value) {
  12529. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12530. return false;
  12531. }
  12532. var proto = getPrototype(value);
  12533. if (proto === null) {
  12534. return true;
  12535. }
  12536. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12537. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12538. funcToString.call(Ctor) == objectCtorString;
  12539. }
  12540. /**
  12541. * Checks if `value` is classified as a `RegExp` object.
  12542. *
  12543. * @static
  12544. * @memberOf _
  12545. * @since 0.1.0
  12546. * @category Lang
  12547. * @param {*} value The value to check.
  12548. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12549. * @example
  12550. *
  12551. * _.isRegExp(/abc/);
  12552. * // => true
  12553. *
  12554. * _.isRegExp('/abc/');
  12555. * // => false
  12556. */
  12557. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12558. /**
  12559. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12560. * double precision number which isn't the result of a rounded unsafe integer.
  12561. *
  12562. * **Note:** This method is based on
  12563. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12564. *
  12565. * @static
  12566. * @memberOf _
  12567. * @since 4.0.0
  12568. * @category Lang
  12569. * @param {*} value The value to check.
  12570. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12571. * @example
  12572. *
  12573. * _.isSafeInteger(3);
  12574. * // => true
  12575. *
  12576. * _.isSafeInteger(Number.MIN_VALUE);
  12577. * // => false
  12578. *
  12579. * _.isSafeInteger(Infinity);
  12580. * // => false
  12581. *
  12582. * _.isSafeInteger('3');
  12583. * // => false
  12584. */
  12585. function isSafeInteger(value) {
  12586. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12587. }
  12588. /**
  12589. * Checks if `value` is classified as a `Set` object.
  12590. *
  12591. * @static
  12592. * @memberOf _
  12593. * @since 4.3.0
  12594. * @category Lang
  12595. * @param {*} value The value to check.
  12596. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12597. * @example
  12598. *
  12599. * _.isSet(new Set);
  12600. * // => true
  12601. *
  12602. * _.isSet(new WeakSet);
  12603. * // => false
  12604. */
  12605. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12606. /**
  12607. * Checks if `value` is classified as a `String` primitive or object.
  12608. *
  12609. * @static
  12610. * @since 0.1.0
  12611. * @memberOf _
  12612. * @category Lang
  12613. * @param {*} value The value to check.
  12614. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12615. * @example
  12616. *
  12617. * _.isString('abc');
  12618. * // => true
  12619. *
  12620. * _.isString(1);
  12621. * // => false
  12622. */
  12623. function isString(value) {
  12624. return typeof value == 'string' ||
  12625. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12626. }
  12627. /**
  12628. * Checks if `value` is classified as a `Symbol` primitive or object.
  12629. *
  12630. * @static
  12631. * @memberOf _
  12632. * @since 4.0.0
  12633. * @category Lang
  12634. * @param {*} value The value to check.
  12635. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12636. * @example
  12637. *
  12638. * _.isSymbol(Symbol.iterator);
  12639. * // => true
  12640. *
  12641. * _.isSymbol('abc');
  12642. * // => false
  12643. */
  12644. function isSymbol(value) {
  12645. return typeof value == 'symbol' ||
  12646. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12647. }
  12648. /**
  12649. * Checks if `value` is classified as a typed array.
  12650. *
  12651. * @static
  12652. * @memberOf _
  12653. * @since 3.0.0
  12654. * @category Lang
  12655. * @param {*} value The value to check.
  12656. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12657. * @example
  12658. *
  12659. * _.isTypedArray(new Uint8Array);
  12660. * // => true
  12661. *
  12662. * _.isTypedArray([]);
  12663. * // => false
  12664. */
  12665. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12666. /**
  12667. * Checks if `value` is `undefined`.
  12668. *
  12669. * @static
  12670. * @since 0.1.0
  12671. * @memberOf _
  12672. * @category Lang
  12673. * @param {*} value The value to check.
  12674. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12675. * @example
  12676. *
  12677. * _.isUndefined(void 0);
  12678. * // => true
  12679. *
  12680. * _.isUndefined(null);
  12681. * // => false
  12682. */
  12683. function isUndefined(value) {
  12684. return value === undefined;
  12685. }
  12686. /**
  12687. * Checks if `value` is classified as a `WeakMap` object.
  12688. *
  12689. * @static
  12690. * @memberOf _
  12691. * @since 4.3.0
  12692. * @category Lang
  12693. * @param {*} value The value to check.
  12694. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12695. * @example
  12696. *
  12697. * _.isWeakMap(new WeakMap);
  12698. * // => true
  12699. *
  12700. * _.isWeakMap(new Map);
  12701. * // => false
  12702. */
  12703. function isWeakMap(value) {
  12704. return isObjectLike(value) && getTag(value) == weakMapTag;
  12705. }
  12706. /**
  12707. * Checks if `value` is classified as a `WeakSet` object.
  12708. *
  12709. * @static
  12710. * @memberOf _
  12711. * @since 4.3.0
  12712. * @category Lang
  12713. * @param {*} value The value to check.
  12714. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12715. * @example
  12716. *
  12717. * _.isWeakSet(new WeakSet);
  12718. * // => true
  12719. *
  12720. * _.isWeakSet(new Set);
  12721. * // => false
  12722. */
  12723. function isWeakSet(value) {
  12724. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12725. }
  12726. /**
  12727. * Checks if `value` is less than `other`.
  12728. *
  12729. * @static
  12730. * @memberOf _
  12731. * @since 3.9.0
  12732. * @category Lang
  12733. * @param {*} value The value to compare.
  12734. * @param {*} other The other value to compare.
  12735. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12736. * else `false`.
  12737. * @see _.gt
  12738. * @example
  12739. *
  12740. * _.lt(1, 3);
  12741. * // => true
  12742. *
  12743. * _.lt(3, 3);
  12744. * // => false
  12745. *
  12746. * _.lt(3, 1);
  12747. * // => false
  12748. */
  12749. var lt = createRelationalOperation(baseLt);
  12750. /**
  12751. * Checks if `value` is less than or equal to `other`.
  12752. *
  12753. * @static
  12754. * @memberOf _
  12755. * @since 3.9.0
  12756. * @category Lang
  12757. * @param {*} value The value to compare.
  12758. * @param {*} other The other value to compare.
  12759. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12760. * `other`, else `false`.
  12761. * @see _.gte
  12762. * @example
  12763. *
  12764. * _.lte(1, 3);
  12765. * // => true
  12766. *
  12767. * _.lte(3, 3);
  12768. * // => true
  12769. *
  12770. * _.lte(3, 1);
  12771. * // => false
  12772. */
  12773. var lte = createRelationalOperation(function(value, other) {
  12774. return value <= other;
  12775. });
  12776. /**
  12777. * Converts `value` to an array.
  12778. *
  12779. * @static
  12780. * @since 0.1.0
  12781. * @memberOf _
  12782. * @category Lang
  12783. * @param {*} value The value to convert.
  12784. * @returns {Array} Returns the converted array.
  12785. * @example
  12786. *
  12787. * _.toArray({ 'a': 1, 'b': 2 });
  12788. * // => [1, 2]
  12789. *
  12790. * _.toArray('abc');
  12791. * // => ['a', 'b', 'c']
  12792. *
  12793. * _.toArray(1);
  12794. * // => []
  12795. *
  12796. * _.toArray(null);
  12797. * // => []
  12798. */
  12799. function toArray(value) {
  12800. if (!value) {
  12801. return [];
  12802. }
  12803. if (isArrayLike(value)) {
  12804. return isString(value) ? stringToArray(value) : copyArray(value);
  12805. }
  12806. if (symIterator && value[symIterator]) {
  12807. return iteratorToArray(value[symIterator]());
  12808. }
  12809. var tag = getTag(value),
  12810. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12811. return func(value);
  12812. }
  12813. /**
  12814. * Converts `value` to a finite number.
  12815. *
  12816. * @static
  12817. * @memberOf _
  12818. * @since 4.12.0
  12819. * @category Lang
  12820. * @param {*} value The value to convert.
  12821. * @returns {number} Returns the converted number.
  12822. * @example
  12823. *
  12824. * _.toFinite(3.2);
  12825. * // => 3.2
  12826. *
  12827. * _.toFinite(Number.MIN_VALUE);
  12828. * // => 5e-324
  12829. *
  12830. * _.toFinite(Infinity);
  12831. * // => 1.7976931348623157e+308
  12832. *
  12833. * _.toFinite('3.2');
  12834. * // => 3.2
  12835. */
  12836. function toFinite(value) {
  12837. if (!value) {
  12838. return value === 0 ? value : 0;
  12839. }
  12840. value = toNumber(value);
  12841. if (value === INFINITY || value === -INFINITY) {
  12842. var sign = (value < 0 ? -1 : 1);
  12843. return sign * MAX_INTEGER;
  12844. }
  12845. return value === value ? value : 0;
  12846. }
  12847. /**
  12848. * Converts `value` to an integer.
  12849. *
  12850. * **Note:** This method is loosely based on
  12851. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12852. *
  12853. * @static
  12854. * @memberOf _
  12855. * @since 4.0.0
  12856. * @category Lang
  12857. * @param {*} value The value to convert.
  12858. * @returns {number} Returns the converted integer.
  12859. * @example
  12860. *
  12861. * _.toInteger(3.2);
  12862. * // => 3
  12863. *
  12864. * _.toInteger(Number.MIN_VALUE);
  12865. * // => 0
  12866. *
  12867. * _.toInteger(Infinity);
  12868. * // => 1.7976931348623157e+308
  12869. *
  12870. * _.toInteger('3.2');
  12871. * // => 3
  12872. */
  12873. function toInteger(value) {
  12874. var result = toFinite(value),
  12875. remainder = result % 1;
  12876. return result === result ? (remainder ? result - remainder : result) : 0;
  12877. }
  12878. /**
  12879. * Converts `value` to an integer suitable for use as the length of an
  12880. * array-like object.
  12881. *
  12882. * **Note:** This method is based on
  12883. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12884. *
  12885. * @static
  12886. * @memberOf _
  12887. * @since 4.0.0
  12888. * @category Lang
  12889. * @param {*} value The value to convert.
  12890. * @returns {number} Returns the converted integer.
  12891. * @example
  12892. *
  12893. * _.toLength(3.2);
  12894. * // => 3
  12895. *
  12896. * _.toLength(Number.MIN_VALUE);
  12897. * // => 0
  12898. *
  12899. * _.toLength(Infinity);
  12900. * // => 4294967295
  12901. *
  12902. * _.toLength('3.2');
  12903. * // => 3
  12904. */
  12905. function toLength(value) {
  12906. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12907. }
  12908. /**
  12909. * Converts `value` to a number.
  12910. *
  12911. * @static
  12912. * @memberOf _
  12913. * @since 4.0.0
  12914. * @category Lang
  12915. * @param {*} value The value to process.
  12916. * @returns {number} Returns the number.
  12917. * @example
  12918. *
  12919. * _.toNumber(3.2);
  12920. * // => 3.2
  12921. *
  12922. * _.toNumber(Number.MIN_VALUE);
  12923. * // => 5e-324
  12924. *
  12925. * _.toNumber(Infinity);
  12926. * // => Infinity
  12927. *
  12928. * _.toNumber('3.2');
  12929. * // => 3.2
  12930. */
  12931. function toNumber(value) {
  12932. if (typeof value == 'number') {
  12933. return value;
  12934. }
  12935. if (isSymbol(value)) {
  12936. return NAN;
  12937. }
  12938. if (isObject(value)) {
  12939. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12940. value = isObject(other) ? (other + '') : other;
  12941. }
  12942. if (typeof value != 'string') {
  12943. return value === 0 ? value : +value;
  12944. }
  12945. value = baseTrim(value);
  12946. var isBinary = reIsBinary.test(value);
  12947. return (isBinary || reIsOctal.test(value))
  12948. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12949. : (reIsBadHex.test(value) ? NAN : +value);
  12950. }
  12951. /**
  12952. * Converts `value` to a plain object flattening inherited enumerable string
  12953. * keyed properties of `value` to own properties of the plain object.
  12954. *
  12955. * @static
  12956. * @memberOf _
  12957. * @since 3.0.0
  12958. * @category Lang
  12959. * @param {*} value The value to convert.
  12960. * @returns {Object} Returns the converted plain object.
  12961. * @example
  12962. *
  12963. * function Foo() {
  12964. * this.b = 2;
  12965. * }
  12966. *
  12967. * Foo.prototype.c = 3;
  12968. *
  12969. * _.assign({ 'a': 1 }, new Foo);
  12970. * // => { 'a': 1, 'b': 2 }
  12971. *
  12972. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12973. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12974. */
  12975. function toPlainObject(value) {
  12976. return copyObject(value, keysIn(value));
  12977. }
  12978. /**
  12979. * Converts `value` to a safe integer. A safe integer can be compared and
  12980. * represented correctly.
  12981. *
  12982. * @static
  12983. * @memberOf _
  12984. * @since 4.0.0
  12985. * @category Lang
  12986. * @param {*} value The value to convert.
  12987. * @returns {number} Returns the converted integer.
  12988. * @example
  12989. *
  12990. * _.toSafeInteger(3.2);
  12991. * // => 3
  12992. *
  12993. * _.toSafeInteger(Number.MIN_VALUE);
  12994. * // => 0
  12995. *
  12996. * _.toSafeInteger(Infinity);
  12997. * // => 9007199254740991
  12998. *
  12999. * _.toSafeInteger('3.2');
  13000. * // => 3
  13001. */
  13002. function toSafeInteger(value) {
  13003. return value
  13004. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13005. : (value === 0 ? value : 0);
  13006. }
  13007. /**
  13008. * Converts `value` to a string. An empty string is returned for `null`
  13009. * and `undefined` values. The sign of `-0` is preserved.
  13010. *
  13011. * @static
  13012. * @memberOf _
  13013. * @since 4.0.0
  13014. * @category Lang
  13015. * @param {*} value The value to convert.
  13016. * @returns {string} Returns the converted string.
  13017. * @example
  13018. *
  13019. * _.toString(null);
  13020. * // => ''
  13021. *
  13022. * _.toString(-0);
  13023. * // => '-0'
  13024. *
  13025. * _.toString([1, 2, 3]);
  13026. * // => '1,2,3'
  13027. */
  13028. function toString(value) {
  13029. return value == null ? '' : baseToString(value);
  13030. }
  13031. /*------------------------------------------------------------------------*/
  13032. /**
  13033. * Assigns own enumerable string keyed properties of source objects to the
  13034. * destination object. Source objects are applied from left to right.
  13035. * Subsequent sources overwrite property assignments of previous sources.
  13036. *
  13037. * **Note:** This method mutates `object` and is loosely based on
  13038. * [`Object.assign`](https://mdn.io/Object/assign).
  13039. *
  13040. * @static
  13041. * @memberOf _
  13042. * @since 0.10.0
  13043. * @category Object
  13044. * @param {Object} object The destination object.
  13045. * @param {...Object} [sources] The source objects.
  13046. * @returns {Object} Returns `object`.
  13047. * @see _.assignIn
  13048. * @example
  13049. *
  13050. * function Foo() {
  13051. * this.a = 1;
  13052. * }
  13053. *
  13054. * function Bar() {
  13055. * this.c = 3;
  13056. * }
  13057. *
  13058. * Foo.prototype.b = 2;
  13059. * Bar.prototype.d = 4;
  13060. *
  13061. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13062. * // => { 'a': 1, 'c': 3 }
  13063. */
  13064. var assign = createAssigner(function(object, source) {
  13065. if (isPrototype(source) || isArrayLike(source)) {
  13066. copyObject(source, keys(source), object);
  13067. return;
  13068. }
  13069. for (var key in source) {
  13070. if (hasOwnProperty.call(source, key)) {
  13071. assignValue(object, key, source[key]);
  13072. }
  13073. }
  13074. });
  13075. /**
  13076. * This method is like `_.assign` except that it iterates over own and
  13077. * inherited source properties.
  13078. *
  13079. * **Note:** This method mutates `object`.
  13080. *
  13081. * @static
  13082. * @memberOf _
  13083. * @since 4.0.0
  13084. * @alias extend
  13085. * @category Object
  13086. * @param {Object} object The destination object.
  13087. * @param {...Object} [sources] The source objects.
  13088. * @returns {Object} Returns `object`.
  13089. * @see _.assign
  13090. * @example
  13091. *
  13092. * function Foo() {
  13093. * this.a = 1;
  13094. * }
  13095. *
  13096. * function Bar() {
  13097. * this.c = 3;
  13098. * }
  13099. *
  13100. * Foo.prototype.b = 2;
  13101. * Bar.prototype.d = 4;
  13102. *
  13103. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13104. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13105. */
  13106. var assignIn = createAssigner(function(object, source) {
  13107. copyObject(source, keysIn(source), object);
  13108. });
  13109. /**
  13110. * This method is like `_.assignIn` except that it accepts `customizer`
  13111. * which is invoked to produce the assigned values. If `customizer` returns
  13112. * `undefined`, assignment is handled by the method instead. The `customizer`
  13113. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13114. *
  13115. * **Note:** This method mutates `object`.
  13116. *
  13117. * @static
  13118. * @memberOf _
  13119. * @since 4.0.0
  13120. * @alias extendWith
  13121. * @category Object
  13122. * @param {Object} object The destination object.
  13123. * @param {...Object} sources The source objects.
  13124. * @param {Function} [customizer] The function to customize assigned values.
  13125. * @returns {Object} Returns `object`.
  13126. * @see _.assignWith
  13127. * @example
  13128. *
  13129. * function customizer(objValue, srcValue) {
  13130. * return _.isUndefined(objValue) ? srcValue : objValue;
  13131. * }
  13132. *
  13133. * var defaults = _.partialRight(_.assignInWith, customizer);
  13134. *
  13135. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13136. * // => { 'a': 1, 'b': 2 }
  13137. */
  13138. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13139. copyObject(source, keysIn(source), object, customizer);
  13140. });
  13141. /**
  13142. * This method is like `_.assign` except that it accepts `customizer`
  13143. * which is invoked to produce the assigned values. If `customizer` returns
  13144. * `undefined`, assignment is handled by the method instead. The `customizer`
  13145. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13146. *
  13147. * **Note:** This method mutates `object`.
  13148. *
  13149. * @static
  13150. * @memberOf _
  13151. * @since 4.0.0
  13152. * @category Object
  13153. * @param {Object} object The destination object.
  13154. * @param {...Object} sources The source objects.
  13155. * @param {Function} [customizer] The function to customize assigned values.
  13156. * @returns {Object} Returns `object`.
  13157. * @see _.assignInWith
  13158. * @example
  13159. *
  13160. * function customizer(objValue, srcValue) {
  13161. * return _.isUndefined(objValue) ? srcValue : objValue;
  13162. * }
  13163. *
  13164. * var defaults = _.partialRight(_.assignWith, customizer);
  13165. *
  13166. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13167. * // => { 'a': 1, 'b': 2 }
  13168. */
  13169. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13170. copyObject(source, keys(source), object, customizer);
  13171. });
  13172. /**
  13173. * Creates an array of values corresponding to `paths` of `object`.
  13174. *
  13175. * @static
  13176. * @memberOf _
  13177. * @since 1.0.0
  13178. * @category Object
  13179. * @param {Object} object The object to iterate over.
  13180. * @param {...(string|string[])} [paths] The property paths to pick.
  13181. * @returns {Array} Returns the picked values.
  13182. * @example
  13183. *
  13184. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13185. *
  13186. * _.at(object, ['a[0].b.c', 'a[1]']);
  13187. * // => [3, 4]
  13188. */
  13189. var at = flatRest(baseAt);
  13190. /**
  13191. * Creates an object that inherits from the `prototype` object. If a
  13192. * `properties` object is given, its own enumerable string keyed properties
  13193. * are assigned to the created object.
  13194. *
  13195. * @static
  13196. * @memberOf _
  13197. * @since 2.3.0
  13198. * @category Object
  13199. * @param {Object} prototype The object to inherit from.
  13200. * @param {Object} [properties] The properties to assign to the object.
  13201. * @returns {Object} Returns the new object.
  13202. * @example
  13203. *
  13204. * function Shape() {
  13205. * this.x = 0;
  13206. * this.y = 0;
  13207. * }
  13208. *
  13209. * function Circle() {
  13210. * Shape.call(this);
  13211. * }
  13212. *
  13213. * Circle.prototype = _.create(Shape.prototype, {
  13214. * 'constructor': Circle
  13215. * });
  13216. *
  13217. * var circle = new Circle;
  13218. * circle instanceof Circle;
  13219. * // => true
  13220. *
  13221. * circle instanceof Shape;
  13222. * // => true
  13223. */
  13224. function create(prototype, properties) {
  13225. var result = baseCreate(prototype);
  13226. return properties == null ? result : baseAssign(result, properties);
  13227. }
  13228. /**
  13229. * Assigns own and inherited enumerable string keyed properties of source
  13230. * objects to the destination object for all destination properties that
  13231. * resolve to `undefined`. Source objects are applied from left to right.
  13232. * Once a property is set, additional values of the same property are ignored.
  13233. *
  13234. * **Note:** This method mutates `object`.
  13235. *
  13236. * @static
  13237. * @since 0.1.0
  13238. * @memberOf _
  13239. * @category Object
  13240. * @param {Object} object The destination object.
  13241. * @param {...Object} [sources] The source objects.
  13242. * @returns {Object} Returns `object`.
  13243. * @see _.defaultsDeep
  13244. * @example
  13245. *
  13246. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13247. * // => { 'a': 1, 'b': 2 }
  13248. */
  13249. var defaults = baseRest(function(object, sources) {
  13250. object = Object(object);
  13251. var index = -1;
  13252. var length = sources.length;
  13253. var guard = length > 2 ? sources[2] : undefined;
  13254. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13255. length = 1;
  13256. }
  13257. while (++index < length) {
  13258. var source = sources[index];
  13259. var props = keysIn(source);
  13260. var propsIndex = -1;
  13261. var propsLength = props.length;
  13262. while (++propsIndex < propsLength) {
  13263. var key = props[propsIndex];
  13264. var value = object[key];
  13265. if (value === undefined ||
  13266. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13267. object[key] = source[key];
  13268. }
  13269. }
  13270. }
  13271. return object;
  13272. });
  13273. /**
  13274. * This method is like `_.defaults` except that it recursively assigns
  13275. * default properties.
  13276. *
  13277. * **Note:** This method mutates `object`.
  13278. *
  13279. * @static
  13280. * @memberOf _
  13281. * @since 3.10.0
  13282. * @category Object
  13283. * @param {Object} object The destination object.
  13284. * @param {...Object} [sources] The source objects.
  13285. * @returns {Object} Returns `object`.
  13286. * @see _.defaults
  13287. * @example
  13288. *
  13289. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13290. * // => { 'a': { 'b': 2, 'c': 3 } }
  13291. */
  13292. var defaultsDeep = baseRest(function(args) {
  13293. args.push(undefined, customDefaultsMerge);
  13294. return apply(mergeWith, undefined, args);
  13295. });
  13296. /**
  13297. * This method is like `_.find` except that it returns the key of the first
  13298. * element `predicate` returns truthy for instead of the element itself.
  13299. *
  13300. * @static
  13301. * @memberOf _
  13302. * @since 1.1.0
  13303. * @category Object
  13304. * @param {Object} object The object to inspect.
  13305. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13306. * @returns {string|undefined} Returns the key of the matched element,
  13307. * else `undefined`.
  13308. * @example
  13309. *
  13310. * var users = {
  13311. * 'barney': { 'age': 36, 'active': true },
  13312. * 'fred': { 'age': 40, 'active': false },
  13313. * 'pebbles': { 'age': 1, 'active': true }
  13314. * };
  13315. *
  13316. * _.findKey(users, function(o) { return o.age < 40; });
  13317. * // => 'barney' (iteration order is not guaranteed)
  13318. *
  13319. * // The `_.matches` iteratee shorthand.
  13320. * _.findKey(users, { 'age': 1, 'active': true });
  13321. * // => 'pebbles'
  13322. *
  13323. * // The `_.matchesProperty` iteratee shorthand.
  13324. * _.findKey(users, ['active', false]);
  13325. * // => 'fred'
  13326. *
  13327. * // The `_.property` iteratee shorthand.
  13328. * _.findKey(users, 'active');
  13329. * // => 'barney'
  13330. */
  13331. function findKey(object, predicate) {
  13332. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13333. }
  13334. /**
  13335. * This method is like `_.findKey` except that it iterates over elements of
  13336. * a collection in the opposite order.
  13337. *
  13338. * @static
  13339. * @memberOf _
  13340. * @since 2.0.0
  13341. * @category Object
  13342. * @param {Object} object The object to inspect.
  13343. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13344. * @returns {string|undefined} Returns the key of the matched element,
  13345. * else `undefined`.
  13346. * @example
  13347. *
  13348. * var users = {
  13349. * 'barney': { 'age': 36, 'active': true },
  13350. * 'fred': { 'age': 40, 'active': false },
  13351. * 'pebbles': { 'age': 1, 'active': true }
  13352. * };
  13353. *
  13354. * _.findLastKey(users, function(o) { return o.age < 40; });
  13355. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13356. *
  13357. * // The `_.matches` iteratee shorthand.
  13358. * _.findLastKey(users, { 'age': 36, 'active': true });
  13359. * // => 'barney'
  13360. *
  13361. * // The `_.matchesProperty` iteratee shorthand.
  13362. * _.findLastKey(users, ['active', false]);
  13363. * // => 'fred'
  13364. *
  13365. * // The `_.property` iteratee shorthand.
  13366. * _.findLastKey(users, 'active');
  13367. * // => 'pebbles'
  13368. */
  13369. function findLastKey(object, predicate) {
  13370. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13371. }
  13372. /**
  13373. * Iterates over own and inherited enumerable string keyed properties of an
  13374. * object and invokes `iteratee` for each property. The iteratee is invoked
  13375. * with three arguments: (value, key, object). Iteratee functions may exit
  13376. * iteration early by explicitly returning `false`.
  13377. *
  13378. * @static
  13379. * @memberOf _
  13380. * @since 0.3.0
  13381. * @category Object
  13382. * @param {Object} object The object to iterate over.
  13383. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13384. * @returns {Object} Returns `object`.
  13385. * @see _.forInRight
  13386. * @example
  13387. *
  13388. * function Foo() {
  13389. * this.a = 1;
  13390. * this.b = 2;
  13391. * }
  13392. *
  13393. * Foo.prototype.c = 3;
  13394. *
  13395. * _.forIn(new Foo, function(value, key) {
  13396. * console.log(key);
  13397. * });
  13398. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13399. */
  13400. function forIn(object, iteratee) {
  13401. return object == null
  13402. ? object
  13403. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13404. }
  13405. /**
  13406. * This method is like `_.forIn` 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 _.forIn
  13417. * @example
  13418. *
  13419. * function Foo() {
  13420. * this.a = 1;
  13421. * this.b = 2;
  13422. * }
  13423. *
  13424. * Foo.prototype.c = 3;
  13425. *
  13426. * _.forInRight(new Foo, function(value, key) {
  13427. * console.log(key);
  13428. * });
  13429. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13430. */
  13431. function forInRight(object, iteratee) {
  13432. return object == null
  13433. ? object
  13434. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13435. }
  13436. /**
  13437. * Iterates over own enumerable string keyed properties of an object and
  13438. * invokes `iteratee` for each property. The iteratee is invoked with three
  13439. * arguments: (value, key, object). Iteratee functions may exit iteration
  13440. * early by explicitly returning `false`.
  13441. *
  13442. * @static
  13443. * @memberOf _
  13444. * @since 0.3.0
  13445. * @category Object
  13446. * @param {Object} object The object to iterate over.
  13447. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13448. * @returns {Object} Returns `object`.
  13449. * @see _.forOwnRight
  13450. * @example
  13451. *
  13452. * function Foo() {
  13453. * this.a = 1;
  13454. * this.b = 2;
  13455. * }
  13456. *
  13457. * Foo.prototype.c = 3;
  13458. *
  13459. * _.forOwn(new Foo, function(value, key) {
  13460. * console.log(key);
  13461. * });
  13462. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13463. */
  13464. function forOwn(object, iteratee) {
  13465. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13466. }
  13467. /**
  13468. * This method is like `_.forOwn` except that it iterates over properties of
  13469. * `object` in the opposite order.
  13470. *
  13471. * @static
  13472. * @memberOf _
  13473. * @since 2.0.0
  13474. * @category Object
  13475. * @param {Object} object The object to iterate over.
  13476. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13477. * @returns {Object} Returns `object`.
  13478. * @see _.forOwn
  13479. * @example
  13480. *
  13481. * function Foo() {
  13482. * this.a = 1;
  13483. * this.b = 2;
  13484. * }
  13485. *
  13486. * Foo.prototype.c = 3;
  13487. *
  13488. * _.forOwnRight(new Foo, function(value, key) {
  13489. * console.log(key);
  13490. * });
  13491. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13492. */
  13493. function forOwnRight(object, iteratee) {
  13494. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13495. }
  13496. /**
  13497. * Creates an array of function property names from own enumerable properties
  13498. * of `object`.
  13499. *
  13500. * @static
  13501. * @since 0.1.0
  13502. * @memberOf _
  13503. * @category Object
  13504. * @param {Object} object The object to inspect.
  13505. * @returns {Array} Returns the function names.
  13506. * @see _.functionsIn
  13507. * @example
  13508. *
  13509. * function Foo() {
  13510. * this.a = _.constant('a');
  13511. * this.b = _.constant('b');
  13512. * }
  13513. *
  13514. * Foo.prototype.c = _.constant('c');
  13515. *
  13516. * _.functions(new Foo);
  13517. * // => ['a', 'b']
  13518. */
  13519. function functions(object) {
  13520. return object == null ? [] : baseFunctions(object, keys(object));
  13521. }
  13522. /**
  13523. * Creates an array of function property names from own and inherited
  13524. * enumerable properties of `object`.
  13525. *
  13526. * @static
  13527. * @memberOf _
  13528. * @since 4.0.0
  13529. * @category Object
  13530. * @param {Object} object The object to inspect.
  13531. * @returns {Array} Returns the function names.
  13532. * @see _.functions
  13533. * @example
  13534. *
  13535. * function Foo() {
  13536. * this.a = _.constant('a');
  13537. * this.b = _.constant('b');
  13538. * }
  13539. *
  13540. * Foo.prototype.c = _.constant('c');
  13541. *
  13542. * _.functionsIn(new Foo);
  13543. * // => ['a', 'b', 'c']
  13544. */
  13545. function functionsIn(object) {
  13546. return object == null ? [] : baseFunctions(object, keysIn(object));
  13547. }
  13548. /**
  13549. * Gets the value at `path` of `object`. If the resolved value is
  13550. * `undefined`, the `defaultValue` is returned in its place.
  13551. *
  13552. * @static
  13553. * @memberOf _
  13554. * @since 3.7.0
  13555. * @category Object
  13556. * @param {Object} object The object to query.
  13557. * @param {Array|string} path The path of the property to get.
  13558. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13559. * @returns {*} Returns the resolved value.
  13560. * @example
  13561. *
  13562. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13563. *
  13564. * _.get(object, 'a[0].b.c');
  13565. * // => 3
  13566. *
  13567. * _.get(object, ['a', '0', 'b', 'c']);
  13568. * // => 3
  13569. *
  13570. * _.get(object, 'a.b.c', 'default');
  13571. * // => 'default'
  13572. */
  13573. function get(object, path, defaultValue) {
  13574. var result = object == null ? undefined : baseGet(object, path);
  13575. return result === undefined ? defaultValue : result;
  13576. }
  13577. /**
  13578. * Checks if `path` is a direct property of `object`.
  13579. *
  13580. * @static
  13581. * @since 0.1.0
  13582. * @memberOf _
  13583. * @category Object
  13584. * @param {Object} object The object to query.
  13585. * @param {Array|string} path The path to check.
  13586. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13587. * @example
  13588. *
  13589. * var object = { 'a': { 'b': 2 } };
  13590. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13591. *
  13592. * _.has(object, 'a');
  13593. * // => true
  13594. *
  13595. * _.has(object, 'a.b');
  13596. * // => true
  13597. *
  13598. * _.has(object, ['a', 'b']);
  13599. * // => true
  13600. *
  13601. * _.has(other, 'a');
  13602. * // => false
  13603. */
  13604. function has(object, path) {
  13605. return object != null && hasPath(object, path, baseHas);
  13606. }
  13607. /**
  13608. * Checks if `path` is a direct or inherited property of `object`.
  13609. *
  13610. * @static
  13611. * @memberOf _
  13612. * @since 4.0.0
  13613. * @category Object
  13614. * @param {Object} object The object to query.
  13615. * @param {Array|string} path The path to check.
  13616. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13617. * @example
  13618. *
  13619. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13620. *
  13621. * _.hasIn(object, 'a');
  13622. * // => true
  13623. *
  13624. * _.hasIn(object, 'a.b');
  13625. * // => true
  13626. *
  13627. * _.hasIn(object, ['a', 'b']);
  13628. * // => true
  13629. *
  13630. * _.hasIn(object, 'b');
  13631. * // => false
  13632. */
  13633. function hasIn(object, path) {
  13634. return object != null && hasPath(object, path, baseHasIn);
  13635. }
  13636. /**
  13637. * Creates an object composed of the inverted keys and values of `object`.
  13638. * If `object` contains duplicate values, subsequent values overwrite
  13639. * property assignments of previous values.
  13640. *
  13641. * @static
  13642. * @memberOf _
  13643. * @since 0.7.0
  13644. * @category Object
  13645. * @param {Object} object The object to invert.
  13646. * @returns {Object} Returns the new inverted object.
  13647. * @example
  13648. *
  13649. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13650. *
  13651. * _.invert(object);
  13652. * // => { '1': 'c', '2': 'b' }
  13653. */
  13654. var invert = createInverter(function(result, value, key) {
  13655. if (value != null &&
  13656. typeof value.toString != 'function') {
  13657. value = nativeObjectToString.call(value);
  13658. }
  13659. result[value] = key;
  13660. }, constant(identity));
  13661. /**
  13662. * This method is like `_.invert` except that the inverted object is generated
  13663. * from the results of running each element of `object` thru `iteratee`. The
  13664. * corresponding inverted value of each inverted key is an array of keys
  13665. * responsible for generating the inverted value. The iteratee is invoked
  13666. * with one argument: (value).
  13667. *
  13668. * @static
  13669. * @memberOf _
  13670. * @since 4.1.0
  13671. * @category Object
  13672. * @param {Object} object The object to invert.
  13673. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13674. * @returns {Object} Returns the new inverted object.
  13675. * @example
  13676. *
  13677. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13678. *
  13679. * _.invertBy(object);
  13680. * // => { '1': ['a', 'c'], '2': ['b'] }
  13681. *
  13682. * _.invertBy(object, function(value) {
  13683. * return 'group' + value;
  13684. * });
  13685. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13686. */
  13687. var invertBy = createInverter(function(result, value, key) {
  13688. if (value != null &&
  13689. typeof value.toString != 'function') {
  13690. value = nativeObjectToString.call(value);
  13691. }
  13692. if (hasOwnProperty.call(result, value)) {
  13693. result[value].push(key);
  13694. } else {
  13695. result[value] = [key];
  13696. }
  13697. }, getIteratee);
  13698. /**
  13699. * Invokes the method at `path` of `object`.
  13700. *
  13701. * @static
  13702. * @memberOf _
  13703. * @since 4.0.0
  13704. * @category Object
  13705. * @param {Object} object The object to query.
  13706. * @param {Array|string} path The path of the method to invoke.
  13707. * @param {...*} [args] The arguments to invoke the method with.
  13708. * @returns {*} Returns the result of the invoked method.
  13709. * @example
  13710. *
  13711. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13712. *
  13713. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13714. * // => [2, 3]
  13715. */
  13716. var invoke = baseRest(baseInvoke);
  13717. /**
  13718. * Creates an array of the own enumerable property names of `object`.
  13719. *
  13720. * **Note:** Non-object values are coerced to objects. See the
  13721. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13722. * for more details.
  13723. *
  13724. * @static
  13725. * @since 0.1.0
  13726. * @memberOf _
  13727. * @category Object
  13728. * @param {Object} object The object to query.
  13729. * @returns {Array} Returns the array of property names.
  13730. * @example
  13731. *
  13732. * function Foo() {
  13733. * this.a = 1;
  13734. * this.b = 2;
  13735. * }
  13736. *
  13737. * Foo.prototype.c = 3;
  13738. *
  13739. * _.keys(new Foo);
  13740. * // => ['a', 'b'] (iteration order is not guaranteed)
  13741. *
  13742. * _.keys('hi');
  13743. * // => ['0', '1']
  13744. */
  13745. function keys(object) {
  13746. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13747. }
  13748. /**
  13749. * Creates an array of the own and inherited enumerable property names of `object`.
  13750. *
  13751. * **Note:** Non-object values are coerced to objects.
  13752. *
  13753. * @static
  13754. * @memberOf _
  13755. * @since 3.0.0
  13756. * @category Object
  13757. * @param {Object} object The object to query.
  13758. * @returns {Array} Returns the array of property names.
  13759. * @example
  13760. *
  13761. * function Foo() {
  13762. * this.a = 1;
  13763. * this.b = 2;
  13764. * }
  13765. *
  13766. * Foo.prototype.c = 3;
  13767. *
  13768. * _.keysIn(new Foo);
  13769. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13770. */
  13771. function keysIn(object) {
  13772. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13773. }
  13774. /**
  13775. * The opposite of `_.mapValues`; this method creates an object with the
  13776. * same values as `object` and keys generated by running each own enumerable
  13777. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13778. * with three arguments: (value, key, object).
  13779. *
  13780. * @static
  13781. * @memberOf _
  13782. * @since 3.8.0
  13783. * @category Object
  13784. * @param {Object} object The object to iterate over.
  13785. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13786. * @returns {Object} Returns the new mapped object.
  13787. * @see _.mapValues
  13788. * @example
  13789. *
  13790. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13791. * return key + value;
  13792. * });
  13793. * // => { 'a1': 1, 'b2': 2 }
  13794. */
  13795. function mapKeys(object, iteratee) {
  13796. var result = {};
  13797. iteratee = getIteratee(iteratee, 3);
  13798. baseForOwn(object, function(value, key, object) {
  13799. baseAssignValue(result, iteratee(value, key, object), value);
  13800. });
  13801. return result;
  13802. }
  13803. /**
  13804. * Creates an object with the same keys as `object` and values generated
  13805. * by running each own enumerable string keyed property of `object` thru
  13806. * `iteratee`. The iteratee is invoked with three arguments:
  13807. * (value, key, object).
  13808. *
  13809. * @static
  13810. * @memberOf _
  13811. * @since 2.4.0
  13812. * @category Object
  13813. * @param {Object} object The object to iterate over.
  13814. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13815. * @returns {Object} Returns the new mapped object.
  13816. * @see _.mapKeys
  13817. * @example
  13818. *
  13819. * var users = {
  13820. * 'fred': { 'user': 'fred', 'age': 40 },
  13821. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13822. * };
  13823. *
  13824. * _.mapValues(users, function(o) { return o.age; });
  13825. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13826. *
  13827. * // The `_.property` iteratee shorthand.
  13828. * _.mapValues(users, 'age');
  13829. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13830. */
  13831. function mapValues(object, iteratee) {
  13832. var result = {};
  13833. iteratee = getIteratee(iteratee, 3);
  13834. baseForOwn(object, function(value, key, object) {
  13835. baseAssignValue(result, key, iteratee(value, key, object));
  13836. });
  13837. return result;
  13838. }
  13839. /**
  13840. * This method is like `_.assign` except that it recursively merges own and
  13841. * inherited enumerable string keyed properties of source objects into the
  13842. * destination object. Source properties that resolve to `undefined` are
  13843. * skipped if a destination value exists. Array and plain object properties
  13844. * are merged recursively. Other objects and value types are overridden by
  13845. * assignment. Source objects are applied from left to right. Subsequent
  13846. * sources overwrite property assignments of previous sources.
  13847. *
  13848. * **Note:** This method mutates `object`.
  13849. *
  13850. * @static
  13851. * @memberOf _
  13852. * @since 0.5.0
  13853. * @category Object
  13854. * @param {Object} object The destination object.
  13855. * @param {...Object} [sources] The source objects.
  13856. * @returns {Object} Returns `object`.
  13857. * @example
  13858. *
  13859. * var object = {
  13860. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13861. * };
  13862. *
  13863. * var other = {
  13864. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13865. * };
  13866. *
  13867. * _.merge(object, other);
  13868. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13869. */
  13870. var merge = createAssigner(function(object, source, srcIndex) {
  13871. baseMerge(object, source, srcIndex);
  13872. });
  13873. /**
  13874. * This method is like `_.merge` except that it accepts `customizer` which
  13875. * is invoked to produce the merged values of the destination and source
  13876. * properties. If `customizer` returns `undefined`, merging is handled by the
  13877. * method instead. The `customizer` is invoked with six arguments:
  13878. * (objValue, srcValue, key, object, source, stack).
  13879. *
  13880. * **Note:** This method mutates `object`.
  13881. *
  13882. * @static
  13883. * @memberOf _
  13884. * @since 4.0.0
  13885. * @category Object
  13886. * @param {Object} object The destination object.
  13887. * @param {...Object} sources The source objects.
  13888. * @param {Function} customizer The function to customize assigned values.
  13889. * @returns {Object} Returns `object`.
  13890. * @example
  13891. *
  13892. * function customizer(objValue, srcValue) {
  13893. * if (_.isArray(objValue)) {
  13894. * return objValue.concat(srcValue);
  13895. * }
  13896. * }
  13897. *
  13898. * var object = { 'a': [1], 'b': [2] };
  13899. * var other = { 'a': [3], 'b': [4] };
  13900. *
  13901. * _.mergeWith(object, other, customizer);
  13902. * // => { 'a': [1, 3], 'b': [2, 4] }
  13903. */
  13904. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13905. baseMerge(object, source, srcIndex, customizer);
  13906. });
  13907. /**
  13908. * The opposite of `_.pick`; this method creates an object composed of the
  13909. * own and inherited enumerable property paths of `object` that are not omitted.
  13910. *
  13911. * **Note:** This method is considerably slower than `_.pick`.
  13912. *
  13913. * @static
  13914. * @since 0.1.0
  13915. * @memberOf _
  13916. * @category Object
  13917. * @param {Object} object The source object.
  13918. * @param {...(string|string[])} [paths] The property paths to omit.
  13919. * @returns {Object} Returns the new object.
  13920. * @example
  13921. *
  13922. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13923. *
  13924. * _.omit(object, ['a', 'c']);
  13925. * // => { 'b': '2' }
  13926. */
  13927. var omit = flatRest(function(object, paths) {
  13928. var result = {};
  13929. if (object == null) {
  13930. return result;
  13931. }
  13932. var isDeep = false;
  13933. paths = arrayMap(paths, function(path) {
  13934. path = castPath(path, object);
  13935. isDeep || (isDeep = path.length > 1);
  13936. return path;
  13937. });
  13938. copyObject(object, getAllKeysIn(object), result);
  13939. if (isDeep) {
  13940. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13941. }
  13942. var length = paths.length;
  13943. while (length--) {
  13944. baseUnset(result, paths[length]);
  13945. }
  13946. return result;
  13947. });
  13948. /**
  13949. * The opposite of `_.pickBy`; this method creates an object composed of
  13950. * the own and inherited enumerable string keyed properties of `object` that
  13951. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13952. * arguments: (value, key).
  13953. *
  13954. * @static
  13955. * @memberOf _
  13956. * @since 4.0.0
  13957. * @category Object
  13958. * @param {Object} object The source object.
  13959. * @param {Function} [predicate=_.identity] The function invoked per property.
  13960. * @returns {Object} Returns the new object.
  13961. * @example
  13962. *
  13963. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13964. *
  13965. * _.omitBy(object, _.isNumber);
  13966. * // => { 'b': '2' }
  13967. */
  13968. function omitBy(object, predicate) {
  13969. return pickBy(object, negate(getIteratee(predicate)));
  13970. }
  13971. /**
  13972. * Creates an object composed of the picked `object` properties.
  13973. *
  13974. * @static
  13975. * @since 0.1.0
  13976. * @memberOf _
  13977. * @category Object
  13978. * @param {Object} object The source object.
  13979. * @param {...(string|string[])} [paths] The property paths to pick.
  13980. * @returns {Object} Returns the new object.
  13981. * @example
  13982. *
  13983. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13984. *
  13985. * _.pick(object, ['a', 'c']);
  13986. * // => { 'a': 1, 'c': 3 }
  13987. */
  13988. var pick = flatRest(function(object, paths) {
  13989. return object == null ? {} : basePick(object, paths);
  13990. });
  13991. /**
  13992. * Creates an object composed of the `object` properties `predicate` returns
  13993. * truthy for. The predicate is invoked with two arguments: (value, key).
  13994. *
  13995. * @static
  13996. * @memberOf _
  13997. * @since 4.0.0
  13998. * @category Object
  13999. * @param {Object} object The source object.
  14000. * @param {Function} [predicate=_.identity] The function invoked per property.
  14001. * @returns {Object} Returns the new object.
  14002. * @example
  14003. *
  14004. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14005. *
  14006. * _.pickBy(object, _.isNumber);
  14007. * // => { 'a': 1, 'c': 3 }
  14008. */
  14009. function pickBy(object, predicate) {
  14010. if (object == null) {
  14011. return {};
  14012. }
  14013. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14014. return [prop];
  14015. });
  14016. predicate = getIteratee(predicate);
  14017. return basePickBy(object, props, function(value, path) {
  14018. return predicate(value, path[0]);
  14019. });
  14020. }
  14021. /**
  14022. * This method is like `_.get` except that if the resolved value is a
  14023. * function it's invoked with the `this` binding of its parent object and
  14024. * its result is returned.
  14025. *
  14026. * @static
  14027. * @since 0.1.0
  14028. * @memberOf _
  14029. * @category Object
  14030. * @param {Object} object The object to query.
  14031. * @param {Array|string} path The path of the property to resolve.
  14032. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14033. * @returns {*} Returns the resolved value.
  14034. * @example
  14035. *
  14036. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14037. *
  14038. * _.result(object, 'a[0].b.c1');
  14039. * // => 3
  14040. *
  14041. * _.result(object, 'a[0].b.c2');
  14042. * // => 4
  14043. *
  14044. * _.result(object, 'a[0].b.c3', 'default');
  14045. * // => 'default'
  14046. *
  14047. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14048. * // => 'default'
  14049. */
  14050. function result(object, path, defaultValue) {
  14051. path = castPath(path, object);
  14052. var index = -1,
  14053. length = path.length;
  14054. // Ensure the loop is entered when path is empty.
  14055. if (!length) {
  14056. length = 1;
  14057. object = undefined;
  14058. }
  14059. while (++index < length) {
  14060. var value = object == null ? undefined : object[toKey(path[index])];
  14061. if (value === undefined) {
  14062. index = length;
  14063. value = defaultValue;
  14064. }
  14065. object = isFunction(value) ? value.call(object) : value;
  14066. }
  14067. return object;
  14068. }
  14069. /**
  14070. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14071. * it's created. Arrays are created for missing index properties while objects
  14072. * are created for all other missing properties. Use `_.setWith` to customize
  14073. * `path` creation.
  14074. *
  14075. * **Note:** This method mutates `object`.
  14076. *
  14077. * @static
  14078. * @memberOf _
  14079. * @since 3.7.0
  14080. * @category Object
  14081. * @param {Object} object The object to modify.
  14082. * @param {Array|string} path The path of the property to set.
  14083. * @param {*} value The value to set.
  14084. * @returns {Object} Returns `object`.
  14085. * @example
  14086. *
  14087. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14088. *
  14089. * _.set(object, 'a[0].b.c', 4);
  14090. * console.log(object.a[0].b.c);
  14091. * // => 4
  14092. *
  14093. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14094. * console.log(object.x[0].y.z);
  14095. * // => 5
  14096. */
  14097. function set(object, path, value) {
  14098. return object == null ? object : baseSet(object, path, value);
  14099. }
  14100. /**
  14101. * This method is like `_.set` except that it accepts `customizer` which is
  14102. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14103. * path creation is handled by the method instead. The `customizer` is invoked
  14104. * with three arguments: (nsValue, key, nsObject).
  14105. *
  14106. * **Note:** This method mutates `object`.
  14107. *
  14108. * @static
  14109. * @memberOf _
  14110. * @since 4.0.0
  14111. * @category Object
  14112. * @param {Object} object The object to modify.
  14113. * @param {Array|string} path The path of the property to set.
  14114. * @param {*} value The value to set.
  14115. * @param {Function} [customizer] The function to customize assigned values.
  14116. * @returns {Object} Returns `object`.
  14117. * @example
  14118. *
  14119. * var object = {};
  14120. *
  14121. * _.setWith(object, '[0][1]', 'a', Object);
  14122. * // => { '0': { '1': 'a' } }
  14123. */
  14124. function setWith(object, path, value, customizer) {
  14125. customizer = typeof customizer == 'function' ? customizer : undefined;
  14126. return object == null ? object : baseSet(object, path, value, customizer);
  14127. }
  14128. /**
  14129. * Creates an array of own enumerable string keyed-value pairs for `object`
  14130. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14131. * entries are returned.
  14132. *
  14133. * @static
  14134. * @memberOf _
  14135. * @since 4.0.0
  14136. * @alias entries
  14137. * @category Object
  14138. * @param {Object} object The object to query.
  14139. * @returns {Array} Returns the key-value pairs.
  14140. * @example
  14141. *
  14142. * function Foo() {
  14143. * this.a = 1;
  14144. * this.b = 2;
  14145. * }
  14146. *
  14147. * Foo.prototype.c = 3;
  14148. *
  14149. * _.toPairs(new Foo);
  14150. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14151. */
  14152. var toPairs = createToPairs(keys);
  14153. /**
  14154. * Creates an array of own and inherited enumerable string keyed-value pairs
  14155. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14156. * or set, its entries are returned.
  14157. *
  14158. * @static
  14159. * @memberOf _
  14160. * @since 4.0.0
  14161. * @alias entriesIn
  14162. * @category Object
  14163. * @param {Object} object The object to query.
  14164. * @returns {Array} Returns the key-value pairs.
  14165. * @example
  14166. *
  14167. * function Foo() {
  14168. * this.a = 1;
  14169. * this.b = 2;
  14170. * }
  14171. *
  14172. * Foo.prototype.c = 3;
  14173. *
  14174. * _.toPairsIn(new Foo);
  14175. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14176. */
  14177. var toPairsIn = createToPairs(keysIn);
  14178. /**
  14179. * An alternative to `_.reduce`; this method transforms `object` to a new
  14180. * `accumulator` object which is the result of running each of its own
  14181. * enumerable string keyed properties thru `iteratee`, with each invocation
  14182. * potentially mutating the `accumulator` object. If `accumulator` is not
  14183. * provided, a new object with the same `[[Prototype]]` will be used. The
  14184. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14185. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14186. *
  14187. * @static
  14188. * @memberOf _
  14189. * @since 1.3.0
  14190. * @category Object
  14191. * @param {Object} object The object to iterate over.
  14192. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14193. * @param {*} [accumulator] The custom accumulator value.
  14194. * @returns {*} Returns the accumulated value.
  14195. * @example
  14196. *
  14197. * _.transform([2, 3, 4], function(result, n) {
  14198. * result.push(n *= n);
  14199. * return n % 2 == 0;
  14200. * }, []);
  14201. * // => [4, 9]
  14202. *
  14203. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14204. * (result[value] || (result[value] = [])).push(key);
  14205. * }, {});
  14206. * // => { '1': ['a', 'c'], '2': ['b'] }
  14207. */
  14208. function transform(object, iteratee, accumulator) {
  14209. var isArr = isArray(object),
  14210. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14211. iteratee = getIteratee(iteratee, 4);
  14212. if (accumulator == null) {
  14213. var Ctor = object && object.constructor;
  14214. if (isArrLike) {
  14215. accumulator = isArr ? new Ctor : [];
  14216. }
  14217. else if (isObject(object)) {
  14218. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14219. }
  14220. else {
  14221. accumulator = {};
  14222. }
  14223. }
  14224. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14225. return iteratee(accumulator, value, index, object);
  14226. });
  14227. return accumulator;
  14228. }
  14229. /**
  14230. * Removes the property at `path` of `object`.
  14231. *
  14232. * **Note:** This method mutates `object`.
  14233. *
  14234. * @static
  14235. * @memberOf _
  14236. * @since 4.0.0
  14237. * @category Object
  14238. * @param {Object} object The object to modify.
  14239. * @param {Array|string} path The path of the property to unset.
  14240. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14241. * @example
  14242. *
  14243. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14244. * _.unset(object, 'a[0].b.c');
  14245. * // => true
  14246. *
  14247. * console.log(object);
  14248. * // => { 'a': [{ 'b': {} }] };
  14249. *
  14250. * _.unset(object, ['a', '0', 'b', 'c']);
  14251. * // => true
  14252. *
  14253. * console.log(object);
  14254. * // => { 'a': [{ 'b': {} }] };
  14255. */
  14256. function unset(object, path) {
  14257. return object == null ? true : baseUnset(object, path);
  14258. }
  14259. /**
  14260. * This method is like `_.set` except that accepts `updater` to produce the
  14261. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14262. * is invoked with one argument: (value).
  14263. *
  14264. * **Note:** This method mutates `object`.
  14265. *
  14266. * @static
  14267. * @memberOf _
  14268. * @since 4.6.0
  14269. * @category Object
  14270. * @param {Object} object The object to modify.
  14271. * @param {Array|string} path The path of the property to set.
  14272. * @param {Function} updater The function to produce the updated value.
  14273. * @returns {Object} Returns `object`.
  14274. * @example
  14275. *
  14276. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14277. *
  14278. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14279. * console.log(object.a[0].b.c);
  14280. * // => 9
  14281. *
  14282. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14283. * console.log(object.x[0].y.z);
  14284. * // => 0
  14285. */
  14286. function update(object, path, updater) {
  14287. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14288. }
  14289. /**
  14290. * This method is like `_.update` except that it accepts `customizer` which is
  14291. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14292. * path creation is handled by the method instead. The `customizer` is invoked
  14293. * with three arguments: (nsValue, key, nsObject).
  14294. *
  14295. * **Note:** This method mutates `object`.
  14296. *
  14297. * @static
  14298. * @memberOf _
  14299. * @since 4.6.0
  14300. * @category Object
  14301. * @param {Object} object The object to modify.
  14302. * @param {Array|string} path The path of the property to set.
  14303. * @param {Function} updater The function to produce the updated value.
  14304. * @param {Function} [customizer] The function to customize assigned values.
  14305. * @returns {Object} Returns `object`.
  14306. * @example
  14307. *
  14308. * var object = {};
  14309. *
  14310. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14311. * // => { '0': { '1': 'a' } }
  14312. */
  14313. function updateWith(object, path, updater, customizer) {
  14314. customizer = typeof customizer == 'function' ? customizer : undefined;
  14315. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14316. }
  14317. /**
  14318. * Creates an array of the own enumerable string keyed property values of `object`.
  14319. *
  14320. * **Note:** Non-object values are coerced to objects.
  14321. *
  14322. * @static
  14323. * @since 0.1.0
  14324. * @memberOf _
  14325. * @category Object
  14326. * @param {Object} object The object to query.
  14327. * @returns {Array} Returns the array of property values.
  14328. * @example
  14329. *
  14330. * function Foo() {
  14331. * this.a = 1;
  14332. * this.b = 2;
  14333. * }
  14334. *
  14335. * Foo.prototype.c = 3;
  14336. *
  14337. * _.values(new Foo);
  14338. * // => [1, 2] (iteration order is not guaranteed)
  14339. *
  14340. * _.values('hi');
  14341. * // => ['h', 'i']
  14342. */
  14343. function values(object) {
  14344. return object == null ? [] : baseValues(object, keys(object));
  14345. }
  14346. /**
  14347. * Creates an array of the own and inherited enumerable string keyed property
  14348. * values of `object`.
  14349. *
  14350. * **Note:** Non-object values are coerced to objects.
  14351. *
  14352. * @static
  14353. * @memberOf _
  14354. * @since 3.0.0
  14355. * @category Object
  14356. * @param {Object} object The object to query.
  14357. * @returns {Array} Returns the array of property values.
  14358. * @example
  14359. *
  14360. * function Foo() {
  14361. * this.a = 1;
  14362. * this.b = 2;
  14363. * }
  14364. *
  14365. * Foo.prototype.c = 3;
  14366. *
  14367. * _.valuesIn(new Foo);
  14368. * // => [1, 2, 3] (iteration order is not guaranteed)
  14369. */
  14370. function valuesIn(object) {
  14371. return object == null ? [] : baseValues(object, keysIn(object));
  14372. }
  14373. /*------------------------------------------------------------------------*/
  14374. /**
  14375. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14376. *
  14377. * @static
  14378. * @memberOf _
  14379. * @since 4.0.0
  14380. * @category Number
  14381. * @param {number} number The number to clamp.
  14382. * @param {number} [lower] The lower bound.
  14383. * @param {number} upper The upper bound.
  14384. * @returns {number} Returns the clamped number.
  14385. * @example
  14386. *
  14387. * _.clamp(-10, -5, 5);
  14388. * // => -5
  14389. *
  14390. * _.clamp(10, -5, 5);
  14391. * // => 5
  14392. */
  14393. function clamp(number, lower, upper) {
  14394. if (upper === undefined) {
  14395. upper = lower;
  14396. lower = undefined;
  14397. }
  14398. if (upper !== undefined) {
  14399. upper = toNumber(upper);
  14400. upper = upper === upper ? upper : 0;
  14401. }
  14402. if (lower !== undefined) {
  14403. lower = toNumber(lower);
  14404. lower = lower === lower ? lower : 0;
  14405. }
  14406. return baseClamp(toNumber(number), lower, upper);
  14407. }
  14408. /**
  14409. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14410. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14411. * If `start` is greater than `end` the params are swapped to support
  14412. * negative ranges.
  14413. *
  14414. * @static
  14415. * @memberOf _
  14416. * @since 3.3.0
  14417. * @category Number
  14418. * @param {number} number The number to check.
  14419. * @param {number} [start=0] The start of the range.
  14420. * @param {number} end The end of the range.
  14421. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14422. * @see _.range, _.rangeRight
  14423. * @example
  14424. *
  14425. * _.inRange(3, 2, 4);
  14426. * // => true
  14427. *
  14428. * _.inRange(4, 8);
  14429. * // => true
  14430. *
  14431. * _.inRange(4, 2);
  14432. * // => false
  14433. *
  14434. * _.inRange(2, 2);
  14435. * // => false
  14436. *
  14437. * _.inRange(1.2, 2);
  14438. * // => true
  14439. *
  14440. * _.inRange(5.2, 4);
  14441. * // => false
  14442. *
  14443. * _.inRange(-3, -2, -6);
  14444. * // => true
  14445. */
  14446. function inRange(number, start, end) {
  14447. start = toFinite(start);
  14448. if (end === undefined) {
  14449. end = start;
  14450. start = 0;
  14451. } else {
  14452. end = toFinite(end);
  14453. }
  14454. number = toNumber(number);
  14455. return baseInRange(number, start, end);
  14456. }
  14457. /**
  14458. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14459. * If only one argument is provided a number between `0` and the given number
  14460. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14461. * floats, a floating-point number is returned instead of an integer.
  14462. *
  14463. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14464. * floating-point values which can produce unexpected results.
  14465. *
  14466. * @static
  14467. * @memberOf _
  14468. * @since 0.7.0
  14469. * @category Number
  14470. * @param {number} [lower=0] The lower bound.
  14471. * @param {number} [upper=1] The upper bound.
  14472. * @param {boolean} [floating] Specify returning a floating-point number.
  14473. * @returns {number} Returns the random number.
  14474. * @example
  14475. *
  14476. * _.random(0, 5);
  14477. * // => an integer between 0 and 5
  14478. *
  14479. * _.random(5);
  14480. * // => also an integer between 0 and 5
  14481. *
  14482. * _.random(5, true);
  14483. * // => a floating-point number between 0 and 5
  14484. *
  14485. * _.random(1.2, 5.2);
  14486. * // => a floating-point number between 1.2 and 5.2
  14487. */
  14488. function random(lower, upper, floating) {
  14489. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14490. upper = floating = undefined;
  14491. }
  14492. if (floating === undefined) {
  14493. if (typeof upper == 'boolean') {
  14494. floating = upper;
  14495. upper = undefined;
  14496. }
  14497. else if (typeof lower == 'boolean') {
  14498. floating = lower;
  14499. lower = undefined;
  14500. }
  14501. }
  14502. if (lower === undefined && upper === undefined) {
  14503. lower = 0;
  14504. upper = 1;
  14505. }
  14506. else {
  14507. lower = toFinite(lower);
  14508. if (upper === undefined) {
  14509. upper = lower;
  14510. lower = 0;
  14511. } else {
  14512. upper = toFinite(upper);
  14513. }
  14514. }
  14515. if (lower > upper) {
  14516. var temp = lower;
  14517. lower = upper;
  14518. upper = temp;
  14519. }
  14520. if (floating || lower % 1 || upper % 1) {
  14521. var rand = nativeRandom();
  14522. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14523. }
  14524. return baseRandom(lower, upper);
  14525. }
  14526. /*------------------------------------------------------------------------*/
  14527. /**
  14528. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14529. *
  14530. * @static
  14531. * @memberOf _
  14532. * @since 3.0.0
  14533. * @category String
  14534. * @param {string} [string=''] The string to convert.
  14535. * @returns {string} Returns the camel cased string.
  14536. * @example
  14537. *
  14538. * _.camelCase('Foo Bar');
  14539. * // => 'fooBar'
  14540. *
  14541. * _.camelCase('--foo-bar--');
  14542. * // => 'fooBar'
  14543. *
  14544. * _.camelCase('__FOO_BAR__');
  14545. * // => 'fooBar'
  14546. */
  14547. var camelCase = createCompounder(function(result, word, index) {
  14548. word = word.toLowerCase();
  14549. return result + (index ? capitalize(word) : word);
  14550. });
  14551. /**
  14552. * Converts the first character of `string` to upper case and the remaining
  14553. * to lower case.
  14554. *
  14555. * @static
  14556. * @memberOf _
  14557. * @since 3.0.0
  14558. * @category String
  14559. * @param {string} [string=''] The string to capitalize.
  14560. * @returns {string} Returns the capitalized string.
  14561. * @example
  14562. *
  14563. * _.capitalize('FRED');
  14564. * // => 'Fred'
  14565. */
  14566. function capitalize(string) {
  14567. return upperFirst(toString(string).toLowerCase());
  14568. }
  14569. /**
  14570. * Deburrs `string` by converting
  14571. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14572. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14573. * letters to basic Latin letters and removing
  14574. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14575. *
  14576. * @static
  14577. * @memberOf _
  14578. * @since 3.0.0
  14579. * @category String
  14580. * @param {string} [string=''] The string to deburr.
  14581. * @returns {string} Returns the deburred string.
  14582. * @example
  14583. *
  14584. * _.deburr('déjà vu');
  14585. * // => 'deja vu'
  14586. */
  14587. function deburr(string) {
  14588. string = toString(string);
  14589. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14590. }
  14591. /**
  14592. * Checks if `string` ends with the given target string.
  14593. *
  14594. * @static
  14595. * @memberOf _
  14596. * @since 3.0.0
  14597. * @category String
  14598. * @param {string} [string=''] The string to inspect.
  14599. * @param {string} [target] The string to search for.
  14600. * @param {number} [position=string.length] The position to search up to.
  14601. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14602. * else `false`.
  14603. * @example
  14604. *
  14605. * _.endsWith('abc', 'c');
  14606. * // => true
  14607. *
  14608. * _.endsWith('abc', 'b');
  14609. * // => false
  14610. *
  14611. * _.endsWith('abc', 'b', 2);
  14612. * // => true
  14613. */
  14614. function endsWith(string, target, position) {
  14615. string = toString(string);
  14616. target = baseToString(target);
  14617. var length = string.length;
  14618. position = position === undefined
  14619. ? length
  14620. : baseClamp(toInteger(position), 0, length);
  14621. var end = position;
  14622. position -= target.length;
  14623. return position >= 0 && string.slice(position, end) == target;
  14624. }
  14625. /**
  14626. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14627. * corresponding HTML entities.
  14628. *
  14629. * **Note:** No other characters are escaped. To escape additional
  14630. * characters use a third-party library like [_he_](https://mths.be/he).
  14631. *
  14632. * Though the ">" character is escaped for symmetry, characters like
  14633. * ">" and "/" don't need escaping in HTML and have no special meaning
  14634. * unless they're part of a tag or unquoted attribute value. See
  14635. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14636. * (under "semi-related fun fact") for more details.
  14637. *
  14638. * When working with HTML you should always
  14639. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14640. * XSS vectors.
  14641. *
  14642. * @static
  14643. * @since 0.1.0
  14644. * @memberOf _
  14645. * @category String
  14646. * @param {string} [string=''] The string to escape.
  14647. * @returns {string} Returns the escaped string.
  14648. * @example
  14649. *
  14650. * _.escape('fred, barney, & pebbles');
  14651. * // => 'fred, barney, &amp; pebbles'
  14652. */
  14653. function escape(string) {
  14654. string = toString(string);
  14655. return (string && reHasUnescapedHtml.test(string))
  14656. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14657. : string;
  14658. }
  14659. /**
  14660. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14661. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14662. *
  14663. * @static
  14664. * @memberOf _
  14665. * @since 3.0.0
  14666. * @category String
  14667. * @param {string} [string=''] The string to escape.
  14668. * @returns {string} Returns the escaped string.
  14669. * @example
  14670. *
  14671. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14672. * // => '\[lodash\]\(https://lodash\.com/\)'
  14673. */
  14674. function escapeRegExp(string) {
  14675. string = toString(string);
  14676. return (string && reHasRegExpChar.test(string))
  14677. ? string.replace(reRegExpChar, '\\$&')
  14678. : string;
  14679. }
  14680. /**
  14681. * Converts `string` to
  14682. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14683. *
  14684. * @static
  14685. * @memberOf _
  14686. * @since 3.0.0
  14687. * @category String
  14688. * @param {string} [string=''] The string to convert.
  14689. * @returns {string} Returns the kebab cased string.
  14690. * @example
  14691. *
  14692. * _.kebabCase('Foo Bar');
  14693. * // => 'foo-bar'
  14694. *
  14695. * _.kebabCase('fooBar');
  14696. * // => 'foo-bar'
  14697. *
  14698. * _.kebabCase('__FOO_BAR__');
  14699. * // => 'foo-bar'
  14700. */
  14701. var kebabCase = createCompounder(function(result, word, index) {
  14702. return result + (index ? '-' : '') + word.toLowerCase();
  14703. });
  14704. /**
  14705. * Converts `string`, as space separated words, to lower case.
  14706. *
  14707. * @static
  14708. * @memberOf _
  14709. * @since 4.0.0
  14710. * @category String
  14711. * @param {string} [string=''] The string to convert.
  14712. * @returns {string} Returns the lower cased string.
  14713. * @example
  14714. *
  14715. * _.lowerCase('--Foo-Bar--');
  14716. * // => 'foo bar'
  14717. *
  14718. * _.lowerCase('fooBar');
  14719. * // => 'foo bar'
  14720. *
  14721. * _.lowerCase('__FOO_BAR__');
  14722. * // => 'foo bar'
  14723. */
  14724. var lowerCase = createCompounder(function(result, word, index) {
  14725. return result + (index ? ' ' : '') + word.toLowerCase();
  14726. });
  14727. /**
  14728. * Converts the first character of `string` to lower case.
  14729. *
  14730. * @static
  14731. * @memberOf _
  14732. * @since 4.0.0
  14733. * @category String
  14734. * @param {string} [string=''] The string to convert.
  14735. * @returns {string} Returns the converted string.
  14736. * @example
  14737. *
  14738. * _.lowerFirst('Fred');
  14739. * // => 'fred'
  14740. *
  14741. * _.lowerFirst('FRED');
  14742. * // => 'fRED'
  14743. */
  14744. var lowerFirst = createCaseFirst('toLowerCase');
  14745. /**
  14746. * Pads `string` on the left and right sides if it's shorter than `length`.
  14747. * Padding characters are truncated if they can't be evenly divided by `length`.
  14748. *
  14749. * @static
  14750. * @memberOf _
  14751. * @since 3.0.0
  14752. * @category String
  14753. * @param {string} [string=''] The string to pad.
  14754. * @param {number} [length=0] The padding length.
  14755. * @param {string} [chars=' '] The string used as padding.
  14756. * @returns {string} Returns the padded string.
  14757. * @example
  14758. *
  14759. * _.pad('abc', 8);
  14760. * // => ' abc '
  14761. *
  14762. * _.pad('abc', 8, '_-');
  14763. * // => '_-abc_-_'
  14764. *
  14765. * _.pad('abc', 3);
  14766. * // => 'abc'
  14767. */
  14768. function pad(string, length, chars) {
  14769. string = toString(string);
  14770. length = toInteger(length);
  14771. var strLength = length ? stringSize(string) : 0;
  14772. if (!length || strLength >= length) {
  14773. return string;
  14774. }
  14775. var mid = (length - strLength) / 2;
  14776. return (
  14777. createPadding(nativeFloor(mid), chars) +
  14778. string +
  14779. createPadding(nativeCeil(mid), chars)
  14780. );
  14781. }
  14782. /**
  14783. * Pads `string` on the right side if it's shorter than `length`. Padding
  14784. * characters are truncated if they exceed `length`.
  14785. *
  14786. * @static
  14787. * @memberOf _
  14788. * @since 4.0.0
  14789. * @category String
  14790. * @param {string} [string=''] The string to pad.
  14791. * @param {number} [length=0] The padding length.
  14792. * @param {string} [chars=' '] The string used as padding.
  14793. * @returns {string} Returns the padded string.
  14794. * @example
  14795. *
  14796. * _.padEnd('abc', 6);
  14797. * // => 'abc '
  14798. *
  14799. * _.padEnd('abc', 6, '_-');
  14800. * // => 'abc_-_'
  14801. *
  14802. * _.padEnd('abc', 3);
  14803. * // => 'abc'
  14804. */
  14805. function padEnd(string, length, chars) {
  14806. string = toString(string);
  14807. length = toInteger(length);
  14808. var strLength = length ? stringSize(string) : 0;
  14809. return (length && strLength < length)
  14810. ? (string + createPadding(length - strLength, chars))
  14811. : string;
  14812. }
  14813. /**
  14814. * Pads `string` on the left side if it's shorter than `length`. Padding
  14815. * characters are truncated if they exceed `length`.
  14816. *
  14817. * @static
  14818. * @memberOf _
  14819. * @since 4.0.0
  14820. * @category String
  14821. * @param {string} [string=''] The string to pad.
  14822. * @param {number} [length=0] The padding length.
  14823. * @param {string} [chars=' '] The string used as padding.
  14824. * @returns {string} Returns the padded string.
  14825. * @example
  14826. *
  14827. * _.padStart('abc', 6);
  14828. * // => ' abc'
  14829. *
  14830. * _.padStart('abc', 6, '_-');
  14831. * // => '_-_abc'
  14832. *
  14833. * _.padStart('abc', 3);
  14834. * // => 'abc'
  14835. */
  14836. function padStart(string, length, chars) {
  14837. string = toString(string);
  14838. length = toInteger(length);
  14839. var strLength = length ? stringSize(string) : 0;
  14840. return (length && strLength < length)
  14841. ? (createPadding(length - strLength, chars) + string)
  14842. : string;
  14843. }
  14844. /**
  14845. * Converts `string` to an integer of the specified radix. If `radix` is
  14846. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14847. * hexadecimal, in which case a `radix` of `16` is used.
  14848. *
  14849. * **Note:** This method aligns with the
  14850. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14851. *
  14852. * @static
  14853. * @memberOf _
  14854. * @since 1.1.0
  14855. * @category String
  14856. * @param {string} string The string to convert.
  14857. * @param {number} [radix=10] The radix to interpret `value` by.
  14858. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14859. * @returns {number} Returns the converted integer.
  14860. * @example
  14861. *
  14862. * _.parseInt('08');
  14863. * // => 8
  14864. *
  14865. * _.map(['6', '08', '10'], _.parseInt);
  14866. * // => [6, 8, 10]
  14867. */
  14868. function parseInt(string, radix, guard) {
  14869. if (guard || radix == null) {
  14870. radix = 0;
  14871. } else if (radix) {
  14872. radix = +radix;
  14873. }
  14874. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14875. }
  14876. /**
  14877. * Repeats the given string `n` times.
  14878. *
  14879. * @static
  14880. * @memberOf _
  14881. * @since 3.0.0
  14882. * @category String
  14883. * @param {string} [string=''] The string to repeat.
  14884. * @param {number} [n=1] The number of times to repeat the string.
  14885. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14886. * @returns {string} Returns the repeated string.
  14887. * @example
  14888. *
  14889. * _.repeat('*', 3);
  14890. * // => '***'
  14891. *
  14892. * _.repeat('abc', 2);
  14893. * // => 'abcabc'
  14894. *
  14895. * _.repeat('abc', 0);
  14896. * // => ''
  14897. */
  14898. function repeat(string, n, guard) {
  14899. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14900. n = 1;
  14901. } else {
  14902. n = toInteger(n);
  14903. }
  14904. return baseRepeat(toString(string), n);
  14905. }
  14906. /**
  14907. * Replaces matches for `pattern` in `string` with `replacement`.
  14908. *
  14909. * **Note:** This method is based on
  14910. * [`String#replace`](https://mdn.io/String/replace).
  14911. *
  14912. * @static
  14913. * @memberOf _
  14914. * @since 4.0.0
  14915. * @category String
  14916. * @param {string} [string=''] The string to modify.
  14917. * @param {RegExp|string} pattern The pattern to replace.
  14918. * @param {Function|string} replacement The match replacement.
  14919. * @returns {string} Returns the modified string.
  14920. * @example
  14921. *
  14922. * _.replace('Hi Fred', 'Fred', 'Barney');
  14923. * // => 'Hi Barney'
  14924. */
  14925. function replace() {
  14926. var args = arguments,
  14927. string = toString(args[0]);
  14928. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14929. }
  14930. /**
  14931. * Converts `string` to
  14932. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14933. *
  14934. * @static
  14935. * @memberOf _
  14936. * @since 3.0.0
  14937. * @category String
  14938. * @param {string} [string=''] The string to convert.
  14939. * @returns {string} Returns the snake cased string.
  14940. * @example
  14941. *
  14942. * _.snakeCase('Foo Bar');
  14943. * // => 'foo_bar'
  14944. *
  14945. * _.snakeCase('fooBar');
  14946. * // => 'foo_bar'
  14947. *
  14948. * _.snakeCase('--FOO-BAR--');
  14949. * // => 'foo_bar'
  14950. */
  14951. var snakeCase = createCompounder(function(result, word, index) {
  14952. return result + (index ? '_' : '') + word.toLowerCase();
  14953. });
  14954. /**
  14955. * Splits `string` by `separator`.
  14956. *
  14957. * **Note:** This method is based on
  14958. * [`String#split`](https://mdn.io/String/split).
  14959. *
  14960. * @static
  14961. * @memberOf _
  14962. * @since 4.0.0
  14963. * @category String
  14964. * @param {string} [string=''] The string to split.
  14965. * @param {RegExp|string} separator The separator pattern to split by.
  14966. * @param {number} [limit] The length to truncate results to.
  14967. * @returns {Array} Returns the string segments.
  14968. * @example
  14969. *
  14970. * _.split('a-b-c', '-', 2);
  14971. * // => ['a', 'b']
  14972. */
  14973. function split(string, separator, limit) {
  14974. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14975. separator = limit = undefined;
  14976. }
  14977. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14978. if (!limit) {
  14979. return [];
  14980. }
  14981. string = toString(string);
  14982. if (string && (
  14983. typeof separator == 'string' ||
  14984. (separator != null && !isRegExp(separator))
  14985. )) {
  14986. separator = baseToString(separator);
  14987. if (!separator && hasUnicode(string)) {
  14988. return castSlice(stringToArray(string), 0, limit);
  14989. }
  14990. }
  14991. return string.split(separator, limit);
  14992. }
  14993. /**
  14994. * Converts `string` to
  14995. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14996. *
  14997. * @static
  14998. * @memberOf _
  14999. * @since 3.1.0
  15000. * @category String
  15001. * @param {string} [string=''] The string to convert.
  15002. * @returns {string} Returns the start cased string.
  15003. * @example
  15004. *
  15005. * _.startCase('--foo-bar--');
  15006. * // => 'Foo Bar'
  15007. *
  15008. * _.startCase('fooBar');
  15009. * // => 'Foo Bar'
  15010. *
  15011. * _.startCase('__FOO_BAR__');
  15012. * // => 'FOO BAR'
  15013. */
  15014. var startCase = createCompounder(function(result, word, index) {
  15015. return result + (index ? ' ' : '') + upperFirst(word);
  15016. });
  15017. /**
  15018. * Checks if `string` starts with the given target string.
  15019. *
  15020. * @static
  15021. * @memberOf _
  15022. * @since 3.0.0
  15023. * @category String
  15024. * @param {string} [string=''] The string to inspect.
  15025. * @param {string} [target] The string to search for.
  15026. * @param {number} [position=0] The position to search from.
  15027. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15028. * else `false`.
  15029. * @example
  15030. *
  15031. * _.startsWith('abc', 'a');
  15032. * // => true
  15033. *
  15034. * _.startsWith('abc', 'b');
  15035. * // => false
  15036. *
  15037. * _.startsWith('abc', 'b', 1);
  15038. * // => true
  15039. */
  15040. function startsWith(string, target, position) {
  15041. string = toString(string);
  15042. position = position == null
  15043. ? 0
  15044. : baseClamp(toInteger(position), 0, string.length);
  15045. target = baseToString(target);
  15046. return string.slice(position, position + target.length) == target;
  15047. }
  15048. /**
  15049. * Creates a compiled template function that can interpolate data properties
  15050. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15051. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15052. * properties may be accessed as free variables in the template. If a setting
  15053. * object is given, it takes precedence over `_.templateSettings` values.
  15054. *
  15055. * **Note:** In the development build `_.template` utilizes
  15056. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15057. * for easier debugging.
  15058. *
  15059. * For more information on precompiling templates see
  15060. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15061. *
  15062. * For more information on Chrome extension sandboxes see
  15063. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15064. *
  15065. * @static
  15066. * @since 0.1.0
  15067. * @memberOf _
  15068. * @category String
  15069. * @param {string} [string=''] The template string.
  15070. * @param {Object} [options={}] The options object.
  15071. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15072. * The HTML "escape" delimiter.
  15073. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15074. * The "evaluate" delimiter.
  15075. * @param {Object} [options.imports=_.templateSettings.imports]
  15076. * An object to import into the template as free variables.
  15077. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15078. * The "interpolate" delimiter.
  15079. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15080. * The sourceURL of the compiled template.
  15081. * @param {string} [options.variable='obj']
  15082. * The data object variable name.
  15083. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15084. * @returns {Function} Returns the compiled template function.
  15085. * @example
  15086. *
  15087. * // Use the "interpolate" delimiter to create a compiled template.
  15088. * var compiled = _.template('hello <%= user %>!');
  15089. * compiled({ 'user': 'fred' });
  15090. * // => 'hello fred!'
  15091. *
  15092. * // Use the HTML "escape" delimiter to escape data property values.
  15093. * var compiled = _.template('<b><%- value %></b>');
  15094. * compiled({ 'value': '<script>' });
  15095. * // => '<b>&lt;script&gt;</b>'
  15096. *
  15097. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15098. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15099. * compiled({ 'users': ['fred', 'barney'] });
  15100. * // => '<li>fred</li><li>barney</li>'
  15101. *
  15102. * // Use the internal `print` function in "evaluate" delimiters.
  15103. * var compiled = _.template('<% print("hello " + user); %>!');
  15104. * compiled({ 'user': 'barney' });
  15105. * // => 'hello barney!'
  15106. *
  15107. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15108. * // Disable support by replacing the "interpolate" delimiter.
  15109. * var compiled = _.template('hello ${ user }!');
  15110. * compiled({ 'user': 'pebbles' });
  15111. * // => 'hello pebbles!'
  15112. *
  15113. * // Use backslashes to treat delimiters as plain text.
  15114. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15115. * compiled({ 'value': 'ignored' });
  15116. * // => '<%- value %>'
  15117. *
  15118. * // Use the `imports` option to import `jQuery` as `jq`.
  15119. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15120. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15121. * compiled({ 'users': ['fred', 'barney'] });
  15122. * // => '<li>fred</li><li>barney</li>'
  15123. *
  15124. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15125. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15126. * compiled(data);
  15127. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15128. *
  15129. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15130. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15131. * compiled.source;
  15132. * // => function(data) {
  15133. * // var __t, __p = '';
  15134. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15135. * // return __p;
  15136. * // }
  15137. *
  15138. * // Use custom template delimiters.
  15139. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15140. * var compiled = _.template('hello {{ user }}!');
  15141. * compiled({ 'user': 'mustache' });
  15142. * // => 'hello mustache!'
  15143. *
  15144. * // Use the `source` property to inline compiled templates for meaningful
  15145. * // line numbers in error messages and stack traces.
  15146. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15147. * var JST = {\
  15148. * "main": ' + _.template(mainText).source + '\
  15149. * };\
  15150. * ');
  15151. */
  15152. function template(string, options, guard) {
  15153. // Based on John Resig's `tmpl` implementation
  15154. // (http://ejohn.org/blog/javascript-micro-templating/)
  15155. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15156. var settings = lodash.templateSettings;
  15157. if (guard && isIterateeCall(string, options, guard)) {
  15158. options = undefined;
  15159. }
  15160. string = toString(string);
  15161. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15162. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15163. importsKeys = keys(imports),
  15164. importsValues = baseValues(imports, importsKeys);
  15165. var isEscaping,
  15166. isEvaluating,
  15167. index = 0,
  15168. interpolate = options.interpolate || reNoMatch,
  15169. source = "__p += '";
  15170. // Compile the regexp to match each delimiter.
  15171. var reDelimiters = RegExp(
  15172. (options.escape || reNoMatch).source + '|' +
  15173. interpolate.source + '|' +
  15174. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15175. (options.evaluate || reNoMatch).source + '|$'
  15176. , 'g');
  15177. // Use a sourceURL for easier debugging.
  15178. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15179. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15180. // and escape the comment, thus injecting code that gets evaled.
  15181. var sourceURL = '//# sourceURL=' +
  15182. (hasOwnProperty.call(options, 'sourceURL')
  15183. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15184. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15185. ) + '\n';
  15186. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15187. interpolateValue || (interpolateValue = esTemplateValue);
  15188. // Escape characters that can't be included in string literals.
  15189. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15190. // Replace delimiters with snippets.
  15191. if (escapeValue) {
  15192. isEscaping = true;
  15193. source += "' +\n__e(" + escapeValue + ") +\n'";
  15194. }
  15195. if (evaluateValue) {
  15196. isEvaluating = true;
  15197. source += "';\n" + evaluateValue + ";\n__p += '";
  15198. }
  15199. if (interpolateValue) {
  15200. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15201. }
  15202. index = offset + match.length;
  15203. // The JS engine embedded in Adobe products needs `match` returned in
  15204. // order to produce the correct `offset` value.
  15205. return match;
  15206. });
  15207. source += "';\n";
  15208. // If `variable` is not specified wrap a with-statement around the generated
  15209. // code to add the data object to the top of the scope chain.
  15210. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15211. if (!variable) {
  15212. source = 'with (obj) {\n' + source + '\n}\n';
  15213. }
  15214. // Throw an error if a forbidden character was found in `variable`, to prevent
  15215. // potential command injection attacks.
  15216. else if (reForbiddenIdentifierChars.test(variable)) {
  15217. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15218. }
  15219. // Cleanup code by stripping empty strings.
  15220. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15221. .replace(reEmptyStringMiddle, '$1')
  15222. .replace(reEmptyStringTrailing, '$1;');
  15223. // Frame code as the function body.
  15224. source = 'function(' + (variable || 'obj') + ') {\n' +
  15225. (variable
  15226. ? ''
  15227. : 'obj || (obj = {});\n'
  15228. ) +
  15229. "var __t, __p = ''" +
  15230. (isEscaping
  15231. ? ', __e = _.escape'
  15232. : ''
  15233. ) +
  15234. (isEvaluating
  15235. ? ', __j = Array.prototype.join;\n' +
  15236. "function print() { __p += __j.call(arguments, '') }\n"
  15237. : ';\n'
  15238. ) +
  15239. source +
  15240. 'return __p\n}';
  15241. var result = attempt(function() {
  15242. return Function(importsKeys, sourceURL + 'return ' + source)
  15243. .apply(undefined, importsValues);
  15244. });
  15245. // Provide the compiled function's source by its `toString` method or
  15246. // the `source` property as a convenience for inlining compiled templates.
  15247. result.source = source;
  15248. if (isError(result)) {
  15249. throw result;
  15250. }
  15251. return result;
  15252. }
  15253. /**
  15254. * Converts `string`, as a whole, to lower case just like
  15255. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15256. *
  15257. * @static
  15258. * @memberOf _
  15259. * @since 4.0.0
  15260. * @category String
  15261. * @param {string} [string=''] The string to convert.
  15262. * @returns {string} Returns the lower cased string.
  15263. * @example
  15264. *
  15265. * _.toLower('--Foo-Bar--');
  15266. * // => '--foo-bar--'
  15267. *
  15268. * _.toLower('fooBar');
  15269. * // => 'foobar'
  15270. *
  15271. * _.toLower('__FOO_BAR__');
  15272. * // => '__foo_bar__'
  15273. */
  15274. function toLower(value) {
  15275. return toString(value).toLowerCase();
  15276. }
  15277. /**
  15278. * Converts `string`, as a whole, to upper case just like
  15279. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15280. *
  15281. * @static
  15282. * @memberOf _
  15283. * @since 4.0.0
  15284. * @category String
  15285. * @param {string} [string=''] The string to convert.
  15286. * @returns {string} Returns the upper cased string.
  15287. * @example
  15288. *
  15289. * _.toUpper('--foo-bar--');
  15290. * // => '--FOO-BAR--'
  15291. *
  15292. * _.toUpper('fooBar');
  15293. * // => 'FOOBAR'
  15294. *
  15295. * _.toUpper('__foo_bar__');
  15296. * // => '__FOO_BAR__'
  15297. */
  15298. function toUpper(value) {
  15299. return toString(value).toUpperCase();
  15300. }
  15301. /**
  15302. * Removes leading and trailing whitespace or specified characters from `string`.
  15303. *
  15304. * @static
  15305. * @memberOf _
  15306. * @since 3.0.0
  15307. * @category String
  15308. * @param {string} [string=''] The string to trim.
  15309. * @param {string} [chars=whitespace] The characters to trim.
  15310. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15311. * @returns {string} Returns the trimmed string.
  15312. * @example
  15313. *
  15314. * _.trim(' abc ');
  15315. * // => 'abc'
  15316. *
  15317. * _.trim('-_-abc-_-', '_-');
  15318. * // => 'abc'
  15319. *
  15320. * _.map([' foo ', ' bar '], _.trim);
  15321. * // => ['foo', 'bar']
  15322. */
  15323. function trim(string, chars, guard) {
  15324. string = toString(string);
  15325. if (string && (guard || chars === undefined)) {
  15326. return baseTrim(string);
  15327. }
  15328. if (!string || !(chars = baseToString(chars))) {
  15329. return string;
  15330. }
  15331. var strSymbols = stringToArray(string),
  15332. chrSymbols = stringToArray(chars),
  15333. start = charsStartIndex(strSymbols, chrSymbols),
  15334. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15335. return castSlice(strSymbols, start, end).join('');
  15336. }
  15337. /**
  15338. * Removes trailing whitespace or specified characters from `string`.
  15339. *
  15340. * @static
  15341. * @memberOf _
  15342. * @since 4.0.0
  15343. * @category String
  15344. * @param {string} [string=''] The string to trim.
  15345. * @param {string} [chars=whitespace] The characters to trim.
  15346. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15347. * @returns {string} Returns the trimmed string.
  15348. * @example
  15349. *
  15350. * _.trimEnd(' abc ');
  15351. * // => ' abc'
  15352. *
  15353. * _.trimEnd('-_-abc-_-', '_-');
  15354. * // => '-_-abc'
  15355. */
  15356. function trimEnd(string, chars, guard) {
  15357. string = toString(string);
  15358. if (string && (guard || chars === undefined)) {
  15359. return string.slice(0, trimmedEndIndex(string) + 1);
  15360. }
  15361. if (!string || !(chars = baseToString(chars))) {
  15362. return string;
  15363. }
  15364. var strSymbols = stringToArray(string),
  15365. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15366. return castSlice(strSymbols, 0, end).join('');
  15367. }
  15368. /**
  15369. * Removes leading whitespace or specified characters from `string`.
  15370. *
  15371. * @static
  15372. * @memberOf _
  15373. * @since 4.0.0
  15374. * @category String
  15375. * @param {string} [string=''] The string to trim.
  15376. * @param {string} [chars=whitespace] The characters to trim.
  15377. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15378. * @returns {string} Returns the trimmed string.
  15379. * @example
  15380. *
  15381. * _.trimStart(' abc ');
  15382. * // => 'abc '
  15383. *
  15384. * _.trimStart('-_-abc-_-', '_-');
  15385. * // => 'abc-_-'
  15386. */
  15387. function trimStart(string, chars, guard) {
  15388. string = toString(string);
  15389. if (string && (guard || chars === undefined)) {
  15390. return string.replace(reTrimStart, '');
  15391. }
  15392. if (!string || !(chars = baseToString(chars))) {
  15393. return string;
  15394. }
  15395. var strSymbols = stringToArray(string),
  15396. start = charsStartIndex(strSymbols, stringToArray(chars));
  15397. return castSlice(strSymbols, start).join('');
  15398. }
  15399. /**
  15400. * Truncates `string` if it's longer than the given maximum string length.
  15401. * The last characters of the truncated string are replaced with the omission
  15402. * string which defaults to "...".
  15403. *
  15404. * @static
  15405. * @memberOf _
  15406. * @since 4.0.0
  15407. * @category String
  15408. * @param {string} [string=''] The string to truncate.
  15409. * @param {Object} [options={}] The options object.
  15410. * @param {number} [options.length=30] The maximum string length.
  15411. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15412. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15413. * @returns {string} Returns the truncated string.
  15414. * @example
  15415. *
  15416. * _.truncate('hi-diddly-ho there, neighborino');
  15417. * // => 'hi-diddly-ho there, neighbo...'
  15418. *
  15419. * _.truncate('hi-diddly-ho there, neighborino', {
  15420. * 'length': 24,
  15421. * 'separator': ' '
  15422. * });
  15423. * // => 'hi-diddly-ho there,...'
  15424. *
  15425. * _.truncate('hi-diddly-ho there, neighborino', {
  15426. * 'length': 24,
  15427. * 'separator': /,? +/
  15428. * });
  15429. * // => 'hi-diddly-ho there...'
  15430. *
  15431. * _.truncate('hi-diddly-ho there, neighborino', {
  15432. * 'omission': ' [...]'
  15433. * });
  15434. * // => 'hi-diddly-ho there, neig [...]'
  15435. */
  15436. function truncate(string, options) {
  15437. var length = DEFAULT_TRUNC_LENGTH,
  15438. omission = DEFAULT_TRUNC_OMISSION;
  15439. if (isObject(options)) {
  15440. var separator = 'separator' in options ? options.separator : separator;
  15441. length = 'length' in options ? toInteger(options.length) : length;
  15442. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15443. }
  15444. string = toString(string);
  15445. var strLength = string.length;
  15446. if (hasUnicode(string)) {
  15447. var strSymbols = stringToArray(string);
  15448. strLength = strSymbols.length;
  15449. }
  15450. if (length >= strLength) {
  15451. return string;
  15452. }
  15453. var end = length - stringSize(omission);
  15454. if (end < 1) {
  15455. return omission;
  15456. }
  15457. var result = strSymbols
  15458. ? castSlice(strSymbols, 0, end).join('')
  15459. : string.slice(0, end);
  15460. if (separator === undefined) {
  15461. return result + omission;
  15462. }
  15463. if (strSymbols) {
  15464. end += (result.length - end);
  15465. }
  15466. if (isRegExp(separator)) {
  15467. if (string.slice(end).search(separator)) {
  15468. var match,
  15469. substring = result;
  15470. if (!separator.global) {
  15471. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15472. }
  15473. separator.lastIndex = 0;
  15474. while ((match = separator.exec(substring))) {
  15475. var newEnd = match.index;
  15476. }
  15477. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15478. }
  15479. } else if (string.indexOf(baseToString(separator), end) != end) {
  15480. var index = result.lastIndexOf(separator);
  15481. if (index > -1) {
  15482. result = result.slice(0, index);
  15483. }
  15484. }
  15485. return result + omission;
  15486. }
  15487. /**
  15488. * The inverse of `_.escape`; this method converts the HTML entities
  15489. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15490. * their corresponding characters.
  15491. *
  15492. * **Note:** No other HTML entities are unescaped. To unescape additional
  15493. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15494. *
  15495. * @static
  15496. * @memberOf _
  15497. * @since 0.6.0
  15498. * @category String
  15499. * @param {string} [string=''] The string to unescape.
  15500. * @returns {string} Returns the unescaped string.
  15501. * @example
  15502. *
  15503. * _.unescape('fred, barney, &amp; pebbles');
  15504. * // => 'fred, barney, & pebbles'
  15505. */
  15506. function unescape(string) {
  15507. string = toString(string);
  15508. return (string && reHasEscapedHtml.test(string))
  15509. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15510. : string;
  15511. }
  15512. /**
  15513. * Converts `string`, as space separated words, to upper case.
  15514. *
  15515. * @static
  15516. * @memberOf _
  15517. * @since 4.0.0
  15518. * @category String
  15519. * @param {string} [string=''] The string to convert.
  15520. * @returns {string} Returns the upper cased string.
  15521. * @example
  15522. *
  15523. * _.upperCase('--foo-bar');
  15524. * // => 'FOO BAR'
  15525. *
  15526. * _.upperCase('fooBar');
  15527. * // => 'FOO BAR'
  15528. *
  15529. * _.upperCase('__foo_bar__');
  15530. * // => 'FOO BAR'
  15531. */
  15532. var upperCase = createCompounder(function(result, word, index) {
  15533. return result + (index ? ' ' : '') + word.toUpperCase();
  15534. });
  15535. /**
  15536. * Converts the first character of `string` to upper case.
  15537. *
  15538. * @static
  15539. * @memberOf _
  15540. * @since 4.0.0
  15541. * @category String
  15542. * @param {string} [string=''] The string to convert.
  15543. * @returns {string} Returns the converted string.
  15544. * @example
  15545. *
  15546. * _.upperFirst('fred');
  15547. * // => 'Fred'
  15548. *
  15549. * _.upperFirst('FRED');
  15550. * // => 'FRED'
  15551. */
  15552. var upperFirst = createCaseFirst('toUpperCase');
  15553. /**
  15554. * Splits `string` into an array of its words.
  15555. *
  15556. * @static
  15557. * @memberOf _
  15558. * @since 3.0.0
  15559. * @category String
  15560. * @param {string} [string=''] The string to inspect.
  15561. * @param {RegExp|string} [pattern] The pattern to match words.
  15562. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15563. * @returns {Array} Returns the words of `string`.
  15564. * @example
  15565. *
  15566. * _.words('fred, barney, & pebbles');
  15567. * // => ['fred', 'barney', 'pebbles']
  15568. *
  15569. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15570. * // => ['fred', 'barney', '&', 'pebbles']
  15571. */
  15572. function words(string, pattern, guard) {
  15573. string = toString(string);
  15574. pattern = guard ? undefined : pattern;
  15575. if (pattern === undefined) {
  15576. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15577. }
  15578. return string.match(pattern) || [];
  15579. }
  15580. /*------------------------------------------------------------------------*/
  15581. /**
  15582. * Attempts to invoke `func`, returning either the result or the caught error
  15583. * object. Any additional arguments are provided to `func` when it's invoked.
  15584. *
  15585. * @static
  15586. * @memberOf _
  15587. * @since 3.0.0
  15588. * @category Util
  15589. * @param {Function} func The function to attempt.
  15590. * @param {...*} [args] The arguments to invoke `func` with.
  15591. * @returns {*} Returns the `func` result or error object.
  15592. * @example
  15593. *
  15594. * // Avoid throwing errors for invalid selectors.
  15595. * var elements = _.attempt(function(selector) {
  15596. * return document.querySelectorAll(selector);
  15597. * }, '>_>');
  15598. *
  15599. * if (_.isError(elements)) {
  15600. * elements = [];
  15601. * }
  15602. */
  15603. var attempt = baseRest(function(func, args) {
  15604. try {
  15605. return apply(func, undefined, args);
  15606. } catch (e) {
  15607. return isError(e) ? e : new Error(e);
  15608. }
  15609. });
  15610. /**
  15611. * Binds methods of an object to the object itself, overwriting the existing
  15612. * method.
  15613. *
  15614. * **Note:** This method doesn't set the "length" property of bound functions.
  15615. *
  15616. * @static
  15617. * @since 0.1.0
  15618. * @memberOf _
  15619. * @category Util
  15620. * @param {Object} object The object to bind and assign the bound methods to.
  15621. * @param {...(string|string[])} methodNames The object method names to bind.
  15622. * @returns {Object} Returns `object`.
  15623. * @example
  15624. *
  15625. * var view = {
  15626. * 'label': 'docs',
  15627. * 'click': function() {
  15628. * console.log('clicked ' + this.label);
  15629. * }
  15630. * };
  15631. *
  15632. * _.bindAll(view, ['click']);
  15633. * jQuery(element).on('click', view.click);
  15634. * // => Logs 'clicked docs' when clicked.
  15635. */
  15636. var bindAll = flatRest(function(object, methodNames) {
  15637. arrayEach(methodNames, function(key) {
  15638. key = toKey(key);
  15639. baseAssignValue(object, key, bind(object[key], object));
  15640. });
  15641. return object;
  15642. });
  15643. /**
  15644. * Creates a function that iterates over `pairs` and invokes the corresponding
  15645. * function of the first predicate to return truthy. The predicate-function
  15646. * pairs are invoked with the `this` binding and arguments of the created
  15647. * function.
  15648. *
  15649. * @static
  15650. * @memberOf _
  15651. * @since 4.0.0
  15652. * @category Util
  15653. * @param {Array} pairs The predicate-function pairs.
  15654. * @returns {Function} Returns the new composite function.
  15655. * @example
  15656. *
  15657. * var func = _.cond([
  15658. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15659. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15660. * [_.stubTrue, _.constant('no match')]
  15661. * ]);
  15662. *
  15663. * func({ 'a': 1, 'b': 2 });
  15664. * // => 'matches A'
  15665. *
  15666. * func({ 'a': 0, 'b': 1 });
  15667. * // => 'matches B'
  15668. *
  15669. * func({ 'a': '1', 'b': '2' });
  15670. * // => 'no match'
  15671. */
  15672. function cond(pairs) {
  15673. var length = pairs == null ? 0 : pairs.length,
  15674. toIteratee = getIteratee();
  15675. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15676. if (typeof pair[1] != 'function') {
  15677. throw new TypeError(FUNC_ERROR_TEXT);
  15678. }
  15679. return [toIteratee(pair[0]), pair[1]];
  15680. });
  15681. return baseRest(function(args) {
  15682. var index = -1;
  15683. while (++index < length) {
  15684. var pair = pairs[index];
  15685. if (apply(pair[0], this, args)) {
  15686. return apply(pair[1], this, args);
  15687. }
  15688. }
  15689. });
  15690. }
  15691. /**
  15692. * Creates a function that invokes the predicate properties of `source` with
  15693. * the corresponding property values of a given object, returning `true` if
  15694. * all predicates return truthy, else `false`.
  15695. *
  15696. * **Note:** The created function is equivalent to `_.conformsTo` with
  15697. * `source` partially applied.
  15698. *
  15699. * @static
  15700. * @memberOf _
  15701. * @since 4.0.0
  15702. * @category Util
  15703. * @param {Object} source The object of property predicates to conform to.
  15704. * @returns {Function} Returns the new spec function.
  15705. * @example
  15706. *
  15707. * var objects = [
  15708. * { 'a': 2, 'b': 1 },
  15709. * { 'a': 1, 'b': 2 }
  15710. * ];
  15711. *
  15712. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15713. * // => [{ 'a': 1, 'b': 2 }]
  15714. */
  15715. function conforms(source) {
  15716. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15717. }
  15718. /**
  15719. * Creates a function that returns `value`.
  15720. *
  15721. * @static
  15722. * @memberOf _
  15723. * @since 2.4.0
  15724. * @category Util
  15725. * @param {*} value The value to return from the new function.
  15726. * @returns {Function} Returns the new constant function.
  15727. * @example
  15728. *
  15729. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15730. *
  15731. * console.log(objects);
  15732. * // => [{ 'a': 1 }, { 'a': 1 }]
  15733. *
  15734. * console.log(objects[0] === objects[1]);
  15735. * // => true
  15736. */
  15737. function constant(value) {
  15738. return function() {
  15739. return value;
  15740. };
  15741. }
  15742. /**
  15743. * Checks `value` to determine whether a default value should be returned in
  15744. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15745. * or `undefined`.
  15746. *
  15747. * @static
  15748. * @memberOf _
  15749. * @since 4.14.0
  15750. * @category Util
  15751. * @param {*} value The value to check.
  15752. * @param {*} defaultValue The default value.
  15753. * @returns {*} Returns the resolved value.
  15754. * @example
  15755. *
  15756. * _.defaultTo(1, 10);
  15757. * // => 1
  15758. *
  15759. * _.defaultTo(undefined, 10);
  15760. * // => 10
  15761. */
  15762. function defaultTo(value, defaultValue) {
  15763. return (value == null || value !== value) ? defaultValue : value;
  15764. }
  15765. /**
  15766. * Creates a function that returns the result of invoking the given functions
  15767. * with the `this` binding of the created function, where each successive
  15768. * invocation is supplied the return value of the previous.
  15769. *
  15770. * @static
  15771. * @memberOf _
  15772. * @since 3.0.0
  15773. * @category Util
  15774. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15775. * @returns {Function} Returns the new composite function.
  15776. * @see _.flowRight
  15777. * @example
  15778. *
  15779. * function square(n) {
  15780. * return n * n;
  15781. * }
  15782. *
  15783. * var addSquare = _.flow([_.add, square]);
  15784. * addSquare(1, 2);
  15785. * // => 9
  15786. */
  15787. var flow = createFlow();
  15788. /**
  15789. * This method is like `_.flow` except that it creates a function that
  15790. * invokes the given functions from right to left.
  15791. *
  15792. * @static
  15793. * @since 3.0.0
  15794. * @memberOf _
  15795. * @category Util
  15796. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15797. * @returns {Function} Returns the new composite function.
  15798. * @see _.flow
  15799. * @example
  15800. *
  15801. * function square(n) {
  15802. * return n * n;
  15803. * }
  15804. *
  15805. * var addSquare = _.flowRight([square, _.add]);
  15806. * addSquare(1, 2);
  15807. * // => 9
  15808. */
  15809. var flowRight = createFlow(true);
  15810. /**
  15811. * This method returns the first argument it receives.
  15812. *
  15813. * @static
  15814. * @since 0.1.0
  15815. * @memberOf _
  15816. * @category Util
  15817. * @param {*} value Any value.
  15818. * @returns {*} Returns `value`.
  15819. * @example
  15820. *
  15821. * var object = { 'a': 1 };
  15822. *
  15823. * console.log(_.identity(object) === object);
  15824. * // => true
  15825. */
  15826. function identity(value) {
  15827. return value;
  15828. }
  15829. /**
  15830. * Creates a function that invokes `func` with the arguments of the created
  15831. * function. If `func` is a property name, the created function returns the
  15832. * property value for a given element. If `func` is an array or object, the
  15833. * created function returns `true` for elements that contain the equivalent
  15834. * source properties, otherwise it returns `false`.
  15835. *
  15836. * @static
  15837. * @since 4.0.0
  15838. * @memberOf _
  15839. * @category Util
  15840. * @param {*} [func=_.identity] The value to convert to a callback.
  15841. * @returns {Function} Returns the callback.
  15842. * @example
  15843. *
  15844. * var users = [
  15845. * { 'user': 'barney', 'age': 36, 'active': true },
  15846. * { 'user': 'fred', 'age': 40, 'active': false }
  15847. * ];
  15848. *
  15849. * // The `_.matches` iteratee shorthand.
  15850. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15851. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15852. *
  15853. * // The `_.matchesProperty` iteratee shorthand.
  15854. * _.filter(users, _.iteratee(['user', 'fred']));
  15855. * // => [{ 'user': 'fred', 'age': 40 }]
  15856. *
  15857. * // The `_.property` iteratee shorthand.
  15858. * _.map(users, _.iteratee('user'));
  15859. * // => ['barney', 'fred']
  15860. *
  15861. * // Create custom iteratee shorthands.
  15862. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15863. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15864. * return func.test(string);
  15865. * };
  15866. * });
  15867. *
  15868. * _.filter(['abc', 'def'], /ef/);
  15869. * // => ['def']
  15870. */
  15871. function iteratee(func) {
  15872. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15873. }
  15874. /**
  15875. * Creates a function that performs a partial deep comparison between a given
  15876. * object and `source`, returning `true` if the given object has equivalent
  15877. * property values, else `false`.
  15878. *
  15879. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15880. * partially applied.
  15881. *
  15882. * Partial comparisons will match empty array and empty object `source`
  15883. * values against any array or object value, respectively. See `_.isEqual`
  15884. * for a list of supported value comparisons.
  15885. *
  15886. * **Note:** Multiple values can be checked by combining several matchers
  15887. * using `_.overSome`
  15888. *
  15889. * @static
  15890. * @memberOf _
  15891. * @since 3.0.0
  15892. * @category Util
  15893. * @param {Object} source The object of property values to match.
  15894. * @returns {Function} Returns the new spec function.
  15895. * @example
  15896. *
  15897. * var objects = [
  15898. * { 'a': 1, 'b': 2, 'c': 3 },
  15899. * { 'a': 4, 'b': 5, 'c': 6 }
  15900. * ];
  15901. *
  15902. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15903. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15904. *
  15905. * // Checking for several possible values
  15906. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15907. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15908. */
  15909. function matches(source) {
  15910. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15911. }
  15912. /**
  15913. * Creates a function that performs a partial deep comparison between the
  15914. * value at `path` of a given object to `srcValue`, returning `true` if the
  15915. * object value is equivalent, else `false`.
  15916. *
  15917. * **Note:** Partial comparisons will match empty array and empty object
  15918. * `srcValue` values against any array or object value, respectively. See
  15919. * `_.isEqual` for a list of supported value comparisons.
  15920. *
  15921. * **Note:** Multiple values can be checked by combining several matchers
  15922. * using `_.overSome`
  15923. *
  15924. * @static
  15925. * @memberOf _
  15926. * @since 3.2.0
  15927. * @category Util
  15928. * @param {Array|string} path The path of the property to get.
  15929. * @param {*} srcValue The value to match.
  15930. * @returns {Function} Returns the new spec function.
  15931. * @example
  15932. *
  15933. * var objects = [
  15934. * { 'a': 1, 'b': 2, 'c': 3 },
  15935. * { 'a': 4, 'b': 5, 'c': 6 }
  15936. * ];
  15937. *
  15938. * _.find(objects, _.matchesProperty('a', 4));
  15939. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15940. *
  15941. * // Checking for several possible values
  15942. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15943. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15944. */
  15945. function matchesProperty(path, srcValue) {
  15946. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15947. }
  15948. /**
  15949. * Creates a function that invokes the method at `path` of a given object.
  15950. * Any additional arguments are provided to the invoked method.
  15951. *
  15952. * @static
  15953. * @memberOf _
  15954. * @since 3.7.0
  15955. * @category Util
  15956. * @param {Array|string} path The path of the method to invoke.
  15957. * @param {...*} [args] The arguments to invoke the method with.
  15958. * @returns {Function} Returns the new invoker function.
  15959. * @example
  15960. *
  15961. * var objects = [
  15962. * { 'a': { 'b': _.constant(2) } },
  15963. * { 'a': { 'b': _.constant(1) } }
  15964. * ];
  15965. *
  15966. * _.map(objects, _.method('a.b'));
  15967. * // => [2, 1]
  15968. *
  15969. * _.map(objects, _.method(['a', 'b']));
  15970. * // => [2, 1]
  15971. */
  15972. var method = baseRest(function(path, args) {
  15973. return function(object) {
  15974. return baseInvoke(object, path, args);
  15975. };
  15976. });
  15977. /**
  15978. * The opposite of `_.method`; this method creates a function that invokes
  15979. * the method at a given path of `object`. Any additional arguments are
  15980. * provided to the invoked method.
  15981. *
  15982. * @static
  15983. * @memberOf _
  15984. * @since 3.7.0
  15985. * @category Util
  15986. * @param {Object} object The object to query.
  15987. * @param {...*} [args] The arguments to invoke the method with.
  15988. * @returns {Function} Returns the new invoker function.
  15989. * @example
  15990. *
  15991. * var array = _.times(3, _.constant),
  15992. * object = { 'a': array, 'b': array, 'c': array };
  15993. *
  15994. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15995. * // => [2, 0]
  15996. *
  15997. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15998. * // => [2, 0]
  15999. */
  16000. var methodOf = baseRest(function(object, args) {
  16001. return function(path) {
  16002. return baseInvoke(object, path, args);
  16003. };
  16004. });
  16005. /**
  16006. * Adds all own enumerable string keyed function properties of a source
  16007. * object to the destination object. If `object` is a function, then methods
  16008. * are added to its prototype as well.
  16009. *
  16010. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16011. * avoid conflicts caused by modifying the original.
  16012. *
  16013. * @static
  16014. * @since 0.1.0
  16015. * @memberOf _
  16016. * @category Util
  16017. * @param {Function|Object} [object=lodash] The destination object.
  16018. * @param {Object} source The object of functions to add.
  16019. * @param {Object} [options={}] The options object.
  16020. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16021. * @returns {Function|Object} Returns `object`.
  16022. * @example
  16023. *
  16024. * function vowels(string) {
  16025. * return _.filter(string, function(v) {
  16026. * return /[aeiou]/i.test(v);
  16027. * });
  16028. * }
  16029. *
  16030. * _.mixin({ 'vowels': vowels });
  16031. * _.vowels('fred');
  16032. * // => ['e']
  16033. *
  16034. * _('fred').vowels().value();
  16035. * // => ['e']
  16036. *
  16037. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16038. * _('fred').vowels();
  16039. * // => ['e']
  16040. */
  16041. function mixin(object, source, options) {
  16042. var props = keys(source),
  16043. methodNames = baseFunctions(source, props);
  16044. if (options == null &&
  16045. !(isObject(source) && (methodNames.length || !props.length))) {
  16046. options = source;
  16047. source = object;
  16048. object = this;
  16049. methodNames = baseFunctions(source, keys(source));
  16050. }
  16051. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16052. isFunc = isFunction(object);
  16053. arrayEach(methodNames, function(methodName) {
  16054. var func = source[methodName];
  16055. object[methodName] = func;
  16056. if (isFunc) {
  16057. object.prototype[methodName] = function() {
  16058. var chainAll = this.__chain__;
  16059. if (chain || chainAll) {
  16060. var result = object(this.__wrapped__),
  16061. actions = result.__actions__ = copyArray(this.__actions__);
  16062. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16063. result.__chain__ = chainAll;
  16064. return result;
  16065. }
  16066. return func.apply(object, arrayPush([this.value()], arguments));
  16067. };
  16068. }
  16069. });
  16070. return object;
  16071. }
  16072. /**
  16073. * Reverts the `_` variable to its previous value and returns a reference to
  16074. * the `lodash` function.
  16075. *
  16076. * @static
  16077. * @since 0.1.0
  16078. * @memberOf _
  16079. * @category Util
  16080. * @returns {Function} Returns the `lodash` function.
  16081. * @example
  16082. *
  16083. * var lodash = _.noConflict();
  16084. */
  16085. function noConflict() {
  16086. if (root._ === this) {
  16087. root._ = oldDash;
  16088. }
  16089. return this;
  16090. }
  16091. /**
  16092. * This method returns `undefined`.
  16093. *
  16094. * @static
  16095. * @memberOf _
  16096. * @since 2.3.0
  16097. * @category Util
  16098. * @example
  16099. *
  16100. * _.times(2, _.noop);
  16101. * // => [undefined, undefined]
  16102. */
  16103. function noop() {
  16104. // No operation performed.
  16105. }
  16106. /**
  16107. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16108. * the nth argument from the end is returned.
  16109. *
  16110. * @static
  16111. * @memberOf _
  16112. * @since 4.0.0
  16113. * @category Util
  16114. * @param {number} [n=0] The index of the argument to return.
  16115. * @returns {Function} Returns the new pass-thru function.
  16116. * @example
  16117. *
  16118. * var func = _.nthArg(1);
  16119. * func('a', 'b', 'c', 'd');
  16120. * // => 'b'
  16121. *
  16122. * var func = _.nthArg(-2);
  16123. * func('a', 'b', 'c', 'd');
  16124. * // => 'c'
  16125. */
  16126. function nthArg(n) {
  16127. n = toInteger(n);
  16128. return baseRest(function(args) {
  16129. return baseNth(args, n);
  16130. });
  16131. }
  16132. /**
  16133. * Creates a function that invokes `iteratees` with the arguments it receives
  16134. * and returns their results.
  16135. *
  16136. * @static
  16137. * @memberOf _
  16138. * @since 4.0.0
  16139. * @category Util
  16140. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16141. * The iteratees to invoke.
  16142. * @returns {Function} Returns the new function.
  16143. * @example
  16144. *
  16145. * var func = _.over([Math.max, Math.min]);
  16146. *
  16147. * func(1, 2, 3, 4);
  16148. * // => [4, 1]
  16149. */
  16150. var over = createOver(arrayMap);
  16151. /**
  16152. * Creates a function that checks if **all** of the `predicates` return
  16153. * truthy when invoked with the arguments it receives.
  16154. *
  16155. * Following shorthands are possible for providing predicates.
  16156. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16157. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16158. *
  16159. * @static
  16160. * @memberOf _
  16161. * @since 4.0.0
  16162. * @category Util
  16163. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16164. * The predicates to check.
  16165. * @returns {Function} Returns the new function.
  16166. * @example
  16167. *
  16168. * var func = _.overEvery([Boolean, isFinite]);
  16169. *
  16170. * func('1');
  16171. * // => true
  16172. *
  16173. * func(null);
  16174. * // => false
  16175. *
  16176. * func(NaN);
  16177. * // => false
  16178. */
  16179. var overEvery = createOver(arrayEvery);
  16180. /**
  16181. * Creates a function that checks if **any** of the `predicates` return
  16182. * truthy when invoked with the arguments it receives.
  16183. *
  16184. * Following shorthands are possible for providing predicates.
  16185. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16186. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16187. *
  16188. * @static
  16189. * @memberOf _
  16190. * @since 4.0.0
  16191. * @category Util
  16192. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16193. * The predicates to check.
  16194. * @returns {Function} Returns the new function.
  16195. * @example
  16196. *
  16197. * var func = _.overSome([Boolean, isFinite]);
  16198. *
  16199. * func('1');
  16200. * // => true
  16201. *
  16202. * func(null);
  16203. * // => true
  16204. *
  16205. * func(NaN);
  16206. * // => false
  16207. *
  16208. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16209. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16210. */
  16211. var overSome = createOver(arraySome);
  16212. /**
  16213. * Creates a function that returns the value at `path` of a given object.
  16214. *
  16215. * @static
  16216. * @memberOf _
  16217. * @since 2.4.0
  16218. * @category Util
  16219. * @param {Array|string} path The path of the property to get.
  16220. * @returns {Function} Returns the new accessor function.
  16221. * @example
  16222. *
  16223. * var objects = [
  16224. * { 'a': { 'b': 2 } },
  16225. * { 'a': { 'b': 1 } }
  16226. * ];
  16227. *
  16228. * _.map(objects, _.property('a.b'));
  16229. * // => [2, 1]
  16230. *
  16231. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16232. * // => [1, 2]
  16233. */
  16234. function property(path) {
  16235. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16236. }
  16237. /**
  16238. * The opposite of `_.property`; this method creates a function that returns
  16239. * the value at a given path of `object`.
  16240. *
  16241. * @static
  16242. * @memberOf _
  16243. * @since 3.0.0
  16244. * @category Util
  16245. * @param {Object} object The object to query.
  16246. * @returns {Function} Returns the new accessor function.
  16247. * @example
  16248. *
  16249. * var array = [0, 1, 2],
  16250. * object = { 'a': array, 'b': array, 'c': array };
  16251. *
  16252. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16253. * // => [2, 0]
  16254. *
  16255. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16256. * // => [2, 0]
  16257. */
  16258. function propertyOf(object) {
  16259. return function(path) {
  16260. return object == null ? undefined : baseGet(object, path);
  16261. };
  16262. }
  16263. /**
  16264. * Creates an array of numbers (positive and/or negative) progressing from
  16265. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16266. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16267. * it's set to `start` with `start` then set to `0`.
  16268. *
  16269. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16270. * floating-point values which can produce unexpected results.
  16271. *
  16272. * @static
  16273. * @since 0.1.0
  16274. * @memberOf _
  16275. * @category Util
  16276. * @param {number} [start=0] The start of the range.
  16277. * @param {number} end The end of the range.
  16278. * @param {number} [step=1] The value to increment or decrement by.
  16279. * @returns {Array} Returns the range of numbers.
  16280. * @see _.inRange, _.rangeRight
  16281. * @example
  16282. *
  16283. * _.range(4);
  16284. * // => [0, 1, 2, 3]
  16285. *
  16286. * _.range(-4);
  16287. * // => [0, -1, -2, -3]
  16288. *
  16289. * _.range(1, 5);
  16290. * // => [1, 2, 3, 4]
  16291. *
  16292. * _.range(0, 20, 5);
  16293. * // => [0, 5, 10, 15]
  16294. *
  16295. * _.range(0, -4, -1);
  16296. * // => [0, -1, -2, -3]
  16297. *
  16298. * _.range(1, 4, 0);
  16299. * // => [1, 1, 1]
  16300. *
  16301. * _.range(0);
  16302. * // => []
  16303. */
  16304. var range = createRange();
  16305. /**
  16306. * This method is like `_.range` except that it populates values in
  16307. * descending order.
  16308. *
  16309. * @static
  16310. * @memberOf _
  16311. * @since 4.0.0
  16312. * @category Util
  16313. * @param {number} [start=0] The start of the range.
  16314. * @param {number} end The end of the range.
  16315. * @param {number} [step=1] The value to increment or decrement by.
  16316. * @returns {Array} Returns the range of numbers.
  16317. * @see _.inRange, _.range
  16318. * @example
  16319. *
  16320. * _.rangeRight(4);
  16321. * // => [3, 2, 1, 0]
  16322. *
  16323. * _.rangeRight(-4);
  16324. * // => [-3, -2, -1, 0]
  16325. *
  16326. * _.rangeRight(1, 5);
  16327. * // => [4, 3, 2, 1]
  16328. *
  16329. * _.rangeRight(0, 20, 5);
  16330. * // => [15, 10, 5, 0]
  16331. *
  16332. * _.rangeRight(0, -4, -1);
  16333. * // => [-3, -2, -1, 0]
  16334. *
  16335. * _.rangeRight(1, 4, 0);
  16336. * // => [1, 1, 1]
  16337. *
  16338. * _.rangeRight(0);
  16339. * // => []
  16340. */
  16341. var rangeRight = createRange(true);
  16342. /**
  16343. * This method returns a new empty array.
  16344. *
  16345. * @static
  16346. * @memberOf _
  16347. * @since 4.13.0
  16348. * @category Util
  16349. * @returns {Array} Returns the new empty array.
  16350. * @example
  16351. *
  16352. * var arrays = _.times(2, _.stubArray);
  16353. *
  16354. * console.log(arrays);
  16355. * // => [[], []]
  16356. *
  16357. * console.log(arrays[0] === arrays[1]);
  16358. * // => false
  16359. */
  16360. function stubArray() {
  16361. return [];
  16362. }
  16363. /**
  16364. * This method returns `false`.
  16365. *
  16366. * @static
  16367. * @memberOf _
  16368. * @since 4.13.0
  16369. * @category Util
  16370. * @returns {boolean} Returns `false`.
  16371. * @example
  16372. *
  16373. * _.times(2, _.stubFalse);
  16374. * // => [false, false]
  16375. */
  16376. function stubFalse() {
  16377. return false;
  16378. }
  16379. /**
  16380. * This method returns a new empty object.
  16381. *
  16382. * @static
  16383. * @memberOf _
  16384. * @since 4.13.0
  16385. * @category Util
  16386. * @returns {Object} Returns the new empty object.
  16387. * @example
  16388. *
  16389. * var objects = _.times(2, _.stubObject);
  16390. *
  16391. * console.log(objects);
  16392. * // => [{}, {}]
  16393. *
  16394. * console.log(objects[0] === objects[1]);
  16395. * // => false
  16396. */
  16397. function stubObject() {
  16398. return {};
  16399. }
  16400. /**
  16401. * This method returns an empty string.
  16402. *
  16403. * @static
  16404. * @memberOf _
  16405. * @since 4.13.0
  16406. * @category Util
  16407. * @returns {string} Returns the empty string.
  16408. * @example
  16409. *
  16410. * _.times(2, _.stubString);
  16411. * // => ['', '']
  16412. */
  16413. function stubString() {
  16414. return '';
  16415. }
  16416. /**
  16417. * This method returns `true`.
  16418. *
  16419. * @static
  16420. * @memberOf _
  16421. * @since 4.13.0
  16422. * @category Util
  16423. * @returns {boolean} Returns `true`.
  16424. * @example
  16425. *
  16426. * _.times(2, _.stubTrue);
  16427. * // => [true, true]
  16428. */
  16429. function stubTrue() {
  16430. return true;
  16431. }
  16432. /**
  16433. * Invokes the iteratee `n` times, returning an array of the results of
  16434. * each invocation. The iteratee is invoked with one argument; (index).
  16435. *
  16436. * @static
  16437. * @since 0.1.0
  16438. * @memberOf _
  16439. * @category Util
  16440. * @param {number} n The number of times to invoke `iteratee`.
  16441. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16442. * @returns {Array} Returns the array of results.
  16443. * @example
  16444. *
  16445. * _.times(3, String);
  16446. * // => ['0', '1', '2']
  16447. *
  16448. * _.times(4, _.constant(0));
  16449. * // => [0, 0, 0, 0]
  16450. */
  16451. function times(n, iteratee) {
  16452. n = toInteger(n);
  16453. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16454. return [];
  16455. }
  16456. var index = MAX_ARRAY_LENGTH,
  16457. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16458. iteratee = getIteratee(iteratee);
  16459. n -= MAX_ARRAY_LENGTH;
  16460. var result = baseTimes(length, iteratee);
  16461. while (++index < n) {
  16462. iteratee(index);
  16463. }
  16464. return result;
  16465. }
  16466. /**
  16467. * Converts `value` to a property path array.
  16468. *
  16469. * @static
  16470. * @memberOf _
  16471. * @since 4.0.0
  16472. * @category Util
  16473. * @param {*} value The value to convert.
  16474. * @returns {Array} Returns the new property path array.
  16475. * @example
  16476. *
  16477. * _.toPath('a.b.c');
  16478. * // => ['a', 'b', 'c']
  16479. *
  16480. * _.toPath('a[0].b.c');
  16481. * // => ['a', '0', 'b', 'c']
  16482. */
  16483. function toPath(value) {
  16484. if (isArray(value)) {
  16485. return arrayMap(value, toKey);
  16486. }
  16487. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16488. }
  16489. /**
  16490. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16491. *
  16492. * @static
  16493. * @since 0.1.0
  16494. * @memberOf _
  16495. * @category Util
  16496. * @param {string} [prefix=''] The value to prefix the ID with.
  16497. * @returns {string} Returns the unique ID.
  16498. * @example
  16499. *
  16500. * _.uniqueId('contact_');
  16501. * // => 'contact_104'
  16502. *
  16503. * _.uniqueId();
  16504. * // => '105'
  16505. */
  16506. function uniqueId(prefix) {
  16507. var id = ++idCounter;
  16508. return toString(prefix) + id;
  16509. }
  16510. /*------------------------------------------------------------------------*/
  16511. /**
  16512. * Adds two numbers.
  16513. *
  16514. * @static
  16515. * @memberOf _
  16516. * @since 3.4.0
  16517. * @category Math
  16518. * @param {number} augend The first number in an addition.
  16519. * @param {number} addend The second number in an addition.
  16520. * @returns {number} Returns the total.
  16521. * @example
  16522. *
  16523. * _.add(6, 4);
  16524. * // => 10
  16525. */
  16526. var add = createMathOperation(function(augend, addend) {
  16527. return augend + addend;
  16528. }, 0);
  16529. /**
  16530. * Computes `number` rounded up to `precision`.
  16531. *
  16532. * @static
  16533. * @memberOf _
  16534. * @since 3.10.0
  16535. * @category Math
  16536. * @param {number} number The number to round up.
  16537. * @param {number} [precision=0] The precision to round up to.
  16538. * @returns {number} Returns the rounded up number.
  16539. * @example
  16540. *
  16541. * _.ceil(4.006);
  16542. * // => 5
  16543. *
  16544. * _.ceil(6.004, 2);
  16545. * // => 6.01
  16546. *
  16547. * _.ceil(6040, -2);
  16548. * // => 6100
  16549. */
  16550. var ceil = createRound('ceil');
  16551. /**
  16552. * Divide two numbers.
  16553. *
  16554. * @static
  16555. * @memberOf _
  16556. * @since 4.7.0
  16557. * @category Math
  16558. * @param {number} dividend The first number in a division.
  16559. * @param {number} divisor The second number in a division.
  16560. * @returns {number} Returns the quotient.
  16561. * @example
  16562. *
  16563. * _.divide(6, 4);
  16564. * // => 1.5
  16565. */
  16566. var divide = createMathOperation(function(dividend, divisor) {
  16567. return dividend / divisor;
  16568. }, 1);
  16569. /**
  16570. * Computes `number` rounded down to `precision`.
  16571. *
  16572. * @static
  16573. * @memberOf _
  16574. * @since 3.10.0
  16575. * @category Math
  16576. * @param {number} number The number to round down.
  16577. * @param {number} [precision=0] The precision to round down to.
  16578. * @returns {number} Returns the rounded down number.
  16579. * @example
  16580. *
  16581. * _.floor(4.006);
  16582. * // => 4
  16583. *
  16584. * _.floor(0.046, 2);
  16585. * // => 0.04
  16586. *
  16587. * _.floor(4060, -2);
  16588. * // => 4000
  16589. */
  16590. var floor = createRound('floor');
  16591. /**
  16592. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16593. * `undefined` is returned.
  16594. *
  16595. * @static
  16596. * @since 0.1.0
  16597. * @memberOf _
  16598. * @category Math
  16599. * @param {Array} array The array to iterate over.
  16600. * @returns {*} Returns the maximum value.
  16601. * @example
  16602. *
  16603. * _.max([4, 2, 8, 6]);
  16604. * // => 8
  16605. *
  16606. * _.max([]);
  16607. * // => undefined
  16608. */
  16609. function max(array) {
  16610. return (array && array.length)
  16611. ? baseExtremum(array, identity, baseGt)
  16612. : undefined;
  16613. }
  16614. /**
  16615. * This method is like `_.max` except that it accepts `iteratee` which is
  16616. * invoked for each element in `array` to generate the criterion by which
  16617. * the value is ranked. The iteratee is invoked with one argument: (value).
  16618. *
  16619. * @static
  16620. * @memberOf _
  16621. * @since 4.0.0
  16622. * @category Math
  16623. * @param {Array} array The array to iterate over.
  16624. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16625. * @returns {*} Returns the maximum value.
  16626. * @example
  16627. *
  16628. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16629. *
  16630. * _.maxBy(objects, function(o) { return o.n; });
  16631. * // => { 'n': 2 }
  16632. *
  16633. * // The `_.property` iteratee shorthand.
  16634. * _.maxBy(objects, 'n');
  16635. * // => { 'n': 2 }
  16636. */
  16637. function maxBy(array, iteratee) {
  16638. return (array && array.length)
  16639. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16640. : undefined;
  16641. }
  16642. /**
  16643. * Computes the mean of the values in `array`.
  16644. *
  16645. * @static
  16646. * @memberOf _
  16647. * @since 4.0.0
  16648. * @category Math
  16649. * @param {Array} array The array to iterate over.
  16650. * @returns {number} Returns the mean.
  16651. * @example
  16652. *
  16653. * _.mean([4, 2, 8, 6]);
  16654. * // => 5
  16655. */
  16656. function mean(array) {
  16657. return baseMean(array, identity);
  16658. }
  16659. /**
  16660. * This method is like `_.mean` except that it accepts `iteratee` which is
  16661. * invoked for each element in `array` to generate the value to be averaged.
  16662. * The iteratee is invoked with one argument: (value).
  16663. *
  16664. * @static
  16665. * @memberOf _
  16666. * @since 4.7.0
  16667. * @category Math
  16668. * @param {Array} array The array to iterate over.
  16669. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16670. * @returns {number} Returns the mean.
  16671. * @example
  16672. *
  16673. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16674. *
  16675. * _.meanBy(objects, function(o) { return o.n; });
  16676. * // => 5
  16677. *
  16678. * // The `_.property` iteratee shorthand.
  16679. * _.meanBy(objects, 'n');
  16680. * // => 5
  16681. */
  16682. function meanBy(array, iteratee) {
  16683. return baseMean(array, getIteratee(iteratee, 2));
  16684. }
  16685. /**
  16686. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16687. * `undefined` is returned.
  16688. *
  16689. * @static
  16690. * @since 0.1.0
  16691. * @memberOf _
  16692. * @category Math
  16693. * @param {Array} array The array to iterate over.
  16694. * @returns {*} Returns the minimum value.
  16695. * @example
  16696. *
  16697. * _.min([4, 2, 8, 6]);
  16698. * // => 2
  16699. *
  16700. * _.min([]);
  16701. * // => undefined
  16702. */
  16703. function min(array) {
  16704. return (array && array.length)
  16705. ? baseExtremum(array, identity, baseLt)
  16706. : undefined;
  16707. }
  16708. /**
  16709. * This method is like `_.min` except that it accepts `iteratee` which is
  16710. * invoked for each element in `array` to generate the criterion by which
  16711. * the value is ranked. The iteratee is invoked with one argument: (value).
  16712. *
  16713. * @static
  16714. * @memberOf _
  16715. * @since 4.0.0
  16716. * @category Math
  16717. * @param {Array} array The array to iterate over.
  16718. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16719. * @returns {*} Returns the minimum value.
  16720. * @example
  16721. *
  16722. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16723. *
  16724. * _.minBy(objects, function(o) { return o.n; });
  16725. * // => { 'n': 1 }
  16726. *
  16727. * // The `_.property` iteratee shorthand.
  16728. * _.minBy(objects, 'n');
  16729. * // => { 'n': 1 }
  16730. */
  16731. function minBy(array, iteratee) {
  16732. return (array && array.length)
  16733. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16734. : undefined;
  16735. }
  16736. /**
  16737. * Multiply two numbers.
  16738. *
  16739. * @static
  16740. * @memberOf _
  16741. * @since 4.7.0
  16742. * @category Math
  16743. * @param {number} multiplier The first number in a multiplication.
  16744. * @param {number} multiplicand The second number in a multiplication.
  16745. * @returns {number} Returns the product.
  16746. * @example
  16747. *
  16748. * _.multiply(6, 4);
  16749. * // => 24
  16750. */
  16751. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16752. return multiplier * multiplicand;
  16753. }, 1);
  16754. /**
  16755. * Computes `number` rounded to `precision`.
  16756. *
  16757. * @static
  16758. * @memberOf _
  16759. * @since 3.10.0
  16760. * @category Math
  16761. * @param {number} number The number to round.
  16762. * @param {number} [precision=0] The precision to round to.
  16763. * @returns {number} Returns the rounded number.
  16764. * @example
  16765. *
  16766. * _.round(4.006);
  16767. * // => 4
  16768. *
  16769. * _.round(4.006, 2);
  16770. * // => 4.01
  16771. *
  16772. * _.round(4060, -2);
  16773. * // => 4100
  16774. */
  16775. var round = createRound('round');
  16776. /**
  16777. * Subtract two numbers.
  16778. *
  16779. * @static
  16780. * @memberOf _
  16781. * @since 4.0.0
  16782. * @category Math
  16783. * @param {number} minuend The first number in a subtraction.
  16784. * @param {number} subtrahend The second number in a subtraction.
  16785. * @returns {number} Returns the difference.
  16786. * @example
  16787. *
  16788. * _.subtract(6, 4);
  16789. * // => 2
  16790. */
  16791. var subtract = createMathOperation(function(minuend, subtrahend) {
  16792. return minuend - subtrahend;
  16793. }, 0);
  16794. /**
  16795. * Computes the sum of the values in `array`.
  16796. *
  16797. * @static
  16798. * @memberOf _
  16799. * @since 3.4.0
  16800. * @category Math
  16801. * @param {Array} array The array to iterate over.
  16802. * @returns {number} Returns the sum.
  16803. * @example
  16804. *
  16805. * _.sum([4, 2, 8, 6]);
  16806. * // => 20
  16807. */
  16808. function sum(array) {
  16809. return (array && array.length)
  16810. ? baseSum(array, identity)
  16811. : 0;
  16812. }
  16813. /**
  16814. * This method is like `_.sum` except that it accepts `iteratee` which is
  16815. * invoked for each element in `array` to generate the value to be summed.
  16816. * The iteratee is invoked with one argument: (value).
  16817. *
  16818. * @static
  16819. * @memberOf _
  16820. * @since 4.0.0
  16821. * @category Math
  16822. * @param {Array} array The array to iterate over.
  16823. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16824. * @returns {number} Returns the sum.
  16825. * @example
  16826. *
  16827. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16828. *
  16829. * _.sumBy(objects, function(o) { return o.n; });
  16830. * // => 20
  16831. *
  16832. * // The `_.property` iteratee shorthand.
  16833. * _.sumBy(objects, 'n');
  16834. * // => 20
  16835. */
  16836. function sumBy(array, iteratee) {
  16837. return (array && array.length)
  16838. ? baseSum(array, getIteratee(iteratee, 2))
  16839. : 0;
  16840. }
  16841. /*------------------------------------------------------------------------*/
  16842. // Add methods that return wrapped values in chain sequences.
  16843. lodash.after = after;
  16844. lodash.ary = ary;
  16845. lodash.assign = assign;
  16846. lodash.assignIn = assignIn;
  16847. lodash.assignInWith = assignInWith;
  16848. lodash.assignWith = assignWith;
  16849. lodash.at = at;
  16850. lodash.before = before;
  16851. lodash.bind = bind;
  16852. lodash.bindAll = bindAll;
  16853. lodash.bindKey = bindKey;
  16854. lodash.castArray = castArray;
  16855. lodash.chain = chain;
  16856. lodash.chunk = chunk;
  16857. lodash.compact = compact;
  16858. lodash.concat = concat;
  16859. lodash.cond = cond;
  16860. lodash.conforms = conforms;
  16861. lodash.constant = constant;
  16862. lodash.countBy = countBy;
  16863. lodash.create = create;
  16864. lodash.curry = curry;
  16865. lodash.curryRight = curryRight;
  16866. lodash.debounce = debounce;
  16867. lodash.defaults = defaults;
  16868. lodash.defaultsDeep = defaultsDeep;
  16869. lodash.defer = defer;
  16870. lodash.delay = delay;
  16871. lodash.difference = difference;
  16872. lodash.differenceBy = differenceBy;
  16873. lodash.differenceWith = differenceWith;
  16874. lodash.drop = drop;
  16875. lodash.dropRight = dropRight;
  16876. lodash.dropRightWhile = dropRightWhile;
  16877. lodash.dropWhile = dropWhile;
  16878. lodash.fill = fill;
  16879. lodash.filter = filter;
  16880. lodash.flatMap = flatMap;
  16881. lodash.flatMapDeep = flatMapDeep;
  16882. lodash.flatMapDepth = flatMapDepth;
  16883. lodash.flatten = flatten;
  16884. lodash.flattenDeep = flattenDeep;
  16885. lodash.flattenDepth = flattenDepth;
  16886. lodash.flip = flip;
  16887. lodash.flow = flow;
  16888. lodash.flowRight = flowRight;
  16889. lodash.fromPairs = fromPairs;
  16890. lodash.functions = functions;
  16891. lodash.functionsIn = functionsIn;
  16892. lodash.groupBy = groupBy;
  16893. lodash.initial = initial;
  16894. lodash.intersection = intersection;
  16895. lodash.intersectionBy = intersectionBy;
  16896. lodash.intersectionWith = intersectionWith;
  16897. lodash.invert = invert;
  16898. lodash.invertBy = invertBy;
  16899. lodash.invokeMap = invokeMap;
  16900. lodash.iteratee = iteratee;
  16901. lodash.keyBy = keyBy;
  16902. lodash.keys = keys;
  16903. lodash.keysIn = keysIn;
  16904. lodash.map = map;
  16905. lodash.mapKeys = mapKeys;
  16906. lodash.mapValues = mapValues;
  16907. lodash.matches = matches;
  16908. lodash.matchesProperty = matchesProperty;
  16909. lodash.memoize = memoize;
  16910. lodash.merge = merge;
  16911. lodash.mergeWith = mergeWith;
  16912. lodash.method = method;
  16913. lodash.methodOf = methodOf;
  16914. lodash.mixin = mixin;
  16915. lodash.negate = negate;
  16916. lodash.nthArg = nthArg;
  16917. lodash.omit = omit;
  16918. lodash.omitBy = omitBy;
  16919. lodash.once = once;
  16920. lodash.orderBy = orderBy;
  16921. lodash.over = over;
  16922. lodash.overArgs = overArgs;
  16923. lodash.overEvery = overEvery;
  16924. lodash.overSome = overSome;
  16925. lodash.partial = partial;
  16926. lodash.partialRight = partialRight;
  16927. lodash.partition = partition;
  16928. lodash.pick = pick;
  16929. lodash.pickBy = pickBy;
  16930. lodash.property = property;
  16931. lodash.propertyOf = propertyOf;
  16932. lodash.pull = pull;
  16933. lodash.pullAll = pullAll;
  16934. lodash.pullAllBy = pullAllBy;
  16935. lodash.pullAllWith = pullAllWith;
  16936. lodash.pullAt = pullAt;
  16937. lodash.range = range;
  16938. lodash.rangeRight = rangeRight;
  16939. lodash.rearg = rearg;
  16940. lodash.reject = reject;
  16941. lodash.remove = remove;
  16942. lodash.rest = rest;
  16943. lodash.reverse = reverse;
  16944. lodash.sampleSize = sampleSize;
  16945. lodash.set = set;
  16946. lodash.setWith = setWith;
  16947. lodash.shuffle = shuffle;
  16948. lodash.slice = slice;
  16949. lodash.sortBy = sortBy;
  16950. lodash.sortedUniq = sortedUniq;
  16951. lodash.sortedUniqBy = sortedUniqBy;
  16952. lodash.split = split;
  16953. lodash.spread = spread;
  16954. lodash.tail = tail;
  16955. lodash.take = take;
  16956. lodash.takeRight = takeRight;
  16957. lodash.takeRightWhile = takeRightWhile;
  16958. lodash.takeWhile = takeWhile;
  16959. lodash.tap = tap;
  16960. lodash.throttle = throttle;
  16961. lodash.thru = thru;
  16962. lodash.toArray = toArray;
  16963. lodash.toPairs = toPairs;
  16964. lodash.toPairsIn = toPairsIn;
  16965. lodash.toPath = toPath;
  16966. lodash.toPlainObject = toPlainObject;
  16967. lodash.transform = transform;
  16968. lodash.unary = unary;
  16969. lodash.union = union;
  16970. lodash.unionBy = unionBy;
  16971. lodash.unionWith = unionWith;
  16972. lodash.uniq = uniq;
  16973. lodash.uniqBy = uniqBy;
  16974. lodash.uniqWith = uniqWith;
  16975. lodash.unset = unset;
  16976. lodash.unzip = unzip;
  16977. lodash.unzipWith = unzipWith;
  16978. lodash.update = update;
  16979. lodash.updateWith = updateWith;
  16980. lodash.values = values;
  16981. lodash.valuesIn = valuesIn;
  16982. lodash.without = without;
  16983. lodash.words = words;
  16984. lodash.wrap = wrap;
  16985. lodash.xor = xor;
  16986. lodash.xorBy = xorBy;
  16987. lodash.xorWith = xorWith;
  16988. lodash.zip = zip;
  16989. lodash.zipObject = zipObject;
  16990. lodash.zipObjectDeep = zipObjectDeep;
  16991. lodash.zipWith = zipWith;
  16992. // Add aliases.
  16993. lodash.entries = toPairs;
  16994. lodash.entriesIn = toPairsIn;
  16995. lodash.extend = assignIn;
  16996. lodash.extendWith = assignInWith;
  16997. // Add methods to `lodash.prototype`.
  16998. mixin(lodash, lodash);
  16999. /*------------------------------------------------------------------------*/
  17000. // Add methods that return unwrapped values in chain sequences.
  17001. lodash.add = add;
  17002. lodash.attempt = attempt;
  17003. lodash.camelCase = camelCase;
  17004. lodash.capitalize = capitalize;
  17005. lodash.ceil = ceil;
  17006. lodash.clamp = clamp;
  17007. lodash.clone = clone;
  17008. lodash.cloneDeep = cloneDeep;
  17009. lodash.cloneDeepWith = cloneDeepWith;
  17010. lodash.cloneWith = cloneWith;
  17011. lodash.conformsTo = conformsTo;
  17012. lodash.deburr = deburr;
  17013. lodash.defaultTo = defaultTo;
  17014. lodash.divide = divide;
  17015. lodash.endsWith = endsWith;
  17016. lodash.eq = eq;
  17017. lodash.escape = escape;
  17018. lodash.escapeRegExp = escapeRegExp;
  17019. lodash.every = every;
  17020. lodash.find = find;
  17021. lodash.findIndex = findIndex;
  17022. lodash.findKey = findKey;
  17023. lodash.findLast = findLast;
  17024. lodash.findLastIndex = findLastIndex;
  17025. lodash.findLastKey = findLastKey;
  17026. lodash.floor = floor;
  17027. lodash.forEach = forEach;
  17028. lodash.forEachRight = forEachRight;
  17029. lodash.forIn = forIn;
  17030. lodash.forInRight = forInRight;
  17031. lodash.forOwn = forOwn;
  17032. lodash.forOwnRight = forOwnRight;
  17033. lodash.get = get;
  17034. lodash.gt = gt;
  17035. lodash.gte = gte;
  17036. lodash.has = has;
  17037. lodash.hasIn = hasIn;
  17038. lodash.head = head;
  17039. lodash.identity = identity;
  17040. lodash.includes = includes;
  17041. lodash.indexOf = indexOf;
  17042. lodash.inRange = inRange;
  17043. lodash.invoke = invoke;
  17044. lodash.isArguments = isArguments;
  17045. lodash.isArray = isArray;
  17046. lodash.isArrayBuffer = isArrayBuffer;
  17047. lodash.isArrayLike = isArrayLike;
  17048. lodash.isArrayLikeObject = isArrayLikeObject;
  17049. lodash.isBoolean = isBoolean;
  17050. lodash.isBuffer = isBuffer;
  17051. lodash.isDate = isDate;
  17052. lodash.isElement = isElement;
  17053. lodash.isEmpty = isEmpty;
  17054. lodash.isEqual = isEqual;
  17055. lodash.isEqualWith = isEqualWith;
  17056. lodash.isError = isError;
  17057. lodash.isFinite = isFinite;
  17058. lodash.isFunction = isFunction;
  17059. lodash.isInteger = isInteger;
  17060. lodash.isLength = isLength;
  17061. lodash.isMap = isMap;
  17062. lodash.isMatch = isMatch;
  17063. lodash.isMatchWith = isMatchWith;
  17064. lodash.isNaN = isNaN;
  17065. lodash.isNative = isNative;
  17066. lodash.isNil = isNil;
  17067. lodash.isNull = isNull;
  17068. lodash.isNumber = isNumber;
  17069. lodash.isObject = isObject;
  17070. lodash.isObjectLike = isObjectLike;
  17071. lodash.isPlainObject = isPlainObject;
  17072. lodash.isRegExp = isRegExp;
  17073. lodash.isSafeInteger = isSafeInteger;
  17074. lodash.isSet = isSet;
  17075. lodash.isString = isString;
  17076. lodash.isSymbol = isSymbol;
  17077. lodash.isTypedArray = isTypedArray;
  17078. lodash.isUndefined = isUndefined;
  17079. lodash.isWeakMap = isWeakMap;
  17080. lodash.isWeakSet = isWeakSet;
  17081. lodash.join = join;
  17082. lodash.kebabCase = kebabCase;
  17083. lodash.last = last;
  17084. lodash.lastIndexOf = lastIndexOf;
  17085. lodash.lowerCase = lowerCase;
  17086. lodash.lowerFirst = lowerFirst;
  17087. lodash.lt = lt;
  17088. lodash.lte = lte;
  17089. lodash.max = max;
  17090. lodash.maxBy = maxBy;
  17091. lodash.mean = mean;
  17092. lodash.meanBy = meanBy;
  17093. lodash.min = min;
  17094. lodash.minBy = minBy;
  17095. lodash.stubArray = stubArray;
  17096. lodash.stubFalse = stubFalse;
  17097. lodash.stubObject = stubObject;
  17098. lodash.stubString = stubString;
  17099. lodash.stubTrue = stubTrue;
  17100. lodash.multiply = multiply;
  17101. lodash.nth = nth;
  17102. lodash.noConflict = noConflict;
  17103. lodash.noop = noop;
  17104. lodash.now = now;
  17105. lodash.pad = pad;
  17106. lodash.padEnd = padEnd;
  17107. lodash.padStart = padStart;
  17108. lodash.parseInt = parseInt;
  17109. lodash.random = random;
  17110. lodash.reduce = reduce;
  17111. lodash.reduceRight = reduceRight;
  17112. lodash.repeat = repeat;
  17113. lodash.replace = replace;
  17114. lodash.result = result;
  17115. lodash.round = round;
  17116. lodash.runInContext = runInContext;
  17117. lodash.sample = sample;
  17118. lodash.size = size;
  17119. lodash.snakeCase = snakeCase;
  17120. lodash.some = some;
  17121. lodash.sortedIndex = sortedIndex;
  17122. lodash.sortedIndexBy = sortedIndexBy;
  17123. lodash.sortedIndexOf = sortedIndexOf;
  17124. lodash.sortedLastIndex = sortedLastIndex;
  17125. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17126. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17127. lodash.startCase = startCase;
  17128. lodash.startsWith = startsWith;
  17129. lodash.subtract = subtract;
  17130. lodash.sum = sum;
  17131. lodash.sumBy = sumBy;
  17132. lodash.template = template;
  17133. lodash.times = times;
  17134. lodash.toFinite = toFinite;
  17135. lodash.toInteger = toInteger;
  17136. lodash.toLength = toLength;
  17137. lodash.toLower = toLower;
  17138. lodash.toNumber = toNumber;
  17139. lodash.toSafeInteger = toSafeInteger;
  17140. lodash.toString = toString;
  17141. lodash.toUpper = toUpper;
  17142. lodash.trim = trim;
  17143. lodash.trimEnd = trimEnd;
  17144. lodash.trimStart = trimStart;
  17145. lodash.truncate = truncate;
  17146. lodash.unescape = unescape;
  17147. lodash.uniqueId = uniqueId;
  17148. lodash.upperCase = upperCase;
  17149. lodash.upperFirst = upperFirst;
  17150. // Add aliases.
  17151. lodash.each = forEach;
  17152. lodash.eachRight = forEachRight;
  17153. lodash.first = head;
  17154. mixin(lodash, (function() {
  17155. var source = {};
  17156. baseForOwn(lodash, function(func, methodName) {
  17157. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17158. source[methodName] = func;
  17159. }
  17160. });
  17161. return source;
  17162. }()), { 'chain': false });
  17163. /*------------------------------------------------------------------------*/
  17164. /**
  17165. * The semantic version number.
  17166. *
  17167. * @static
  17168. * @memberOf _
  17169. * @type {string}
  17170. */
  17171. lodash.VERSION = VERSION;
  17172. // Assign default placeholders.
  17173. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17174. lodash[methodName].placeholder = lodash;
  17175. });
  17176. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17177. arrayEach(['drop', 'take'], function(methodName, index) {
  17178. LazyWrapper.prototype[methodName] = function(n) {
  17179. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17180. var result = (this.__filtered__ && !index)
  17181. ? new LazyWrapper(this)
  17182. : this.clone();
  17183. if (result.__filtered__) {
  17184. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17185. } else {
  17186. result.__views__.push({
  17187. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17188. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17189. });
  17190. }
  17191. return result;
  17192. };
  17193. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17194. return this.reverse()[methodName](n).reverse();
  17195. };
  17196. });
  17197. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17198. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17199. var type = index + 1,
  17200. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17201. LazyWrapper.prototype[methodName] = function(iteratee) {
  17202. var result = this.clone();
  17203. result.__iteratees__.push({
  17204. 'iteratee': getIteratee(iteratee, 3),
  17205. 'type': type
  17206. });
  17207. result.__filtered__ = result.__filtered__ || isFilter;
  17208. return result;
  17209. };
  17210. });
  17211. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17212. arrayEach(['head', 'last'], function(methodName, index) {
  17213. var takeName = 'take' + (index ? 'Right' : '');
  17214. LazyWrapper.prototype[methodName] = function() {
  17215. return this[takeName](1).value()[0];
  17216. };
  17217. });
  17218. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17219. arrayEach(['initial', 'tail'], function(methodName, index) {
  17220. var dropName = 'drop' + (index ? '' : 'Right');
  17221. LazyWrapper.prototype[methodName] = function() {
  17222. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17223. };
  17224. });
  17225. LazyWrapper.prototype.compact = function() {
  17226. return this.filter(identity);
  17227. };
  17228. LazyWrapper.prototype.find = function(predicate) {
  17229. return this.filter(predicate).head();
  17230. };
  17231. LazyWrapper.prototype.findLast = function(predicate) {
  17232. return this.reverse().find(predicate);
  17233. };
  17234. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17235. if (typeof path == 'function') {
  17236. return new LazyWrapper(this);
  17237. }
  17238. return this.map(function(value) {
  17239. return baseInvoke(value, path, args);
  17240. });
  17241. });
  17242. LazyWrapper.prototype.reject = function(predicate) {
  17243. return this.filter(negate(getIteratee(predicate)));
  17244. };
  17245. LazyWrapper.prototype.slice = function(start, end) {
  17246. start = toInteger(start);
  17247. var result = this;
  17248. if (result.__filtered__ && (start > 0 || end < 0)) {
  17249. return new LazyWrapper(result);
  17250. }
  17251. if (start < 0) {
  17252. result = result.takeRight(-start);
  17253. } else if (start) {
  17254. result = result.drop(start);
  17255. }
  17256. if (end !== undefined) {
  17257. end = toInteger(end);
  17258. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17259. }
  17260. return result;
  17261. };
  17262. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17263. return this.reverse().takeWhile(predicate).reverse();
  17264. };
  17265. LazyWrapper.prototype.toArray = function() {
  17266. return this.take(MAX_ARRAY_LENGTH);
  17267. };
  17268. // Add `LazyWrapper` methods to `lodash.prototype`.
  17269. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17270. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17271. isTaker = /^(?:head|last)$/.test(methodName),
  17272. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17273. retUnwrapped = isTaker || /^find/.test(methodName);
  17274. if (!lodashFunc) {
  17275. return;
  17276. }
  17277. lodash.prototype[methodName] = function() {
  17278. var value = this.__wrapped__,
  17279. args = isTaker ? [1] : arguments,
  17280. isLazy = value instanceof LazyWrapper,
  17281. iteratee = args[0],
  17282. useLazy = isLazy || isArray(value);
  17283. var interceptor = function(value) {
  17284. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17285. return (isTaker && chainAll) ? result[0] : result;
  17286. };
  17287. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17288. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17289. isLazy = useLazy = false;
  17290. }
  17291. var chainAll = this.__chain__,
  17292. isHybrid = !!this.__actions__.length,
  17293. isUnwrapped = retUnwrapped && !chainAll,
  17294. onlyLazy = isLazy && !isHybrid;
  17295. if (!retUnwrapped && useLazy) {
  17296. value = onlyLazy ? value : new LazyWrapper(this);
  17297. var result = func.apply(value, args);
  17298. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17299. return new LodashWrapper(result, chainAll);
  17300. }
  17301. if (isUnwrapped && onlyLazy) {
  17302. return func.apply(this, args);
  17303. }
  17304. result = this.thru(interceptor);
  17305. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17306. };
  17307. });
  17308. // Add `Array` methods to `lodash.prototype`.
  17309. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17310. var func = arrayProto[methodName],
  17311. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17312. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17313. lodash.prototype[methodName] = function() {
  17314. var args = arguments;
  17315. if (retUnwrapped && !this.__chain__) {
  17316. var value = this.value();
  17317. return func.apply(isArray(value) ? value : [], args);
  17318. }
  17319. return this[chainName](function(value) {
  17320. return func.apply(isArray(value) ? value : [], args);
  17321. });
  17322. };
  17323. });
  17324. // Map minified method names to their real names.
  17325. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17326. var lodashFunc = lodash[methodName];
  17327. if (lodashFunc) {
  17328. var key = lodashFunc.name + '';
  17329. if (!hasOwnProperty.call(realNames, key)) {
  17330. realNames[key] = [];
  17331. }
  17332. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17333. }
  17334. });
  17335. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17336. 'name': 'wrapper',
  17337. 'func': undefined
  17338. }];
  17339. // Add methods to `LazyWrapper`.
  17340. LazyWrapper.prototype.clone = lazyClone;
  17341. LazyWrapper.prototype.reverse = lazyReverse;
  17342. LazyWrapper.prototype.value = lazyValue;
  17343. // Add chain sequence methods to the `lodash` wrapper.
  17344. lodash.prototype.at = wrapperAt;
  17345. lodash.prototype.chain = wrapperChain;
  17346. lodash.prototype.commit = wrapperCommit;
  17347. lodash.prototype.next = wrapperNext;
  17348. lodash.prototype.plant = wrapperPlant;
  17349. lodash.prototype.reverse = wrapperReverse;
  17350. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17351. // Add lazy aliases.
  17352. lodash.prototype.first = lodash.prototype.head;
  17353. if (symIterator) {
  17354. lodash.prototype[symIterator] = wrapperToIterator;
  17355. }
  17356. return lodash;
  17357. });
  17358. /*--------------------------------------------------------------------------*/
  17359. // Export lodash.
  17360. var _ = runInContext();
  17361. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17362. if (true) {
  17363. // Expose Lodash on the global object to prevent errors when Lodash is
  17364. // loaded by a script tag in the presence of an AMD loader.
  17365. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17366. // Use `_.noConflict` to remove Lodash from the global object.
  17367. root._ = _;
  17368. // Define as an anonymous module so, through path mapping, it can be
  17369. // referenced as the "underscore" module.
  17370. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17371. return _;
  17372. }).call(exports, __webpack_require__, exports, module),
  17373. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17374. }
  17375. // Check for `exports` after `define` in case a build optimizer adds it.
  17376. else {}
  17377. }.call(this));
  17378. /***/ }),
  17379. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17380. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17381. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17382. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17383. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17384. "use strict";
  17385. __webpack_require__.r(__webpack_exports__);
  17386. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17387. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17388. /* harmony export */ });
  17389. /* 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");
  17390. /* 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__);
  17391. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17392. var options = {};
  17393. options.insert = "head";
  17394. options.singleton = false;
  17395. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17396. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17397. /***/ }),
  17398. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17399. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17400. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17401. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17402. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17403. "use strict";
  17404. __webpack_require__.r(__webpack_exports__);
  17405. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17406. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17407. /* harmony export */ });
  17408. /* 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");
  17409. /* 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__);
  17410. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17411. var options = {};
  17412. options.insert = "head";
  17413. options.singleton = false;
  17414. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17415. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17416. /***/ }),
  17417. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17418. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17419. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17420. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17421. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17422. "use strict";
  17423. __webpack_require__.r(__webpack_exports__);
  17424. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17425. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17426. /* harmony export */ });
  17427. /* 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");
  17428. /* 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__);
  17429. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17430. var options = {};
  17431. options.insert = "head";
  17432. options.singleton = false;
  17433. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17434. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17435. /***/ }),
  17436. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17437. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17438. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17439. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17441. "use strict";
  17442. __webpack_require__.r(__webpack_exports__);
  17443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17444. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17445. /* harmony export */ });
  17446. /* 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");
  17447. /* 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__);
  17448. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17449. var options = {};
  17450. options.insert = "head";
  17451. options.singleton = false;
  17452. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17453. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17454. /***/ }),
  17455. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17456. /*!******************************************************!*\
  17457. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17458. \******************************************************/
  17459. /***/ ((__unused_webpack_module, exports) => {
  17460. "use strict";
  17461. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17462. // runtime helper for setting properties on components
  17463. // in a tree-shakable way
  17464. exports["default"] = (sfc, props) => {
  17465. const target = sfc.__vccOpts || sfc;
  17466. for (const [key, val] of props) {
  17467. target[key] = val;
  17468. }
  17469. return target;
  17470. };
  17471. /***/ }),
  17472. /***/ "./resources/js/components/AppButtonLink.vue":
  17473. /*!***************************************************!*\
  17474. !*** ./resources/js/components/AppButtonLink.vue ***!
  17475. \***************************************************/
  17476. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17477. "use strict";
  17478. __webpack_require__.r(__webpack_exports__);
  17479. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17480. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17481. /* harmony export */ });
  17482. /* 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");
  17483. /* 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");
  17484. /* 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");
  17485. ;
  17486. 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"]])
  17487. /* hot reload */
  17488. if (false) {}
  17489. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17490. /***/ }),
  17491. /***/ "./resources/js/components/AppMessage.vue":
  17492. /*!************************************************!*\
  17493. !*** ./resources/js/components/AppMessage.vue ***!
  17494. \************************************************/
  17495. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17496. "use strict";
  17497. __webpack_require__.r(__webpack_exports__);
  17498. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17499. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17500. /* harmony export */ });
  17501. /* 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");
  17502. /* 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");
  17503. /* 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");
  17504. ;
  17505. 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"]])
  17506. /* hot reload */
  17507. if (false) {}
  17508. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17509. /***/ }),
  17510. /***/ "./resources/js/components/AppPagination.vue":
  17511. /*!***************************************************!*\
  17512. !*** ./resources/js/components/AppPagination.vue ***!
  17513. \***************************************************/
  17514. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17515. "use strict";
  17516. __webpack_require__.r(__webpack_exports__);
  17517. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17518. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17519. /* harmony export */ });
  17520. /* 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");
  17521. /* 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");
  17522. /* 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");
  17523. ;
  17524. 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"]])
  17525. /* hot reload */
  17526. if (false) {}
  17527. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17528. /***/ }),
  17529. /***/ "./resources/js/components/AppSearch.vue":
  17530. /*!***********************************************!*\
  17531. !*** ./resources/js/components/AppSearch.vue ***!
  17532. \***********************************************/
  17533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17534. "use strict";
  17535. __webpack_require__.r(__webpack_exports__);
  17536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17537. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17538. /* harmony export */ });
  17539. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17540. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17541. /* 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");
  17542. ;
  17543. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17544. /* hot reload */
  17545. if (false) {}
  17546. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17547. /***/ }),
  17548. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17549. /*!**************************************************************!*\
  17550. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17551. \**************************************************************/
  17552. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17553. "use strict";
  17554. __webpack_require__.r(__webpack_exports__);
  17555. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17556. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17557. /* harmony export */ });
  17558. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17559. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17560. const script = {}
  17561. ;
  17562. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17563. /* hot reload */
  17564. if (false) {}
  17565. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17566. /***/ }),
  17567. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17568. /*!***************************************************************!*\
  17569. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17570. \***************************************************************/
  17571. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17572. "use strict";
  17573. __webpack_require__.r(__webpack_exports__);
  17574. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17575. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17576. /* harmony export */ });
  17577. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17578. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17579. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17580. /* 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");
  17581. ;
  17582. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17583. /* hot reload */
  17584. if (false) {}
  17585. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17586. /***/ }),
  17587. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17588. /*!******************************************************************!*\
  17589. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17590. \******************************************************************/
  17591. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17592. "use strict";
  17593. __webpack_require__.r(__webpack_exports__);
  17594. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17595. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17596. /* harmony export */ });
  17597. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17598. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17599. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17600. /* 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");
  17601. ;
  17602. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17603. /* hot reload */
  17604. if (false) {}
  17605. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17606. /***/ }),
  17607. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17608. /*!**************************************************************!*\
  17609. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17610. \**************************************************************/
  17611. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17612. "use strict";
  17613. __webpack_require__.r(__webpack_exports__);
  17614. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17615. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17616. /* harmony export */ });
  17617. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17618. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17619. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17620. /* 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");
  17621. ;
  17622. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17623. /* hot reload */
  17624. if (false) {}
  17625. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17626. /***/ }),
  17627. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17628. /*!************************************************************!*\
  17629. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17630. \************************************************************/
  17631. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17632. "use strict";
  17633. __webpack_require__.r(__webpack_exports__);
  17634. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17635. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17636. /* harmony export */ });
  17637. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17638. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17639. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17640. /* 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");
  17641. ;
  17642. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17643. /* hot reload */
  17644. if (false) {}
  17645. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17646. /***/ }),
  17647. /***/ "./resources/js/pages/Suppliers/Index.vue":
  17648. /*!************************************************!*\
  17649. !*** ./resources/js/pages/Suppliers/Index.vue ***!
  17650. \************************************************/
  17651. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17652. "use strict";
  17653. __webpack_require__.r(__webpack_exports__);
  17654. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17655. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17656. /* harmony export */ });
  17657. /* 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");
  17658. /* 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");
  17659. /* 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");
  17660. ;
  17661. 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"]])
  17662. /* hot reload */
  17663. if (false) {}
  17664. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17665. /***/ }),
  17666. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17667. /*!**************************************************************************************!*\
  17668. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17669. \**************************************************************************************/
  17670. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17671. "use strict";
  17672. __webpack_require__.r(__webpack_exports__);
  17673. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17674. /* 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"])
  17675. /* harmony export */ });
  17676. /* 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");
  17677. /***/ }),
  17678. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17679. /*!***********************************************************************************!*\
  17680. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17681. \***********************************************************************************/
  17682. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17683. "use strict";
  17684. __webpack_require__.r(__webpack_exports__);
  17685. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17686. /* 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"])
  17687. /* harmony export */ });
  17688. /* 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");
  17689. /***/ }),
  17690. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17691. /*!**************************************************************************************!*\
  17692. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17693. \**************************************************************************************/
  17694. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17695. "use strict";
  17696. __webpack_require__.r(__webpack_exports__);
  17697. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17698. /* 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"])
  17699. /* harmony export */ });
  17700. /* 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");
  17701. /***/ }),
  17702. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17703. /*!**********************************************************************************!*\
  17704. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17705. \**********************************************************************************/
  17706. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17707. "use strict";
  17708. __webpack_require__.r(__webpack_exports__);
  17709. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17710. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17711. /* harmony export */ });
  17712. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17713. /***/ }),
  17714. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17715. /*!**************************************************************************************************!*\
  17716. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17717. \**************************************************************************************************/
  17718. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17719. "use strict";
  17720. __webpack_require__.r(__webpack_exports__);
  17721. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17722. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17723. /* harmony export */ });
  17724. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17725. /***/ }),
  17726. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17727. /*!*****************************************************************************************************!*\
  17728. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17729. \*****************************************************************************************************/
  17730. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17731. "use strict";
  17732. __webpack_require__.r(__webpack_exports__);
  17733. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17734. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17735. /* harmony export */ });
  17736. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17737. /***/ }),
  17738. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17739. /*!*************************************************************************************************!*\
  17740. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17741. \*************************************************************************************************/
  17742. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17743. "use strict";
  17744. __webpack_require__.r(__webpack_exports__);
  17745. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17746. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17747. /* harmony export */ });
  17748. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17749. /***/ }),
  17750. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17751. /*!***********************************************************************************************!*\
  17752. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17753. \***********************************************************************************************/
  17754. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17755. "use strict";
  17756. __webpack_require__.r(__webpack_exports__);
  17757. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17758. /* 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"])
  17759. /* harmony export */ });
  17760. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17761. /***/ }),
  17762. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  17763. /*!***********************************************************************************!*\
  17764. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17765. \***********************************************************************************/
  17766. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17767. "use strict";
  17768. __webpack_require__.r(__webpack_exports__);
  17769. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17770. /* 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"])
  17771. /* harmony export */ });
  17772. /* 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");
  17773. /***/ }),
  17774. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17775. /*!*********************************************************************************!*\
  17776. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17777. \*********************************************************************************/
  17778. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17779. "use strict";
  17780. __webpack_require__.r(__webpack_exports__);
  17781. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17782. /* 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)
  17783. /* harmony export */ });
  17784. /* 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");
  17785. /***/ }),
  17786. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17787. /*!******************************************************************************!*\
  17788. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17789. \******************************************************************************/
  17790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17791. "use strict";
  17792. __webpack_require__.r(__webpack_exports__);
  17793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17794. /* 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)
  17795. /* harmony export */ });
  17796. /* 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");
  17797. /***/ }),
  17798. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17799. /*!*********************************************************************************!*\
  17800. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17801. \*********************************************************************************/
  17802. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17803. "use strict";
  17804. __webpack_require__.r(__webpack_exports__);
  17805. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17806. /* 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)
  17807. /* harmony export */ });
  17808. /* 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");
  17809. /***/ }),
  17810. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17811. /*!*****************************************************************************!*\
  17812. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17813. \*****************************************************************************/
  17814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17815. "use strict";
  17816. __webpack_require__.r(__webpack_exports__);
  17817. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17818. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17819. /* harmony export */ });
  17820. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17821. /***/ }),
  17822. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17823. /*!********************************************************************************************!*\
  17824. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17825. \********************************************************************************************/
  17826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17827. "use strict";
  17828. __webpack_require__.r(__webpack_exports__);
  17829. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17830. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17831. /* harmony export */ });
  17832. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17833. /***/ }),
  17834. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17835. /*!*********************************************************************************************************!*\
  17836. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17837. \*********************************************************************************************************/
  17838. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17839. "use strict";
  17840. __webpack_require__.r(__webpack_exports__);
  17841. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17842. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17843. /* harmony export */ });
  17844. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17845. /***/ }),
  17846. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17847. /*!************************************************************************************************************!*\
  17848. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17849. \************************************************************************************************************/
  17850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17851. "use strict";
  17852. __webpack_require__.r(__webpack_exports__);
  17853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17854. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17855. /* harmony export */ });
  17856. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17857. /***/ }),
  17858. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17859. /*!********************************************************************************************************!*\
  17860. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17861. \********************************************************************************************************/
  17862. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17863. "use strict";
  17864. __webpack_require__.r(__webpack_exports__);
  17865. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17866. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17867. /* harmony export */ });
  17868. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17869. /***/ }),
  17870. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17871. /*!******************************************************************************************************!*\
  17872. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17873. \******************************************************************************************************/
  17874. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17875. "use strict";
  17876. __webpack_require__.r(__webpack_exports__);
  17877. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17878. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17879. /* harmony export */ });
  17880. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17881. /***/ }),
  17882. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  17883. /*!******************************************************************************!*\
  17884. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  17885. \******************************************************************************/
  17886. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17887. "use strict";
  17888. __webpack_require__.r(__webpack_exports__);
  17889. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17890. /* 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)
  17891. /* harmony export */ });
  17892. /* 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");
  17893. /***/ }),
  17894. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17895. /*!************************************************************************************************************************!*\
  17896. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17897. \************************************************************************************************************************/
  17898. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17899. "use strict";
  17900. __webpack_require__.r(__webpack_exports__);
  17901. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17902. /***/ }),
  17903. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17904. /*!***************************************************************************************************************************!*\
  17905. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17906. \***************************************************************************************************************************/
  17907. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17908. "use strict";
  17909. __webpack_require__.r(__webpack_exports__);
  17910. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17911. /***/ }),
  17912. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17913. /*!***********************************************************************************************************************!*\
  17914. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17915. \***********************************************************************************************************************/
  17916. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17917. "use strict";
  17918. __webpack_require__.r(__webpack_exports__);
  17919. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17920. /***/ }),
  17921. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17922. /*!*********************************************************************************************************************!*\
  17923. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17924. \*********************************************************************************************************************/
  17925. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17926. "use strict";
  17927. __webpack_require__.r(__webpack_exports__);
  17928. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17929. /***/ })
  17930. }]);