resources_js_pages_Sales_Index_vue.js 694KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Sales_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/Sales/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/Sales/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 _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Sales/config.js");
  335. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  336. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  337. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  338. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  339. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  340. __name: 'Index',
  341. props: {
  342. sales: Object,
  343. initialSearch: String
  344. },
  345. setup: function setup(__props, _ref) {
  346. var expose = _ref.expose;
  347. expose();
  348. var __returned__ = {
  349. indexTable: _config__WEBPACK_IMPORTED_MODULE_0__.indexTable,
  350. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  351. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  352. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  353. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_4__["default"]
  354. };
  355. Object.defineProperty(__returned__, '__isScriptSetup', {
  356. enumerable: false,
  357. value: true
  358. });
  359. return __returned__;
  360. }
  361. });
  362. /***/ }),
  363. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  364. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  365. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  366. \***********************************************************************************************************************************************************************************************************************************************************************************/
  367. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  368. "use strict";
  369. __webpack_require__.r(__webpack_exports__);
  370. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  371. /* harmony export */ "render": () => (/* binding */ render)
  372. /* harmony export */ });
  373. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  374. var _hoisted_1 = {
  375. key: 1,
  376. "class": "p-button-label"
  377. };
  378. var _hoisted_2 = {
  379. key: 1,
  380. "class": "p-button p-component"
  381. };
  382. var _hoisted_3 = {
  383. key: 1,
  384. "class": "p-button-label"
  385. };
  386. function render(_ctx, _cache, $props, $setup, $data, $options) {
  387. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  388. key: 0,
  389. "class": "p-button p-component",
  390. as: "button",
  391. type: "button"
  392. }, {
  393. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  394. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  395. key: 0,
  396. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  397. }, null, 2
  398. /* CLASS */
  399. )) : (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
  400. /* TEXT */
  401. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  402. }),
  403. _: 1
  404. /* STABLE */
  405. })) : ((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", {
  406. key: 0,
  407. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  408. }, null, 2
  409. /* CLASS */
  410. )) : (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
  411. /* TEXT */
  412. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  413. }
  414. /***/ }),
  415. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  416. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  417. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  418. \********************************************************************************************************************************************************************************************************************************************************************************/
  419. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  420. "use strict";
  421. __webpack_require__.r(__webpack_exports__);
  422. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  423. /* harmony export */ "render": () => (/* binding */ render)
  424. /* harmony export */ });
  425. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  426. var _hoisted_1 = {
  427. key: 0
  428. };
  429. var _hoisted_2 = {
  430. key: 1
  431. };
  432. function render(_ctx, _cache, $props, $setup, $data, $options) {
  433. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  434. 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, {
  435. key: 0,
  436. severity: "success",
  437. onClose: $setup.onClose
  438. }, {
  439. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  440. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  441. /* TEXT */
  442. )];
  443. }),
  444. _: 1
  445. /* STABLE */
  446. })) : (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, {
  447. key: 1,
  448. severity: "error",
  449. onClose: $setup.onClose
  450. }, {
  451. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  452. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  453. /* TEXT */
  454. )];
  455. }),
  456. _: 1
  457. /* STABLE */
  458. })) : (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, {
  459. key: 2,
  460. severity: "error",
  461. onClose: $setup.onClose
  462. }, {
  463. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  464. 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
  465. /* TEXT */
  466. ))];
  467. }),
  468. _: 1
  469. /* STABLE */
  470. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  471. /* STABLE_FRAGMENT */
  472. );
  473. }
  474. /***/ }),
  475. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  476. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  477. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  478. \***********************************************************************************************************************************************************************************************************************************************************************************/
  479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  480. "use strict";
  481. __webpack_require__.r(__webpack_exports__);
  482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  483. /* harmony export */ "render": () => (/* binding */ render)
  484. /* harmony export */ });
  485. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  486. var _hoisted_1 = {
  487. key: 0,
  488. "class": "p-paginator p-component flex justify-content-start"
  489. };
  490. var _hoisted_2 = {
  491. "class": "p-paginator-pages"
  492. };
  493. var _hoisted_3 = ["innerHTML"];
  494. function render(_ctx, _cache, $props, $setup, $data, $options) {
  495. 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) {
  496. 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", {
  497. key: "link-".concat(key),
  498. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  499. 'p-disabled': link
  500. }]),
  501. innerHTML: link.label
  502. }, null, 10
  503. /* CLASS, PROPS */
  504. , _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"], {
  505. key: "link-".concat(key),
  506. href: link.url,
  507. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  508. 'p-highlight': link.active
  509. }, "p-paginator-page p-paginator-element p-link"]),
  510. innerHTML: link.label
  511. }, null, 8
  512. /* PROPS */
  513. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  514. /* STABLE_FRAGMENT */
  515. );
  516. }), 256
  517. /* UNKEYED_FRAGMENT */
  518. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  519. }
  520. /***/ }),
  521. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  522. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  523. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  524. \*******************************************************************************************************************************************************************************************************************************************************************************/
  525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  526. "use strict";
  527. __webpack_require__.r(__webpack_exports__);
  528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  529. /* harmony export */ "render": () => (/* binding */ render)
  530. /* harmony export */ });
  531. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  532. function render(_ctx, _cache, $props, $setup, $data, $options) {
  533. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  535. modelValue: $setup.search,
  536. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  537. return $setup.search = $event;
  538. })
  539. }, null, 8
  540. /* PROPS */
  541. , ["modelValue"]);
  542. }
  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/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  545. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  546. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  547. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  548. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  549. "use strict";
  550. __webpack_require__.r(__webpack_exports__);
  551. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  552. /* harmony export */ "render": () => (/* binding */ render)
  553. /* harmony export */ });
  554. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  555. var _hoisted_1 = {
  556. "class": "layout-footer"
  557. };
  558. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  559. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  560. href: "https://dijitalcode.com",
  561. target: "_blank",
  562. "class": "font-medium ml-2"
  563. }, " DijitalCODE ", -1
  564. /* HOISTED */
  565. );
  566. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  567. function render(_ctx, _cache) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  569. }
  570. /***/ }),
  571. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  572. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  573. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  574. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  576. "use strict";
  577. __webpack_require__.r(__webpack_exports__);
  578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  579. /* harmony export */ "render": () => (/* binding */ render)
  580. /* harmony export */ });
  581. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  582. function render(_ctx, _cache, $props, $setup, $data, $options) {
  583. 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"], {
  584. "class": "layout-menu",
  585. items: $props.menu,
  586. root: true
  587. }, null, 8
  588. /* PROPS */
  589. , ["items"])]);
  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/SubSidebar.vue?vue&type=template&id=b1b23eb4&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/SubSidebar.vue?vue&type=template&id=b1b23eb4&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. var _withScopeId = function _withScopeId(n) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  605. };
  606. var _hoisted_1 = {
  607. key: 0
  608. };
  609. var _hoisted_2 = ["aria-label"];
  610. var _hoisted_3 = ["aria-label"];
  611. function render(_ctx, _cache, $props, $setup, $data, $options) {
  612. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  613. 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) {
  614. 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", {
  615. key: i,
  616. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  617. 'layout-menuitem-category': $props.root
  618. }]),
  619. role: "none"
  620. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  621. key: 0
  622. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  623. "class": "layout-menuitem-root-text",
  624. "aria-label": item.label
  625. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  626. /* TEXT, PROPS */
  627. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  628. items: item.items
  629. }, null, 8
  630. /* PROPS */
  631. , ["items"])], 64
  632. /* STABLE_FRAGMENT */
  633. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  634. key: 1
  635. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  636. key: 0,
  637. role: "menuitem",
  638. href: item.to,
  639. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  640. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  641. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  642. }]),
  643. "aria-label": item.label
  644. }, {
  645. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  646. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  647. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  648. }, null, 2
  649. /* CLASS */
  650. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  651. /* TEXT */
  652. )];
  653. }),
  654. _: 2
  655. /* DYNAMIC */
  656. }, 1032
  657. /* PROPS, DYNAMIC_SLOTS */
  658. , ["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", {
  659. key: 1,
  660. href: "#",
  661. role: "menuitem",
  662. "aria-label": item.label
  663. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  664. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  665. }, null, 2
  666. /* CLASS */
  667. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  668. /* TEXT */
  669. )], 8
  670. /* PROPS */
  671. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  672. items: item.items
  673. }, null, 8
  674. /* PROPS */
  675. , ["items"])], 64
  676. /* STABLE_FRAGMENT */
  677. ))], 2
  678. /* CLASS */
  679. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  680. /* STABLE_FRAGMENT */
  681. );
  682. }), 256
  683. /* UNKEYED_FRAGMENT */
  684. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  685. }
  686. /***/ }),
  687. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  688. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  689. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  690. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  691. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  692. "use strict";
  693. __webpack_require__.r(__webpack_exports__);
  694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  695. /* harmony export */ "render": () => (/* binding */ render)
  696. /* harmony export */ });
  697. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  698. var _withScopeId = function _withScopeId(n) {
  699. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  700. };
  701. var _hoisted_1 = {
  702. "class": "layout-topbar"
  703. };
  704. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  705. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  706. alt: "Brand Logo",
  707. src: "/images/logo.svg",
  708. "class": "md:mr-3"
  709. }, null, -1
  710. /* HOISTED */
  711. );
  712. });
  713. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  714. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  715. /* HOISTED */
  716. );
  717. });
  718. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  719. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  720. "class": "pi pi-bars"
  721. }, null, -1
  722. /* HOISTED */
  723. );
  724. });
  725. var _hoisted_5 = [_hoisted_4];
  726. var _hoisted_6 = {
  727. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  728. };
  729. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  730. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  731. "class": "pi pi-ellipsis-v"
  732. }, null, -1
  733. /* HOISTED */
  734. );
  735. });
  736. var _hoisted_8 = [_hoisted_7];
  737. var _hoisted_9 = {
  738. "class": "layout-topbar-menu hidden lg:flex origin-top"
  739. };
  740. var _hoisted_10 = {
  741. "class": "align-self-center"
  742. };
  743. var _hoisted_11 = {
  744. "class": "hidden lg:inline"
  745. };
  746. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  747. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  748. "class": "pi pi-user"
  749. }, null, -1
  750. /* HOISTED */
  751. );
  752. });
  753. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  754. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  755. /* HOISTED */
  756. );
  757. });
  758. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  759. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  760. "class": "pi pi-sign-out"
  761. }, null, -1
  762. /* HOISTED */
  763. );
  764. });
  765. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  766. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  767. /* HOISTED */
  768. );
  769. });
  770. function render(_ctx, _cache, $props, $setup, $data, $options) {
  771. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  772. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  773. 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"], {
  774. href: "/",
  775. "class": "layout-topbar-logo"
  776. }, {
  777. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  778. return [_hoisted_2, _hoisted_3];
  779. }),
  780. _: 1
  781. /* STABLE */
  782. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  783. "class": "p-link layout-menu-button layout-topbar-button",
  784. onClick: _cache[0] || (_cache[0] = function ($event) {
  785. return _ctx.$emit('menu-toggle', $event);
  786. })
  787. }, _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, {
  788. selector: '@next',
  789. enterClass: 'hidden',
  790. enterActiveClass: 'scalein',
  791. leaveToClass: 'hidden',
  792. leaveActiveClass: 'fadeout',
  793. hideOnOutsideClick: true
  794. }]]), (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
  795. /* TEXT */
  796. )]), (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"], {
  797. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  798. "class": "p-link layout-topbar-button"
  799. }, {
  800. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  801. return [_hoisted_12, _hoisted_13];
  802. }),
  803. _: 1
  804. /* STABLE */
  805. }, 8
  806. /* PROPS */
  807. , ["href"])), [[_directive_tooltip, {
  808. value: 'Ubah Profil',
  809. "class": 'layout-topbar-menu-tooltip'
  810. }, void 0, {
  811. bottom: true
  812. }]])]), (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"], {
  813. href: _ctx.route('logout'),
  814. as: "button",
  815. method: "post",
  816. "class": "p-link layout-topbar-button"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. return [_hoisted_14, _hoisted_15];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. }, 8
  824. /* PROPS */
  825. , ["href"])), [[_directive_tooltip, {
  826. value: 'Keluar',
  827. "class": 'layout-topbar-menu-tooltip'
  828. }, void 0, {
  829. bottom: true
  830. }]])])])]);
  831. }
  832. /***/ }),
  833. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  834. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  835. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  836. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  837. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  838. "use strict";
  839. __webpack_require__.r(__webpack_exports__);
  840. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  841. /* harmony export */ "render": () => (/* binding */ render)
  842. /* harmony export */ });
  843. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  844. var _withScopeId = function _withScopeId(n) {
  845. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  846. };
  847. var _hoisted_1 = {
  848. "class": "layout-sidebar"
  849. };
  850. var _hoisted_2 = {
  851. "class": "layout-main-container"
  852. };
  853. var _hoisted_3 = {
  854. "class": "layout-main"
  855. };
  856. var _hoisted_4 = {
  857. key: 0,
  858. "class": "layout-mask p-component-overlay"
  859. };
  860. function render(_ctx, _cache, $props, $setup, $data, $options) {
  861. 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"], {
  862. title: $props.title
  863. }, null, 8
  864. /* PROPS */
  865. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  866. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  867. onClick: $setup.onWrapperClick
  868. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  869. onMenuToggle: $setup.onMenuToggle
  870. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  871. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  872. }, null, 8
  873. /* PROPS */
  874. , ["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, {
  875. name: "layout-mask"
  876. }, {
  877. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. 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)];
  879. }),
  880. _: 1
  881. /* STABLE */
  882. })], 2
  883. /* CLASS */
  884. )], 64
  885. /* STABLE_FRAGMENT */
  886. );
  887. }
  888. /***/ }),
  889. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Sales/Index.vue?vue&type=template&id=7c234776":
  890. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  891. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Sales/Index.vue?vue&type=template&id=7c234776 ***!
  892. \****************************************************************************************************************************************************************************************************************************************************************************/
  893. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  894. "use strict";
  895. __webpack_require__.r(__webpack_exports__);
  896. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  897. /* harmony export */ "render": () => (/* binding */ render)
  898. /* harmony export */ });
  899. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  900. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Penjualan", -1
  901. /* HOISTED */
  902. );
  903. var _hoisted_2 = {
  904. "class": "grid"
  905. };
  906. var _hoisted_3 = {
  907. "class": "col-12 md:col-8"
  908. };
  909. var _hoisted_4 = {
  910. "class": "flex align-items-center"
  911. };
  912. var _hoisted_5 = {
  913. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  914. };
  915. function render(_ctx, _cache, $props, $setup, $data, $options) {
  916. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  917. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  918. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], {
  919. title: "Daftar Penjualan"
  920. }, {
  921. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  922. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  923. responsiveLayout: "scroll",
  924. columnResizeMode: "expand",
  925. value: $props.sales.data,
  926. rowHover: true,
  927. stripedRows: true
  928. }, {
  929. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  930. 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"], {
  931. "class": "w-full md:w-27rem",
  932. placeholder: "cari, contoh: P0xx, Pending, Success",
  933. url: "/sales",
  934. "initial-search": $props.initialSearch
  935. }, null, 8
  936. /* PROPS */
  937. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  938. label: "Tambah Penjualan",
  939. icon: "pi pi-pencil",
  940. "class": "p-button-outlined",
  941. href: _ctx.route('sales.create')
  942. }, null, 8
  943. /* PROPS */
  944. , ["href"])])])];
  945. }),
  946. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  947. 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) {
  948. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  949. field: value.field,
  950. header: value.header,
  951. key: value.field
  952. }, null, 8
  953. /* PROPS */
  954. , ["field", "header"]);
  955. }), 128
  956. /* KEYED_FRAGMENT */
  957. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  958. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  959. var data = _ref.data;
  960. return [];
  961. }),
  962. _: 1
  963. /* STABLE */
  964. })];
  965. }),
  966. _: 1
  967. /* STABLE */
  968. }, 8
  969. /* PROPS */
  970. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  971. links: $props.sales.links
  972. }, null, 8
  973. /* PROPS */
  974. , ["links"])];
  975. }),
  976. _: 1
  977. /* STABLE */
  978. });
  979. }
  980. /***/ }),
  981. /***/ "./resources/js/pages/Sales/config.js":
  982. /*!********************************************!*\
  983. !*** ./resources/js/pages/Sales/config.js ***!
  984. \********************************************/
  985. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  986. "use strict";
  987. __webpack_require__.r(__webpack_exports__);
  988. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  989. /* harmony export */ "dialogStyle": () => (/* binding */ dialogStyle),
  990. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  991. /* harmony export */ "optionStatus": () => (/* binding */ optionStatus)
  992. /* harmony export */ });
  993. var optionStatus = [{
  994. label: 'Pending',
  995. value: 'pending'
  996. }, {
  997. label: 'Berhasil',
  998. value: 'success'
  999. }];
  1000. var indexTable = [{
  1001. field: 'updatedAt',
  1002. header: 'Tanggal'
  1003. }, {
  1004. field: 'number',
  1005. header: 'Nomor Penjualan'
  1006. }, {
  1007. field: 'status',
  1008. header: 'Status'
  1009. }, {
  1010. field: 'price',
  1011. header: 'Harga'
  1012. }, {
  1013. field: 'qty',
  1014. header: 'Kuantitas'
  1015. }, {
  1016. field: 'productName',
  1017. header: 'Nama Produk'
  1018. }, {
  1019. field: 'productNumber',
  1020. header: 'Nomor Produk'
  1021. }];
  1022. var dialogStyle = {
  1023. style: {
  1024. width: '50vw'
  1025. },
  1026. breakpoints: {
  1027. '960px': '75vw',
  1028. '640px': '90vw'
  1029. },
  1030. modal: true
  1031. };
  1032. /***/ }),
  1033. /***/ "./resources/js/utils/menu.js":
  1034. /*!************************************!*\
  1035. !*** ./resources/js/utils/menu.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 */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1042. /* harmony export */ });
  1043. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1044. // Admin
  1045. 1: [{
  1046. label: 'Home',
  1047. items: [{
  1048. label: 'Dashboard',
  1049. icon: 'pi pi-chart-bar',
  1050. to: '/dashboards',
  1051. component: 'Dashboards/Index'
  1052. }]
  1053. }, {
  1054. label: 'Laporan',
  1055. items: []
  1056. }, {
  1057. label: 'Master',
  1058. items: [{
  1059. label: 'User',
  1060. icon: 'pi pi-user',
  1061. to: '/users',
  1062. component: 'Users/Index'
  1063. }]
  1064. }],
  1065. // Supervisor
  1066. 2: [{
  1067. label: 'Home',
  1068. items: [{
  1069. label: 'Dashboard',
  1070. icon: 'pi pi-chart-bar',
  1071. to: '/dashboards',
  1072. component: 'Dashboards/Index'
  1073. }]
  1074. }, {
  1075. label: 'Master',
  1076. items: [{
  1077. label: 'Pelanggan',
  1078. icon: 'pi pi-users',
  1079. to: '/customers',
  1080. component: 'Customers/Index'
  1081. }, {
  1082. label: 'Pembelian',
  1083. icon: 'pi pi-shopping-cart',
  1084. to: '/purchases',
  1085. component: 'Purchases/Index'
  1086. }, {
  1087. label: 'Penjualan',
  1088. icon: 'pi pi-tag',
  1089. to: '/sales',
  1090. component: 'Sales/Index'
  1091. }, {
  1092. label: 'Produk',
  1093. icon: 'pi pi-th-large',
  1094. to: '/products',
  1095. component: 'Products/Index'
  1096. }]
  1097. }],
  1098. // Operator
  1099. 3: [{
  1100. label: 'Home',
  1101. items: [{
  1102. label: 'Dashboard',
  1103. icon: 'pi pi-chart-bar',
  1104. to: '/dashboards',
  1105. component: 'Dashboards/Index'
  1106. }]
  1107. }, {
  1108. label: 'Master',
  1109. items: [{
  1110. label: 'Supplier',
  1111. icon: 'pi pi-shopping-cart',
  1112. to: '/suppliers',
  1113. component: 'Suppliers/Index'
  1114. }, {
  1115. label: 'Stok Barang',
  1116. icon: 'pi pi-box',
  1117. to: '/stock-products',
  1118. component: 'StockProducts/Index'
  1119. }]
  1120. }]
  1121. });
  1122. /***/ }),
  1123. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1124. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1125. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1126. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1127. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1128. "use strict";
  1129. __webpack_require__.r(__webpack_exports__);
  1130. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1131. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1132. /* harmony export */ });
  1133. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1134. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1135. // Imports
  1136. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1137. // Module
  1138. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1139. // Exports
  1140. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1141. /***/ }),
  1142. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1143. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1144. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1145. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1146. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1147. "use strict";
  1148. __webpack_require__.r(__webpack_exports__);
  1149. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1150. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1151. /* harmony export */ });
  1152. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1153. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1154. // Imports
  1155. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1156. // Module
  1157. ___CSS_LOADER_EXPORT___.push([module.id, "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}", ""]);
  1158. // Exports
  1159. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1160. /***/ }),
  1161. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1162. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1163. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1164. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1165. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1166. "use strict";
  1167. __webpack_require__.r(__webpack_exports__);
  1168. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1169. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1170. /* harmony export */ });
  1171. /* 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");
  1172. /* 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__);
  1173. // Imports
  1174. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1175. // Module
  1176. ___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}", ""]);
  1177. // Exports
  1178. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1179. /***/ }),
  1180. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1181. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1182. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1183. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1184. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1185. "use strict";
  1186. __webpack_require__.r(__webpack_exports__);
  1187. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1188. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1189. /* harmony export */ });
  1190. /* 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");
  1191. /* 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__);
  1192. // Imports
  1193. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1194. // Module
  1195. ___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}", ""]);
  1196. // Exports
  1197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1198. /***/ }),
  1199. /***/ "./node_modules/lodash/lodash.js":
  1200. /*!***************************************!*\
  1201. !*** ./node_modules/lodash/lodash.js ***!
  1202. \***************************************/
  1203. /***/ (function(module, exports, __webpack_require__) {
  1204. /* module decorator */ module = __webpack_require__.nmd(module);
  1205. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1206. * @license
  1207. * Lodash <https://lodash.com/>
  1208. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1209. * Released under MIT license <https://lodash.com/license>
  1210. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1211. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1212. */
  1213. ;(function() {
  1214. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1215. var undefined;
  1216. /** Used as the semantic version number. */
  1217. var VERSION = '4.17.21';
  1218. /** Used as the size to enable large array optimizations. */
  1219. var LARGE_ARRAY_SIZE = 200;
  1220. /** Error message constants. */
  1221. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1222. FUNC_ERROR_TEXT = 'Expected a function',
  1223. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1224. /** Used to stand-in for `undefined` hash values. */
  1225. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1226. /** Used as the maximum memoize cache size. */
  1227. var MAX_MEMOIZE_SIZE = 500;
  1228. /** Used as the internal argument placeholder. */
  1229. var PLACEHOLDER = '__lodash_placeholder__';
  1230. /** Used to compose bitmasks for cloning. */
  1231. var CLONE_DEEP_FLAG = 1,
  1232. CLONE_FLAT_FLAG = 2,
  1233. CLONE_SYMBOLS_FLAG = 4;
  1234. /** Used to compose bitmasks for value comparisons. */
  1235. var COMPARE_PARTIAL_FLAG = 1,
  1236. COMPARE_UNORDERED_FLAG = 2;
  1237. /** Used to compose bitmasks for function metadata. */
  1238. var WRAP_BIND_FLAG = 1,
  1239. WRAP_BIND_KEY_FLAG = 2,
  1240. WRAP_CURRY_BOUND_FLAG = 4,
  1241. WRAP_CURRY_FLAG = 8,
  1242. WRAP_CURRY_RIGHT_FLAG = 16,
  1243. WRAP_PARTIAL_FLAG = 32,
  1244. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1245. WRAP_ARY_FLAG = 128,
  1246. WRAP_REARG_FLAG = 256,
  1247. WRAP_FLIP_FLAG = 512;
  1248. /** Used as default options for `_.truncate`. */
  1249. var DEFAULT_TRUNC_LENGTH = 30,
  1250. DEFAULT_TRUNC_OMISSION = '...';
  1251. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1252. var HOT_COUNT = 800,
  1253. HOT_SPAN = 16;
  1254. /** Used to indicate the type of lazy iteratees. */
  1255. var LAZY_FILTER_FLAG = 1,
  1256. LAZY_MAP_FLAG = 2,
  1257. LAZY_WHILE_FLAG = 3;
  1258. /** Used as references for various `Number` constants. */
  1259. var INFINITY = 1 / 0,
  1260. MAX_SAFE_INTEGER = 9007199254740991,
  1261. MAX_INTEGER = 1.7976931348623157e+308,
  1262. NAN = 0 / 0;
  1263. /** Used as references for the maximum length and index of an array. */
  1264. var MAX_ARRAY_LENGTH = 4294967295,
  1265. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1266. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1267. /** Used to associate wrap methods with their bit flags. */
  1268. var wrapFlags = [
  1269. ['ary', WRAP_ARY_FLAG],
  1270. ['bind', WRAP_BIND_FLAG],
  1271. ['bindKey', WRAP_BIND_KEY_FLAG],
  1272. ['curry', WRAP_CURRY_FLAG],
  1273. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1274. ['flip', WRAP_FLIP_FLAG],
  1275. ['partial', WRAP_PARTIAL_FLAG],
  1276. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1277. ['rearg', WRAP_REARG_FLAG]
  1278. ];
  1279. /** `Object#toString` result references. */
  1280. var argsTag = '[object Arguments]',
  1281. arrayTag = '[object Array]',
  1282. asyncTag = '[object AsyncFunction]',
  1283. boolTag = '[object Boolean]',
  1284. dateTag = '[object Date]',
  1285. domExcTag = '[object DOMException]',
  1286. errorTag = '[object Error]',
  1287. funcTag = '[object Function]',
  1288. genTag = '[object GeneratorFunction]',
  1289. mapTag = '[object Map]',
  1290. numberTag = '[object Number]',
  1291. nullTag = '[object Null]',
  1292. objectTag = '[object Object]',
  1293. promiseTag = '[object Promise]',
  1294. proxyTag = '[object Proxy]',
  1295. regexpTag = '[object RegExp]',
  1296. setTag = '[object Set]',
  1297. stringTag = '[object String]',
  1298. symbolTag = '[object Symbol]',
  1299. undefinedTag = '[object Undefined]',
  1300. weakMapTag = '[object WeakMap]',
  1301. weakSetTag = '[object WeakSet]';
  1302. var arrayBufferTag = '[object ArrayBuffer]',
  1303. dataViewTag = '[object DataView]',
  1304. float32Tag = '[object Float32Array]',
  1305. float64Tag = '[object Float64Array]',
  1306. int8Tag = '[object Int8Array]',
  1307. int16Tag = '[object Int16Array]',
  1308. int32Tag = '[object Int32Array]',
  1309. uint8Tag = '[object Uint8Array]',
  1310. uint8ClampedTag = '[object Uint8ClampedArray]',
  1311. uint16Tag = '[object Uint16Array]',
  1312. uint32Tag = '[object Uint32Array]';
  1313. /** Used to match empty string literals in compiled template source. */
  1314. var reEmptyStringLeading = /\b__p \+= '';/g,
  1315. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1316. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1317. /** Used to match HTML entities and HTML characters. */
  1318. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1319. reUnescapedHtml = /[&<>"']/g,
  1320. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1321. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1322. /** Used to match template delimiters. */
  1323. var reEscape = /<%-([\s\S]+?)%>/g,
  1324. reEvaluate = /<%([\s\S]+?)%>/g,
  1325. reInterpolate = /<%=([\s\S]+?)%>/g;
  1326. /** Used to match property names within property paths. */
  1327. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1328. reIsPlainProp = /^\w*$/,
  1329. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1330. /**
  1331. * Used to match `RegExp`
  1332. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1333. */
  1334. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1335. reHasRegExpChar = RegExp(reRegExpChar.source);
  1336. /** Used to match leading whitespace. */
  1337. var reTrimStart = /^\s+/;
  1338. /** Used to match a single whitespace character. */
  1339. var reWhitespace = /\s/;
  1340. /** Used to match wrap detail comments. */
  1341. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1342. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1343. reSplitDetails = /,? & /;
  1344. /** Used to match words composed of alphanumeric characters. */
  1345. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1346. /**
  1347. * Used to validate the `validate` option in `_.template` variable.
  1348. *
  1349. * Forbids characters which could potentially change the meaning of the function argument definition:
  1350. * - "()," (modification of function parameters)
  1351. * - "=" (default value)
  1352. * - "[]{}" (destructuring of function parameters)
  1353. * - "/" (beginning of a comment)
  1354. * - whitespace
  1355. */
  1356. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1357. /** Used to match backslashes in property paths. */
  1358. var reEscapeChar = /\\(\\)?/g;
  1359. /**
  1360. * Used to match
  1361. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1362. */
  1363. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1364. /** Used to match `RegExp` flags from their coerced string values. */
  1365. var reFlags = /\w*$/;
  1366. /** Used to detect bad signed hexadecimal string values. */
  1367. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1368. /** Used to detect binary string values. */
  1369. var reIsBinary = /^0b[01]+$/i;
  1370. /** Used to detect host constructors (Safari). */
  1371. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1372. /** Used to detect octal string values. */
  1373. var reIsOctal = /^0o[0-7]+$/i;
  1374. /** Used to detect unsigned integer values. */
  1375. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1376. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1377. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1378. /** Used to ensure capturing order of template delimiters. */
  1379. var reNoMatch = /($^)/;
  1380. /** Used to match unescaped characters in compiled string literals. */
  1381. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1382. /** Used to compose unicode character classes. */
  1383. var rsAstralRange = '\\ud800-\\udfff',
  1384. rsComboMarksRange = '\\u0300-\\u036f',
  1385. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1386. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1387. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1388. rsDingbatRange = '\\u2700-\\u27bf',
  1389. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1390. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1391. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1392. rsPunctuationRange = '\\u2000-\\u206f',
  1393. 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',
  1394. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1395. rsVarRange = '\\ufe0e\\ufe0f',
  1396. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1397. /** Used to compose unicode capture groups. */
  1398. var rsApos = "['\u2019]",
  1399. rsAstral = '[' + rsAstralRange + ']',
  1400. rsBreak = '[' + rsBreakRange + ']',
  1401. rsCombo = '[' + rsComboRange + ']',
  1402. rsDigits = '\\d+',
  1403. rsDingbat = '[' + rsDingbatRange + ']',
  1404. rsLower = '[' + rsLowerRange + ']',
  1405. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1406. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1407. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1408. rsNonAstral = '[^' + rsAstralRange + ']',
  1409. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1410. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1411. rsUpper = '[' + rsUpperRange + ']',
  1412. rsZWJ = '\\u200d';
  1413. /** Used to compose unicode regexes. */
  1414. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1415. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1416. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1417. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1418. reOptMod = rsModifier + '?',
  1419. rsOptVar = '[' + rsVarRange + ']?',
  1420. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1421. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1422. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1423. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1424. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1425. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1426. /** Used to match apostrophes. */
  1427. var reApos = RegExp(rsApos, 'g');
  1428. /**
  1429. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1430. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1431. */
  1432. var reComboMark = RegExp(rsCombo, 'g');
  1433. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1434. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1435. /** Used to match complex or compound words. */
  1436. var reUnicodeWord = RegExp([
  1437. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1438. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1439. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1440. rsUpper + '+' + rsOptContrUpper,
  1441. rsOrdUpper,
  1442. rsOrdLower,
  1443. rsDigits,
  1444. rsEmoji
  1445. ].join('|'), 'g');
  1446. /** 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/). */
  1447. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1448. /** Used to detect strings that need a more robust regexp to match words. */
  1449. 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 ]/;
  1450. /** Used to assign default `context` object properties. */
  1451. var contextProps = [
  1452. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1453. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1454. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1455. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1456. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1457. ];
  1458. /** Used to make template sourceURLs easier to identify. */
  1459. var templateCounter = -1;
  1460. /** Used to identify `toStringTag` values of typed arrays. */
  1461. var typedArrayTags = {};
  1462. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1463. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1464. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1465. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1466. typedArrayTags[uint32Tag] = true;
  1467. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1468. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1469. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1470. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1471. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1472. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1473. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1474. typedArrayTags[weakMapTag] = false;
  1475. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1476. var cloneableTags = {};
  1477. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1478. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1479. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1480. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1481. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1482. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1483. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1484. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1485. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1486. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1487. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1488. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1489. cloneableTags[weakMapTag] = false;
  1490. /** Used to map Latin Unicode letters to basic Latin letters. */
  1491. var deburredLetters = {
  1492. // Latin-1 Supplement block.
  1493. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1494. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1495. '\xc7': 'C', '\xe7': 'c',
  1496. '\xd0': 'D', '\xf0': 'd',
  1497. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1498. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1499. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1500. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1501. '\xd1': 'N', '\xf1': 'n',
  1502. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1503. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1504. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1505. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1506. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1507. '\xc6': 'Ae', '\xe6': 'ae',
  1508. '\xde': 'Th', '\xfe': 'th',
  1509. '\xdf': 'ss',
  1510. // Latin Extended-A block.
  1511. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1512. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1513. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1514. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1515. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1516. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1517. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1518. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1519. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1520. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1521. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1522. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1523. '\u0134': 'J', '\u0135': 'j',
  1524. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1525. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1526. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1527. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1528. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1529. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1530. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1531. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1532. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1533. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1534. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1535. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1536. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1537. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1538. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1539. '\u0174': 'W', '\u0175': 'w',
  1540. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1541. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1542. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1543. '\u0132': 'IJ', '\u0133': 'ij',
  1544. '\u0152': 'Oe', '\u0153': 'oe',
  1545. '\u0149': "'n", '\u017f': 's'
  1546. };
  1547. /** Used to map characters to HTML entities. */
  1548. var htmlEscapes = {
  1549. '&': '&amp;',
  1550. '<': '&lt;',
  1551. '>': '&gt;',
  1552. '"': '&quot;',
  1553. "'": '&#39;'
  1554. };
  1555. /** Used to map HTML entities to characters. */
  1556. var htmlUnescapes = {
  1557. '&amp;': '&',
  1558. '&lt;': '<',
  1559. '&gt;': '>',
  1560. '&quot;': '"',
  1561. '&#39;': "'"
  1562. };
  1563. /** Used to escape characters for inclusion in compiled string literals. */
  1564. var stringEscapes = {
  1565. '\\': '\\',
  1566. "'": "'",
  1567. '\n': 'n',
  1568. '\r': 'r',
  1569. '\u2028': 'u2028',
  1570. '\u2029': 'u2029'
  1571. };
  1572. /** Built-in method references without a dependency on `root`. */
  1573. var freeParseFloat = parseFloat,
  1574. freeParseInt = parseInt;
  1575. /** Detect free variable `global` from Node.js. */
  1576. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1577. /** Detect free variable `self`. */
  1578. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1579. /** Used as a reference to the global object. */
  1580. var root = freeGlobal || freeSelf || Function('return this')();
  1581. /** Detect free variable `exports`. */
  1582. var freeExports = true && exports && !exports.nodeType && exports;
  1583. /** Detect free variable `module`. */
  1584. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1585. /** Detect the popular CommonJS extension `module.exports`. */
  1586. var moduleExports = freeModule && freeModule.exports === freeExports;
  1587. /** Detect free variable `process` from Node.js. */
  1588. var freeProcess = moduleExports && freeGlobal.process;
  1589. /** Used to access faster Node.js helpers. */
  1590. var nodeUtil = (function() {
  1591. try {
  1592. // Use `util.types` for Node.js 10+.
  1593. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1594. if (types) {
  1595. return types;
  1596. }
  1597. // Legacy `process.binding('util')` for Node.js < 10.
  1598. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1599. } catch (e) {}
  1600. }());
  1601. /* Node.js helper references. */
  1602. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1603. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1604. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1605. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1606. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1607. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1608. /*--------------------------------------------------------------------------*/
  1609. /**
  1610. * A faster alternative to `Function#apply`, this function invokes `func`
  1611. * with the `this` binding of `thisArg` and the arguments of `args`.
  1612. *
  1613. * @private
  1614. * @param {Function} func The function to invoke.
  1615. * @param {*} thisArg The `this` binding of `func`.
  1616. * @param {Array} args The arguments to invoke `func` with.
  1617. * @returns {*} Returns the result of `func`.
  1618. */
  1619. function apply(func, thisArg, args) {
  1620. switch (args.length) {
  1621. case 0: return func.call(thisArg);
  1622. case 1: return func.call(thisArg, args[0]);
  1623. case 2: return func.call(thisArg, args[0], args[1]);
  1624. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1625. }
  1626. return func.apply(thisArg, args);
  1627. }
  1628. /**
  1629. * A specialized version of `baseAggregator` for arrays.
  1630. *
  1631. * @private
  1632. * @param {Array} [array] The array to iterate over.
  1633. * @param {Function} setter The function to set `accumulator` values.
  1634. * @param {Function} iteratee The iteratee to transform keys.
  1635. * @param {Object} accumulator The initial aggregated object.
  1636. * @returns {Function} Returns `accumulator`.
  1637. */
  1638. function arrayAggregator(array, setter, iteratee, accumulator) {
  1639. var index = -1,
  1640. length = array == null ? 0 : array.length;
  1641. while (++index < length) {
  1642. var value = array[index];
  1643. setter(accumulator, value, iteratee(value), array);
  1644. }
  1645. return accumulator;
  1646. }
  1647. /**
  1648. * A specialized version of `_.forEach` for arrays without support for
  1649. * iteratee shorthands.
  1650. *
  1651. * @private
  1652. * @param {Array} [array] The array to iterate over.
  1653. * @param {Function} iteratee The function invoked per iteration.
  1654. * @returns {Array} Returns `array`.
  1655. */
  1656. function arrayEach(array, iteratee) {
  1657. var index = -1,
  1658. length = array == null ? 0 : array.length;
  1659. while (++index < length) {
  1660. if (iteratee(array[index], index, array) === false) {
  1661. break;
  1662. }
  1663. }
  1664. return array;
  1665. }
  1666. /**
  1667. * A specialized version of `_.forEachRight` for arrays without support for
  1668. * iteratee shorthands.
  1669. *
  1670. * @private
  1671. * @param {Array} [array] The array to iterate over.
  1672. * @param {Function} iteratee The function invoked per iteration.
  1673. * @returns {Array} Returns `array`.
  1674. */
  1675. function arrayEachRight(array, iteratee) {
  1676. var length = array == null ? 0 : array.length;
  1677. while (length--) {
  1678. if (iteratee(array[length], length, array) === false) {
  1679. break;
  1680. }
  1681. }
  1682. return array;
  1683. }
  1684. /**
  1685. * A specialized version of `_.every` for arrays without support for
  1686. * iteratee shorthands.
  1687. *
  1688. * @private
  1689. * @param {Array} [array] The array to iterate over.
  1690. * @param {Function} predicate The function invoked per iteration.
  1691. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1692. * else `false`.
  1693. */
  1694. function arrayEvery(array, predicate) {
  1695. var index = -1,
  1696. length = array == null ? 0 : array.length;
  1697. while (++index < length) {
  1698. if (!predicate(array[index], index, array)) {
  1699. return false;
  1700. }
  1701. }
  1702. return true;
  1703. }
  1704. /**
  1705. * A specialized version of `_.filter` for arrays without support for
  1706. * iteratee shorthands.
  1707. *
  1708. * @private
  1709. * @param {Array} [array] The array to iterate over.
  1710. * @param {Function} predicate The function invoked per iteration.
  1711. * @returns {Array} Returns the new filtered array.
  1712. */
  1713. function arrayFilter(array, predicate) {
  1714. var index = -1,
  1715. length = array == null ? 0 : array.length,
  1716. resIndex = 0,
  1717. result = [];
  1718. while (++index < length) {
  1719. var value = array[index];
  1720. if (predicate(value, index, array)) {
  1721. result[resIndex++] = value;
  1722. }
  1723. }
  1724. return result;
  1725. }
  1726. /**
  1727. * A specialized version of `_.includes` for arrays without support for
  1728. * specifying an index to search from.
  1729. *
  1730. * @private
  1731. * @param {Array} [array] The array to inspect.
  1732. * @param {*} target The value to search for.
  1733. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1734. */
  1735. function arrayIncludes(array, value) {
  1736. var length = array == null ? 0 : array.length;
  1737. return !!length && baseIndexOf(array, value, 0) > -1;
  1738. }
  1739. /**
  1740. * This function is like `arrayIncludes` except that it accepts a comparator.
  1741. *
  1742. * @private
  1743. * @param {Array} [array] The array to inspect.
  1744. * @param {*} target The value to search for.
  1745. * @param {Function} comparator The comparator invoked per element.
  1746. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1747. */
  1748. function arrayIncludesWith(array, value, comparator) {
  1749. var index = -1,
  1750. length = array == null ? 0 : array.length;
  1751. while (++index < length) {
  1752. if (comparator(value, array[index])) {
  1753. return true;
  1754. }
  1755. }
  1756. return false;
  1757. }
  1758. /**
  1759. * A specialized version of `_.map` for arrays without support for iteratee
  1760. * shorthands.
  1761. *
  1762. * @private
  1763. * @param {Array} [array] The array to iterate over.
  1764. * @param {Function} iteratee The function invoked per iteration.
  1765. * @returns {Array} Returns the new mapped array.
  1766. */
  1767. function arrayMap(array, iteratee) {
  1768. var index = -1,
  1769. length = array == null ? 0 : array.length,
  1770. result = Array(length);
  1771. while (++index < length) {
  1772. result[index] = iteratee(array[index], index, array);
  1773. }
  1774. return result;
  1775. }
  1776. /**
  1777. * Appends the elements of `values` to `array`.
  1778. *
  1779. * @private
  1780. * @param {Array} array The array to modify.
  1781. * @param {Array} values The values to append.
  1782. * @returns {Array} Returns `array`.
  1783. */
  1784. function arrayPush(array, values) {
  1785. var index = -1,
  1786. length = values.length,
  1787. offset = array.length;
  1788. while (++index < length) {
  1789. array[offset + index] = values[index];
  1790. }
  1791. return array;
  1792. }
  1793. /**
  1794. * A specialized version of `_.reduce` for arrays without support for
  1795. * iteratee shorthands.
  1796. *
  1797. * @private
  1798. * @param {Array} [array] The array to iterate over.
  1799. * @param {Function} iteratee The function invoked per iteration.
  1800. * @param {*} [accumulator] The initial value.
  1801. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1802. * the initial value.
  1803. * @returns {*} Returns the accumulated value.
  1804. */
  1805. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1806. var index = -1,
  1807. length = array == null ? 0 : array.length;
  1808. if (initAccum && length) {
  1809. accumulator = array[++index];
  1810. }
  1811. while (++index < length) {
  1812. accumulator = iteratee(accumulator, array[index], index, array);
  1813. }
  1814. return accumulator;
  1815. }
  1816. /**
  1817. * A specialized version of `_.reduceRight` for arrays without support for
  1818. * iteratee shorthands.
  1819. *
  1820. * @private
  1821. * @param {Array} [array] The array to iterate over.
  1822. * @param {Function} iteratee The function invoked per iteration.
  1823. * @param {*} [accumulator] The initial value.
  1824. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1825. * the initial value.
  1826. * @returns {*} Returns the accumulated value.
  1827. */
  1828. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1829. var length = array == null ? 0 : array.length;
  1830. if (initAccum && length) {
  1831. accumulator = array[--length];
  1832. }
  1833. while (length--) {
  1834. accumulator = iteratee(accumulator, array[length], length, array);
  1835. }
  1836. return accumulator;
  1837. }
  1838. /**
  1839. * A specialized version of `_.some` for arrays without support for iteratee
  1840. * shorthands.
  1841. *
  1842. * @private
  1843. * @param {Array} [array] The array to iterate over.
  1844. * @param {Function} predicate The function invoked per iteration.
  1845. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1846. * else `false`.
  1847. */
  1848. function arraySome(array, predicate) {
  1849. var index = -1,
  1850. length = array == null ? 0 : array.length;
  1851. while (++index < length) {
  1852. if (predicate(array[index], index, array)) {
  1853. return true;
  1854. }
  1855. }
  1856. return false;
  1857. }
  1858. /**
  1859. * Gets the size of an ASCII `string`.
  1860. *
  1861. * @private
  1862. * @param {string} string The string inspect.
  1863. * @returns {number} Returns the string size.
  1864. */
  1865. var asciiSize = baseProperty('length');
  1866. /**
  1867. * Converts an ASCII `string` to an array.
  1868. *
  1869. * @private
  1870. * @param {string} string The string to convert.
  1871. * @returns {Array} Returns the converted array.
  1872. */
  1873. function asciiToArray(string) {
  1874. return string.split('');
  1875. }
  1876. /**
  1877. * Splits an ASCII `string` into an array of its words.
  1878. *
  1879. * @private
  1880. * @param {string} The string to inspect.
  1881. * @returns {Array} Returns the words of `string`.
  1882. */
  1883. function asciiWords(string) {
  1884. return string.match(reAsciiWord) || [];
  1885. }
  1886. /**
  1887. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1888. * without support for iteratee shorthands, which iterates over `collection`
  1889. * using `eachFunc`.
  1890. *
  1891. * @private
  1892. * @param {Array|Object} collection The collection to inspect.
  1893. * @param {Function} predicate The function invoked per iteration.
  1894. * @param {Function} eachFunc The function to iterate over `collection`.
  1895. * @returns {*} Returns the found element or its key, else `undefined`.
  1896. */
  1897. function baseFindKey(collection, predicate, eachFunc) {
  1898. var result;
  1899. eachFunc(collection, function(value, key, collection) {
  1900. if (predicate(value, key, collection)) {
  1901. result = key;
  1902. return false;
  1903. }
  1904. });
  1905. return result;
  1906. }
  1907. /**
  1908. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1909. * support for iteratee shorthands.
  1910. *
  1911. * @private
  1912. * @param {Array} array The array to inspect.
  1913. * @param {Function} predicate The function invoked per iteration.
  1914. * @param {number} fromIndex The index to search from.
  1915. * @param {boolean} [fromRight] Specify iterating from right to left.
  1916. * @returns {number} Returns the index of the matched value, else `-1`.
  1917. */
  1918. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1919. var length = array.length,
  1920. index = fromIndex + (fromRight ? 1 : -1);
  1921. while ((fromRight ? index-- : ++index < length)) {
  1922. if (predicate(array[index], index, array)) {
  1923. return index;
  1924. }
  1925. }
  1926. return -1;
  1927. }
  1928. /**
  1929. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1930. *
  1931. * @private
  1932. * @param {Array} array The array to inspect.
  1933. * @param {*} value The value to search for.
  1934. * @param {number} fromIndex The index to search from.
  1935. * @returns {number} Returns the index of the matched value, else `-1`.
  1936. */
  1937. function baseIndexOf(array, value, fromIndex) {
  1938. return value === value
  1939. ? strictIndexOf(array, value, fromIndex)
  1940. : baseFindIndex(array, baseIsNaN, fromIndex);
  1941. }
  1942. /**
  1943. * This function is like `baseIndexOf` except that it accepts a comparator.
  1944. *
  1945. * @private
  1946. * @param {Array} array The array to inspect.
  1947. * @param {*} value The value to search for.
  1948. * @param {number} fromIndex The index to search from.
  1949. * @param {Function} comparator The comparator invoked per element.
  1950. * @returns {number} Returns the index of the matched value, else `-1`.
  1951. */
  1952. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1953. var index = fromIndex - 1,
  1954. length = array.length;
  1955. while (++index < length) {
  1956. if (comparator(array[index], value)) {
  1957. return index;
  1958. }
  1959. }
  1960. return -1;
  1961. }
  1962. /**
  1963. * The base implementation of `_.isNaN` without support for number objects.
  1964. *
  1965. * @private
  1966. * @param {*} value The value to check.
  1967. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1968. */
  1969. function baseIsNaN(value) {
  1970. return value !== value;
  1971. }
  1972. /**
  1973. * The base implementation of `_.mean` and `_.meanBy` without support for
  1974. * iteratee shorthands.
  1975. *
  1976. * @private
  1977. * @param {Array} array The array to iterate over.
  1978. * @param {Function} iteratee The function invoked per iteration.
  1979. * @returns {number} Returns the mean.
  1980. */
  1981. function baseMean(array, iteratee) {
  1982. var length = array == null ? 0 : array.length;
  1983. return length ? (baseSum(array, iteratee) / length) : NAN;
  1984. }
  1985. /**
  1986. * The base implementation of `_.property` without support for deep paths.
  1987. *
  1988. * @private
  1989. * @param {string} key The key of the property to get.
  1990. * @returns {Function} Returns the new accessor function.
  1991. */
  1992. function baseProperty(key) {
  1993. return function(object) {
  1994. return object == null ? undefined : object[key];
  1995. };
  1996. }
  1997. /**
  1998. * The base implementation of `_.propertyOf` without support for deep paths.
  1999. *
  2000. * @private
  2001. * @param {Object} object The object to query.
  2002. * @returns {Function} Returns the new accessor function.
  2003. */
  2004. function basePropertyOf(object) {
  2005. return function(key) {
  2006. return object == null ? undefined : object[key];
  2007. };
  2008. }
  2009. /**
  2010. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2011. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2012. *
  2013. * @private
  2014. * @param {Array|Object} collection The collection to iterate over.
  2015. * @param {Function} iteratee The function invoked per iteration.
  2016. * @param {*} accumulator The initial value.
  2017. * @param {boolean} initAccum Specify using the first or last element of
  2018. * `collection` as the initial value.
  2019. * @param {Function} eachFunc The function to iterate over `collection`.
  2020. * @returns {*} Returns the accumulated value.
  2021. */
  2022. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2023. eachFunc(collection, function(value, index, collection) {
  2024. accumulator = initAccum
  2025. ? (initAccum = false, value)
  2026. : iteratee(accumulator, value, index, collection);
  2027. });
  2028. return accumulator;
  2029. }
  2030. /**
  2031. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2032. * sort order of `array` and replaces criteria objects with their corresponding
  2033. * values.
  2034. *
  2035. * @private
  2036. * @param {Array} array The array to sort.
  2037. * @param {Function} comparer The function to define sort order.
  2038. * @returns {Array} Returns `array`.
  2039. */
  2040. function baseSortBy(array, comparer) {
  2041. var length = array.length;
  2042. array.sort(comparer);
  2043. while (length--) {
  2044. array[length] = array[length].value;
  2045. }
  2046. return array;
  2047. }
  2048. /**
  2049. * The base implementation of `_.sum` and `_.sumBy` without support for
  2050. * iteratee shorthands.
  2051. *
  2052. * @private
  2053. * @param {Array} array The array to iterate over.
  2054. * @param {Function} iteratee The function invoked per iteration.
  2055. * @returns {number} Returns the sum.
  2056. */
  2057. function baseSum(array, iteratee) {
  2058. var result,
  2059. index = -1,
  2060. length = array.length;
  2061. while (++index < length) {
  2062. var current = iteratee(array[index]);
  2063. if (current !== undefined) {
  2064. result = result === undefined ? current : (result + current);
  2065. }
  2066. }
  2067. return result;
  2068. }
  2069. /**
  2070. * The base implementation of `_.times` without support for iteratee shorthands
  2071. * or max array length checks.
  2072. *
  2073. * @private
  2074. * @param {number} n The number of times to invoke `iteratee`.
  2075. * @param {Function} iteratee The function invoked per iteration.
  2076. * @returns {Array} Returns the array of results.
  2077. */
  2078. function baseTimes(n, iteratee) {
  2079. var index = -1,
  2080. result = Array(n);
  2081. while (++index < n) {
  2082. result[index] = iteratee(index);
  2083. }
  2084. return result;
  2085. }
  2086. /**
  2087. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2088. * of key-value pairs for `object` corresponding to the property names of `props`.
  2089. *
  2090. * @private
  2091. * @param {Object} object The object to query.
  2092. * @param {Array} props The property names to get values for.
  2093. * @returns {Object} Returns the key-value pairs.
  2094. */
  2095. function baseToPairs(object, props) {
  2096. return arrayMap(props, function(key) {
  2097. return [key, object[key]];
  2098. });
  2099. }
  2100. /**
  2101. * The base implementation of `_.trim`.
  2102. *
  2103. * @private
  2104. * @param {string} string The string to trim.
  2105. * @returns {string} Returns the trimmed string.
  2106. */
  2107. function baseTrim(string) {
  2108. return string
  2109. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2110. : string;
  2111. }
  2112. /**
  2113. * The base implementation of `_.unary` without support for storing metadata.
  2114. *
  2115. * @private
  2116. * @param {Function} func The function to cap arguments for.
  2117. * @returns {Function} Returns the new capped function.
  2118. */
  2119. function baseUnary(func) {
  2120. return function(value) {
  2121. return func(value);
  2122. };
  2123. }
  2124. /**
  2125. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2126. * array of `object` property values corresponding to the property names
  2127. * of `props`.
  2128. *
  2129. * @private
  2130. * @param {Object} object The object to query.
  2131. * @param {Array} props The property names to get values for.
  2132. * @returns {Object} Returns the array of property values.
  2133. */
  2134. function baseValues(object, props) {
  2135. return arrayMap(props, function(key) {
  2136. return object[key];
  2137. });
  2138. }
  2139. /**
  2140. * Checks if a `cache` value for `key` exists.
  2141. *
  2142. * @private
  2143. * @param {Object} cache The cache to query.
  2144. * @param {string} key The key of the entry to check.
  2145. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2146. */
  2147. function cacheHas(cache, key) {
  2148. return cache.has(key);
  2149. }
  2150. /**
  2151. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2152. * that is not found in the character symbols.
  2153. *
  2154. * @private
  2155. * @param {Array} strSymbols The string symbols to inspect.
  2156. * @param {Array} chrSymbols The character symbols to find.
  2157. * @returns {number} Returns the index of the first unmatched string symbol.
  2158. */
  2159. function charsStartIndex(strSymbols, chrSymbols) {
  2160. var index = -1,
  2161. length = strSymbols.length;
  2162. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2163. return index;
  2164. }
  2165. /**
  2166. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2167. * that is not found in the character symbols.
  2168. *
  2169. * @private
  2170. * @param {Array} strSymbols The string symbols to inspect.
  2171. * @param {Array} chrSymbols The character symbols to find.
  2172. * @returns {number} Returns the index of the last unmatched string symbol.
  2173. */
  2174. function charsEndIndex(strSymbols, chrSymbols) {
  2175. var index = strSymbols.length;
  2176. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2177. return index;
  2178. }
  2179. /**
  2180. * Gets the number of `placeholder` occurrences in `array`.
  2181. *
  2182. * @private
  2183. * @param {Array} array The array to inspect.
  2184. * @param {*} placeholder The placeholder to search for.
  2185. * @returns {number} Returns the placeholder count.
  2186. */
  2187. function countHolders(array, placeholder) {
  2188. var length = array.length,
  2189. result = 0;
  2190. while (length--) {
  2191. if (array[length] === placeholder) {
  2192. ++result;
  2193. }
  2194. }
  2195. return result;
  2196. }
  2197. /**
  2198. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2199. * letters to basic Latin letters.
  2200. *
  2201. * @private
  2202. * @param {string} letter The matched letter to deburr.
  2203. * @returns {string} Returns the deburred letter.
  2204. */
  2205. var deburrLetter = basePropertyOf(deburredLetters);
  2206. /**
  2207. * Used by `_.escape` to convert characters to HTML entities.
  2208. *
  2209. * @private
  2210. * @param {string} chr The matched character to escape.
  2211. * @returns {string} Returns the escaped character.
  2212. */
  2213. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2214. /**
  2215. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2216. *
  2217. * @private
  2218. * @param {string} chr The matched character to escape.
  2219. * @returns {string} Returns the escaped character.
  2220. */
  2221. function escapeStringChar(chr) {
  2222. return '\\' + stringEscapes[chr];
  2223. }
  2224. /**
  2225. * Gets the value at `key` of `object`.
  2226. *
  2227. * @private
  2228. * @param {Object} [object] The object to query.
  2229. * @param {string} key The key of the property to get.
  2230. * @returns {*} Returns the property value.
  2231. */
  2232. function getValue(object, key) {
  2233. return object == null ? undefined : object[key];
  2234. }
  2235. /**
  2236. * Checks if `string` contains Unicode symbols.
  2237. *
  2238. * @private
  2239. * @param {string} string The string to inspect.
  2240. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2241. */
  2242. function hasUnicode(string) {
  2243. return reHasUnicode.test(string);
  2244. }
  2245. /**
  2246. * Checks if `string` contains a word composed of Unicode symbols.
  2247. *
  2248. * @private
  2249. * @param {string} string The string to inspect.
  2250. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2251. */
  2252. function hasUnicodeWord(string) {
  2253. return reHasUnicodeWord.test(string);
  2254. }
  2255. /**
  2256. * Converts `iterator` to an array.
  2257. *
  2258. * @private
  2259. * @param {Object} iterator The iterator to convert.
  2260. * @returns {Array} Returns the converted array.
  2261. */
  2262. function iteratorToArray(iterator) {
  2263. var data,
  2264. result = [];
  2265. while (!(data = iterator.next()).done) {
  2266. result.push(data.value);
  2267. }
  2268. return result;
  2269. }
  2270. /**
  2271. * Converts `map` to its key-value pairs.
  2272. *
  2273. * @private
  2274. * @param {Object} map The map to convert.
  2275. * @returns {Array} Returns the key-value pairs.
  2276. */
  2277. function mapToArray(map) {
  2278. var index = -1,
  2279. result = Array(map.size);
  2280. map.forEach(function(value, key) {
  2281. result[++index] = [key, value];
  2282. });
  2283. return result;
  2284. }
  2285. /**
  2286. * Creates a unary function that invokes `func` with its argument transformed.
  2287. *
  2288. * @private
  2289. * @param {Function} func The function to wrap.
  2290. * @param {Function} transform The argument transform.
  2291. * @returns {Function} Returns the new function.
  2292. */
  2293. function overArg(func, transform) {
  2294. return function(arg) {
  2295. return func(transform(arg));
  2296. };
  2297. }
  2298. /**
  2299. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2300. * and returns an array of their indexes.
  2301. *
  2302. * @private
  2303. * @param {Array} array The array to modify.
  2304. * @param {*} placeholder The placeholder to replace.
  2305. * @returns {Array} Returns the new array of placeholder indexes.
  2306. */
  2307. function replaceHolders(array, placeholder) {
  2308. var index = -1,
  2309. length = array.length,
  2310. resIndex = 0,
  2311. result = [];
  2312. while (++index < length) {
  2313. var value = array[index];
  2314. if (value === placeholder || value === PLACEHOLDER) {
  2315. array[index] = PLACEHOLDER;
  2316. result[resIndex++] = index;
  2317. }
  2318. }
  2319. return result;
  2320. }
  2321. /**
  2322. * Converts `set` to an array of its values.
  2323. *
  2324. * @private
  2325. * @param {Object} set The set to convert.
  2326. * @returns {Array} Returns the values.
  2327. */
  2328. function setToArray(set) {
  2329. var index = -1,
  2330. result = Array(set.size);
  2331. set.forEach(function(value) {
  2332. result[++index] = value;
  2333. });
  2334. return result;
  2335. }
  2336. /**
  2337. * Converts `set` to its value-value pairs.
  2338. *
  2339. * @private
  2340. * @param {Object} set The set to convert.
  2341. * @returns {Array} Returns the value-value pairs.
  2342. */
  2343. function setToPairs(set) {
  2344. var index = -1,
  2345. result = Array(set.size);
  2346. set.forEach(function(value) {
  2347. result[++index] = [value, value];
  2348. });
  2349. return result;
  2350. }
  2351. /**
  2352. * A specialized version of `_.indexOf` which performs strict equality
  2353. * comparisons of values, i.e. `===`.
  2354. *
  2355. * @private
  2356. * @param {Array} array The array to inspect.
  2357. * @param {*} value The value to search for.
  2358. * @param {number} fromIndex The index to search from.
  2359. * @returns {number} Returns the index of the matched value, else `-1`.
  2360. */
  2361. function strictIndexOf(array, value, fromIndex) {
  2362. var index = fromIndex - 1,
  2363. length = array.length;
  2364. while (++index < length) {
  2365. if (array[index] === value) {
  2366. return index;
  2367. }
  2368. }
  2369. return -1;
  2370. }
  2371. /**
  2372. * A specialized version of `_.lastIndexOf` which performs strict equality
  2373. * comparisons of values, i.e. `===`.
  2374. *
  2375. * @private
  2376. * @param {Array} array The array to inspect.
  2377. * @param {*} value The value to search for.
  2378. * @param {number} fromIndex The index to search from.
  2379. * @returns {number} Returns the index of the matched value, else `-1`.
  2380. */
  2381. function strictLastIndexOf(array, value, fromIndex) {
  2382. var index = fromIndex + 1;
  2383. while (index--) {
  2384. if (array[index] === value) {
  2385. return index;
  2386. }
  2387. }
  2388. return index;
  2389. }
  2390. /**
  2391. * Gets the number of symbols in `string`.
  2392. *
  2393. * @private
  2394. * @param {string} string The string to inspect.
  2395. * @returns {number} Returns the string size.
  2396. */
  2397. function stringSize(string) {
  2398. return hasUnicode(string)
  2399. ? unicodeSize(string)
  2400. : asciiSize(string);
  2401. }
  2402. /**
  2403. * Converts `string` to an array.
  2404. *
  2405. * @private
  2406. * @param {string} string The string to convert.
  2407. * @returns {Array} Returns the converted array.
  2408. */
  2409. function stringToArray(string) {
  2410. return hasUnicode(string)
  2411. ? unicodeToArray(string)
  2412. : asciiToArray(string);
  2413. }
  2414. /**
  2415. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2416. * character of `string`.
  2417. *
  2418. * @private
  2419. * @param {string} string The string to inspect.
  2420. * @returns {number} Returns the index of the last non-whitespace character.
  2421. */
  2422. function trimmedEndIndex(string) {
  2423. var index = string.length;
  2424. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2425. return index;
  2426. }
  2427. /**
  2428. * Used by `_.unescape` to convert HTML entities to characters.
  2429. *
  2430. * @private
  2431. * @param {string} chr The matched character to unescape.
  2432. * @returns {string} Returns the unescaped character.
  2433. */
  2434. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2435. /**
  2436. * Gets the size of a Unicode `string`.
  2437. *
  2438. * @private
  2439. * @param {string} string The string inspect.
  2440. * @returns {number} Returns the string size.
  2441. */
  2442. function unicodeSize(string) {
  2443. var result = reUnicode.lastIndex = 0;
  2444. while (reUnicode.test(string)) {
  2445. ++result;
  2446. }
  2447. return result;
  2448. }
  2449. /**
  2450. * Converts a Unicode `string` to an array.
  2451. *
  2452. * @private
  2453. * @param {string} string The string to convert.
  2454. * @returns {Array} Returns the converted array.
  2455. */
  2456. function unicodeToArray(string) {
  2457. return string.match(reUnicode) || [];
  2458. }
  2459. /**
  2460. * Splits a Unicode `string` into an array of its words.
  2461. *
  2462. * @private
  2463. * @param {string} The string to inspect.
  2464. * @returns {Array} Returns the words of `string`.
  2465. */
  2466. function unicodeWords(string) {
  2467. return string.match(reUnicodeWord) || [];
  2468. }
  2469. /*--------------------------------------------------------------------------*/
  2470. /**
  2471. * Create a new pristine `lodash` function using the `context` object.
  2472. *
  2473. * @static
  2474. * @memberOf _
  2475. * @since 1.1.0
  2476. * @category Util
  2477. * @param {Object} [context=root] The context object.
  2478. * @returns {Function} Returns a new `lodash` function.
  2479. * @example
  2480. *
  2481. * _.mixin({ 'foo': _.constant('foo') });
  2482. *
  2483. * var lodash = _.runInContext();
  2484. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2485. *
  2486. * _.isFunction(_.foo);
  2487. * // => true
  2488. * _.isFunction(_.bar);
  2489. * // => false
  2490. *
  2491. * lodash.isFunction(lodash.foo);
  2492. * // => false
  2493. * lodash.isFunction(lodash.bar);
  2494. * // => true
  2495. *
  2496. * // Create a suped-up `defer` in Node.js.
  2497. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2498. */
  2499. var runInContext = (function runInContext(context) {
  2500. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2501. /** Built-in constructor references. */
  2502. var Array = context.Array,
  2503. Date = context.Date,
  2504. Error = context.Error,
  2505. Function = context.Function,
  2506. Math = context.Math,
  2507. Object = context.Object,
  2508. RegExp = context.RegExp,
  2509. String = context.String,
  2510. TypeError = context.TypeError;
  2511. /** Used for built-in method references. */
  2512. var arrayProto = Array.prototype,
  2513. funcProto = Function.prototype,
  2514. objectProto = Object.prototype;
  2515. /** Used to detect overreaching core-js shims. */
  2516. var coreJsData = context['__core-js_shared__'];
  2517. /** Used to resolve the decompiled source of functions. */
  2518. var funcToString = funcProto.toString;
  2519. /** Used to check objects for own properties. */
  2520. var hasOwnProperty = objectProto.hasOwnProperty;
  2521. /** Used to generate unique IDs. */
  2522. var idCounter = 0;
  2523. /** Used to detect methods masquerading as native. */
  2524. var maskSrcKey = (function() {
  2525. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2526. return uid ? ('Symbol(src)_1.' + uid) : '';
  2527. }());
  2528. /**
  2529. * Used to resolve the
  2530. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2531. * of values.
  2532. */
  2533. var nativeObjectToString = objectProto.toString;
  2534. /** Used to infer the `Object` constructor. */
  2535. var objectCtorString = funcToString.call(Object);
  2536. /** Used to restore the original `_` reference in `_.noConflict`. */
  2537. var oldDash = root._;
  2538. /** Used to detect if a method is native. */
  2539. var reIsNative = RegExp('^' +
  2540. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2541. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2542. );
  2543. /** Built-in value references. */
  2544. var Buffer = moduleExports ? context.Buffer : undefined,
  2545. Symbol = context.Symbol,
  2546. Uint8Array = context.Uint8Array,
  2547. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2548. getPrototype = overArg(Object.getPrototypeOf, Object),
  2549. objectCreate = Object.create,
  2550. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2551. splice = arrayProto.splice,
  2552. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2553. symIterator = Symbol ? Symbol.iterator : undefined,
  2554. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2555. var defineProperty = (function() {
  2556. try {
  2557. var func = getNative(Object, 'defineProperty');
  2558. func({}, '', {});
  2559. return func;
  2560. } catch (e) {}
  2561. }());
  2562. /** Mocked built-ins. */
  2563. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2564. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2565. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2566. /* Built-in method references for those with the same name as other `lodash` methods. */
  2567. var nativeCeil = Math.ceil,
  2568. nativeFloor = Math.floor,
  2569. nativeGetSymbols = Object.getOwnPropertySymbols,
  2570. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2571. nativeIsFinite = context.isFinite,
  2572. nativeJoin = arrayProto.join,
  2573. nativeKeys = overArg(Object.keys, Object),
  2574. nativeMax = Math.max,
  2575. nativeMin = Math.min,
  2576. nativeNow = Date.now,
  2577. nativeParseInt = context.parseInt,
  2578. nativeRandom = Math.random,
  2579. nativeReverse = arrayProto.reverse;
  2580. /* Built-in method references that are verified to be native. */
  2581. var DataView = getNative(context, 'DataView'),
  2582. Map = getNative(context, 'Map'),
  2583. Promise = getNative(context, 'Promise'),
  2584. Set = getNative(context, 'Set'),
  2585. WeakMap = getNative(context, 'WeakMap'),
  2586. nativeCreate = getNative(Object, 'create');
  2587. /** Used to store function metadata. */
  2588. var metaMap = WeakMap && new WeakMap;
  2589. /** Used to lookup unminified function names. */
  2590. var realNames = {};
  2591. /** Used to detect maps, sets, and weakmaps. */
  2592. var dataViewCtorString = toSource(DataView),
  2593. mapCtorString = toSource(Map),
  2594. promiseCtorString = toSource(Promise),
  2595. setCtorString = toSource(Set),
  2596. weakMapCtorString = toSource(WeakMap);
  2597. /** Used to convert symbols to primitives and strings. */
  2598. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2599. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2600. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2601. /*------------------------------------------------------------------------*/
  2602. /**
  2603. * Creates a `lodash` object which wraps `value` to enable implicit method
  2604. * chain sequences. Methods that operate on and return arrays, collections,
  2605. * and functions can be chained together. Methods that retrieve a single value
  2606. * or may return a primitive value will automatically end the chain sequence
  2607. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2608. * with `_#value`.
  2609. *
  2610. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2611. * enabled using `_.chain`.
  2612. *
  2613. * The execution of chained methods is lazy, that is, it's deferred until
  2614. * `_#value` is implicitly or explicitly called.
  2615. *
  2616. * Lazy evaluation allows several methods to support shortcut fusion.
  2617. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2618. * the creation of intermediate arrays and can greatly reduce the number of
  2619. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2620. * fusion if the section is applied to an array and iteratees accept only
  2621. * one argument. The heuristic for whether a section qualifies for shortcut
  2622. * fusion is subject to change.
  2623. *
  2624. * Chaining is supported in custom builds as long as the `_#value` method is
  2625. * directly or indirectly included in the build.
  2626. *
  2627. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2628. *
  2629. * The wrapper `Array` methods are:
  2630. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2631. *
  2632. * The wrapper `String` methods are:
  2633. * `replace` and `split`
  2634. *
  2635. * The wrapper methods that support shortcut fusion are:
  2636. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2637. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2638. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2639. *
  2640. * The chainable wrapper methods are:
  2641. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2642. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2643. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2644. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2645. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2646. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2647. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2648. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2649. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2650. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2651. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2652. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2653. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2654. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2655. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2656. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2657. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2658. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2659. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2660. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2661. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2662. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2663. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2664. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2665. *
  2666. * The wrapper methods that are **not** chainable by default are:
  2667. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2668. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2669. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2670. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2671. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2672. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2673. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2674. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2675. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2676. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2677. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2678. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2679. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2680. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2681. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2682. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2683. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2684. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2685. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2686. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2687. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2688. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2689. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2690. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2691. * `upperFirst`, `value`, and `words`
  2692. *
  2693. * @name _
  2694. * @constructor
  2695. * @category Seq
  2696. * @param {*} value The value to wrap in a `lodash` instance.
  2697. * @returns {Object} Returns the new `lodash` wrapper instance.
  2698. * @example
  2699. *
  2700. * function square(n) {
  2701. * return n * n;
  2702. * }
  2703. *
  2704. * var wrapped = _([1, 2, 3]);
  2705. *
  2706. * // Returns an unwrapped value.
  2707. * wrapped.reduce(_.add);
  2708. * // => 6
  2709. *
  2710. * // Returns a wrapped value.
  2711. * var squares = wrapped.map(square);
  2712. *
  2713. * _.isArray(squares);
  2714. * // => false
  2715. *
  2716. * _.isArray(squares.value());
  2717. * // => true
  2718. */
  2719. function lodash(value) {
  2720. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2721. if (value instanceof LodashWrapper) {
  2722. return value;
  2723. }
  2724. if (hasOwnProperty.call(value, '__wrapped__')) {
  2725. return wrapperClone(value);
  2726. }
  2727. }
  2728. return new LodashWrapper(value);
  2729. }
  2730. /**
  2731. * The base implementation of `_.create` without support for assigning
  2732. * properties to the created object.
  2733. *
  2734. * @private
  2735. * @param {Object} proto The object to inherit from.
  2736. * @returns {Object} Returns the new object.
  2737. */
  2738. var baseCreate = (function() {
  2739. function object() {}
  2740. return function(proto) {
  2741. if (!isObject(proto)) {
  2742. return {};
  2743. }
  2744. if (objectCreate) {
  2745. return objectCreate(proto);
  2746. }
  2747. object.prototype = proto;
  2748. var result = new object;
  2749. object.prototype = undefined;
  2750. return result;
  2751. };
  2752. }());
  2753. /**
  2754. * The function whose prototype chain sequence wrappers inherit from.
  2755. *
  2756. * @private
  2757. */
  2758. function baseLodash() {
  2759. // No operation performed.
  2760. }
  2761. /**
  2762. * The base constructor for creating `lodash` wrapper objects.
  2763. *
  2764. * @private
  2765. * @param {*} value The value to wrap.
  2766. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2767. */
  2768. function LodashWrapper(value, chainAll) {
  2769. this.__wrapped__ = value;
  2770. this.__actions__ = [];
  2771. this.__chain__ = !!chainAll;
  2772. this.__index__ = 0;
  2773. this.__values__ = undefined;
  2774. }
  2775. /**
  2776. * By default, the template delimiters used by lodash are like those in
  2777. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2778. * following template settings to use alternative delimiters.
  2779. *
  2780. * @static
  2781. * @memberOf _
  2782. * @type {Object}
  2783. */
  2784. lodash.templateSettings = {
  2785. /**
  2786. * Used to detect `data` property values to be HTML-escaped.
  2787. *
  2788. * @memberOf _.templateSettings
  2789. * @type {RegExp}
  2790. */
  2791. 'escape': reEscape,
  2792. /**
  2793. * Used to detect code to be evaluated.
  2794. *
  2795. * @memberOf _.templateSettings
  2796. * @type {RegExp}
  2797. */
  2798. 'evaluate': reEvaluate,
  2799. /**
  2800. * Used to detect `data` property values to inject.
  2801. *
  2802. * @memberOf _.templateSettings
  2803. * @type {RegExp}
  2804. */
  2805. 'interpolate': reInterpolate,
  2806. /**
  2807. * Used to reference the data object in the template text.
  2808. *
  2809. * @memberOf _.templateSettings
  2810. * @type {string}
  2811. */
  2812. 'variable': '',
  2813. /**
  2814. * Used to import variables into the compiled template.
  2815. *
  2816. * @memberOf _.templateSettings
  2817. * @type {Object}
  2818. */
  2819. 'imports': {
  2820. /**
  2821. * A reference to the `lodash` function.
  2822. *
  2823. * @memberOf _.templateSettings.imports
  2824. * @type {Function}
  2825. */
  2826. '_': lodash
  2827. }
  2828. };
  2829. // Ensure wrappers are instances of `baseLodash`.
  2830. lodash.prototype = baseLodash.prototype;
  2831. lodash.prototype.constructor = lodash;
  2832. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2833. LodashWrapper.prototype.constructor = LodashWrapper;
  2834. /*------------------------------------------------------------------------*/
  2835. /**
  2836. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2837. *
  2838. * @private
  2839. * @constructor
  2840. * @param {*} value The value to wrap.
  2841. */
  2842. function LazyWrapper(value) {
  2843. this.__wrapped__ = value;
  2844. this.__actions__ = [];
  2845. this.__dir__ = 1;
  2846. this.__filtered__ = false;
  2847. this.__iteratees__ = [];
  2848. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2849. this.__views__ = [];
  2850. }
  2851. /**
  2852. * Creates a clone of the lazy wrapper object.
  2853. *
  2854. * @private
  2855. * @name clone
  2856. * @memberOf LazyWrapper
  2857. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2858. */
  2859. function lazyClone() {
  2860. var result = new LazyWrapper(this.__wrapped__);
  2861. result.__actions__ = copyArray(this.__actions__);
  2862. result.__dir__ = this.__dir__;
  2863. result.__filtered__ = this.__filtered__;
  2864. result.__iteratees__ = copyArray(this.__iteratees__);
  2865. result.__takeCount__ = this.__takeCount__;
  2866. result.__views__ = copyArray(this.__views__);
  2867. return result;
  2868. }
  2869. /**
  2870. * Reverses the direction of lazy iteration.
  2871. *
  2872. * @private
  2873. * @name reverse
  2874. * @memberOf LazyWrapper
  2875. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2876. */
  2877. function lazyReverse() {
  2878. if (this.__filtered__) {
  2879. var result = new LazyWrapper(this);
  2880. result.__dir__ = -1;
  2881. result.__filtered__ = true;
  2882. } else {
  2883. result = this.clone();
  2884. result.__dir__ *= -1;
  2885. }
  2886. return result;
  2887. }
  2888. /**
  2889. * Extracts the unwrapped value from its lazy wrapper.
  2890. *
  2891. * @private
  2892. * @name value
  2893. * @memberOf LazyWrapper
  2894. * @returns {*} Returns the unwrapped value.
  2895. */
  2896. function lazyValue() {
  2897. var array = this.__wrapped__.value(),
  2898. dir = this.__dir__,
  2899. isArr = isArray(array),
  2900. isRight = dir < 0,
  2901. arrLength = isArr ? array.length : 0,
  2902. view = getView(0, arrLength, this.__views__),
  2903. start = view.start,
  2904. end = view.end,
  2905. length = end - start,
  2906. index = isRight ? end : (start - 1),
  2907. iteratees = this.__iteratees__,
  2908. iterLength = iteratees.length,
  2909. resIndex = 0,
  2910. takeCount = nativeMin(length, this.__takeCount__);
  2911. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2912. return baseWrapperValue(array, this.__actions__);
  2913. }
  2914. var result = [];
  2915. outer:
  2916. while (length-- && resIndex < takeCount) {
  2917. index += dir;
  2918. var iterIndex = -1,
  2919. value = array[index];
  2920. while (++iterIndex < iterLength) {
  2921. var data = iteratees[iterIndex],
  2922. iteratee = data.iteratee,
  2923. type = data.type,
  2924. computed = iteratee(value);
  2925. if (type == LAZY_MAP_FLAG) {
  2926. value = computed;
  2927. } else if (!computed) {
  2928. if (type == LAZY_FILTER_FLAG) {
  2929. continue outer;
  2930. } else {
  2931. break outer;
  2932. }
  2933. }
  2934. }
  2935. result[resIndex++] = value;
  2936. }
  2937. return result;
  2938. }
  2939. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2940. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2941. LazyWrapper.prototype.constructor = LazyWrapper;
  2942. /*------------------------------------------------------------------------*/
  2943. /**
  2944. * Creates a hash object.
  2945. *
  2946. * @private
  2947. * @constructor
  2948. * @param {Array} [entries] The key-value pairs to cache.
  2949. */
  2950. function Hash(entries) {
  2951. var index = -1,
  2952. length = entries == null ? 0 : entries.length;
  2953. this.clear();
  2954. while (++index < length) {
  2955. var entry = entries[index];
  2956. this.set(entry[0], entry[1]);
  2957. }
  2958. }
  2959. /**
  2960. * Removes all key-value entries from the hash.
  2961. *
  2962. * @private
  2963. * @name clear
  2964. * @memberOf Hash
  2965. */
  2966. function hashClear() {
  2967. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2968. this.size = 0;
  2969. }
  2970. /**
  2971. * Removes `key` and its value from the hash.
  2972. *
  2973. * @private
  2974. * @name delete
  2975. * @memberOf Hash
  2976. * @param {Object} hash The hash to modify.
  2977. * @param {string} key The key of the value to remove.
  2978. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2979. */
  2980. function hashDelete(key) {
  2981. var result = this.has(key) && delete this.__data__[key];
  2982. this.size -= result ? 1 : 0;
  2983. return result;
  2984. }
  2985. /**
  2986. * Gets the hash value for `key`.
  2987. *
  2988. * @private
  2989. * @name get
  2990. * @memberOf Hash
  2991. * @param {string} key The key of the value to get.
  2992. * @returns {*} Returns the entry value.
  2993. */
  2994. function hashGet(key) {
  2995. var data = this.__data__;
  2996. if (nativeCreate) {
  2997. var result = data[key];
  2998. return result === HASH_UNDEFINED ? undefined : result;
  2999. }
  3000. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3001. }
  3002. /**
  3003. * Checks if a hash value for `key` exists.
  3004. *
  3005. * @private
  3006. * @name has
  3007. * @memberOf Hash
  3008. * @param {string} key The key of the entry to check.
  3009. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3010. */
  3011. function hashHas(key) {
  3012. var data = this.__data__;
  3013. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3014. }
  3015. /**
  3016. * Sets the hash `key` to `value`.
  3017. *
  3018. * @private
  3019. * @name set
  3020. * @memberOf Hash
  3021. * @param {string} key The key of the value to set.
  3022. * @param {*} value The value to set.
  3023. * @returns {Object} Returns the hash instance.
  3024. */
  3025. function hashSet(key, value) {
  3026. var data = this.__data__;
  3027. this.size += this.has(key) ? 0 : 1;
  3028. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3029. return this;
  3030. }
  3031. // Add methods to `Hash`.
  3032. Hash.prototype.clear = hashClear;
  3033. Hash.prototype['delete'] = hashDelete;
  3034. Hash.prototype.get = hashGet;
  3035. Hash.prototype.has = hashHas;
  3036. Hash.prototype.set = hashSet;
  3037. /*------------------------------------------------------------------------*/
  3038. /**
  3039. * Creates an list cache object.
  3040. *
  3041. * @private
  3042. * @constructor
  3043. * @param {Array} [entries] The key-value pairs to cache.
  3044. */
  3045. function ListCache(entries) {
  3046. var index = -1,
  3047. length = entries == null ? 0 : entries.length;
  3048. this.clear();
  3049. while (++index < length) {
  3050. var entry = entries[index];
  3051. this.set(entry[0], entry[1]);
  3052. }
  3053. }
  3054. /**
  3055. * Removes all key-value entries from the list cache.
  3056. *
  3057. * @private
  3058. * @name clear
  3059. * @memberOf ListCache
  3060. */
  3061. function listCacheClear() {
  3062. this.__data__ = [];
  3063. this.size = 0;
  3064. }
  3065. /**
  3066. * Removes `key` and its value from the list cache.
  3067. *
  3068. * @private
  3069. * @name delete
  3070. * @memberOf ListCache
  3071. * @param {string} key The key of the value to remove.
  3072. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3073. */
  3074. function listCacheDelete(key) {
  3075. var data = this.__data__,
  3076. index = assocIndexOf(data, key);
  3077. if (index < 0) {
  3078. return false;
  3079. }
  3080. var lastIndex = data.length - 1;
  3081. if (index == lastIndex) {
  3082. data.pop();
  3083. } else {
  3084. splice.call(data, index, 1);
  3085. }
  3086. --this.size;
  3087. return true;
  3088. }
  3089. /**
  3090. * Gets the list cache value for `key`.
  3091. *
  3092. * @private
  3093. * @name get
  3094. * @memberOf ListCache
  3095. * @param {string} key The key of the value to get.
  3096. * @returns {*} Returns the entry value.
  3097. */
  3098. function listCacheGet(key) {
  3099. var data = this.__data__,
  3100. index = assocIndexOf(data, key);
  3101. return index < 0 ? undefined : data[index][1];
  3102. }
  3103. /**
  3104. * Checks if a list cache value for `key` exists.
  3105. *
  3106. * @private
  3107. * @name has
  3108. * @memberOf ListCache
  3109. * @param {string} key The key of the entry to check.
  3110. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3111. */
  3112. function listCacheHas(key) {
  3113. return assocIndexOf(this.__data__, key) > -1;
  3114. }
  3115. /**
  3116. * Sets the list cache `key` to `value`.
  3117. *
  3118. * @private
  3119. * @name set
  3120. * @memberOf ListCache
  3121. * @param {string} key The key of the value to set.
  3122. * @param {*} value The value to set.
  3123. * @returns {Object} Returns the list cache instance.
  3124. */
  3125. function listCacheSet(key, value) {
  3126. var data = this.__data__,
  3127. index = assocIndexOf(data, key);
  3128. if (index < 0) {
  3129. ++this.size;
  3130. data.push([key, value]);
  3131. } else {
  3132. data[index][1] = value;
  3133. }
  3134. return this;
  3135. }
  3136. // Add methods to `ListCache`.
  3137. ListCache.prototype.clear = listCacheClear;
  3138. ListCache.prototype['delete'] = listCacheDelete;
  3139. ListCache.prototype.get = listCacheGet;
  3140. ListCache.prototype.has = listCacheHas;
  3141. ListCache.prototype.set = listCacheSet;
  3142. /*------------------------------------------------------------------------*/
  3143. /**
  3144. * Creates a map cache object to store key-value pairs.
  3145. *
  3146. * @private
  3147. * @constructor
  3148. * @param {Array} [entries] The key-value pairs to cache.
  3149. */
  3150. function MapCache(entries) {
  3151. var index = -1,
  3152. length = entries == null ? 0 : entries.length;
  3153. this.clear();
  3154. while (++index < length) {
  3155. var entry = entries[index];
  3156. this.set(entry[0], entry[1]);
  3157. }
  3158. }
  3159. /**
  3160. * Removes all key-value entries from the map.
  3161. *
  3162. * @private
  3163. * @name clear
  3164. * @memberOf MapCache
  3165. */
  3166. function mapCacheClear() {
  3167. this.size = 0;
  3168. this.__data__ = {
  3169. 'hash': new Hash,
  3170. 'map': new (Map || ListCache),
  3171. 'string': new Hash
  3172. };
  3173. }
  3174. /**
  3175. * Removes `key` and its value from the map.
  3176. *
  3177. * @private
  3178. * @name delete
  3179. * @memberOf MapCache
  3180. * @param {string} key The key of the value to remove.
  3181. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3182. */
  3183. function mapCacheDelete(key) {
  3184. var result = getMapData(this, key)['delete'](key);
  3185. this.size -= result ? 1 : 0;
  3186. return result;
  3187. }
  3188. /**
  3189. * Gets the map value for `key`.
  3190. *
  3191. * @private
  3192. * @name get
  3193. * @memberOf MapCache
  3194. * @param {string} key The key of the value to get.
  3195. * @returns {*} Returns the entry value.
  3196. */
  3197. function mapCacheGet(key) {
  3198. return getMapData(this, key).get(key);
  3199. }
  3200. /**
  3201. * Checks if a map value for `key` exists.
  3202. *
  3203. * @private
  3204. * @name has
  3205. * @memberOf MapCache
  3206. * @param {string} key The key of the entry to check.
  3207. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3208. */
  3209. function mapCacheHas(key) {
  3210. return getMapData(this, key).has(key);
  3211. }
  3212. /**
  3213. * Sets the map `key` to `value`.
  3214. *
  3215. * @private
  3216. * @name set
  3217. * @memberOf MapCache
  3218. * @param {string} key The key of the value to set.
  3219. * @param {*} value The value to set.
  3220. * @returns {Object} Returns the map cache instance.
  3221. */
  3222. function mapCacheSet(key, value) {
  3223. var data = getMapData(this, key),
  3224. size = data.size;
  3225. data.set(key, value);
  3226. this.size += data.size == size ? 0 : 1;
  3227. return this;
  3228. }
  3229. // Add methods to `MapCache`.
  3230. MapCache.prototype.clear = mapCacheClear;
  3231. MapCache.prototype['delete'] = mapCacheDelete;
  3232. MapCache.prototype.get = mapCacheGet;
  3233. MapCache.prototype.has = mapCacheHas;
  3234. MapCache.prototype.set = mapCacheSet;
  3235. /*------------------------------------------------------------------------*/
  3236. /**
  3237. *
  3238. * Creates an array cache object to store unique values.
  3239. *
  3240. * @private
  3241. * @constructor
  3242. * @param {Array} [values] The values to cache.
  3243. */
  3244. function SetCache(values) {
  3245. var index = -1,
  3246. length = values == null ? 0 : values.length;
  3247. this.__data__ = new MapCache;
  3248. while (++index < length) {
  3249. this.add(values[index]);
  3250. }
  3251. }
  3252. /**
  3253. * Adds `value` to the array cache.
  3254. *
  3255. * @private
  3256. * @name add
  3257. * @memberOf SetCache
  3258. * @alias push
  3259. * @param {*} value The value to cache.
  3260. * @returns {Object} Returns the cache instance.
  3261. */
  3262. function setCacheAdd(value) {
  3263. this.__data__.set(value, HASH_UNDEFINED);
  3264. return this;
  3265. }
  3266. /**
  3267. * Checks if `value` is in the array cache.
  3268. *
  3269. * @private
  3270. * @name has
  3271. * @memberOf SetCache
  3272. * @param {*} value The value to search for.
  3273. * @returns {number} Returns `true` if `value` is found, else `false`.
  3274. */
  3275. function setCacheHas(value) {
  3276. return this.__data__.has(value);
  3277. }
  3278. // Add methods to `SetCache`.
  3279. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3280. SetCache.prototype.has = setCacheHas;
  3281. /*------------------------------------------------------------------------*/
  3282. /**
  3283. * Creates a stack cache object to store key-value pairs.
  3284. *
  3285. * @private
  3286. * @constructor
  3287. * @param {Array} [entries] The key-value pairs to cache.
  3288. */
  3289. function Stack(entries) {
  3290. var data = this.__data__ = new ListCache(entries);
  3291. this.size = data.size;
  3292. }
  3293. /**
  3294. * Removes all key-value entries from the stack.
  3295. *
  3296. * @private
  3297. * @name clear
  3298. * @memberOf Stack
  3299. */
  3300. function stackClear() {
  3301. this.__data__ = new ListCache;
  3302. this.size = 0;
  3303. }
  3304. /**
  3305. * Removes `key` and its value from the stack.
  3306. *
  3307. * @private
  3308. * @name delete
  3309. * @memberOf Stack
  3310. * @param {string} key The key of the value to remove.
  3311. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3312. */
  3313. function stackDelete(key) {
  3314. var data = this.__data__,
  3315. result = data['delete'](key);
  3316. this.size = data.size;
  3317. return result;
  3318. }
  3319. /**
  3320. * Gets the stack value for `key`.
  3321. *
  3322. * @private
  3323. * @name get
  3324. * @memberOf Stack
  3325. * @param {string} key The key of the value to get.
  3326. * @returns {*} Returns the entry value.
  3327. */
  3328. function stackGet(key) {
  3329. return this.__data__.get(key);
  3330. }
  3331. /**
  3332. * Checks if a stack value for `key` exists.
  3333. *
  3334. * @private
  3335. * @name has
  3336. * @memberOf Stack
  3337. * @param {string} key The key of the entry to check.
  3338. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3339. */
  3340. function stackHas(key) {
  3341. return this.__data__.has(key);
  3342. }
  3343. /**
  3344. * Sets the stack `key` to `value`.
  3345. *
  3346. * @private
  3347. * @name set
  3348. * @memberOf Stack
  3349. * @param {string} key The key of the value to set.
  3350. * @param {*} value The value to set.
  3351. * @returns {Object} Returns the stack cache instance.
  3352. */
  3353. function stackSet(key, value) {
  3354. var data = this.__data__;
  3355. if (data instanceof ListCache) {
  3356. var pairs = data.__data__;
  3357. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3358. pairs.push([key, value]);
  3359. this.size = ++data.size;
  3360. return this;
  3361. }
  3362. data = this.__data__ = new MapCache(pairs);
  3363. }
  3364. data.set(key, value);
  3365. this.size = data.size;
  3366. return this;
  3367. }
  3368. // Add methods to `Stack`.
  3369. Stack.prototype.clear = stackClear;
  3370. Stack.prototype['delete'] = stackDelete;
  3371. Stack.prototype.get = stackGet;
  3372. Stack.prototype.has = stackHas;
  3373. Stack.prototype.set = stackSet;
  3374. /*------------------------------------------------------------------------*/
  3375. /**
  3376. * Creates an array of the enumerable property names of the array-like `value`.
  3377. *
  3378. * @private
  3379. * @param {*} value The value to query.
  3380. * @param {boolean} inherited Specify returning inherited property names.
  3381. * @returns {Array} Returns the array of property names.
  3382. */
  3383. function arrayLikeKeys(value, inherited) {
  3384. var isArr = isArray(value),
  3385. isArg = !isArr && isArguments(value),
  3386. isBuff = !isArr && !isArg && isBuffer(value),
  3387. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3388. skipIndexes = isArr || isArg || isBuff || isType,
  3389. result = skipIndexes ? baseTimes(value.length, String) : [],
  3390. length = result.length;
  3391. for (var key in value) {
  3392. if ((inherited || hasOwnProperty.call(value, key)) &&
  3393. !(skipIndexes && (
  3394. // Safari 9 has enumerable `arguments.length` in strict mode.
  3395. key == 'length' ||
  3396. // Node.js 0.10 has enumerable non-index properties on buffers.
  3397. (isBuff && (key == 'offset' || key == 'parent')) ||
  3398. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3399. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3400. // Skip index properties.
  3401. isIndex(key, length)
  3402. ))) {
  3403. result.push(key);
  3404. }
  3405. }
  3406. return result;
  3407. }
  3408. /**
  3409. * A specialized version of `_.sample` for arrays.
  3410. *
  3411. * @private
  3412. * @param {Array} array The array to sample.
  3413. * @returns {*} Returns the random element.
  3414. */
  3415. function arraySample(array) {
  3416. var length = array.length;
  3417. return length ? array[baseRandom(0, length - 1)] : undefined;
  3418. }
  3419. /**
  3420. * A specialized version of `_.sampleSize` for arrays.
  3421. *
  3422. * @private
  3423. * @param {Array} array The array to sample.
  3424. * @param {number} n The number of elements to sample.
  3425. * @returns {Array} Returns the random elements.
  3426. */
  3427. function arraySampleSize(array, n) {
  3428. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3429. }
  3430. /**
  3431. * A specialized version of `_.shuffle` for arrays.
  3432. *
  3433. * @private
  3434. * @param {Array} array The array to shuffle.
  3435. * @returns {Array} Returns the new shuffled array.
  3436. */
  3437. function arrayShuffle(array) {
  3438. return shuffleSelf(copyArray(array));
  3439. }
  3440. /**
  3441. * This function is like `assignValue` except that it doesn't assign
  3442. * `undefined` values.
  3443. *
  3444. * @private
  3445. * @param {Object} object The object to modify.
  3446. * @param {string} key The key of the property to assign.
  3447. * @param {*} value The value to assign.
  3448. */
  3449. function assignMergeValue(object, key, value) {
  3450. if ((value !== undefined && !eq(object[key], value)) ||
  3451. (value === undefined && !(key in object))) {
  3452. baseAssignValue(object, key, value);
  3453. }
  3454. }
  3455. /**
  3456. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3457. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3458. * for equality comparisons.
  3459. *
  3460. * @private
  3461. * @param {Object} object The object to modify.
  3462. * @param {string} key The key of the property to assign.
  3463. * @param {*} value The value to assign.
  3464. */
  3465. function assignValue(object, key, value) {
  3466. var objValue = object[key];
  3467. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3468. (value === undefined && !(key in object))) {
  3469. baseAssignValue(object, key, value);
  3470. }
  3471. }
  3472. /**
  3473. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3474. *
  3475. * @private
  3476. * @param {Array} array The array to inspect.
  3477. * @param {*} key The key to search for.
  3478. * @returns {number} Returns the index of the matched value, else `-1`.
  3479. */
  3480. function assocIndexOf(array, key) {
  3481. var length = array.length;
  3482. while (length--) {
  3483. if (eq(array[length][0], key)) {
  3484. return length;
  3485. }
  3486. }
  3487. return -1;
  3488. }
  3489. /**
  3490. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3491. * by `iteratee` and values set by `setter`.
  3492. *
  3493. * @private
  3494. * @param {Array|Object} collection The collection to iterate over.
  3495. * @param {Function} setter The function to set `accumulator` values.
  3496. * @param {Function} iteratee The iteratee to transform keys.
  3497. * @param {Object} accumulator The initial aggregated object.
  3498. * @returns {Function} Returns `accumulator`.
  3499. */
  3500. function baseAggregator(collection, setter, iteratee, accumulator) {
  3501. baseEach(collection, function(value, key, collection) {
  3502. setter(accumulator, value, iteratee(value), collection);
  3503. });
  3504. return accumulator;
  3505. }
  3506. /**
  3507. * The base implementation of `_.assign` without support for multiple sources
  3508. * or `customizer` functions.
  3509. *
  3510. * @private
  3511. * @param {Object} object The destination object.
  3512. * @param {Object} source The source object.
  3513. * @returns {Object} Returns `object`.
  3514. */
  3515. function baseAssign(object, source) {
  3516. return object && copyObject(source, keys(source), object);
  3517. }
  3518. /**
  3519. * The base implementation of `_.assignIn` without support for multiple sources
  3520. * or `customizer` functions.
  3521. *
  3522. * @private
  3523. * @param {Object} object The destination object.
  3524. * @param {Object} source The source object.
  3525. * @returns {Object} Returns `object`.
  3526. */
  3527. function baseAssignIn(object, source) {
  3528. return object && copyObject(source, keysIn(source), object);
  3529. }
  3530. /**
  3531. * The base implementation of `assignValue` and `assignMergeValue` without
  3532. * value checks.
  3533. *
  3534. * @private
  3535. * @param {Object} object The object to modify.
  3536. * @param {string} key The key of the property to assign.
  3537. * @param {*} value The value to assign.
  3538. */
  3539. function baseAssignValue(object, key, value) {
  3540. if (key == '__proto__' && defineProperty) {
  3541. defineProperty(object, key, {
  3542. 'configurable': true,
  3543. 'enumerable': true,
  3544. 'value': value,
  3545. 'writable': true
  3546. });
  3547. } else {
  3548. object[key] = value;
  3549. }
  3550. }
  3551. /**
  3552. * The base implementation of `_.at` without support for individual paths.
  3553. *
  3554. * @private
  3555. * @param {Object} object The object to iterate over.
  3556. * @param {string[]} paths The property paths to pick.
  3557. * @returns {Array} Returns the picked elements.
  3558. */
  3559. function baseAt(object, paths) {
  3560. var index = -1,
  3561. length = paths.length,
  3562. result = Array(length),
  3563. skip = object == null;
  3564. while (++index < length) {
  3565. result[index] = skip ? undefined : get(object, paths[index]);
  3566. }
  3567. return result;
  3568. }
  3569. /**
  3570. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3571. *
  3572. * @private
  3573. * @param {number} number The number to clamp.
  3574. * @param {number} [lower] The lower bound.
  3575. * @param {number} upper The upper bound.
  3576. * @returns {number} Returns the clamped number.
  3577. */
  3578. function baseClamp(number, lower, upper) {
  3579. if (number === number) {
  3580. if (upper !== undefined) {
  3581. number = number <= upper ? number : upper;
  3582. }
  3583. if (lower !== undefined) {
  3584. number = number >= lower ? number : lower;
  3585. }
  3586. }
  3587. return number;
  3588. }
  3589. /**
  3590. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3591. * traversed objects.
  3592. *
  3593. * @private
  3594. * @param {*} value The value to clone.
  3595. * @param {boolean} bitmask The bitmask flags.
  3596. * 1 - Deep clone
  3597. * 2 - Flatten inherited properties
  3598. * 4 - Clone symbols
  3599. * @param {Function} [customizer] The function to customize cloning.
  3600. * @param {string} [key] The key of `value`.
  3601. * @param {Object} [object] The parent object of `value`.
  3602. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3603. * @returns {*} Returns the cloned value.
  3604. */
  3605. function baseClone(value, bitmask, customizer, key, object, stack) {
  3606. var result,
  3607. isDeep = bitmask & CLONE_DEEP_FLAG,
  3608. isFlat = bitmask & CLONE_FLAT_FLAG,
  3609. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3610. if (customizer) {
  3611. result = object ? customizer(value, key, object, stack) : customizer(value);
  3612. }
  3613. if (result !== undefined) {
  3614. return result;
  3615. }
  3616. if (!isObject(value)) {
  3617. return value;
  3618. }
  3619. var isArr = isArray(value);
  3620. if (isArr) {
  3621. result = initCloneArray(value);
  3622. if (!isDeep) {
  3623. return copyArray(value, result);
  3624. }
  3625. } else {
  3626. var tag = getTag(value),
  3627. isFunc = tag == funcTag || tag == genTag;
  3628. if (isBuffer(value)) {
  3629. return cloneBuffer(value, isDeep);
  3630. }
  3631. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3632. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3633. if (!isDeep) {
  3634. return isFlat
  3635. ? copySymbolsIn(value, baseAssignIn(result, value))
  3636. : copySymbols(value, baseAssign(result, value));
  3637. }
  3638. } else {
  3639. if (!cloneableTags[tag]) {
  3640. return object ? value : {};
  3641. }
  3642. result = initCloneByTag(value, tag, isDeep);
  3643. }
  3644. }
  3645. // Check for circular references and return its corresponding clone.
  3646. stack || (stack = new Stack);
  3647. var stacked = stack.get(value);
  3648. if (stacked) {
  3649. return stacked;
  3650. }
  3651. stack.set(value, result);
  3652. if (isSet(value)) {
  3653. value.forEach(function(subValue) {
  3654. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3655. });
  3656. } else if (isMap(value)) {
  3657. value.forEach(function(subValue, key) {
  3658. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3659. });
  3660. }
  3661. var keysFunc = isFull
  3662. ? (isFlat ? getAllKeysIn : getAllKeys)
  3663. : (isFlat ? keysIn : keys);
  3664. var props = isArr ? undefined : keysFunc(value);
  3665. arrayEach(props || value, function(subValue, key) {
  3666. if (props) {
  3667. key = subValue;
  3668. subValue = value[key];
  3669. }
  3670. // Recursively populate clone (susceptible to call stack limits).
  3671. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3672. });
  3673. return result;
  3674. }
  3675. /**
  3676. * The base implementation of `_.conforms` which doesn't clone `source`.
  3677. *
  3678. * @private
  3679. * @param {Object} source The object of property predicates to conform to.
  3680. * @returns {Function} Returns the new spec function.
  3681. */
  3682. function baseConforms(source) {
  3683. var props = keys(source);
  3684. return function(object) {
  3685. return baseConformsTo(object, source, props);
  3686. };
  3687. }
  3688. /**
  3689. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3690. *
  3691. * @private
  3692. * @param {Object} object The object to inspect.
  3693. * @param {Object} source The object of property predicates to conform to.
  3694. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3695. */
  3696. function baseConformsTo(object, source, props) {
  3697. var length = props.length;
  3698. if (object == null) {
  3699. return !length;
  3700. }
  3701. object = Object(object);
  3702. while (length--) {
  3703. var key = props[length],
  3704. predicate = source[key],
  3705. value = object[key];
  3706. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3707. return false;
  3708. }
  3709. }
  3710. return true;
  3711. }
  3712. /**
  3713. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3714. * to provide to `func`.
  3715. *
  3716. * @private
  3717. * @param {Function} func The function to delay.
  3718. * @param {number} wait The number of milliseconds to delay invocation.
  3719. * @param {Array} args The arguments to provide to `func`.
  3720. * @returns {number|Object} Returns the timer id or timeout object.
  3721. */
  3722. function baseDelay(func, wait, args) {
  3723. if (typeof func != 'function') {
  3724. throw new TypeError(FUNC_ERROR_TEXT);
  3725. }
  3726. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3727. }
  3728. /**
  3729. * The base implementation of methods like `_.difference` without support
  3730. * for excluding multiple arrays or iteratee shorthands.
  3731. *
  3732. * @private
  3733. * @param {Array} array The array to inspect.
  3734. * @param {Array} values The values to exclude.
  3735. * @param {Function} [iteratee] The iteratee invoked per element.
  3736. * @param {Function} [comparator] The comparator invoked per element.
  3737. * @returns {Array} Returns the new array of filtered values.
  3738. */
  3739. function baseDifference(array, values, iteratee, comparator) {
  3740. var index = -1,
  3741. includes = arrayIncludes,
  3742. isCommon = true,
  3743. length = array.length,
  3744. result = [],
  3745. valuesLength = values.length;
  3746. if (!length) {
  3747. return result;
  3748. }
  3749. if (iteratee) {
  3750. values = arrayMap(values, baseUnary(iteratee));
  3751. }
  3752. if (comparator) {
  3753. includes = arrayIncludesWith;
  3754. isCommon = false;
  3755. }
  3756. else if (values.length >= LARGE_ARRAY_SIZE) {
  3757. includes = cacheHas;
  3758. isCommon = false;
  3759. values = new SetCache(values);
  3760. }
  3761. outer:
  3762. while (++index < length) {
  3763. var value = array[index],
  3764. computed = iteratee == null ? value : iteratee(value);
  3765. value = (comparator || value !== 0) ? value : 0;
  3766. if (isCommon && computed === computed) {
  3767. var valuesIndex = valuesLength;
  3768. while (valuesIndex--) {
  3769. if (values[valuesIndex] === computed) {
  3770. continue outer;
  3771. }
  3772. }
  3773. result.push(value);
  3774. }
  3775. else if (!includes(values, computed, comparator)) {
  3776. result.push(value);
  3777. }
  3778. }
  3779. return result;
  3780. }
  3781. /**
  3782. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3783. *
  3784. * @private
  3785. * @param {Array|Object} collection The collection to iterate over.
  3786. * @param {Function} iteratee The function invoked per iteration.
  3787. * @returns {Array|Object} Returns `collection`.
  3788. */
  3789. var baseEach = createBaseEach(baseForOwn);
  3790. /**
  3791. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3792. *
  3793. * @private
  3794. * @param {Array|Object} collection The collection to iterate over.
  3795. * @param {Function} iteratee The function invoked per iteration.
  3796. * @returns {Array|Object} Returns `collection`.
  3797. */
  3798. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3799. /**
  3800. * The base implementation of `_.every` without support for iteratee shorthands.
  3801. *
  3802. * @private
  3803. * @param {Array|Object} collection The collection to iterate over.
  3804. * @param {Function} predicate The function invoked per iteration.
  3805. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3806. * else `false`
  3807. */
  3808. function baseEvery(collection, predicate) {
  3809. var result = true;
  3810. baseEach(collection, function(value, index, collection) {
  3811. result = !!predicate(value, index, collection);
  3812. return result;
  3813. });
  3814. return result;
  3815. }
  3816. /**
  3817. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3818. * `comparator` to determine the extremum value.
  3819. *
  3820. * @private
  3821. * @param {Array} array The array to iterate over.
  3822. * @param {Function} iteratee The iteratee invoked per iteration.
  3823. * @param {Function} comparator The comparator used to compare values.
  3824. * @returns {*} Returns the extremum value.
  3825. */
  3826. function baseExtremum(array, iteratee, comparator) {
  3827. var index = -1,
  3828. length = array.length;
  3829. while (++index < length) {
  3830. var value = array[index],
  3831. current = iteratee(value);
  3832. if (current != null && (computed === undefined
  3833. ? (current === current && !isSymbol(current))
  3834. : comparator(current, computed)
  3835. )) {
  3836. var computed = current,
  3837. result = value;
  3838. }
  3839. }
  3840. return result;
  3841. }
  3842. /**
  3843. * The base implementation of `_.fill` without an iteratee call guard.
  3844. *
  3845. * @private
  3846. * @param {Array} array The array to fill.
  3847. * @param {*} value The value to fill `array` with.
  3848. * @param {number} [start=0] The start position.
  3849. * @param {number} [end=array.length] The end position.
  3850. * @returns {Array} Returns `array`.
  3851. */
  3852. function baseFill(array, value, start, end) {
  3853. var length = array.length;
  3854. start = toInteger(start);
  3855. if (start < 0) {
  3856. start = -start > length ? 0 : (length + start);
  3857. }
  3858. end = (end === undefined || end > length) ? length : toInteger(end);
  3859. if (end < 0) {
  3860. end += length;
  3861. }
  3862. end = start > end ? 0 : toLength(end);
  3863. while (start < end) {
  3864. array[start++] = value;
  3865. }
  3866. return array;
  3867. }
  3868. /**
  3869. * The base implementation of `_.filter` without support for iteratee shorthands.
  3870. *
  3871. * @private
  3872. * @param {Array|Object} collection The collection to iterate over.
  3873. * @param {Function} predicate The function invoked per iteration.
  3874. * @returns {Array} Returns the new filtered array.
  3875. */
  3876. function baseFilter(collection, predicate) {
  3877. var result = [];
  3878. baseEach(collection, function(value, index, collection) {
  3879. if (predicate(value, index, collection)) {
  3880. result.push(value);
  3881. }
  3882. });
  3883. return result;
  3884. }
  3885. /**
  3886. * The base implementation of `_.flatten` with support for restricting flattening.
  3887. *
  3888. * @private
  3889. * @param {Array} array The array to flatten.
  3890. * @param {number} depth The maximum recursion depth.
  3891. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3892. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3893. * @param {Array} [result=[]] The initial result value.
  3894. * @returns {Array} Returns the new flattened array.
  3895. */
  3896. function baseFlatten(array, depth, predicate, isStrict, result) {
  3897. var index = -1,
  3898. length = array.length;
  3899. predicate || (predicate = isFlattenable);
  3900. result || (result = []);
  3901. while (++index < length) {
  3902. var value = array[index];
  3903. if (depth > 0 && predicate(value)) {
  3904. if (depth > 1) {
  3905. // Recursively flatten arrays (susceptible to call stack limits).
  3906. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3907. } else {
  3908. arrayPush(result, value);
  3909. }
  3910. } else if (!isStrict) {
  3911. result[result.length] = value;
  3912. }
  3913. }
  3914. return result;
  3915. }
  3916. /**
  3917. * The base implementation of `baseForOwn` which iterates over `object`
  3918. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3919. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3920. *
  3921. * @private
  3922. * @param {Object} object The object to iterate over.
  3923. * @param {Function} iteratee The function invoked per iteration.
  3924. * @param {Function} keysFunc The function to get the keys of `object`.
  3925. * @returns {Object} Returns `object`.
  3926. */
  3927. var baseFor = createBaseFor();
  3928. /**
  3929. * This function is like `baseFor` except that it iterates over properties
  3930. * in the opposite order.
  3931. *
  3932. * @private
  3933. * @param {Object} object The object to iterate over.
  3934. * @param {Function} iteratee The function invoked per iteration.
  3935. * @param {Function} keysFunc The function to get the keys of `object`.
  3936. * @returns {Object} Returns `object`.
  3937. */
  3938. var baseForRight = createBaseFor(true);
  3939. /**
  3940. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3941. *
  3942. * @private
  3943. * @param {Object} object The object to iterate over.
  3944. * @param {Function} iteratee The function invoked per iteration.
  3945. * @returns {Object} Returns `object`.
  3946. */
  3947. function baseForOwn(object, iteratee) {
  3948. return object && baseFor(object, iteratee, keys);
  3949. }
  3950. /**
  3951. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3952. *
  3953. * @private
  3954. * @param {Object} object The object to iterate over.
  3955. * @param {Function} iteratee The function invoked per iteration.
  3956. * @returns {Object} Returns `object`.
  3957. */
  3958. function baseForOwnRight(object, iteratee) {
  3959. return object && baseForRight(object, iteratee, keys);
  3960. }
  3961. /**
  3962. * The base implementation of `_.functions` which creates an array of
  3963. * `object` function property names filtered from `props`.
  3964. *
  3965. * @private
  3966. * @param {Object} object The object to inspect.
  3967. * @param {Array} props The property names to filter.
  3968. * @returns {Array} Returns the function names.
  3969. */
  3970. function baseFunctions(object, props) {
  3971. return arrayFilter(props, function(key) {
  3972. return isFunction(object[key]);
  3973. });
  3974. }
  3975. /**
  3976. * The base implementation of `_.get` without support for default values.
  3977. *
  3978. * @private
  3979. * @param {Object} object The object to query.
  3980. * @param {Array|string} path The path of the property to get.
  3981. * @returns {*} Returns the resolved value.
  3982. */
  3983. function baseGet(object, path) {
  3984. path = castPath(path, object);
  3985. var index = 0,
  3986. length = path.length;
  3987. while (object != null && index < length) {
  3988. object = object[toKey(path[index++])];
  3989. }
  3990. return (index && index == length) ? object : undefined;
  3991. }
  3992. /**
  3993. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3994. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3995. * symbols of `object`.
  3996. *
  3997. * @private
  3998. * @param {Object} object The object to query.
  3999. * @param {Function} keysFunc The function to get the keys of `object`.
  4000. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4001. * @returns {Array} Returns the array of property names and symbols.
  4002. */
  4003. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4004. var result = keysFunc(object);
  4005. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4006. }
  4007. /**
  4008. * The base implementation of `getTag` without fallbacks for buggy environments.
  4009. *
  4010. * @private
  4011. * @param {*} value The value to query.
  4012. * @returns {string} Returns the `toStringTag`.
  4013. */
  4014. function baseGetTag(value) {
  4015. if (value == null) {
  4016. return value === undefined ? undefinedTag : nullTag;
  4017. }
  4018. return (symToStringTag && symToStringTag in Object(value))
  4019. ? getRawTag(value)
  4020. : objectToString(value);
  4021. }
  4022. /**
  4023. * The base implementation of `_.gt` which doesn't coerce arguments.
  4024. *
  4025. * @private
  4026. * @param {*} value The value to compare.
  4027. * @param {*} other The other value to compare.
  4028. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4029. * else `false`.
  4030. */
  4031. function baseGt(value, other) {
  4032. return value > other;
  4033. }
  4034. /**
  4035. * The base implementation of `_.has` without support for deep paths.
  4036. *
  4037. * @private
  4038. * @param {Object} [object] The object to query.
  4039. * @param {Array|string} key The key to check.
  4040. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4041. */
  4042. function baseHas(object, key) {
  4043. return object != null && hasOwnProperty.call(object, key);
  4044. }
  4045. /**
  4046. * The base implementation of `_.hasIn` without support for deep paths.
  4047. *
  4048. * @private
  4049. * @param {Object} [object] The object to query.
  4050. * @param {Array|string} key The key to check.
  4051. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4052. */
  4053. function baseHasIn(object, key) {
  4054. return object != null && key in Object(object);
  4055. }
  4056. /**
  4057. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4058. *
  4059. * @private
  4060. * @param {number} number The number to check.
  4061. * @param {number} start The start of the range.
  4062. * @param {number} end The end of the range.
  4063. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4064. */
  4065. function baseInRange(number, start, end) {
  4066. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4067. }
  4068. /**
  4069. * The base implementation of methods like `_.intersection`, without support
  4070. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4071. *
  4072. * @private
  4073. * @param {Array} arrays The arrays to inspect.
  4074. * @param {Function} [iteratee] The iteratee invoked per element.
  4075. * @param {Function} [comparator] The comparator invoked per element.
  4076. * @returns {Array} Returns the new array of shared values.
  4077. */
  4078. function baseIntersection(arrays, iteratee, comparator) {
  4079. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4080. length = arrays[0].length,
  4081. othLength = arrays.length,
  4082. othIndex = othLength,
  4083. caches = Array(othLength),
  4084. maxLength = Infinity,
  4085. result = [];
  4086. while (othIndex--) {
  4087. var array = arrays[othIndex];
  4088. if (othIndex && iteratee) {
  4089. array = arrayMap(array, baseUnary(iteratee));
  4090. }
  4091. maxLength = nativeMin(array.length, maxLength);
  4092. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4093. ? new SetCache(othIndex && array)
  4094. : undefined;
  4095. }
  4096. array = arrays[0];
  4097. var index = -1,
  4098. seen = caches[0];
  4099. outer:
  4100. while (++index < length && result.length < maxLength) {
  4101. var value = array[index],
  4102. computed = iteratee ? iteratee(value) : value;
  4103. value = (comparator || value !== 0) ? value : 0;
  4104. if (!(seen
  4105. ? cacheHas(seen, computed)
  4106. : includes(result, computed, comparator)
  4107. )) {
  4108. othIndex = othLength;
  4109. while (--othIndex) {
  4110. var cache = caches[othIndex];
  4111. if (!(cache
  4112. ? cacheHas(cache, computed)
  4113. : includes(arrays[othIndex], computed, comparator))
  4114. ) {
  4115. continue outer;
  4116. }
  4117. }
  4118. if (seen) {
  4119. seen.push(computed);
  4120. }
  4121. result.push(value);
  4122. }
  4123. }
  4124. return result;
  4125. }
  4126. /**
  4127. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4128. * `object` with values transformed by `iteratee` and set by `setter`.
  4129. *
  4130. * @private
  4131. * @param {Object} object The object to iterate over.
  4132. * @param {Function} setter The function to set `accumulator` values.
  4133. * @param {Function} iteratee The iteratee to transform values.
  4134. * @param {Object} accumulator The initial inverted object.
  4135. * @returns {Function} Returns `accumulator`.
  4136. */
  4137. function baseInverter(object, setter, iteratee, accumulator) {
  4138. baseForOwn(object, function(value, key, object) {
  4139. setter(accumulator, iteratee(value), key, object);
  4140. });
  4141. return accumulator;
  4142. }
  4143. /**
  4144. * The base implementation of `_.invoke` without support for individual
  4145. * method arguments.
  4146. *
  4147. * @private
  4148. * @param {Object} object The object to query.
  4149. * @param {Array|string} path The path of the method to invoke.
  4150. * @param {Array} args The arguments to invoke the method with.
  4151. * @returns {*} Returns the result of the invoked method.
  4152. */
  4153. function baseInvoke(object, path, args) {
  4154. path = castPath(path, object);
  4155. object = parent(object, path);
  4156. var func = object == null ? object : object[toKey(last(path))];
  4157. return func == null ? undefined : apply(func, object, args);
  4158. }
  4159. /**
  4160. * The base implementation of `_.isArguments`.
  4161. *
  4162. * @private
  4163. * @param {*} value The value to check.
  4164. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4165. */
  4166. function baseIsArguments(value) {
  4167. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4168. }
  4169. /**
  4170. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4171. *
  4172. * @private
  4173. * @param {*} value The value to check.
  4174. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4175. */
  4176. function baseIsArrayBuffer(value) {
  4177. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4178. }
  4179. /**
  4180. * The base implementation of `_.isDate` without Node.js optimizations.
  4181. *
  4182. * @private
  4183. * @param {*} value The value to check.
  4184. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4185. */
  4186. function baseIsDate(value) {
  4187. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4188. }
  4189. /**
  4190. * The base implementation of `_.isEqual` which supports partial comparisons
  4191. * and tracks traversed objects.
  4192. *
  4193. * @private
  4194. * @param {*} value The value to compare.
  4195. * @param {*} other The other value to compare.
  4196. * @param {boolean} bitmask The bitmask flags.
  4197. * 1 - Unordered comparison
  4198. * 2 - Partial comparison
  4199. * @param {Function} [customizer] The function to customize comparisons.
  4200. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4201. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4202. */
  4203. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4204. if (value === other) {
  4205. return true;
  4206. }
  4207. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4208. return value !== value && other !== other;
  4209. }
  4210. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4211. }
  4212. /**
  4213. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4214. * deep comparisons and tracks traversed objects enabling objects with circular
  4215. * references to be compared.
  4216. *
  4217. * @private
  4218. * @param {Object} object The object to compare.
  4219. * @param {Object} other The other object to compare.
  4220. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4221. * @param {Function} customizer The function to customize comparisons.
  4222. * @param {Function} equalFunc The function to determine equivalents of values.
  4223. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4224. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4225. */
  4226. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4227. var objIsArr = isArray(object),
  4228. othIsArr = isArray(other),
  4229. objTag = objIsArr ? arrayTag : getTag(object),
  4230. othTag = othIsArr ? arrayTag : getTag(other);
  4231. objTag = objTag == argsTag ? objectTag : objTag;
  4232. othTag = othTag == argsTag ? objectTag : othTag;
  4233. var objIsObj = objTag == objectTag,
  4234. othIsObj = othTag == objectTag,
  4235. isSameTag = objTag == othTag;
  4236. if (isSameTag && isBuffer(object)) {
  4237. if (!isBuffer(other)) {
  4238. return false;
  4239. }
  4240. objIsArr = true;
  4241. objIsObj = false;
  4242. }
  4243. if (isSameTag && !objIsObj) {
  4244. stack || (stack = new Stack);
  4245. return (objIsArr || isTypedArray(object))
  4246. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4247. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4248. }
  4249. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4250. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4251. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4252. if (objIsWrapped || othIsWrapped) {
  4253. var objUnwrapped = objIsWrapped ? object.value() : object,
  4254. othUnwrapped = othIsWrapped ? other.value() : other;
  4255. stack || (stack = new Stack);
  4256. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4257. }
  4258. }
  4259. if (!isSameTag) {
  4260. return false;
  4261. }
  4262. stack || (stack = new Stack);
  4263. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4264. }
  4265. /**
  4266. * The base implementation of `_.isMap` without Node.js optimizations.
  4267. *
  4268. * @private
  4269. * @param {*} value The value to check.
  4270. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4271. */
  4272. function baseIsMap(value) {
  4273. return isObjectLike(value) && getTag(value) == mapTag;
  4274. }
  4275. /**
  4276. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4277. *
  4278. * @private
  4279. * @param {Object} object The object to inspect.
  4280. * @param {Object} source The object of property values to match.
  4281. * @param {Array} matchData The property names, values, and compare flags to match.
  4282. * @param {Function} [customizer] The function to customize comparisons.
  4283. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4284. */
  4285. function baseIsMatch(object, source, matchData, customizer) {
  4286. var index = matchData.length,
  4287. length = index,
  4288. noCustomizer = !customizer;
  4289. if (object == null) {
  4290. return !length;
  4291. }
  4292. object = Object(object);
  4293. while (index--) {
  4294. var data = matchData[index];
  4295. if ((noCustomizer && data[2])
  4296. ? data[1] !== object[data[0]]
  4297. : !(data[0] in object)
  4298. ) {
  4299. return false;
  4300. }
  4301. }
  4302. while (++index < length) {
  4303. data = matchData[index];
  4304. var key = data[0],
  4305. objValue = object[key],
  4306. srcValue = data[1];
  4307. if (noCustomizer && data[2]) {
  4308. if (objValue === undefined && !(key in object)) {
  4309. return false;
  4310. }
  4311. } else {
  4312. var stack = new Stack;
  4313. if (customizer) {
  4314. var result = customizer(objValue, srcValue, key, object, source, stack);
  4315. }
  4316. if (!(result === undefined
  4317. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4318. : result
  4319. )) {
  4320. return false;
  4321. }
  4322. }
  4323. }
  4324. return true;
  4325. }
  4326. /**
  4327. * The base implementation of `_.isNative` without bad shim checks.
  4328. *
  4329. * @private
  4330. * @param {*} value The value to check.
  4331. * @returns {boolean} Returns `true` if `value` is a native function,
  4332. * else `false`.
  4333. */
  4334. function baseIsNative(value) {
  4335. if (!isObject(value) || isMasked(value)) {
  4336. return false;
  4337. }
  4338. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4339. return pattern.test(toSource(value));
  4340. }
  4341. /**
  4342. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4343. *
  4344. * @private
  4345. * @param {*} value The value to check.
  4346. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4347. */
  4348. function baseIsRegExp(value) {
  4349. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4350. }
  4351. /**
  4352. * The base implementation of `_.isSet` without Node.js optimizations.
  4353. *
  4354. * @private
  4355. * @param {*} value The value to check.
  4356. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4357. */
  4358. function baseIsSet(value) {
  4359. return isObjectLike(value) && getTag(value) == setTag;
  4360. }
  4361. /**
  4362. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4363. *
  4364. * @private
  4365. * @param {*} value The value to check.
  4366. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4367. */
  4368. function baseIsTypedArray(value) {
  4369. return isObjectLike(value) &&
  4370. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4371. }
  4372. /**
  4373. * The base implementation of `_.iteratee`.
  4374. *
  4375. * @private
  4376. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4377. * @returns {Function} Returns the iteratee.
  4378. */
  4379. function baseIteratee(value) {
  4380. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4381. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4382. if (typeof value == 'function') {
  4383. return value;
  4384. }
  4385. if (value == null) {
  4386. return identity;
  4387. }
  4388. if (typeof value == 'object') {
  4389. return isArray(value)
  4390. ? baseMatchesProperty(value[0], value[1])
  4391. : baseMatches(value);
  4392. }
  4393. return property(value);
  4394. }
  4395. /**
  4396. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4397. *
  4398. * @private
  4399. * @param {Object} object The object to query.
  4400. * @returns {Array} Returns the array of property names.
  4401. */
  4402. function baseKeys(object) {
  4403. if (!isPrototype(object)) {
  4404. return nativeKeys(object);
  4405. }
  4406. var result = [];
  4407. for (var key in Object(object)) {
  4408. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4409. result.push(key);
  4410. }
  4411. }
  4412. return result;
  4413. }
  4414. /**
  4415. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4416. *
  4417. * @private
  4418. * @param {Object} object The object to query.
  4419. * @returns {Array} Returns the array of property names.
  4420. */
  4421. function baseKeysIn(object) {
  4422. if (!isObject(object)) {
  4423. return nativeKeysIn(object);
  4424. }
  4425. var isProto = isPrototype(object),
  4426. result = [];
  4427. for (var key in object) {
  4428. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4429. result.push(key);
  4430. }
  4431. }
  4432. return result;
  4433. }
  4434. /**
  4435. * The base implementation of `_.lt` which doesn't coerce arguments.
  4436. *
  4437. * @private
  4438. * @param {*} value The value to compare.
  4439. * @param {*} other The other value to compare.
  4440. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4441. * else `false`.
  4442. */
  4443. function baseLt(value, other) {
  4444. return value < other;
  4445. }
  4446. /**
  4447. * The base implementation of `_.map` without support for iteratee shorthands.
  4448. *
  4449. * @private
  4450. * @param {Array|Object} collection The collection to iterate over.
  4451. * @param {Function} iteratee The function invoked per iteration.
  4452. * @returns {Array} Returns the new mapped array.
  4453. */
  4454. function baseMap(collection, iteratee) {
  4455. var index = -1,
  4456. result = isArrayLike(collection) ? Array(collection.length) : [];
  4457. baseEach(collection, function(value, key, collection) {
  4458. result[++index] = iteratee(value, key, collection);
  4459. });
  4460. return result;
  4461. }
  4462. /**
  4463. * The base implementation of `_.matches` which doesn't clone `source`.
  4464. *
  4465. * @private
  4466. * @param {Object} source The object of property values to match.
  4467. * @returns {Function} Returns the new spec function.
  4468. */
  4469. function baseMatches(source) {
  4470. var matchData = getMatchData(source);
  4471. if (matchData.length == 1 && matchData[0][2]) {
  4472. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4473. }
  4474. return function(object) {
  4475. return object === source || baseIsMatch(object, source, matchData);
  4476. };
  4477. }
  4478. /**
  4479. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4480. *
  4481. * @private
  4482. * @param {string} path The path of the property to get.
  4483. * @param {*} srcValue The value to match.
  4484. * @returns {Function} Returns the new spec function.
  4485. */
  4486. function baseMatchesProperty(path, srcValue) {
  4487. if (isKey(path) && isStrictComparable(srcValue)) {
  4488. return matchesStrictComparable(toKey(path), srcValue);
  4489. }
  4490. return function(object) {
  4491. var objValue = get(object, path);
  4492. return (objValue === undefined && objValue === srcValue)
  4493. ? hasIn(object, path)
  4494. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4495. };
  4496. }
  4497. /**
  4498. * The base implementation of `_.merge` without support for multiple sources.
  4499. *
  4500. * @private
  4501. * @param {Object} object The destination object.
  4502. * @param {Object} source The source object.
  4503. * @param {number} srcIndex The index of `source`.
  4504. * @param {Function} [customizer] The function to customize merged values.
  4505. * @param {Object} [stack] Tracks traversed source values and their merged
  4506. * counterparts.
  4507. */
  4508. function baseMerge(object, source, srcIndex, customizer, stack) {
  4509. if (object === source) {
  4510. return;
  4511. }
  4512. baseFor(source, function(srcValue, key) {
  4513. stack || (stack = new Stack);
  4514. if (isObject(srcValue)) {
  4515. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4516. }
  4517. else {
  4518. var newValue = customizer
  4519. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4520. : undefined;
  4521. if (newValue === undefined) {
  4522. newValue = srcValue;
  4523. }
  4524. assignMergeValue(object, key, newValue);
  4525. }
  4526. }, keysIn);
  4527. }
  4528. /**
  4529. * A specialized version of `baseMerge` for arrays and objects which performs
  4530. * deep merges and tracks traversed objects enabling objects with circular
  4531. * references to be merged.
  4532. *
  4533. * @private
  4534. * @param {Object} object The destination object.
  4535. * @param {Object} source The source object.
  4536. * @param {string} key The key of the value to merge.
  4537. * @param {number} srcIndex The index of `source`.
  4538. * @param {Function} mergeFunc The function to merge values.
  4539. * @param {Function} [customizer] The function to customize assigned values.
  4540. * @param {Object} [stack] Tracks traversed source values and their merged
  4541. * counterparts.
  4542. */
  4543. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4544. var objValue = safeGet(object, key),
  4545. srcValue = safeGet(source, key),
  4546. stacked = stack.get(srcValue);
  4547. if (stacked) {
  4548. assignMergeValue(object, key, stacked);
  4549. return;
  4550. }
  4551. var newValue = customizer
  4552. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4553. : undefined;
  4554. var isCommon = newValue === undefined;
  4555. if (isCommon) {
  4556. var isArr = isArray(srcValue),
  4557. isBuff = !isArr && isBuffer(srcValue),
  4558. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4559. newValue = srcValue;
  4560. if (isArr || isBuff || isTyped) {
  4561. if (isArray(objValue)) {
  4562. newValue = objValue;
  4563. }
  4564. else if (isArrayLikeObject(objValue)) {
  4565. newValue = copyArray(objValue);
  4566. }
  4567. else if (isBuff) {
  4568. isCommon = false;
  4569. newValue = cloneBuffer(srcValue, true);
  4570. }
  4571. else if (isTyped) {
  4572. isCommon = false;
  4573. newValue = cloneTypedArray(srcValue, true);
  4574. }
  4575. else {
  4576. newValue = [];
  4577. }
  4578. }
  4579. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4580. newValue = objValue;
  4581. if (isArguments(objValue)) {
  4582. newValue = toPlainObject(objValue);
  4583. }
  4584. else if (!isObject(objValue) || isFunction(objValue)) {
  4585. newValue = initCloneObject(srcValue);
  4586. }
  4587. }
  4588. else {
  4589. isCommon = false;
  4590. }
  4591. }
  4592. if (isCommon) {
  4593. // Recursively merge objects and arrays (susceptible to call stack limits).
  4594. stack.set(srcValue, newValue);
  4595. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4596. stack['delete'](srcValue);
  4597. }
  4598. assignMergeValue(object, key, newValue);
  4599. }
  4600. /**
  4601. * The base implementation of `_.nth` which doesn't coerce arguments.
  4602. *
  4603. * @private
  4604. * @param {Array} array The array to query.
  4605. * @param {number} n The index of the element to return.
  4606. * @returns {*} Returns the nth element of `array`.
  4607. */
  4608. function baseNth(array, n) {
  4609. var length = array.length;
  4610. if (!length) {
  4611. return;
  4612. }
  4613. n += n < 0 ? length : 0;
  4614. return isIndex(n, length) ? array[n] : undefined;
  4615. }
  4616. /**
  4617. * The base implementation of `_.orderBy` without param guards.
  4618. *
  4619. * @private
  4620. * @param {Array|Object} collection The collection to iterate over.
  4621. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4622. * @param {string[]} orders The sort orders of `iteratees`.
  4623. * @returns {Array} Returns the new sorted array.
  4624. */
  4625. function baseOrderBy(collection, iteratees, orders) {
  4626. if (iteratees.length) {
  4627. iteratees = arrayMap(iteratees, function(iteratee) {
  4628. if (isArray(iteratee)) {
  4629. return function(value) {
  4630. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4631. }
  4632. }
  4633. return iteratee;
  4634. });
  4635. } else {
  4636. iteratees = [identity];
  4637. }
  4638. var index = -1;
  4639. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4640. var result = baseMap(collection, function(value, key, collection) {
  4641. var criteria = arrayMap(iteratees, function(iteratee) {
  4642. return iteratee(value);
  4643. });
  4644. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4645. });
  4646. return baseSortBy(result, function(object, other) {
  4647. return compareMultiple(object, other, orders);
  4648. });
  4649. }
  4650. /**
  4651. * The base implementation of `_.pick` without support for individual
  4652. * property identifiers.
  4653. *
  4654. * @private
  4655. * @param {Object} object The source object.
  4656. * @param {string[]} paths The property paths to pick.
  4657. * @returns {Object} Returns the new object.
  4658. */
  4659. function basePick(object, paths) {
  4660. return basePickBy(object, paths, function(value, path) {
  4661. return hasIn(object, path);
  4662. });
  4663. }
  4664. /**
  4665. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4666. *
  4667. * @private
  4668. * @param {Object} object The source object.
  4669. * @param {string[]} paths The property paths to pick.
  4670. * @param {Function} predicate The function invoked per property.
  4671. * @returns {Object} Returns the new object.
  4672. */
  4673. function basePickBy(object, paths, predicate) {
  4674. var index = -1,
  4675. length = paths.length,
  4676. result = {};
  4677. while (++index < length) {
  4678. var path = paths[index],
  4679. value = baseGet(object, path);
  4680. if (predicate(value, path)) {
  4681. baseSet(result, castPath(path, object), value);
  4682. }
  4683. }
  4684. return result;
  4685. }
  4686. /**
  4687. * A specialized version of `baseProperty` which supports deep paths.
  4688. *
  4689. * @private
  4690. * @param {Array|string} path The path of the property to get.
  4691. * @returns {Function} Returns the new accessor function.
  4692. */
  4693. function basePropertyDeep(path) {
  4694. return function(object) {
  4695. return baseGet(object, path);
  4696. };
  4697. }
  4698. /**
  4699. * The base implementation of `_.pullAllBy` without support for iteratee
  4700. * shorthands.
  4701. *
  4702. * @private
  4703. * @param {Array} array The array to modify.
  4704. * @param {Array} values The values to remove.
  4705. * @param {Function} [iteratee] The iteratee invoked per element.
  4706. * @param {Function} [comparator] The comparator invoked per element.
  4707. * @returns {Array} Returns `array`.
  4708. */
  4709. function basePullAll(array, values, iteratee, comparator) {
  4710. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4711. index = -1,
  4712. length = values.length,
  4713. seen = array;
  4714. if (array === values) {
  4715. values = copyArray(values);
  4716. }
  4717. if (iteratee) {
  4718. seen = arrayMap(array, baseUnary(iteratee));
  4719. }
  4720. while (++index < length) {
  4721. var fromIndex = 0,
  4722. value = values[index],
  4723. computed = iteratee ? iteratee(value) : value;
  4724. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4725. if (seen !== array) {
  4726. splice.call(seen, fromIndex, 1);
  4727. }
  4728. splice.call(array, fromIndex, 1);
  4729. }
  4730. }
  4731. return array;
  4732. }
  4733. /**
  4734. * The base implementation of `_.pullAt` without support for individual
  4735. * indexes or capturing the removed elements.
  4736. *
  4737. * @private
  4738. * @param {Array} array The array to modify.
  4739. * @param {number[]} indexes The indexes of elements to remove.
  4740. * @returns {Array} Returns `array`.
  4741. */
  4742. function basePullAt(array, indexes) {
  4743. var length = array ? indexes.length : 0,
  4744. lastIndex = length - 1;
  4745. while (length--) {
  4746. var index = indexes[length];
  4747. if (length == lastIndex || index !== previous) {
  4748. var previous = index;
  4749. if (isIndex(index)) {
  4750. splice.call(array, index, 1);
  4751. } else {
  4752. baseUnset(array, index);
  4753. }
  4754. }
  4755. }
  4756. return array;
  4757. }
  4758. /**
  4759. * The base implementation of `_.random` without support for returning
  4760. * floating-point numbers.
  4761. *
  4762. * @private
  4763. * @param {number} lower The lower bound.
  4764. * @param {number} upper The upper bound.
  4765. * @returns {number} Returns the random number.
  4766. */
  4767. function baseRandom(lower, upper) {
  4768. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4769. }
  4770. /**
  4771. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4772. * coerce arguments.
  4773. *
  4774. * @private
  4775. * @param {number} start The start of the range.
  4776. * @param {number} end The end of the range.
  4777. * @param {number} step The value to increment or decrement by.
  4778. * @param {boolean} [fromRight] Specify iterating from right to left.
  4779. * @returns {Array} Returns the range of numbers.
  4780. */
  4781. function baseRange(start, end, step, fromRight) {
  4782. var index = -1,
  4783. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4784. result = Array(length);
  4785. while (length--) {
  4786. result[fromRight ? length : ++index] = start;
  4787. start += step;
  4788. }
  4789. return result;
  4790. }
  4791. /**
  4792. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4793. *
  4794. * @private
  4795. * @param {string} string The string to repeat.
  4796. * @param {number} n The number of times to repeat the string.
  4797. * @returns {string} Returns the repeated string.
  4798. */
  4799. function baseRepeat(string, n) {
  4800. var result = '';
  4801. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4802. return result;
  4803. }
  4804. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4805. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4806. do {
  4807. if (n % 2) {
  4808. result += string;
  4809. }
  4810. n = nativeFloor(n / 2);
  4811. if (n) {
  4812. string += string;
  4813. }
  4814. } while (n);
  4815. return result;
  4816. }
  4817. /**
  4818. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4819. *
  4820. * @private
  4821. * @param {Function} func The function to apply a rest parameter to.
  4822. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4823. * @returns {Function} Returns the new function.
  4824. */
  4825. function baseRest(func, start) {
  4826. return setToString(overRest(func, start, identity), func + '');
  4827. }
  4828. /**
  4829. * The base implementation of `_.sample`.
  4830. *
  4831. * @private
  4832. * @param {Array|Object} collection The collection to sample.
  4833. * @returns {*} Returns the random element.
  4834. */
  4835. function baseSample(collection) {
  4836. return arraySample(values(collection));
  4837. }
  4838. /**
  4839. * The base implementation of `_.sampleSize` without param guards.
  4840. *
  4841. * @private
  4842. * @param {Array|Object} collection The collection to sample.
  4843. * @param {number} n The number of elements to sample.
  4844. * @returns {Array} Returns the random elements.
  4845. */
  4846. function baseSampleSize(collection, n) {
  4847. var array = values(collection);
  4848. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4849. }
  4850. /**
  4851. * The base implementation of `_.set`.
  4852. *
  4853. * @private
  4854. * @param {Object} object The object to modify.
  4855. * @param {Array|string} path The path of the property to set.
  4856. * @param {*} value The value to set.
  4857. * @param {Function} [customizer] The function to customize path creation.
  4858. * @returns {Object} Returns `object`.
  4859. */
  4860. function baseSet(object, path, value, customizer) {
  4861. if (!isObject(object)) {
  4862. return object;
  4863. }
  4864. path = castPath(path, object);
  4865. var index = -1,
  4866. length = path.length,
  4867. lastIndex = length - 1,
  4868. nested = object;
  4869. while (nested != null && ++index < length) {
  4870. var key = toKey(path[index]),
  4871. newValue = value;
  4872. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4873. return object;
  4874. }
  4875. if (index != lastIndex) {
  4876. var objValue = nested[key];
  4877. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4878. if (newValue === undefined) {
  4879. newValue = isObject(objValue)
  4880. ? objValue
  4881. : (isIndex(path[index + 1]) ? [] : {});
  4882. }
  4883. }
  4884. assignValue(nested, key, newValue);
  4885. nested = nested[key];
  4886. }
  4887. return object;
  4888. }
  4889. /**
  4890. * The base implementation of `setData` without support for hot loop shorting.
  4891. *
  4892. * @private
  4893. * @param {Function} func The function to associate metadata with.
  4894. * @param {*} data The metadata.
  4895. * @returns {Function} Returns `func`.
  4896. */
  4897. var baseSetData = !metaMap ? identity : function(func, data) {
  4898. metaMap.set(func, data);
  4899. return func;
  4900. };
  4901. /**
  4902. * The base implementation of `setToString` without support for hot loop shorting.
  4903. *
  4904. * @private
  4905. * @param {Function} func The function to modify.
  4906. * @param {Function} string The `toString` result.
  4907. * @returns {Function} Returns `func`.
  4908. */
  4909. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4910. return defineProperty(func, 'toString', {
  4911. 'configurable': true,
  4912. 'enumerable': false,
  4913. 'value': constant(string),
  4914. 'writable': true
  4915. });
  4916. };
  4917. /**
  4918. * The base implementation of `_.shuffle`.
  4919. *
  4920. * @private
  4921. * @param {Array|Object} collection The collection to shuffle.
  4922. * @returns {Array} Returns the new shuffled array.
  4923. */
  4924. function baseShuffle(collection) {
  4925. return shuffleSelf(values(collection));
  4926. }
  4927. /**
  4928. * The base implementation of `_.slice` without an iteratee call guard.
  4929. *
  4930. * @private
  4931. * @param {Array} array The array to slice.
  4932. * @param {number} [start=0] The start position.
  4933. * @param {number} [end=array.length] The end position.
  4934. * @returns {Array} Returns the slice of `array`.
  4935. */
  4936. function baseSlice(array, start, end) {
  4937. var index = -1,
  4938. length = array.length;
  4939. if (start < 0) {
  4940. start = -start > length ? 0 : (length + start);
  4941. }
  4942. end = end > length ? length : end;
  4943. if (end < 0) {
  4944. end += length;
  4945. }
  4946. length = start > end ? 0 : ((end - start) >>> 0);
  4947. start >>>= 0;
  4948. var result = Array(length);
  4949. while (++index < length) {
  4950. result[index] = array[index + start];
  4951. }
  4952. return result;
  4953. }
  4954. /**
  4955. * The base implementation of `_.some` without support for iteratee shorthands.
  4956. *
  4957. * @private
  4958. * @param {Array|Object} collection The collection to iterate over.
  4959. * @param {Function} predicate The function invoked per iteration.
  4960. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4961. * else `false`.
  4962. */
  4963. function baseSome(collection, predicate) {
  4964. var result;
  4965. baseEach(collection, function(value, index, collection) {
  4966. result = predicate(value, index, collection);
  4967. return !result;
  4968. });
  4969. return !!result;
  4970. }
  4971. /**
  4972. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4973. * performs a binary search of `array` to determine the index at which `value`
  4974. * should be inserted into `array` in order to maintain its sort order.
  4975. *
  4976. * @private
  4977. * @param {Array} array The sorted array to inspect.
  4978. * @param {*} value The value to evaluate.
  4979. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4980. * @returns {number} Returns the index at which `value` should be inserted
  4981. * into `array`.
  4982. */
  4983. function baseSortedIndex(array, value, retHighest) {
  4984. var low = 0,
  4985. high = array == null ? low : array.length;
  4986. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4987. while (low < high) {
  4988. var mid = (low + high) >>> 1,
  4989. computed = array[mid];
  4990. if (computed !== null && !isSymbol(computed) &&
  4991. (retHighest ? (computed <= value) : (computed < value))) {
  4992. low = mid + 1;
  4993. } else {
  4994. high = mid;
  4995. }
  4996. }
  4997. return high;
  4998. }
  4999. return baseSortedIndexBy(array, value, identity, retHighest);
  5000. }
  5001. /**
  5002. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5003. * which invokes `iteratee` for `value` and each element of `array` to compute
  5004. * their sort ranking. The iteratee is invoked with one argument; (value).
  5005. *
  5006. * @private
  5007. * @param {Array} array The sorted array to inspect.
  5008. * @param {*} value The value to evaluate.
  5009. * @param {Function} iteratee The iteratee invoked per element.
  5010. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5011. * @returns {number} Returns the index at which `value` should be inserted
  5012. * into `array`.
  5013. */
  5014. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5015. var low = 0,
  5016. high = array == null ? 0 : array.length;
  5017. if (high === 0) {
  5018. return 0;
  5019. }
  5020. value = iteratee(value);
  5021. var valIsNaN = value !== value,
  5022. valIsNull = value === null,
  5023. valIsSymbol = isSymbol(value),
  5024. valIsUndefined = value === undefined;
  5025. while (low < high) {
  5026. var mid = nativeFloor((low + high) / 2),
  5027. computed = iteratee(array[mid]),
  5028. othIsDefined = computed !== undefined,
  5029. othIsNull = computed === null,
  5030. othIsReflexive = computed === computed,
  5031. othIsSymbol = isSymbol(computed);
  5032. if (valIsNaN) {
  5033. var setLow = retHighest || othIsReflexive;
  5034. } else if (valIsUndefined) {
  5035. setLow = othIsReflexive && (retHighest || othIsDefined);
  5036. } else if (valIsNull) {
  5037. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5038. } else if (valIsSymbol) {
  5039. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5040. } else if (othIsNull || othIsSymbol) {
  5041. setLow = false;
  5042. } else {
  5043. setLow = retHighest ? (computed <= value) : (computed < value);
  5044. }
  5045. if (setLow) {
  5046. low = mid + 1;
  5047. } else {
  5048. high = mid;
  5049. }
  5050. }
  5051. return nativeMin(high, MAX_ARRAY_INDEX);
  5052. }
  5053. /**
  5054. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5055. * support for iteratee shorthands.
  5056. *
  5057. * @private
  5058. * @param {Array} array The array to inspect.
  5059. * @param {Function} [iteratee] The iteratee invoked per element.
  5060. * @returns {Array} Returns the new duplicate free array.
  5061. */
  5062. function baseSortedUniq(array, iteratee) {
  5063. var index = -1,
  5064. length = array.length,
  5065. resIndex = 0,
  5066. result = [];
  5067. while (++index < length) {
  5068. var value = array[index],
  5069. computed = iteratee ? iteratee(value) : value;
  5070. if (!index || !eq(computed, seen)) {
  5071. var seen = computed;
  5072. result[resIndex++] = value === 0 ? 0 : value;
  5073. }
  5074. }
  5075. return result;
  5076. }
  5077. /**
  5078. * The base implementation of `_.toNumber` which doesn't ensure correct
  5079. * conversions of binary, hexadecimal, or octal string values.
  5080. *
  5081. * @private
  5082. * @param {*} value The value to process.
  5083. * @returns {number} Returns the number.
  5084. */
  5085. function baseToNumber(value) {
  5086. if (typeof value == 'number') {
  5087. return value;
  5088. }
  5089. if (isSymbol(value)) {
  5090. return NAN;
  5091. }
  5092. return +value;
  5093. }
  5094. /**
  5095. * The base implementation of `_.toString` which doesn't convert nullish
  5096. * values to empty strings.
  5097. *
  5098. * @private
  5099. * @param {*} value The value to process.
  5100. * @returns {string} Returns the string.
  5101. */
  5102. function baseToString(value) {
  5103. // Exit early for strings to avoid a performance hit in some environments.
  5104. if (typeof value == 'string') {
  5105. return value;
  5106. }
  5107. if (isArray(value)) {
  5108. // Recursively convert values (susceptible to call stack limits).
  5109. return arrayMap(value, baseToString) + '';
  5110. }
  5111. if (isSymbol(value)) {
  5112. return symbolToString ? symbolToString.call(value) : '';
  5113. }
  5114. var result = (value + '');
  5115. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5116. }
  5117. /**
  5118. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5119. *
  5120. * @private
  5121. * @param {Array} array The array to inspect.
  5122. * @param {Function} [iteratee] The iteratee invoked per element.
  5123. * @param {Function} [comparator] The comparator invoked per element.
  5124. * @returns {Array} Returns the new duplicate free array.
  5125. */
  5126. function baseUniq(array, iteratee, comparator) {
  5127. var index = -1,
  5128. includes = arrayIncludes,
  5129. length = array.length,
  5130. isCommon = true,
  5131. result = [],
  5132. seen = result;
  5133. if (comparator) {
  5134. isCommon = false;
  5135. includes = arrayIncludesWith;
  5136. }
  5137. else if (length >= LARGE_ARRAY_SIZE) {
  5138. var set = iteratee ? null : createSet(array);
  5139. if (set) {
  5140. return setToArray(set);
  5141. }
  5142. isCommon = false;
  5143. includes = cacheHas;
  5144. seen = new SetCache;
  5145. }
  5146. else {
  5147. seen = iteratee ? [] : result;
  5148. }
  5149. outer:
  5150. while (++index < length) {
  5151. var value = array[index],
  5152. computed = iteratee ? iteratee(value) : value;
  5153. value = (comparator || value !== 0) ? value : 0;
  5154. if (isCommon && computed === computed) {
  5155. var seenIndex = seen.length;
  5156. while (seenIndex--) {
  5157. if (seen[seenIndex] === computed) {
  5158. continue outer;
  5159. }
  5160. }
  5161. if (iteratee) {
  5162. seen.push(computed);
  5163. }
  5164. result.push(value);
  5165. }
  5166. else if (!includes(seen, computed, comparator)) {
  5167. if (seen !== result) {
  5168. seen.push(computed);
  5169. }
  5170. result.push(value);
  5171. }
  5172. }
  5173. return result;
  5174. }
  5175. /**
  5176. * The base implementation of `_.unset`.
  5177. *
  5178. * @private
  5179. * @param {Object} object The object to modify.
  5180. * @param {Array|string} path The property path to unset.
  5181. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5182. */
  5183. function baseUnset(object, path) {
  5184. path = castPath(path, object);
  5185. object = parent(object, path);
  5186. return object == null || delete object[toKey(last(path))];
  5187. }
  5188. /**
  5189. * The base implementation of `_.update`.
  5190. *
  5191. * @private
  5192. * @param {Object} object The object to modify.
  5193. * @param {Array|string} path The path of the property to update.
  5194. * @param {Function} updater The function to produce the updated value.
  5195. * @param {Function} [customizer] The function to customize path creation.
  5196. * @returns {Object} Returns `object`.
  5197. */
  5198. function baseUpdate(object, path, updater, customizer) {
  5199. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5200. }
  5201. /**
  5202. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5203. * without support for iteratee shorthands.
  5204. *
  5205. * @private
  5206. * @param {Array} array The array to query.
  5207. * @param {Function} predicate The function invoked per iteration.
  5208. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5209. * @param {boolean} [fromRight] Specify iterating from right to left.
  5210. * @returns {Array} Returns the slice of `array`.
  5211. */
  5212. function baseWhile(array, predicate, isDrop, fromRight) {
  5213. var length = array.length,
  5214. index = fromRight ? length : -1;
  5215. while ((fromRight ? index-- : ++index < length) &&
  5216. predicate(array[index], index, array)) {}
  5217. return isDrop
  5218. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5219. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5220. }
  5221. /**
  5222. * The base implementation of `wrapperValue` which returns the result of
  5223. * performing a sequence of actions on the unwrapped `value`, where each
  5224. * successive action is supplied the return value of the previous.
  5225. *
  5226. * @private
  5227. * @param {*} value The unwrapped value.
  5228. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5229. * @returns {*} Returns the resolved value.
  5230. */
  5231. function baseWrapperValue(value, actions) {
  5232. var result = value;
  5233. if (result instanceof LazyWrapper) {
  5234. result = result.value();
  5235. }
  5236. return arrayReduce(actions, function(result, action) {
  5237. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5238. }, result);
  5239. }
  5240. /**
  5241. * The base implementation of methods like `_.xor`, without support for
  5242. * iteratee shorthands, that accepts an array of arrays to inspect.
  5243. *
  5244. * @private
  5245. * @param {Array} arrays The arrays to inspect.
  5246. * @param {Function} [iteratee] The iteratee invoked per element.
  5247. * @param {Function} [comparator] The comparator invoked per element.
  5248. * @returns {Array} Returns the new array of values.
  5249. */
  5250. function baseXor(arrays, iteratee, comparator) {
  5251. var length = arrays.length;
  5252. if (length < 2) {
  5253. return length ? baseUniq(arrays[0]) : [];
  5254. }
  5255. var index = -1,
  5256. result = Array(length);
  5257. while (++index < length) {
  5258. var array = arrays[index],
  5259. othIndex = -1;
  5260. while (++othIndex < length) {
  5261. if (othIndex != index) {
  5262. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5263. }
  5264. }
  5265. }
  5266. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5267. }
  5268. /**
  5269. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5270. *
  5271. * @private
  5272. * @param {Array} props The property identifiers.
  5273. * @param {Array} values The property values.
  5274. * @param {Function} assignFunc The function to assign values.
  5275. * @returns {Object} Returns the new object.
  5276. */
  5277. function baseZipObject(props, values, assignFunc) {
  5278. var index = -1,
  5279. length = props.length,
  5280. valsLength = values.length,
  5281. result = {};
  5282. while (++index < length) {
  5283. var value = index < valsLength ? values[index] : undefined;
  5284. assignFunc(result, props[index], value);
  5285. }
  5286. return result;
  5287. }
  5288. /**
  5289. * Casts `value` to an empty array if it's not an array like object.
  5290. *
  5291. * @private
  5292. * @param {*} value The value to inspect.
  5293. * @returns {Array|Object} Returns the cast array-like object.
  5294. */
  5295. function castArrayLikeObject(value) {
  5296. return isArrayLikeObject(value) ? value : [];
  5297. }
  5298. /**
  5299. * Casts `value` to `identity` if it's not a function.
  5300. *
  5301. * @private
  5302. * @param {*} value The value to inspect.
  5303. * @returns {Function} Returns cast function.
  5304. */
  5305. function castFunction(value) {
  5306. return typeof value == 'function' ? value : identity;
  5307. }
  5308. /**
  5309. * Casts `value` to a path array if it's not one.
  5310. *
  5311. * @private
  5312. * @param {*} value The value to inspect.
  5313. * @param {Object} [object] The object to query keys on.
  5314. * @returns {Array} Returns the cast property path array.
  5315. */
  5316. function castPath(value, object) {
  5317. if (isArray(value)) {
  5318. return value;
  5319. }
  5320. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5321. }
  5322. /**
  5323. * A `baseRest` alias which can be replaced with `identity` by module
  5324. * replacement plugins.
  5325. *
  5326. * @private
  5327. * @type {Function}
  5328. * @param {Function} func The function to apply a rest parameter to.
  5329. * @returns {Function} Returns the new function.
  5330. */
  5331. var castRest = baseRest;
  5332. /**
  5333. * Casts `array` to a slice if it's needed.
  5334. *
  5335. * @private
  5336. * @param {Array} array The array to inspect.
  5337. * @param {number} start The start position.
  5338. * @param {number} [end=array.length] The end position.
  5339. * @returns {Array} Returns the cast slice.
  5340. */
  5341. function castSlice(array, start, end) {
  5342. var length = array.length;
  5343. end = end === undefined ? length : end;
  5344. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5345. }
  5346. /**
  5347. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5348. *
  5349. * @private
  5350. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5351. */
  5352. var clearTimeout = ctxClearTimeout || function(id) {
  5353. return root.clearTimeout(id);
  5354. };
  5355. /**
  5356. * Creates a clone of `buffer`.
  5357. *
  5358. * @private
  5359. * @param {Buffer} buffer The buffer to clone.
  5360. * @param {boolean} [isDeep] Specify a deep clone.
  5361. * @returns {Buffer} Returns the cloned buffer.
  5362. */
  5363. function cloneBuffer(buffer, isDeep) {
  5364. if (isDeep) {
  5365. return buffer.slice();
  5366. }
  5367. var length = buffer.length,
  5368. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5369. buffer.copy(result);
  5370. return result;
  5371. }
  5372. /**
  5373. * Creates a clone of `arrayBuffer`.
  5374. *
  5375. * @private
  5376. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5377. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5378. */
  5379. function cloneArrayBuffer(arrayBuffer) {
  5380. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5381. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5382. return result;
  5383. }
  5384. /**
  5385. * Creates a clone of `dataView`.
  5386. *
  5387. * @private
  5388. * @param {Object} dataView The data view to clone.
  5389. * @param {boolean} [isDeep] Specify a deep clone.
  5390. * @returns {Object} Returns the cloned data view.
  5391. */
  5392. function cloneDataView(dataView, isDeep) {
  5393. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5394. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5395. }
  5396. /**
  5397. * Creates a clone of `regexp`.
  5398. *
  5399. * @private
  5400. * @param {Object} regexp The regexp to clone.
  5401. * @returns {Object} Returns the cloned regexp.
  5402. */
  5403. function cloneRegExp(regexp) {
  5404. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5405. result.lastIndex = regexp.lastIndex;
  5406. return result;
  5407. }
  5408. /**
  5409. * Creates a clone of the `symbol` object.
  5410. *
  5411. * @private
  5412. * @param {Object} symbol The symbol object to clone.
  5413. * @returns {Object} Returns the cloned symbol object.
  5414. */
  5415. function cloneSymbol(symbol) {
  5416. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5417. }
  5418. /**
  5419. * Creates a clone of `typedArray`.
  5420. *
  5421. * @private
  5422. * @param {Object} typedArray The typed array to clone.
  5423. * @param {boolean} [isDeep] Specify a deep clone.
  5424. * @returns {Object} Returns the cloned typed array.
  5425. */
  5426. function cloneTypedArray(typedArray, isDeep) {
  5427. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5428. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5429. }
  5430. /**
  5431. * Compares values to sort them in ascending order.
  5432. *
  5433. * @private
  5434. * @param {*} value The value to compare.
  5435. * @param {*} other The other value to compare.
  5436. * @returns {number} Returns the sort order indicator for `value`.
  5437. */
  5438. function compareAscending(value, other) {
  5439. if (value !== other) {
  5440. var valIsDefined = value !== undefined,
  5441. valIsNull = value === null,
  5442. valIsReflexive = value === value,
  5443. valIsSymbol = isSymbol(value);
  5444. var othIsDefined = other !== undefined,
  5445. othIsNull = other === null,
  5446. othIsReflexive = other === other,
  5447. othIsSymbol = isSymbol(other);
  5448. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5449. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5450. (valIsNull && othIsDefined && othIsReflexive) ||
  5451. (!valIsDefined && othIsReflexive) ||
  5452. !valIsReflexive) {
  5453. return 1;
  5454. }
  5455. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5456. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5457. (othIsNull && valIsDefined && valIsReflexive) ||
  5458. (!othIsDefined && valIsReflexive) ||
  5459. !othIsReflexive) {
  5460. return -1;
  5461. }
  5462. }
  5463. return 0;
  5464. }
  5465. /**
  5466. * Used by `_.orderBy` to compare multiple properties of a value to another
  5467. * and stable sort them.
  5468. *
  5469. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5470. * specify an order of "desc" for descending or "asc" for ascending sort order
  5471. * of corresponding values.
  5472. *
  5473. * @private
  5474. * @param {Object} object The object to compare.
  5475. * @param {Object} other The other object to compare.
  5476. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5477. * @returns {number} Returns the sort order indicator for `object`.
  5478. */
  5479. function compareMultiple(object, other, orders) {
  5480. var index = -1,
  5481. objCriteria = object.criteria,
  5482. othCriteria = other.criteria,
  5483. length = objCriteria.length,
  5484. ordersLength = orders.length;
  5485. while (++index < length) {
  5486. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5487. if (result) {
  5488. if (index >= ordersLength) {
  5489. return result;
  5490. }
  5491. var order = orders[index];
  5492. return result * (order == 'desc' ? -1 : 1);
  5493. }
  5494. }
  5495. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5496. // that causes it, under certain circumstances, to provide the same value for
  5497. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5498. // for more details.
  5499. //
  5500. // This also ensures a stable sort in V8 and other engines.
  5501. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5502. return object.index - other.index;
  5503. }
  5504. /**
  5505. * Creates an array that is the composition of partially applied arguments,
  5506. * placeholders, and provided arguments into a single array of arguments.
  5507. *
  5508. * @private
  5509. * @param {Array} args The provided arguments.
  5510. * @param {Array} partials The arguments to prepend to those provided.
  5511. * @param {Array} holders The `partials` placeholder indexes.
  5512. * @params {boolean} [isCurried] Specify composing for a curried function.
  5513. * @returns {Array} Returns the new array of composed arguments.
  5514. */
  5515. function composeArgs(args, partials, holders, isCurried) {
  5516. var argsIndex = -1,
  5517. argsLength = args.length,
  5518. holdersLength = holders.length,
  5519. leftIndex = -1,
  5520. leftLength = partials.length,
  5521. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5522. result = Array(leftLength + rangeLength),
  5523. isUncurried = !isCurried;
  5524. while (++leftIndex < leftLength) {
  5525. result[leftIndex] = partials[leftIndex];
  5526. }
  5527. while (++argsIndex < holdersLength) {
  5528. if (isUncurried || argsIndex < argsLength) {
  5529. result[holders[argsIndex]] = args[argsIndex];
  5530. }
  5531. }
  5532. while (rangeLength--) {
  5533. result[leftIndex++] = args[argsIndex++];
  5534. }
  5535. return result;
  5536. }
  5537. /**
  5538. * This function is like `composeArgs` except that the arguments composition
  5539. * is tailored for `_.partialRight`.
  5540. *
  5541. * @private
  5542. * @param {Array} args The provided arguments.
  5543. * @param {Array} partials The arguments to append to those provided.
  5544. * @param {Array} holders The `partials` placeholder indexes.
  5545. * @params {boolean} [isCurried] Specify composing for a curried function.
  5546. * @returns {Array} Returns the new array of composed arguments.
  5547. */
  5548. function composeArgsRight(args, partials, holders, isCurried) {
  5549. var argsIndex = -1,
  5550. argsLength = args.length,
  5551. holdersIndex = -1,
  5552. holdersLength = holders.length,
  5553. rightIndex = -1,
  5554. rightLength = partials.length,
  5555. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5556. result = Array(rangeLength + rightLength),
  5557. isUncurried = !isCurried;
  5558. while (++argsIndex < rangeLength) {
  5559. result[argsIndex] = args[argsIndex];
  5560. }
  5561. var offset = argsIndex;
  5562. while (++rightIndex < rightLength) {
  5563. result[offset + rightIndex] = partials[rightIndex];
  5564. }
  5565. while (++holdersIndex < holdersLength) {
  5566. if (isUncurried || argsIndex < argsLength) {
  5567. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5568. }
  5569. }
  5570. return result;
  5571. }
  5572. /**
  5573. * Copies the values of `source` to `array`.
  5574. *
  5575. * @private
  5576. * @param {Array} source The array to copy values from.
  5577. * @param {Array} [array=[]] The array to copy values to.
  5578. * @returns {Array} Returns `array`.
  5579. */
  5580. function copyArray(source, array) {
  5581. var index = -1,
  5582. length = source.length;
  5583. array || (array = Array(length));
  5584. while (++index < length) {
  5585. array[index] = source[index];
  5586. }
  5587. return array;
  5588. }
  5589. /**
  5590. * Copies properties of `source` to `object`.
  5591. *
  5592. * @private
  5593. * @param {Object} source The object to copy properties from.
  5594. * @param {Array} props The property identifiers to copy.
  5595. * @param {Object} [object={}] The object to copy properties to.
  5596. * @param {Function} [customizer] The function to customize copied values.
  5597. * @returns {Object} Returns `object`.
  5598. */
  5599. function copyObject(source, props, object, customizer) {
  5600. var isNew = !object;
  5601. object || (object = {});
  5602. var index = -1,
  5603. length = props.length;
  5604. while (++index < length) {
  5605. var key = props[index];
  5606. var newValue = customizer
  5607. ? customizer(object[key], source[key], key, object, source)
  5608. : undefined;
  5609. if (newValue === undefined) {
  5610. newValue = source[key];
  5611. }
  5612. if (isNew) {
  5613. baseAssignValue(object, key, newValue);
  5614. } else {
  5615. assignValue(object, key, newValue);
  5616. }
  5617. }
  5618. return object;
  5619. }
  5620. /**
  5621. * Copies own symbols of `source` to `object`.
  5622. *
  5623. * @private
  5624. * @param {Object} source The object to copy symbols from.
  5625. * @param {Object} [object={}] The object to copy symbols to.
  5626. * @returns {Object} Returns `object`.
  5627. */
  5628. function copySymbols(source, object) {
  5629. return copyObject(source, getSymbols(source), object);
  5630. }
  5631. /**
  5632. * Copies own and inherited symbols of `source` to `object`.
  5633. *
  5634. * @private
  5635. * @param {Object} source The object to copy symbols from.
  5636. * @param {Object} [object={}] The object to copy symbols to.
  5637. * @returns {Object} Returns `object`.
  5638. */
  5639. function copySymbolsIn(source, object) {
  5640. return copyObject(source, getSymbolsIn(source), object);
  5641. }
  5642. /**
  5643. * Creates a function like `_.groupBy`.
  5644. *
  5645. * @private
  5646. * @param {Function} setter The function to set accumulator values.
  5647. * @param {Function} [initializer] The accumulator object initializer.
  5648. * @returns {Function} Returns the new aggregator function.
  5649. */
  5650. function createAggregator(setter, initializer) {
  5651. return function(collection, iteratee) {
  5652. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5653. accumulator = initializer ? initializer() : {};
  5654. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5655. };
  5656. }
  5657. /**
  5658. * Creates a function like `_.assign`.
  5659. *
  5660. * @private
  5661. * @param {Function} assigner The function to assign values.
  5662. * @returns {Function} Returns the new assigner function.
  5663. */
  5664. function createAssigner(assigner) {
  5665. return baseRest(function(object, sources) {
  5666. var index = -1,
  5667. length = sources.length,
  5668. customizer = length > 1 ? sources[length - 1] : undefined,
  5669. guard = length > 2 ? sources[2] : undefined;
  5670. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5671. ? (length--, customizer)
  5672. : undefined;
  5673. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5674. customizer = length < 3 ? undefined : customizer;
  5675. length = 1;
  5676. }
  5677. object = Object(object);
  5678. while (++index < length) {
  5679. var source = sources[index];
  5680. if (source) {
  5681. assigner(object, source, index, customizer);
  5682. }
  5683. }
  5684. return object;
  5685. });
  5686. }
  5687. /**
  5688. * Creates a `baseEach` or `baseEachRight` function.
  5689. *
  5690. * @private
  5691. * @param {Function} eachFunc The function to iterate over a collection.
  5692. * @param {boolean} [fromRight] Specify iterating from right to left.
  5693. * @returns {Function} Returns the new base function.
  5694. */
  5695. function createBaseEach(eachFunc, fromRight) {
  5696. return function(collection, iteratee) {
  5697. if (collection == null) {
  5698. return collection;
  5699. }
  5700. if (!isArrayLike(collection)) {
  5701. return eachFunc(collection, iteratee);
  5702. }
  5703. var length = collection.length,
  5704. index = fromRight ? length : -1,
  5705. iterable = Object(collection);
  5706. while ((fromRight ? index-- : ++index < length)) {
  5707. if (iteratee(iterable[index], index, iterable) === false) {
  5708. break;
  5709. }
  5710. }
  5711. return collection;
  5712. };
  5713. }
  5714. /**
  5715. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5716. *
  5717. * @private
  5718. * @param {boolean} [fromRight] Specify iterating from right to left.
  5719. * @returns {Function} Returns the new base function.
  5720. */
  5721. function createBaseFor(fromRight) {
  5722. return function(object, iteratee, keysFunc) {
  5723. var index = -1,
  5724. iterable = Object(object),
  5725. props = keysFunc(object),
  5726. length = props.length;
  5727. while (length--) {
  5728. var key = props[fromRight ? length : ++index];
  5729. if (iteratee(iterable[key], key, iterable) === false) {
  5730. break;
  5731. }
  5732. }
  5733. return object;
  5734. };
  5735. }
  5736. /**
  5737. * Creates a function that wraps `func` to invoke it with the optional `this`
  5738. * binding of `thisArg`.
  5739. *
  5740. * @private
  5741. * @param {Function} func The function to wrap.
  5742. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5743. * @param {*} [thisArg] The `this` binding of `func`.
  5744. * @returns {Function} Returns the new wrapped function.
  5745. */
  5746. function createBind(func, bitmask, thisArg) {
  5747. var isBind = bitmask & WRAP_BIND_FLAG,
  5748. Ctor = createCtor(func);
  5749. function wrapper() {
  5750. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5751. return fn.apply(isBind ? thisArg : this, arguments);
  5752. }
  5753. return wrapper;
  5754. }
  5755. /**
  5756. * Creates a function like `_.lowerFirst`.
  5757. *
  5758. * @private
  5759. * @param {string} methodName The name of the `String` case method to use.
  5760. * @returns {Function} Returns the new case function.
  5761. */
  5762. function createCaseFirst(methodName) {
  5763. return function(string) {
  5764. string = toString(string);
  5765. var strSymbols = hasUnicode(string)
  5766. ? stringToArray(string)
  5767. : undefined;
  5768. var chr = strSymbols
  5769. ? strSymbols[0]
  5770. : string.charAt(0);
  5771. var trailing = strSymbols
  5772. ? castSlice(strSymbols, 1).join('')
  5773. : string.slice(1);
  5774. return chr[methodName]() + trailing;
  5775. };
  5776. }
  5777. /**
  5778. * Creates a function like `_.camelCase`.
  5779. *
  5780. * @private
  5781. * @param {Function} callback The function to combine each word.
  5782. * @returns {Function} Returns the new compounder function.
  5783. */
  5784. function createCompounder(callback) {
  5785. return function(string) {
  5786. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5787. };
  5788. }
  5789. /**
  5790. * Creates a function that produces an instance of `Ctor` regardless of
  5791. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5792. *
  5793. * @private
  5794. * @param {Function} Ctor The constructor to wrap.
  5795. * @returns {Function} Returns the new wrapped function.
  5796. */
  5797. function createCtor(Ctor) {
  5798. return function() {
  5799. // Use a `switch` statement to work with class constructors. See
  5800. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5801. // for more details.
  5802. var args = arguments;
  5803. switch (args.length) {
  5804. case 0: return new Ctor;
  5805. case 1: return new Ctor(args[0]);
  5806. case 2: return new Ctor(args[0], args[1]);
  5807. case 3: return new Ctor(args[0], args[1], args[2]);
  5808. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5809. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5810. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5811. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5812. }
  5813. var thisBinding = baseCreate(Ctor.prototype),
  5814. result = Ctor.apply(thisBinding, args);
  5815. // Mimic the constructor's `return` behavior.
  5816. // See https://es5.github.io/#x13.2.2 for more details.
  5817. return isObject(result) ? result : thisBinding;
  5818. };
  5819. }
  5820. /**
  5821. * Creates a function that wraps `func` to enable currying.
  5822. *
  5823. * @private
  5824. * @param {Function} func The function to wrap.
  5825. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5826. * @param {number} arity The arity of `func`.
  5827. * @returns {Function} Returns the new wrapped function.
  5828. */
  5829. function createCurry(func, bitmask, arity) {
  5830. var Ctor = createCtor(func);
  5831. function wrapper() {
  5832. var length = arguments.length,
  5833. args = Array(length),
  5834. index = length,
  5835. placeholder = getHolder(wrapper);
  5836. while (index--) {
  5837. args[index] = arguments[index];
  5838. }
  5839. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5840. ? []
  5841. : replaceHolders(args, placeholder);
  5842. length -= holders.length;
  5843. if (length < arity) {
  5844. return createRecurry(
  5845. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5846. args, holders, undefined, undefined, arity - length);
  5847. }
  5848. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5849. return apply(fn, this, args);
  5850. }
  5851. return wrapper;
  5852. }
  5853. /**
  5854. * Creates a `_.find` or `_.findLast` function.
  5855. *
  5856. * @private
  5857. * @param {Function} findIndexFunc The function to find the collection index.
  5858. * @returns {Function} Returns the new find function.
  5859. */
  5860. function createFind(findIndexFunc) {
  5861. return function(collection, predicate, fromIndex) {
  5862. var iterable = Object(collection);
  5863. if (!isArrayLike(collection)) {
  5864. var iteratee = getIteratee(predicate, 3);
  5865. collection = keys(collection);
  5866. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5867. }
  5868. var index = findIndexFunc(collection, predicate, fromIndex);
  5869. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5870. };
  5871. }
  5872. /**
  5873. * Creates a `_.flow` or `_.flowRight` function.
  5874. *
  5875. * @private
  5876. * @param {boolean} [fromRight] Specify iterating from right to left.
  5877. * @returns {Function} Returns the new flow function.
  5878. */
  5879. function createFlow(fromRight) {
  5880. return flatRest(function(funcs) {
  5881. var length = funcs.length,
  5882. index = length,
  5883. prereq = LodashWrapper.prototype.thru;
  5884. if (fromRight) {
  5885. funcs.reverse();
  5886. }
  5887. while (index--) {
  5888. var func = funcs[index];
  5889. if (typeof func != 'function') {
  5890. throw new TypeError(FUNC_ERROR_TEXT);
  5891. }
  5892. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5893. var wrapper = new LodashWrapper([], true);
  5894. }
  5895. }
  5896. index = wrapper ? index : length;
  5897. while (++index < length) {
  5898. func = funcs[index];
  5899. var funcName = getFuncName(func),
  5900. data = funcName == 'wrapper' ? getData(func) : undefined;
  5901. if (data && isLaziable(data[0]) &&
  5902. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5903. !data[4].length && data[9] == 1
  5904. ) {
  5905. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5906. } else {
  5907. wrapper = (func.length == 1 && isLaziable(func))
  5908. ? wrapper[funcName]()
  5909. : wrapper.thru(func);
  5910. }
  5911. }
  5912. return function() {
  5913. var args = arguments,
  5914. value = args[0];
  5915. if (wrapper && args.length == 1 && isArray(value)) {
  5916. return wrapper.plant(value).value();
  5917. }
  5918. var index = 0,
  5919. result = length ? funcs[index].apply(this, args) : value;
  5920. while (++index < length) {
  5921. result = funcs[index].call(this, result);
  5922. }
  5923. return result;
  5924. };
  5925. });
  5926. }
  5927. /**
  5928. * Creates a function that wraps `func` to invoke it with optional `this`
  5929. * binding of `thisArg`, partial application, and currying.
  5930. *
  5931. * @private
  5932. * @param {Function|string} func The function or method name to wrap.
  5933. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5934. * @param {*} [thisArg] The `this` binding of `func`.
  5935. * @param {Array} [partials] The arguments to prepend to those provided to
  5936. * the new function.
  5937. * @param {Array} [holders] The `partials` placeholder indexes.
  5938. * @param {Array} [partialsRight] The arguments to append to those provided
  5939. * to the new function.
  5940. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5941. * @param {Array} [argPos] The argument positions of the new function.
  5942. * @param {number} [ary] The arity cap of `func`.
  5943. * @param {number} [arity] The arity of `func`.
  5944. * @returns {Function} Returns the new wrapped function.
  5945. */
  5946. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5947. var isAry = bitmask & WRAP_ARY_FLAG,
  5948. isBind = bitmask & WRAP_BIND_FLAG,
  5949. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5950. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5951. isFlip = bitmask & WRAP_FLIP_FLAG,
  5952. Ctor = isBindKey ? undefined : createCtor(func);
  5953. function wrapper() {
  5954. var length = arguments.length,
  5955. args = Array(length),
  5956. index = length;
  5957. while (index--) {
  5958. args[index] = arguments[index];
  5959. }
  5960. if (isCurried) {
  5961. var placeholder = getHolder(wrapper),
  5962. holdersCount = countHolders(args, placeholder);
  5963. }
  5964. if (partials) {
  5965. args = composeArgs(args, partials, holders, isCurried);
  5966. }
  5967. if (partialsRight) {
  5968. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5969. }
  5970. length -= holdersCount;
  5971. if (isCurried && length < arity) {
  5972. var newHolders = replaceHolders(args, placeholder);
  5973. return createRecurry(
  5974. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5975. args, newHolders, argPos, ary, arity - length
  5976. );
  5977. }
  5978. var thisBinding = isBind ? thisArg : this,
  5979. fn = isBindKey ? thisBinding[func] : func;
  5980. length = args.length;
  5981. if (argPos) {
  5982. args = reorder(args, argPos);
  5983. } else if (isFlip && length > 1) {
  5984. args.reverse();
  5985. }
  5986. if (isAry && ary < length) {
  5987. args.length = ary;
  5988. }
  5989. if (this && this !== root && this instanceof wrapper) {
  5990. fn = Ctor || createCtor(fn);
  5991. }
  5992. return fn.apply(thisBinding, args);
  5993. }
  5994. return wrapper;
  5995. }
  5996. /**
  5997. * Creates a function like `_.invertBy`.
  5998. *
  5999. * @private
  6000. * @param {Function} setter The function to set accumulator values.
  6001. * @param {Function} toIteratee The function to resolve iteratees.
  6002. * @returns {Function} Returns the new inverter function.
  6003. */
  6004. function createInverter(setter, toIteratee) {
  6005. return function(object, iteratee) {
  6006. return baseInverter(object, setter, toIteratee(iteratee), {});
  6007. };
  6008. }
  6009. /**
  6010. * Creates a function that performs a mathematical operation on two values.
  6011. *
  6012. * @private
  6013. * @param {Function} operator The function to perform the operation.
  6014. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6015. * @returns {Function} Returns the new mathematical operation function.
  6016. */
  6017. function createMathOperation(operator, defaultValue) {
  6018. return function(value, other) {
  6019. var result;
  6020. if (value === undefined && other === undefined) {
  6021. return defaultValue;
  6022. }
  6023. if (value !== undefined) {
  6024. result = value;
  6025. }
  6026. if (other !== undefined) {
  6027. if (result === undefined) {
  6028. return other;
  6029. }
  6030. if (typeof value == 'string' || typeof other == 'string') {
  6031. value = baseToString(value);
  6032. other = baseToString(other);
  6033. } else {
  6034. value = baseToNumber(value);
  6035. other = baseToNumber(other);
  6036. }
  6037. result = operator(value, other);
  6038. }
  6039. return result;
  6040. };
  6041. }
  6042. /**
  6043. * Creates a function like `_.over`.
  6044. *
  6045. * @private
  6046. * @param {Function} arrayFunc The function to iterate over iteratees.
  6047. * @returns {Function} Returns the new over function.
  6048. */
  6049. function createOver(arrayFunc) {
  6050. return flatRest(function(iteratees) {
  6051. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6052. return baseRest(function(args) {
  6053. var thisArg = this;
  6054. return arrayFunc(iteratees, function(iteratee) {
  6055. return apply(iteratee, thisArg, args);
  6056. });
  6057. });
  6058. });
  6059. }
  6060. /**
  6061. * Creates the padding for `string` based on `length`. The `chars` string
  6062. * is truncated if the number of characters exceeds `length`.
  6063. *
  6064. * @private
  6065. * @param {number} length The padding length.
  6066. * @param {string} [chars=' '] The string used as padding.
  6067. * @returns {string} Returns the padding for `string`.
  6068. */
  6069. function createPadding(length, chars) {
  6070. chars = chars === undefined ? ' ' : baseToString(chars);
  6071. var charsLength = chars.length;
  6072. if (charsLength < 2) {
  6073. return charsLength ? baseRepeat(chars, length) : chars;
  6074. }
  6075. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6076. return hasUnicode(chars)
  6077. ? castSlice(stringToArray(result), 0, length).join('')
  6078. : result.slice(0, length);
  6079. }
  6080. /**
  6081. * Creates a function that wraps `func` to invoke it with the `this` binding
  6082. * of `thisArg` and `partials` prepended to the arguments it receives.
  6083. *
  6084. * @private
  6085. * @param {Function} func The function to wrap.
  6086. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6087. * @param {*} thisArg The `this` binding of `func`.
  6088. * @param {Array} partials The arguments to prepend to those provided to
  6089. * the new function.
  6090. * @returns {Function} Returns the new wrapped function.
  6091. */
  6092. function createPartial(func, bitmask, thisArg, partials) {
  6093. var isBind = bitmask & WRAP_BIND_FLAG,
  6094. Ctor = createCtor(func);
  6095. function wrapper() {
  6096. var argsIndex = -1,
  6097. argsLength = arguments.length,
  6098. leftIndex = -1,
  6099. leftLength = partials.length,
  6100. args = Array(leftLength + argsLength),
  6101. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6102. while (++leftIndex < leftLength) {
  6103. args[leftIndex] = partials[leftIndex];
  6104. }
  6105. while (argsLength--) {
  6106. args[leftIndex++] = arguments[++argsIndex];
  6107. }
  6108. return apply(fn, isBind ? thisArg : this, args);
  6109. }
  6110. return wrapper;
  6111. }
  6112. /**
  6113. * Creates a `_.range` or `_.rangeRight` function.
  6114. *
  6115. * @private
  6116. * @param {boolean} [fromRight] Specify iterating from right to left.
  6117. * @returns {Function} Returns the new range function.
  6118. */
  6119. function createRange(fromRight) {
  6120. return function(start, end, step) {
  6121. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6122. end = step = undefined;
  6123. }
  6124. // Ensure the sign of `-0` is preserved.
  6125. start = toFinite(start);
  6126. if (end === undefined) {
  6127. end = start;
  6128. start = 0;
  6129. } else {
  6130. end = toFinite(end);
  6131. }
  6132. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6133. return baseRange(start, end, step, fromRight);
  6134. };
  6135. }
  6136. /**
  6137. * Creates a function that performs a relational operation on two values.
  6138. *
  6139. * @private
  6140. * @param {Function} operator The function to perform the operation.
  6141. * @returns {Function} Returns the new relational operation function.
  6142. */
  6143. function createRelationalOperation(operator) {
  6144. return function(value, other) {
  6145. if (!(typeof value == 'string' && typeof other == 'string')) {
  6146. value = toNumber(value);
  6147. other = toNumber(other);
  6148. }
  6149. return operator(value, other);
  6150. };
  6151. }
  6152. /**
  6153. * Creates a function that wraps `func` to continue currying.
  6154. *
  6155. * @private
  6156. * @param {Function} func The function to wrap.
  6157. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6158. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6159. * @param {*} placeholder The placeholder value.
  6160. * @param {*} [thisArg] The `this` binding of `func`.
  6161. * @param {Array} [partials] The arguments to prepend to those provided to
  6162. * the new function.
  6163. * @param {Array} [holders] The `partials` placeholder indexes.
  6164. * @param {Array} [argPos] The argument positions of the new function.
  6165. * @param {number} [ary] The arity cap of `func`.
  6166. * @param {number} [arity] The arity of `func`.
  6167. * @returns {Function} Returns the new wrapped function.
  6168. */
  6169. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6170. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6171. newHolders = isCurry ? holders : undefined,
  6172. newHoldersRight = isCurry ? undefined : holders,
  6173. newPartials = isCurry ? partials : undefined,
  6174. newPartialsRight = isCurry ? undefined : partials;
  6175. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6176. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6177. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6178. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6179. }
  6180. var newData = [
  6181. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6182. newHoldersRight, argPos, ary, arity
  6183. ];
  6184. var result = wrapFunc.apply(undefined, newData);
  6185. if (isLaziable(func)) {
  6186. setData(result, newData);
  6187. }
  6188. result.placeholder = placeholder;
  6189. return setWrapToString(result, func, bitmask);
  6190. }
  6191. /**
  6192. * Creates a function like `_.round`.
  6193. *
  6194. * @private
  6195. * @param {string} methodName The name of the `Math` method to use when rounding.
  6196. * @returns {Function} Returns the new round function.
  6197. */
  6198. function createRound(methodName) {
  6199. var func = Math[methodName];
  6200. return function(number, precision) {
  6201. number = toNumber(number);
  6202. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6203. if (precision && nativeIsFinite(number)) {
  6204. // Shift with exponential notation to avoid floating-point issues.
  6205. // See [MDN](https://mdn.io/round#Examples) for more details.
  6206. var pair = (toString(number) + 'e').split('e'),
  6207. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6208. pair = (toString(value) + 'e').split('e');
  6209. return +(pair[0] + 'e' + (+pair[1] - precision));
  6210. }
  6211. return func(number);
  6212. };
  6213. }
  6214. /**
  6215. * Creates a set object of `values`.
  6216. *
  6217. * @private
  6218. * @param {Array} values The values to add to the set.
  6219. * @returns {Object} Returns the new set.
  6220. */
  6221. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6222. return new Set(values);
  6223. };
  6224. /**
  6225. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6226. *
  6227. * @private
  6228. * @param {Function} keysFunc The function to get the keys of a given object.
  6229. * @returns {Function} Returns the new pairs function.
  6230. */
  6231. function createToPairs(keysFunc) {
  6232. return function(object) {
  6233. var tag = getTag(object);
  6234. if (tag == mapTag) {
  6235. return mapToArray(object);
  6236. }
  6237. if (tag == setTag) {
  6238. return setToPairs(object);
  6239. }
  6240. return baseToPairs(object, keysFunc(object));
  6241. };
  6242. }
  6243. /**
  6244. * Creates a function that either curries or invokes `func` with optional
  6245. * `this` binding and partially applied arguments.
  6246. *
  6247. * @private
  6248. * @param {Function|string} func The function or method name to wrap.
  6249. * @param {number} bitmask The bitmask flags.
  6250. * 1 - `_.bind`
  6251. * 2 - `_.bindKey`
  6252. * 4 - `_.curry` or `_.curryRight` of a bound function
  6253. * 8 - `_.curry`
  6254. * 16 - `_.curryRight`
  6255. * 32 - `_.partial`
  6256. * 64 - `_.partialRight`
  6257. * 128 - `_.rearg`
  6258. * 256 - `_.ary`
  6259. * 512 - `_.flip`
  6260. * @param {*} [thisArg] The `this` binding of `func`.
  6261. * @param {Array} [partials] The arguments to be partially applied.
  6262. * @param {Array} [holders] The `partials` placeholder indexes.
  6263. * @param {Array} [argPos] The argument positions of the new function.
  6264. * @param {number} [ary] The arity cap of `func`.
  6265. * @param {number} [arity] The arity of `func`.
  6266. * @returns {Function} Returns the new wrapped function.
  6267. */
  6268. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6269. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6270. if (!isBindKey && typeof func != 'function') {
  6271. throw new TypeError(FUNC_ERROR_TEXT);
  6272. }
  6273. var length = partials ? partials.length : 0;
  6274. if (!length) {
  6275. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6276. partials = holders = undefined;
  6277. }
  6278. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6279. arity = arity === undefined ? arity : toInteger(arity);
  6280. length -= holders ? holders.length : 0;
  6281. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6282. var partialsRight = partials,
  6283. holdersRight = holders;
  6284. partials = holders = undefined;
  6285. }
  6286. var data = isBindKey ? undefined : getData(func);
  6287. var newData = [
  6288. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6289. argPos, ary, arity
  6290. ];
  6291. if (data) {
  6292. mergeData(newData, data);
  6293. }
  6294. func = newData[0];
  6295. bitmask = newData[1];
  6296. thisArg = newData[2];
  6297. partials = newData[3];
  6298. holders = newData[4];
  6299. arity = newData[9] = newData[9] === undefined
  6300. ? (isBindKey ? 0 : func.length)
  6301. : nativeMax(newData[9] - length, 0);
  6302. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6303. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6304. }
  6305. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6306. var result = createBind(func, bitmask, thisArg);
  6307. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6308. result = createCurry(func, bitmask, arity);
  6309. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6310. result = createPartial(func, bitmask, thisArg, partials);
  6311. } else {
  6312. result = createHybrid.apply(undefined, newData);
  6313. }
  6314. var setter = data ? baseSetData : setData;
  6315. return setWrapToString(setter(result, newData), func, bitmask);
  6316. }
  6317. /**
  6318. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6319. * of source objects to the destination object for all destination properties
  6320. * that resolve to `undefined`.
  6321. *
  6322. * @private
  6323. * @param {*} objValue The destination value.
  6324. * @param {*} srcValue The source value.
  6325. * @param {string} key The key of the property to assign.
  6326. * @param {Object} object The parent object of `objValue`.
  6327. * @returns {*} Returns the value to assign.
  6328. */
  6329. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6330. if (objValue === undefined ||
  6331. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6332. return srcValue;
  6333. }
  6334. return objValue;
  6335. }
  6336. /**
  6337. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6338. * objects into destination objects that are passed thru.
  6339. *
  6340. * @private
  6341. * @param {*} objValue The destination value.
  6342. * @param {*} srcValue The source value.
  6343. * @param {string} key The key of the property to merge.
  6344. * @param {Object} object The parent object of `objValue`.
  6345. * @param {Object} source The parent object of `srcValue`.
  6346. * @param {Object} [stack] Tracks traversed source values and their merged
  6347. * counterparts.
  6348. * @returns {*} Returns the value to assign.
  6349. */
  6350. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6351. if (isObject(objValue) && isObject(srcValue)) {
  6352. // Recursively merge objects and arrays (susceptible to call stack limits).
  6353. stack.set(srcValue, objValue);
  6354. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6355. stack['delete'](srcValue);
  6356. }
  6357. return objValue;
  6358. }
  6359. /**
  6360. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6361. * objects.
  6362. *
  6363. * @private
  6364. * @param {*} value The value to inspect.
  6365. * @param {string} key The key of the property to inspect.
  6366. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6367. */
  6368. function customOmitClone(value) {
  6369. return isPlainObject(value) ? undefined : value;
  6370. }
  6371. /**
  6372. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6373. * partial deep comparisons.
  6374. *
  6375. * @private
  6376. * @param {Array} array The array to compare.
  6377. * @param {Array} other The other array to compare.
  6378. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6379. * @param {Function} customizer The function to customize comparisons.
  6380. * @param {Function} equalFunc The function to determine equivalents of values.
  6381. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6382. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6383. */
  6384. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6385. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6386. arrLength = array.length,
  6387. othLength = other.length;
  6388. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6389. return false;
  6390. }
  6391. // Check that cyclic values are equal.
  6392. var arrStacked = stack.get(array);
  6393. var othStacked = stack.get(other);
  6394. if (arrStacked && othStacked) {
  6395. return arrStacked == other && othStacked == array;
  6396. }
  6397. var index = -1,
  6398. result = true,
  6399. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6400. stack.set(array, other);
  6401. stack.set(other, array);
  6402. // Ignore non-index properties.
  6403. while (++index < arrLength) {
  6404. var arrValue = array[index],
  6405. othValue = other[index];
  6406. if (customizer) {
  6407. var compared = isPartial
  6408. ? customizer(othValue, arrValue, index, other, array, stack)
  6409. : customizer(arrValue, othValue, index, array, other, stack);
  6410. }
  6411. if (compared !== undefined) {
  6412. if (compared) {
  6413. continue;
  6414. }
  6415. result = false;
  6416. break;
  6417. }
  6418. // Recursively compare arrays (susceptible to call stack limits).
  6419. if (seen) {
  6420. if (!arraySome(other, function(othValue, othIndex) {
  6421. if (!cacheHas(seen, othIndex) &&
  6422. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6423. return seen.push(othIndex);
  6424. }
  6425. })) {
  6426. result = false;
  6427. break;
  6428. }
  6429. } else if (!(
  6430. arrValue === othValue ||
  6431. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6432. )) {
  6433. result = false;
  6434. break;
  6435. }
  6436. }
  6437. stack['delete'](array);
  6438. stack['delete'](other);
  6439. return result;
  6440. }
  6441. /**
  6442. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6443. * the same `toStringTag`.
  6444. *
  6445. * **Note:** This function only supports comparing values with tags of
  6446. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6447. *
  6448. * @private
  6449. * @param {Object} object The object to compare.
  6450. * @param {Object} other The other object to compare.
  6451. * @param {string} tag The `toStringTag` of the objects to compare.
  6452. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6453. * @param {Function} customizer The function to customize comparisons.
  6454. * @param {Function} equalFunc The function to determine equivalents of values.
  6455. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6456. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6457. */
  6458. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6459. switch (tag) {
  6460. case dataViewTag:
  6461. if ((object.byteLength != other.byteLength) ||
  6462. (object.byteOffset != other.byteOffset)) {
  6463. return false;
  6464. }
  6465. object = object.buffer;
  6466. other = other.buffer;
  6467. case arrayBufferTag:
  6468. if ((object.byteLength != other.byteLength) ||
  6469. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6470. return false;
  6471. }
  6472. return true;
  6473. case boolTag:
  6474. case dateTag:
  6475. case numberTag:
  6476. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6477. // Invalid dates are coerced to `NaN`.
  6478. return eq(+object, +other);
  6479. case errorTag:
  6480. return object.name == other.name && object.message == other.message;
  6481. case regexpTag:
  6482. case stringTag:
  6483. // Coerce regexes to strings and treat strings, primitives and objects,
  6484. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6485. // for more details.
  6486. return object == (other + '');
  6487. case mapTag:
  6488. var convert = mapToArray;
  6489. case setTag:
  6490. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6491. convert || (convert = setToArray);
  6492. if (object.size != other.size && !isPartial) {
  6493. return false;
  6494. }
  6495. // Assume cyclic values are equal.
  6496. var stacked = stack.get(object);
  6497. if (stacked) {
  6498. return stacked == other;
  6499. }
  6500. bitmask |= COMPARE_UNORDERED_FLAG;
  6501. // Recursively compare objects (susceptible to call stack limits).
  6502. stack.set(object, other);
  6503. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6504. stack['delete'](object);
  6505. return result;
  6506. case symbolTag:
  6507. if (symbolValueOf) {
  6508. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6509. }
  6510. }
  6511. return false;
  6512. }
  6513. /**
  6514. * A specialized version of `baseIsEqualDeep` for objects with support for
  6515. * partial deep comparisons.
  6516. *
  6517. * @private
  6518. * @param {Object} object The object to compare.
  6519. * @param {Object} other The other object to compare.
  6520. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6521. * @param {Function} customizer The function to customize comparisons.
  6522. * @param {Function} equalFunc The function to determine equivalents of values.
  6523. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6524. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6525. */
  6526. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6527. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6528. objProps = getAllKeys(object),
  6529. objLength = objProps.length,
  6530. othProps = getAllKeys(other),
  6531. othLength = othProps.length;
  6532. if (objLength != othLength && !isPartial) {
  6533. return false;
  6534. }
  6535. var index = objLength;
  6536. while (index--) {
  6537. var key = objProps[index];
  6538. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6539. return false;
  6540. }
  6541. }
  6542. // Check that cyclic values are equal.
  6543. var objStacked = stack.get(object);
  6544. var othStacked = stack.get(other);
  6545. if (objStacked && othStacked) {
  6546. return objStacked == other && othStacked == object;
  6547. }
  6548. var result = true;
  6549. stack.set(object, other);
  6550. stack.set(other, object);
  6551. var skipCtor = isPartial;
  6552. while (++index < objLength) {
  6553. key = objProps[index];
  6554. var objValue = object[key],
  6555. othValue = other[key];
  6556. if (customizer) {
  6557. var compared = isPartial
  6558. ? customizer(othValue, objValue, key, other, object, stack)
  6559. : customizer(objValue, othValue, key, object, other, stack);
  6560. }
  6561. // Recursively compare objects (susceptible to call stack limits).
  6562. if (!(compared === undefined
  6563. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6564. : compared
  6565. )) {
  6566. result = false;
  6567. break;
  6568. }
  6569. skipCtor || (skipCtor = key == 'constructor');
  6570. }
  6571. if (result && !skipCtor) {
  6572. var objCtor = object.constructor,
  6573. othCtor = other.constructor;
  6574. // Non `Object` object instances with different constructors are not equal.
  6575. if (objCtor != othCtor &&
  6576. ('constructor' in object && 'constructor' in other) &&
  6577. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6578. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6579. result = false;
  6580. }
  6581. }
  6582. stack['delete'](object);
  6583. stack['delete'](other);
  6584. return result;
  6585. }
  6586. /**
  6587. * A specialized version of `baseRest` which flattens the rest array.
  6588. *
  6589. * @private
  6590. * @param {Function} func The function to apply a rest parameter to.
  6591. * @returns {Function} Returns the new function.
  6592. */
  6593. function flatRest(func) {
  6594. return setToString(overRest(func, undefined, flatten), func + '');
  6595. }
  6596. /**
  6597. * Creates an array of own enumerable property names and symbols of `object`.
  6598. *
  6599. * @private
  6600. * @param {Object} object The object to query.
  6601. * @returns {Array} Returns the array of property names and symbols.
  6602. */
  6603. function getAllKeys(object) {
  6604. return baseGetAllKeys(object, keys, getSymbols);
  6605. }
  6606. /**
  6607. * Creates an array of own and inherited enumerable property names and
  6608. * symbols of `object`.
  6609. *
  6610. * @private
  6611. * @param {Object} object The object to query.
  6612. * @returns {Array} Returns the array of property names and symbols.
  6613. */
  6614. function getAllKeysIn(object) {
  6615. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6616. }
  6617. /**
  6618. * Gets metadata for `func`.
  6619. *
  6620. * @private
  6621. * @param {Function} func The function to query.
  6622. * @returns {*} Returns the metadata for `func`.
  6623. */
  6624. var getData = !metaMap ? noop : function(func) {
  6625. return metaMap.get(func);
  6626. };
  6627. /**
  6628. * Gets the name of `func`.
  6629. *
  6630. * @private
  6631. * @param {Function} func The function to query.
  6632. * @returns {string} Returns the function name.
  6633. */
  6634. function getFuncName(func) {
  6635. var result = (func.name + ''),
  6636. array = realNames[result],
  6637. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6638. while (length--) {
  6639. var data = array[length],
  6640. otherFunc = data.func;
  6641. if (otherFunc == null || otherFunc == func) {
  6642. return data.name;
  6643. }
  6644. }
  6645. return result;
  6646. }
  6647. /**
  6648. * Gets the argument placeholder value for `func`.
  6649. *
  6650. * @private
  6651. * @param {Function} func The function to inspect.
  6652. * @returns {*} Returns the placeholder value.
  6653. */
  6654. function getHolder(func) {
  6655. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6656. return object.placeholder;
  6657. }
  6658. /**
  6659. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6660. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6661. * If arguments are provided, the chosen function is invoked with them and
  6662. * its result is returned.
  6663. *
  6664. * @private
  6665. * @param {*} [value] The value to convert to an iteratee.
  6666. * @param {number} [arity] The arity of the created iteratee.
  6667. * @returns {Function} Returns the chosen function or its result.
  6668. */
  6669. function getIteratee() {
  6670. var result = lodash.iteratee || iteratee;
  6671. result = result === iteratee ? baseIteratee : result;
  6672. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6673. }
  6674. /**
  6675. * Gets the data for `map`.
  6676. *
  6677. * @private
  6678. * @param {Object} map The map to query.
  6679. * @param {string} key The reference key.
  6680. * @returns {*} Returns the map data.
  6681. */
  6682. function getMapData(map, key) {
  6683. var data = map.__data__;
  6684. return isKeyable(key)
  6685. ? data[typeof key == 'string' ? 'string' : 'hash']
  6686. : data.map;
  6687. }
  6688. /**
  6689. * Gets the property names, values, and compare flags of `object`.
  6690. *
  6691. * @private
  6692. * @param {Object} object The object to query.
  6693. * @returns {Array} Returns the match data of `object`.
  6694. */
  6695. function getMatchData(object) {
  6696. var result = keys(object),
  6697. length = result.length;
  6698. while (length--) {
  6699. var key = result[length],
  6700. value = object[key];
  6701. result[length] = [key, value, isStrictComparable(value)];
  6702. }
  6703. return result;
  6704. }
  6705. /**
  6706. * Gets the native function at `key` of `object`.
  6707. *
  6708. * @private
  6709. * @param {Object} object The object to query.
  6710. * @param {string} key The key of the method to get.
  6711. * @returns {*} Returns the function if it's native, else `undefined`.
  6712. */
  6713. function getNative(object, key) {
  6714. var value = getValue(object, key);
  6715. return baseIsNative(value) ? value : undefined;
  6716. }
  6717. /**
  6718. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6719. *
  6720. * @private
  6721. * @param {*} value The value to query.
  6722. * @returns {string} Returns the raw `toStringTag`.
  6723. */
  6724. function getRawTag(value) {
  6725. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6726. tag = value[symToStringTag];
  6727. try {
  6728. value[symToStringTag] = undefined;
  6729. var unmasked = true;
  6730. } catch (e) {}
  6731. var result = nativeObjectToString.call(value);
  6732. if (unmasked) {
  6733. if (isOwn) {
  6734. value[symToStringTag] = tag;
  6735. } else {
  6736. delete value[symToStringTag];
  6737. }
  6738. }
  6739. return result;
  6740. }
  6741. /**
  6742. * Creates an array of the own enumerable symbols of `object`.
  6743. *
  6744. * @private
  6745. * @param {Object} object The object to query.
  6746. * @returns {Array} Returns the array of symbols.
  6747. */
  6748. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6749. if (object == null) {
  6750. return [];
  6751. }
  6752. object = Object(object);
  6753. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6754. return propertyIsEnumerable.call(object, symbol);
  6755. });
  6756. };
  6757. /**
  6758. * Creates an array of the own and inherited enumerable symbols of `object`.
  6759. *
  6760. * @private
  6761. * @param {Object} object The object to query.
  6762. * @returns {Array} Returns the array of symbols.
  6763. */
  6764. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6765. var result = [];
  6766. while (object) {
  6767. arrayPush(result, getSymbols(object));
  6768. object = getPrototype(object);
  6769. }
  6770. return result;
  6771. };
  6772. /**
  6773. * Gets the `toStringTag` of `value`.
  6774. *
  6775. * @private
  6776. * @param {*} value The value to query.
  6777. * @returns {string} Returns the `toStringTag`.
  6778. */
  6779. var getTag = baseGetTag;
  6780. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6781. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6782. (Map && getTag(new Map) != mapTag) ||
  6783. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6784. (Set && getTag(new Set) != setTag) ||
  6785. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6786. getTag = function(value) {
  6787. var result = baseGetTag(value),
  6788. Ctor = result == objectTag ? value.constructor : undefined,
  6789. ctorString = Ctor ? toSource(Ctor) : '';
  6790. if (ctorString) {
  6791. switch (ctorString) {
  6792. case dataViewCtorString: return dataViewTag;
  6793. case mapCtorString: return mapTag;
  6794. case promiseCtorString: return promiseTag;
  6795. case setCtorString: return setTag;
  6796. case weakMapCtorString: return weakMapTag;
  6797. }
  6798. }
  6799. return result;
  6800. };
  6801. }
  6802. /**
  6803. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6804. *
  6805. * @private
  6806. * @param {number} start The start of the view.
  6807. * @param {number} end The end of the view.
  6808. * @param {Array} transforms The transformations to apply to the view.
  6809. * @returns {Object} Returns an object containing the `start` and `end`
  6810. * positions of the view.
  6811. */
  6812. function getView(start, end, transforms) {
  6813. var index = -1,
  6814. length = transforms.length;
  6815. while (++index < length) {
  6816. var data = transforms[index],
  6817. size = data.size;
  6818. switch (data.type) {
  6819. case 'drop': start += size; break;
  6820. case 'dropRight': end -= size; break;
  6821. case 'take': end = nativeMin(end, start + size); break;
  6822. case 'takeRight': start = nativeMax(start, end - size); break;
  6823. }
  6824. }
  6825. return { 'start': start, 'end': end };
  6826. }
  6827. /**
  6828. * Extracts wrapper details from the `source` body comment.
  6829. *
  6830. * @private
  6831. * @param {string} source The source to inspect.
  6832. * @returns {Array} Returns the wrapper details.
  6833. */
  6834. function getWrapDetails(source) {
  6835. var match = source.match(reWrapDetails);
  6836. return match ? match[1].split(reSplitDetails) : [];
  6837. }
  6838. /**
  6839. * Checks if `path` exists on `object`.
  6840. *
  6841. * @private
  6842. * @param {Object} object The object to query.
  6843. * @param {Array|string} path The path to check.
  6844. * @param {Function} hasFunc The function to check properties.
  6845. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6846. */
  6847. function hasPath(object, path, hasFunc) {
  6848. path = castPath(path, object);
  6849. var index = -1,
  6850. length = path.length,
  6851. result = false;
  6852. while (++index < length) {
  6853. var key = toKey(path[index]);
  6854. if (!(result = object != null && hasFunc(object, key))) {
  6855. break;
  6856. }
  6857. object = object[key];
  6858. }
  6859. if (result || ++index != length) {
  6860. return result;
  6861. }
  6862. length = object == null ? 0 : object.length;
  6863. return !!length && isLength(length) && isIndex(key, length) &&
  6864. (isArray(object) || isArguments(object));
  6865. }
  6866. /**
  6867. * Initializes an array clone.
  6868. *
  6869. * @private
  6870. * @param {Array} array The array to clone.
  6871. * @returns {Array} Returns the initialized clone.
  6872. */
  6873. function initCloneArray(array) {
  6874. var length = array.length,
  6875. result = new array.constructor(length);
  6876. // Add properties assigned by `RegExp#exec`.
  6877. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6878. result.index = array.index;
  6879. result.input = array.input;
  6880. }
  6881. return result;
  6882. }
  6883. /**
  6884. * Initializes an object clone.
  6885. *
  6886. * @private
  6887. * @param {Object} object The object to clone.
  6888. * @returns {Object} Returns the initialized clone.
  6889. */
  6890. function initCloneObject(object) {
  6891. return (typeof object.constructor == 'function' && !isPrototype(object))
  6892. ? baseCreate(getPrototype(object))
  6893. : {};
  6894. }
  6895. /**
  6896. * Initializes an object clone based on its `toStringTag`.
  6897. *
  6898. * **Note:** This function only supports cloning values with tags of
  6899. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6900. *
  6901. * @private
  6902. * @param {Object} object The object to clone.
  6903. * @param {string} tag The `toStringTag` of the object to clone.
  6904. * @param {boolean} [isDeep] Specify a deep clone.
  6905. * @returns {Object} Returns the initialized clone.
  6906. */
  6907. function initCloneByTag(object, tag, isDeep) {
  6908. var Ctor = object.constructor;
  6909. switch (tag) {
  6910. case arrayBufferTag:
  6911. return cloneArrayBuffer(object);
  6912. case boolTag:
  6913. case dateTag:
  6914. return new Ctor(+object);
  6915. case dataViewTag:
  6916. return cloneDataView(object, isDeep);
  6917. case float32Tag: case float64Tag:
  6918. case int8Tag: case int16Tag: case int32Tag:
  6919. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6920. return cloneTypedArray(object, isDeep);
  6921. case mapTag:
  6922. return new Ctor;
  6923. case numberTag:
  6924. case stringTag:
  6925. return new Ctor(object);
  6926. case regexpTag:
  6927. return cloneRegExp(object);
  6928. case setTag:
  6929. return new Ctor;
  6930. case symbolTag:
  6931. return cloneSymbol(object);
  6932. }
  6933. }
  6934. /**
  6935. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6936. *
  6937. * @private
  6938. * @param {string} source The source to modify.
  6939. * @returns {Array} details The details to insert.
  6940. * @returns {string} Returns the modified source.
  6941. */
  6942. function insertWrapDetails(source, details) {
  6943. var length = details.length;
  6944. if (!length) {
  6945. return source;
  6946. }
  6947. var lastIndex = length - 1;
  6948. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6949. details = details.join(length > 2 ? ', ' : ' ');
  6950. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6951. }
  6952. /**
  6953. * Checks if `value` is a flattenable `arguments` object or array.
  6954. *
  6955. * @private
  6956. * @param {*} value The value to check.
  6957. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6958. */
  6959. function isFlattenable(value) {
  6960. return isArray(value) || isArguments(value) ||
  6961. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6962. }
  6963. /**
  6964. * Checks if `value` is a valid array-like index.
  6965. *
  6966. * @private
  6967. * @param {*} value The value to check.
  6968. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6969. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6970. */
  6971. function isIndex(value, length) {
  6972. var type = typeof value;
  6973. length = length == null ? MAX_SAFE_INTEGER : length;
  6974. return !!length &&
  6975. (type == 'number' ||
  6976. (type != 'symbol' && reIsUint.test(value))) &&
  6977. (value > -1 && value % 1 == 0 && value < length);
  6978. }
  6979. /**
  6980. * Checks if the given arguments are from an iteratee call.
  6981. *
  6982. * @private
  6983. * @param {*} value The potential iteratee value argument.
  6984. * @param {*} index The potential iteratee index or key argument.
  6985. * @param {*} object The potential iteratee object argument.
  6986. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6987. * else `false`.
  6988. */
  6989. function isIterateeCall(value, index, object) {
  6990. if (!isObject(object)) {
  6991. return false;
  6992. }
  6993. var type = typeof index;
  6994. if (type == 'number'
  6995. ? (isArrayLike(object) && isIndex(index, object.length))
  6996. : (type == 'string' && index in object)
  6997. ) {
  6998. return eq(object[index], value);
  6999. }
  7000. return false;
  7001. }
  7002. /**
  7003. * Checks if `value` is a property name and not a property path.
  7004. *
  7005. * @private
  7006. * @param {*} value The value to check.
  7007. * @param {Object} [object] The object to query keys on.
  7008. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7009. */
  7010. function isKey(value, object) {
  7011. if (isArray(value)) {
  7012. return false;
  7013. }
  7014. var type = typeof value;
  7015. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7016. value == null || isSymbol(value)) {
  7017. return true;
  7018. }
  7019. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7020. (object != null && value in Object(object));
  7021. }
  7022. /**
  7023. * Checks if `value` is suitable for use as unique object key.
  7024. *
  7025. * @private
  7026. * @param {*} value The value to check.
  7027. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7028. */
  7029. function isKeyable(value) {
  7030. var type = typeof value;
  7031. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7032. ? (value !== '__proto__')
  7033. : (value === null);
  7034. }
  7035. /**
  7036. * Checks if `func` has a lazy counterpart.
  7037. *
  7038. * @private
  7039. * @param {Function} func The function to check.
  7040. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7041. * else `false`.
  7042. */
  7043. function isLaziable(func) {
  7044. var funcName = getFuncName(func),
  7045. other = lodash[funcName];
  7046. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7047. return false;
  7048. }
  7049. if (func === other) {
  7050. return true;
  7051. }
  7052. var data = getData(other);
  7053. return !!data && func === data[0];
  7054. }
  7055. /**
  7056. * Checks if `func` has its source masked.
  7057. *
  7058. * @private
  7059. * @param {Function} func The function to check.
  7060. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7061. */
  7062. function isMasked(func) {
  7063. return !!maskSrcKey && (maskSrcKey in func);
  7064. }
  7065. /**
  7066. * Checks if `func` is capable of being masked.
  7067. *
  7068. * @private
  7069. * @param {*} value The value to check.
  7070. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7071. */
  7072. var isMaskable = coreJsData ? isFunction : stubFalse;
  7073. /**
  7074. * Checks if `value` is likely a prototype object.
  7075. *
  7076. * @private
  7077. * @param {*} value The value to check.
  7078. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7079. */
  7080. function isPrototype(value) {
  7081. var Ctor = value && value.constructor,
  7082. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7083. return value === proto;
  7084. }
  7085. /**
  7086. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7087. *
  7088. * @private
  7089. * @param {*} value The value to check.
  7090. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7091. * equality comparisons, else `false`.
  7092. */
  7093. function isStrictComparable(value) {
  7094. return value === value && !isObject(value);
  7095. }
  7096. /**
  7097. * A specialized version of `matchesProperty` for source values suitable
  7098. * for strict equality comparisons, i.e. `===`.
  7099. *
  7100. * @private
  7101. * @param {string} key The key of the property to get.
  7102. * @param {*} srcValue The value to match.
  7103. * @returns {Function} Returns the new spec function.
  7104. */
  7105. function matchesStrictComparable(key, srcValue) {
  7106. return function(object) {
  7107. if (object == null) {
  7108. return false;
  7109. }
  7110. return object[key] === srcValue &&
  7111. (srcValue !== undefined || (key in Object(object)));
  7112. };
  7113. }
  7114. /**
  7115. * A specialized version of `_.memoize` which clears the memoized function's
  7116. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7117. *
  7118. * @private
  7119. * @param {Function} func The function to have its output memoized.
  7120. * @returns {Function} Returns the new memoized function.
  7121. */
  7122. function memoizeCapped(func) {
  7123. var result = memoize(func, function(key) {
  7124. if (cache.size === MAX_MEMOIZE_SIZE) {
  7125. cache.clear();
  7126. }
  7127. return key;
  7128. });
  7129. var cache = result.cache;
  7130. return result;
  7131. }
  7132. /**
  7133. * Merges the function metadata of `source` into `data`.
  7134. *
  7135. * Merging metadata reduces the number of wrappers used to invoke a function.
  7136. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7137. * may be applied regardless of execution order. Methods like `_.ary` and
  7138. * `_.rearg` modify function arguments, making the order in which they are
  7139. * executed important, preventing the merging of metadata. However, we make
  7140. * an exception for a safe combined case where curried functions have `_.ary`
  7141. * and or `_.rearg` applied.
  7142. *
  7143. * @private
  7144. * @param {Array} data The destination metadata.
  7145. * @param {Array} source The source metadata.
  7146. * @returns {Array} Returns `data`.
  7147. */
  7148. function mergeData(data, source) {
  7149. var bitmask = data[1],
  7150. srcBitmask = source[1],
  7151. newBitmask = bitmask | srcBitmask,
  7152. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7153. var isCombo =
  7154. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7155. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7156. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7157. // Exit early if metadata can't be merged.
  7158. if (!(isCommon || isCombo)) {
  7159. return data;
  7160. }
  7161. // Use source `thisArg` if available.
  7162. if (srcBitmask & WRAP_BIND_FLAG) {
  7163. data[2] = source[2];
  7164. // Set when currying a bound function.
  7165. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7166. }
  7167. // Compose partial arguments.
  7168. var value = source[3];
  7169. if (value) {
  7170. var partials = data[3];
  7171. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7172. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7173. }
  7174. // Compose partial right arguments.
  7175. value = source[5];
  7176. if (value) {
  7177. partials = data[5];
  7178. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7179. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7180. }
  7181. // Use source `argPos` if available.
  7182. value = source[7];
  7183. if (value) {
  7184. data[7] = value;
  7185. }
  7186. // Use source `ary` if it's smaller.
  7187. if (srcBitmask & WRAP_ARY_FLAG) {
  7188. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7189. }
  7190. // Use source `arity` if one is not provided.
  7191. if (data[9] == null) {
  7192. data[9] = source[9];
  7193. }
  7194. // Use source `func` and merge bitmasks.
  7195. data[0] = source[0];
  7196. data[1] = newBitmask;
  7197. return data;
  7198. }
  7199. /**
  7200. * This function is like
  7201. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7202. * except that it includes inherited enumerable properties.
  7203. *
  7204. * @private
  7205. * @param {Object} object The object to query.
  7206. * @returns {Array} Returns the array of property names.
  7207. */
  7208. function nativeKeysIn(object) {
  7209. var result = [];
  7210. if (object != null) {
  7211. for (var key in Object(object)) {
  7212. result.push(key);
  7213. }
  7214. }
  7215. return result;
  7216. }
  7217. /**
  7218. * Converts `value` to a string using `Object.prototype.toString`.
  7219. *
  7220. * @private
  7221. * @param {*} value The value to convert.
  7222. * @returns {string} Returns the converted string.
  7223. */
  7224. function objectToString(value) {
  7225. return nativeObjectToString.call(value);
  7226. }
  7227. /**
  7228. * A specialized version of `baseRest` which transforms the rest array.
  7229. *
  7230. * @private
  7231. * @param {Function} func The function to apply a rest parameter to.
  7232. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7233. * @param {Function} transform The rest array transform.
  7234. * @returns {Function} Returns the new function.
  7235. */
  7236. function overRest(func, start, transform) {
  7237. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7238. return function() {
  7239. var args = arguments,
  7240. index = -1,
  7241. length = nativeMax(args.length - start, 0),
  7242. array = Array(length);
  7243. while (++index < length) {
  7244. array[index] = args[start + index];
  7245. }
  7246. index = -1;
  7247. var otherArgs = Array(start + 1);
  7248. while (++index < start) {
  7249. otherArgs[index] = args[index];
  7250. }
  7251. otherArgs[start] = transform(array);
  7252. return apply(func, this, otherArgs);
  7253. };
  7254. }
  7255. /**
  7256. * Gets the parent value at `path` of `object`.
  7257. *
  7258. * @private
  7259. * @param {Object} object The object to query.
  7260. * @param {Array} path The path to get the parent value of.
  7261. * @returns {*} Returns the parent value.
  7262. */
  7263. function parent(object, path) {
  7264. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7265. }
  7266. /**
  7267. * Reorder `array` according to the specified indexes where the element at
  7268. * the first index is assigned as the first element, the element at
  7269. * the second index is assigned as the second element, and so on.
  7270. *
  7271. * @private
  7272. * @param {Array} array The array to reorder.
  7273. * @param {Array} indexes The arranged array indexes.
  7274. * @returns {Array} Returns `array`.
  7275. */
  7276. function reorder(array, indexes) {
  7277. var arrLength = array.length,
  7278. length = nativeMin(indexes.length, arrLength),
  7279. oldArray = copyArray(array);
  7280. while (length--) {
  7281. var index = indexes[length];
  7282. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7283. }
  7284. return array;
  7285. }
  7286. /**
  7287. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7288. *
  7289. * @private
  7290. * @param {Object} object The object to query.
  7291. * @param {string} key The key of the property to get.
  7292. * @returns {*} Returns the property value.
  7293. */
  7294. function safeGet(object, key) {
  7295. if (key === 'constructor' && typeof object[key] === 'function') {
  7296. return;
  7297. }
  7298. if (key == '__proto__') {
  7299. return;
  7300. }
  7301. return object[key];
  7302. }
  7303. /**
  7304. * Sets metadata for `func`.
  7305. *
  7306. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7307. * period of time, it will trip its breaker and transition to an identity
  7308. * function to avoid garbage collection pauses in V8. See
  7309. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7310. * for more details.
  7311. *
  7312. * @private
  7313. * @param {Function} func The function to associate metadata with.
  7314. * @param {*} data The metadata.
  7315. * @returns {Function} Returns `func`.
  7316. */
  7317. var setData = shortOut(baseSetData);
  7318. /**
  7319. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7320. *
  7321. * @private
  7322. * @param {Function} func The function to delay.
  7323. * @param {number} wait The number of milliseconds to delay invocation.
  7324. * @returns {number|Object} Returns the timer id or timeout object.
  7325. */
  7326. var setTimeout = ctxSetTimeout || function(func, wait) {
  7327. return root.setTimeout(func, wait);
  7328. };
  7329. /**
  7330. * Sets the `toString` method of `func` to return `string`.
  7331. *
  7332. * @private
  7333. * @param {Function} func The function to modify.
  7334. * @param {Function} string The `toString` result.
  7335. * @returns {Function} Returns `func`.
  7336. */
  7337. var setToString = shortOut(baseSetToString);
  7338. /**
  7339. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7340. * with wrapper details in a comment at the top of the source body.
  7341. *
  7342. * @private
  7343. * @param {Function} wrapper The function to modify.
  7344. * @param {Function} reference The reference function.
  7345. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7346. * @returns {Function} Returns `wrapper`.
  7347. */
  7348. function setWrapToString(wrapper, reference, bitmask) {
  7349. var source = (reference + '');
  7350. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7351. }
  7352. /**
  7353. * Creates a function that'll short out and invoke `identity` instead
  7354. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7355. * milliseconds.
  7356. *
  7357. * @private
  7358. * @param {Function} func The function to restrict.
  7359. * @returns {Function} Returns the new shortable function.
  7360. */
  7361. function shortOut(func) {
  7362. var count = 0,
  7363. lastCalled = 0;
  7364. return function() {
  7365. var stamp = nativeNow(),
  7366. remaining = HOT_SPAN - (stamp - lastCalled);
  7367. lastCalled = stamp;
  7368. if (remaining > 0) {
  7369. if (++count >= HOT_COUNT) {
  7370. return arguments[0];
  7371. }
  7372. } else {
  7373. count = 0;
  7374. }
  7375. return func.apply(undefined, arguments);
  7376. };
  7377. }
  7378. /**
  7379. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7380. *
  7381. * @private
  7382. * @param {Array} array The array to shuffle.
  7383. * @param {number} [size=array.length] The size of `array`.
  7384. * @returns {Array} Returns `array`.
  7385. */
  7386. function shuffleSelf(array, size) {
  7387. var index = -1,
  7388. length = array.length,
  7389. lastIndex = length - 1;
  7390. size = size === undefined ? length : size;
  7391. while (++index < size) {
  7392. var rand = baseRandom(index, lastIndex),
  7393. value = array[rand];
  7394. array[rand] = array[index];
  7395. array[index] = value;
  7396. }
  7397. array.length = size;
  7398. return array;
  7399. }
  7400. /**
  7401. * Converts `string` to a property path array.
  7402. *
  7403. * @private
  7404. * @param {string} string The string to convert.
  7405. * @returns {Array} Returns the property path array.
  7406. */
  7407. var stringToPath = memoizeCapped(function(string) {
  7408. var result = [];
  7409. if (string.charCodeAt(0) === 46 /* . */) {
  7410. result.push('');
  7411. }
  7412. string.replace(rePropName, function(match, number, quote, subString) {
  7413. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7414. });
  7415. return result;
  7416. });
  7417. /**
  7418. * Converts `value` to a string key if it's not a string or symbol.
  7419. *
  7420. * @private
  7421. * @param {*} value The value to inspect.
  7422. * @returns {string|symbol} Returns the key.
  7423. */
  7424. function toKey(value) {
  7425. if (typeof value == 'string' || isSymbol(value)) {
  7426. return value;
  7427. }
  7428. var result = (value + '');
  7429. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7430. }
  7431. /**
  7432. * Converts `func` to its source code.
  7433. *
  7434. * @private
  7435. * @param {Function} func The function to convert.
  7436. * @returns {string} Returns the source code.
  7437. */
  7438. function toSource(func) {
  7439. if (func != null) {
  7440. try {
  7441. return funcToString.call(func);
  7442. } catch (e) {}
  7443. try {
  7444. return (func + '');
  7445. } catch (e) {}
  7446. }
  7447. return '';
  7448. }
  7449. /**
  7450. * Updates wrapper `details` based on `bitmask` flags.
  7451. *
  7452. * @private
  7453. * @returns {Array} details The details to modify.
  7454. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7455. * @returns {Array} Returns `details`.
  7456. */
  7457. function updateWrapDetails(details, bitmask) {
  7458. arrayEach(wrapFlags, function(pair) {
  7459. var value = '_.' + pair[0];
  7460. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7461. details.push(value);
  7462. }
  7463. });
  7464. return details.sort();
  7465. }
  7466. /**
  7467. * Creates a clone of `wrapper`.
  7468. *
  7469. * @private
  7470. * @param {Object} wrapper The wrapper to clone.
  7471. * @returns {Object} Returns the cloned wrapper.
  7472. */
  7473. function wrapperClone(wrapper) {
  7474. if (wrapper instanceof LazyWrapper) {
  7475. return wrapper.clone();
  7476. }
  7477. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7478. result.__actions__ = copyArray(wrapper.__actions__);
  7479. result.__index__ = wrapper.__index__;
  7480. result.__values__ = wrapper.__values__;
  7481. return result;
  7482. }
  7483. /*------------------------------------------------------------------------*/
  7484. /**
  7485. * Creates an array of elements split into groups the length of `size`.
  7486. * If `array` can't be split evenly, the final chunk will be the remaining
  7487. * elements.
  7488. *
  7489. * @static
  7490. * @memberOf _
  7491. * @since 3.0.0
  7492. * @category Array
  7493. * @param {Array} array The array to process.
  7494. * @param {number} [size=1] The length of each chunk
  7495. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7496. * @returns {Array} Returns the new array of chunks.
  7497. * @example
  7498. *
  7499. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7500. * // => [['a', 'b'], ['c', 'd']]
  7501. *
  7502. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7503. * // => [['a', 'b', 'c'], ['d']]
  7504. */
  7505. function chunk(array, size, guard) {
  7506. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7507. size = 1;
  7508. } else {
  7509. size = nativeMax(toInteger(size), 0);
  7510. }
  7511. var length = array == null ? 0 : array.length;
  7512. if (!length || size < 1) {
  7513. return [];
  7514. }
  7515. var index = 0,
  7516. resIndex = 0,
  7517. result = Array(nativeCeil(length / size));
  7518. while (index < length) {
  7519. result[resIndex++] = baseSlice(array, index, (index += size));
  7520. }
  7521. return result;
  7522. }
  7523. /**
  7524. * Creates an array with all falsey values removed. The values `false`, `null`,
  7525. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7526. *
  7527. * @static
  7528. * @memberOf _
  7529. * @since 0.1.0
  7530. * @category Array
  7531. * @param {Array} array The array to compact.
  7532. * @returns {Array} Returns the new array of filtered values.
  7533. * @example
  7534. *
  7535. * _.compact([0, 1, false, 2, '', 3]);
  7536. * // => [1, 2, 3]
  7537. */
  7538. function compact(array) {
  7539. var index = -1,
  7540. length = array == null ? 0 : array.length,
  7541. resIndex = 0,
  7542. result = [];
  7543. while (++index < length) {
  7544. var value = array[index];
  7545. if (value) {
  7546. result[resIndex++] = value;
  7547. }
  7548. }
  7549. return result;
  7550. }
  7551. /**
  7552. * Creates a new array concatenating `array` with any additional arrays
  7553. * and/or values.
  7554. *
  7555. * @static
  7556. * @memberOf _
  7557. * @since 4.0.0
  7558. * @category Array
  7559. * @param {Array} array The array to concatenate.
  7560. * @param {...*} [values] The values to concatenate.
  7561. * @returns {Array} Returns the new concatenated array.
  7562. * @example
  7563. *
  7564. * var array = [1];
  7565. * var other = _.concat(array, 2, [3], [[4]]);
  7566. *
  7567. * console.log(other);
  7568. * // => [1, 2, 3, [4]]
  7569. *
  7570. * console.log(array);
  7571. * // => [1]
  7572. */
  7573. function concat() {
  7574. var length = arguments.length;
  7575. if (!length) {
  7576. return [];
  7577. }
  7578. var args = Array(length - 1),
  7579. array = arguments[0],
  7580. index = length;
  7581. while (index--) {
  7582. args[index - 1] = arguments[index];
  7583. }
  7584. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7585. }
  7586. /**
  7587. * Creates an array of `array` values not included in the other given arrays
  7588. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7589. * for equality comparisons. The order and references of result values are
  7590. * determined by the first array.
  7591. *
  7592. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7593. *
  7594. * @static
  7595. * @memberOf _
  7596. * @since 0.1.0
  7597. * @category Array
  7598. * @param {Array} array The array to inspect.
  7599. * @param {...Array} [values] The values to exclude.
  7600. * @returns {Array} Returns the new array of filtered values.
  7601. * @see _.without, _.xor
  7602. * @example
  7603. *
  7604. * _.difference([2, 1], [2, 3]);
  7605. * // => [1]
  7606. */
  7607. var difference = baseRest(function(array, values) {
  7608. return isArrayLikeObject(array)
  7609. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7610. : [];
  7611. });
  7612. /**
  7613. * This method is like `_.difference` except that it accepts `iteratee` which
  7614. * is invoked for each element of `array` and `values` to generate the criterion
  7615. * by which they're compared. The order and references of result values are
  7616. * determined by the first array. The iteratee is invoked with one argument:
  7617. * (value).
  7618. *
  7619. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7620. *
  7621. * @static
  7622. * @memberOf _
  7623. * @since 4.0.0
  7624. * @category Array
  7625. * @param {Array} array The array to inspect.
  7626. * @param {...Array} [values] The values to exclude.
  7627. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7628. * @returns {Array} Returns the new array of filtered values.
  7629. * @example
  7630. *
  7631. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7632. * // => [1.2]
  7633. *
  7634. * // The `_.property` iteratee shorthand.
  7635. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7636. * // => [{ 'x': 2 }]
  7637. */
  7638. var differenceBy = baseRest(function(array, values) {
  7639. var iteratee = last(values);
  7640. if (isArrayLikeObject(iteratee)) {
  7641. iteratee = undefined;
  7642. }
  7643. return isArrayLikeObject(array)
  7644. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7645. : [];
  7646. });
  7647. /**
  7648. * This method is like `_.difference` except that it accepts `comparator`
  7649. * which is invoked to compare elements of `array` to `values`. The order and
  7650. * references of result values are determined by the first array. The comparator
  7651. * is invoked with two arguments: (arrVal, othVal).
  7652. *
  7653. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7654. *
  7655. * @static
  7656. * @memberOf _
  7657. * @since 4.0.0
  7658. * @category Array
  7659. * @param {Array} array The array to inspect.
  7660. * @param {...Array} [values] The values to exclude.
  7661. * @param {Function} [comparator] The comparator invoked per element.
  7662. * @returns {Array} Returns the new array of filtered values.
  7663. * @example
  7664. *
  7665. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7666. *
  7667. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7668. * // => [{ 'x': 2, 'y': 1 }]
  7669. */
  7670. var differenceWith = baseRest(function(array, values) {
  7671. var comparator = last(values);
  7672. if (isArrayLikeObject(comparator)) {
  7673. comparator = undefined;
  7674. }
  7675. return isArrayLikeObject(array)
  7676. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7677. : [];
  7678. });
  7679. /**
  7680. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7681. *
  7682. * @static
  7683. * @memberOf _
  7684. * @since 0.5.0
  7685. * @category Array
  7686. * @param {Array} array The array to query.
  7687. * @param {number} [n=1] The number of elements to drop.
  7688. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7689. * @returns {Array} Returns the slice of `array`.
  7690. * @example
  7691. *
  7692. * _.drop([1, 2, 3]);
  7693. * // => [2, 3]
  7694. *
  7695. * _.drop([1, 2, 3], 2);
  7696. * // => [3]
  7697. *
  7698. * _.drop([1, 2, 3], 5);
  7699. * // => []
  7700. *
  7701. * _.drop([1, 2, 3], 0);
  7702. * // => [1, 2, 3]
  7703. */
  7704. function drop(array, n, guard) {
  7705. var length = array == null ? 0 : array.length;
  7706. if (!length) {
  7707. return [];
  7708. }
  7709. n = (guard || n === undefined) ? 1 : toInteger(n);
  7710. return baseSlice(array, n < 0 ? 0 : n, length);
  7711. }
  7712. /**
  7713. * Creates a slice of `array` with `n` elements dropped from the end.
  7714. *
  7715. * @static
  7716. * @memberOf _
  7717. * @since 3.0.0
  7718. * @category Array
  7719. * @param {Array} array The array to query.
  7720. * @param {number} [n=1] The number of elements to drop.
  7721. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7722. * @returns {Array} Returns the slice of `array`.
  7723. * @example
  7724. *
  7725. * _.dropRight([1, 2, 3]);
  7726. * // => [1, 2]
  7727. *
  7728. * _.dropRight([1, 2, 3], 2);
  7729. * // => [1]
  7730. *
  7731. * _.dropRight([1, 2, 3], 5);
  7732. * // => []
  7733. *
  7734. * _.dropRight([1, 2, 3], 0);
  7735. * // => [1, 2, 3]
  7736. */
  7737. function dropRight(array, n, guard) {
  7738. var length = array == null ? 0 : array.length;
  7739. if (!length) {
  7740. return [];
  7741. }
  7742. n = (guard || n === undefined) ? 1 : toInteger(n);
  7743. n = length - n;
  7744. return baseSlice(array, 0, n < 0 ? 0 : n);
  7745. }
  7746. /**
  7747. * Creates a slice of `array` excluding elements dropped from the end.
  7748. * Elements are dropped until `predicate` returns falsey. The predicate is
  7749. * invoked with three arguments: (value, index, array).
  7750. *
  7751. * @static
  7752. * @memberOf _
  7753. * @since 3.0.0
  7754. * @category Array
  7755. * @param {Array} array The array to query.
  7756. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7757. * @returns {Array} Returns the slice of `array`.
  7758. * @example
  7759. *
  7760. * var users = [
  7761. * { 'user': 'barney', 'active': true },
  7762. * { 'user': 'fred', 'active': false },
  7763. * { 'user': 'pebbles', 'active': false }
  7764. * ];
  7765. *
  7766. * _.dropRightWhile(users, function(o) { return !o.active; });
  7767. * // => objects for ['barney']
  7768. *
  7769. * // The `_.matches` iteratee shorthand.
  7770. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7771. * // => objects for ['barney', 'fred']
  7772. *
  7773. * // The `_.matchesProperty` iteratee shorthand.
  7774. * _.dropRightWhile(users, ['active', false]);
  7775. * // => objects for ['barney']
  7776. *
  7777. * // The `_.property` iteratee shorthand.
  7778. * _.dropRightWhile(users, 'active');
  7779. * // => objects for ['barney', 'fred', 'pebbles']
  7780. */
  7781. function dropRightWhile(array, predicate) {
  7782. return (array && array.length)
  7783. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7784. : [];
  7785. }
  7786. /**
  7787. * Creates a slice of `array` excluding elements dropped from the beginning.
  7788. * Elements are dropped until `predicate` returns falsey. The predicate is
  7789. * invoked with three arguments: (value, index, array).
  7790. *
  7791. * @static
  7792. * @memberOf _
  7793. * @since 3.0.0
  7794. * @category Array
  7795. * @param {Array} array The array to query.
  7796. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7797. * @returns {Array} Returns the slice of `array`.
  7798. * @example
  7799. *
  7800. * var users = [
  7801. * { 'user': 'barney', 'active': false },
  7802. * { 'user': 'fred', 'active': false },
  7803. * { 'user': 'pebbles', 'active': true }
  7804. * ];
  7805. *
  7806. * _.dropWhile(users, function(o) { return !o.active; });
  7807. * // => objects for ['pebbles']
  7808. *
  7809. * // The `_.matches` iteratee shorthand.
  7810. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7811. * // => objects for ['fred', 'pebbles']
  7812. *
  7813. * // The `_.matchesProperty` iteratee shorthand.
  7814. * _.dropWhile(users, ['active', false]);
  7815. * // => objects for ['pebbles']
  7816. *
  7817. * // The `_.property` iteratee shorthand.
  7818. * _.dropWhile(users, 'active');
  7819. * // => objects for ['barney', 'fred', 'pebbles']
  7820. */
  7821. function dropWhile(array, predicate) {
  7822. return (array && array.length)
  7823. ? baseWhile(array, getIteratee(predicate, 3), true)
  7824. : [];
  7825. }
  7826. /**
  7827. * Fills elements of `array` with `value` from `start` up to, but not
  7828. * including, `end`.
  7829. *
  7830. * **Note:** This method mutates `array`.
  7831. *
  7832. * @static
  7833. * @memberOf _
  7834. * @since 3.2.0
  7835. * @category Array
  7836. * @param {Array} array The array to fill.
  7837. * @param {*} value The value to fill `array` with.
  7838. * @param {number} [start=0] The start position.
  7839. * @param {number} [end=array.length] The end position.
  7840. * @returns {Array} Returns `array`.
  7841. * @example
  7842. *
  7843. * var array = [1, 2, 3];
  7844. *
  7845. * _.fill(array, 'a');
  7846. * console.log(array);
  7847. * // => ['a', 'a', 'a']
  7848. *
  7849. * _.fill(Array(3), 2);
  7850. * // => [2, 2, 2]
  7851. *
  7852. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7853. * // => [4, '*', '*', 10]
  7854. */
  7855. function fill(array, value, start, end) {
  7856. var length = array == null ? 0 : array.length;
  7857. if (!length) {
  7858. return [];
  7859. }
  7860. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7861. start = 0;
  7862. end = length;
  7863. }
  7864. return baseFill(array, value, start, end);
  7865. }
  7866. /**
  7867. * This method is like `_.find` except that it returns the index of the first
  7868. * element `predicate` returns truthy for instead of the element itself.
  7869. *
  7870. * @static
  7871. * @memberOf _
  7872. * @since 1.1.0
  7873. * @category Array
  7874. * @param {Array} array The array to inspect.
  7875. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7876. * @param {number} [fromIndex=0] The index to search from.
  7877. * @returns {number} Returns the index of the found element, else `-1`.
  7878. * @example
  7879. *
  7880. * var users = [
  7881. * { 'user': 'barney', 'active': false },
  7882. * { 'user': 'fred', 'active': false },
  7883. * { 'user': 'pebbles', 'active': true }
  7884. * ];
  7885. *
  7886. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7887. * // => 0
  7888. *
  7889. * // The `_.matches` iteratee shorthand.
  7890. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7891. * // => 1
  7892. *
  7893. * // The `_.matchesProperty` iteratee shorthand.
  7894. * _.findIndex(users, ['active', false]);
  7895. * // => 0
  7896. *
  7897. * // The `_.property` iteratee shorthand.
  7898. * _.findIndex(users, 'active');
  7899. * // => 2
  7900. */
  7901. function findIndex(array, predicate, fromIndex) {
  7902. var length = array == null ? 0 : array.length;
  7903. if (!length) {
  7904. return -1;
  7905. }
  7906. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7907. if (index < 0) {
  7908. index = nativeMax(length + index, 0);
  7909. }
  7910. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7911. }
  7912. /**
  7913. * This method is like `_.findIndex` except that it iterates over elements
  7914. * of `collection` from right to left.
  7915. *
  7916. * @static
  7917. * @memberOf _
  7918. * @since 2.0.0
  7919. * @category Array
  7920. * @param {Array} array The array to inspect.
  7921. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7922. * @param {number} [fromIndex=array.length-1] The index to search from.
  7923. * @returns {number} Returns the index of the found element, else `-1`.
  7924. * @example
  7925. *
  7926. * var users = [
  7927. * { 'user': 'barney', 'active': true },
  7928. * { 'user': 'fred', 'active': false },
  7929. * { 'user': 'pebbles', 'active': false }
  7930. * ];
  7931. *
  7932. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7933. * // => 2
  7934. *
  7935. * // The `_.matches` iteratee shorthand.
  7936. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7937. * // => 0
  7938. *
  7939. * // The `_.matchesProperty` iteratee shorthand.
  7940. * _.findLastIndex(users, ['active', false]);
  7941. * // => 2
  7942. *
  7943. * // The `_.property` iteratee shorthand.
  7944. * _.findLastIndex(users, 'active');
  7945. * // => 0
  7946. */
  7947. function findLastIndex(array, predicate, fromIndex) {
  7948. var length = array == null ? 0 : array.length;
  7949. if (!length) {
  7950. return -1;
  7951. }
  7952. var index = length - 1;
  7953. if (fromIndex !== undefined) {
  7954. index = toInteger(fromIndex);
  7955. index = fromIndex < 0
  7956. ? nativeMax(length + index, 0)
  7957. : nativeMin(index, length - 1);
  7958. }
  7959. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7960. }
  7961. /**
  7962. * Flattens `array` a single level deep.
  7963. *
  7964. * @static
  7965. * @memberOf _
  7966. * @since 0.1.0
  7967. * @category Array
  7968. * @param {Array} array The array to flatten.
  7969. * @returns {Array} Returns the new flattened array.
  7970. * @example
  7971. *
  7972. * _.flatten([1, [2, [3, [4]], 5]]);
  7973. * // => [1, 2, [3, [4]], 5]
  7974. */
  7975. function flatten(array) {
  7976. var length = array == null ? 0 : array.length;
  7977. return length ? baseFlatten(array, 1) : [];
  7978. }
  7979. /**
  7980. * Recursively flattens `array`.
  7981. *
  7982. * @static
  7983. * @memberOf _
  7984. * @since 3.0.0
  7985. * @category Array
  7986. * @param {Array} array The array to flatten.
  7987. * @returns {Array} Returns the new flattened array.
  7988. * @example
  7989. *
  7990. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7991. * // => [1, 2, 3, 4, 5]
  7992. */
  7993. function flattenDeep(array) {
  7994. var length = array == null ? 0 : array.length;
  7995. return length ? baseFlatten(array, INFINITY) : [];
  7996. }
  7997. /**
  7998. * Recursively flatten `array` up to `depth` times.
  7999. *
  8000. * @static
  8001. * @memberOf _
  8002. * @since 4.4.0
  8003. * @category Array
  8004. * @param {Array} array The array to flatten.
  8005. * @param {number} [depth=1] The maximum recursion depth.
  8006. * @returns {Array} Returns the new flattened array.
  8007. * @example
  8008. *
  8009. * var array = [1, [2, [3, [4]], 5]];
  8010. *
  8011. * _.flattenDepth(array, 1);
  8012. * // => [1, 2, [3, [4]], 5]
  8013. *
  8014. * _.flattenDepth(array, 2);
  8015. * // => [1, 2, 3, [4], 5]
  8016. */
  8017. function flattenDepth(array, depth) {
  8018. var length = array == null ? 0 : array.length;
  8019. if (!length) {
  8020. return [];
  8021. }
  8022. depth = depth === undefined ? 1 : toInteger(depth);
  8023. return baseFlatten(array, depth);
  8024. }
  8025. /**
  8026. * The inverse of `_.toPairs`; this method returns an object composed
  8027. * from key-value `pairs`.
  8028. *
  8029. * @static
  8030. * @memberOf _
  8031. * @since 4.0.0
  8032. * @category Array
  8033. * @param {Array} pairs The key-value pairs.
  8034. * @returns {Object} Returns the new object.
  8035. * @example
  8036. *
  8037. * _.fromPairs([['a', 1], ['b', 2]]);
  8038. * // => { 'a': 1, 'b': 2 }
  8039. */
  8040. function fromPairs(pairs) {
  8041. var index = -1,
  8042. length = pairs == null ? 0 : pairs.length,
  8043. result = {};
  8044. while (++index < length) {
  8045. var pair = pairs[index];
  8046. result[pair[0]] = pair[1];
  8047. }
  8048. return result;
  8049. }
  8050. /**
  8051. * Gets the first element of `array`.
  8052. *
  8053. * @static
  8054. * @memberOf _
  8055. * @since 0.1.0
  8056. * @alias first
  8057. * @category Array
  8058. * @param {Array} array The array to query.
  8059. * @returns {*} Returns the first element of `array`.
  8060. * @example
  8061. *
  8062. * _.head([1, 2, 3]);
  8063. * // => 1
  8064. *
  8065. * _.head([]);
  8066. * // => undefined
  8067. */
  8068. function head(array) {
  8069. return (array && array.length) ? array[0] : undefined;
  8070. }
  8071. /**
  8072. * Gets the index at which the first occurrence of `value` is found in `array`
  8073. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8074. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8075. * offset from the end of `array`.
  8076. *
  8077. * @static
  8078. * @memberOf _
  8079. * @since 0.1.0
  8080. * @category Array
  8081. * @param {Array} array The array to inspect.
  8082. * @param {*} value The value to search for.
  8083. * @param {number} [fromIndex=0] The index to search from.
  8084. * @returns {number} Returns the index of the matched value, else `-1`.
  8085. * @example
  8086. *
  8087. * _.indexOf([1, 2, 1, 2], 2);
  8088. * // => 1
  8089. *
  8090. * // Search from the `fromIndex`.
  8091. * _.indexOf([1, 2, 1, 2], 2, 2);
  8092. * // => 3
  8093. */
  8094. function indexOf(array, value, fromIndex) {
  8095. var length = array == null ? 0 : array.length;
  8096. if (!length) {
  8097. return -1;
  8098. }
  8099. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8100. if (index < 0) {
  8101. index = nativeMax(length + index, 0);
  8102. }
  8103. return baseIndexOf(array, value, index);
  8104. }
  8105. /**
  8106. * Gets all but the last element of `array`.
  8107. *
  8108. * @static
  8109. * @memberOf _
  8110. * @since 0.1.0
  8111. * @category Array
  8112. * @param {Array} array The array to query.
  8113. * @returns {Array} Returns the slice of `array`.
  8114. * @example
  8115. *
  8116. * _.initial([1, 2, 3]);
  8117. * // => [1, 2]
  8118. */
  8119. function initial(array) {
  8120. var length = array == null ? 0 : array.length;
  8121. return length ? baseSlice(array, 0, -1) : [];
  8122. }
  8123. /**
  8124. * Creates an array of unique values that are included in all given arrays
  8125. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8126. * for equality comparisons. The order and references of result values are
  8127. * determined by the first array.
  8128. *
  8129. * @static
  8130. * @memberOf _
  8131. * @since 0.1.0
  8132. * @category Array
  8133. * @param {...Array} [arrays] The arrays to inspect.
  8134. * @returns {Array} Returns the new array of intersecting values.
  8135. * @example
  8136. *
  8137. * _.intersection([2, 1], [2, 3]);
  8138. * // => [2]
  8139. */
  8140. var intersection = baseRest(function(arrays) {
  8141. var mapped = arrayMap(arrays, castArrayLikeObject);
  8142. return (mapped.length && mapped[0] === arrays[0])
  8143. ? baseIntersection(mapped)
  8144. : [];
  8145. });
  8146. /**
  8147. * This method is like `_.intersection` except that it accepts `iteratee`
  8148. * which is invoked for each element of each `arrays` to generate the criterion
  8149. * by which they're compared. The order and references of result values are
  8150. * determined by the first array. The iteratee is invoked with one argument:
  8151. * (value).
  8152. *
  8153. * @static
  8154. * @memberOf _
  8155. * @since 4.0.0
  8156. * @category Array
  8157. * @param {...Array} [arrays] The arrays to inspect.
  8158. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8159. * @returns {Array} Returns the new array of intersecting values.
  8160. * @example
  8161. *
  8162. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8163. * // => [2.1]
  8164. *
  8165. * // The `_.property` iteratee shorthand.
  8166. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8167. * // => [{ 'x': 1 }]
  8168. */
  8169. var intersectionBy = baseRest(function(arrays) {
  8170. var iteratee = last(arrays),
  8171. mapped = arrayMap(arrays, castArrayLikeObject);
  8172. if (iteratee === last(mapped)) {
  8173. iteratee = undefined;
  8174. } else {
  8175. mapped.pop();
  8176. }
  8177. return (mapped.length && mapped[0] === arrays[0])
  8178. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8179. : [];
  8180. });
  8181. /**
  8182. * This method is like `_.intersection` except that it accepts `comparator`
  8183. * which is invoked to compare elements of `arrays`. The order and references
  8184. * of result values are determined by the first array. The comparator is
  8185. * invoked with two arguments: (arrVal, othVal).
  8186. *
  8187. * @static
  8188. * @memberOf _
  8189. * @since 4.0.0
  8190. * @category Array
  8191. * @param {...Array} [arrays] The arrays to inspect.
  8192. * @param {Function} [comparator] The comparator invoked per element.
  8193. * @returns {Array} Returns the new array of intersecting values.
  8194. * @example
  8195. *
  8196. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8197. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8198. *
  8199. * _.intersectionWith(objects, others, _.isEqual);
  8200. * // => [{ 'x': 1, 'y': 2 }]
  8201. */
  8202. var intersectionWith = baseRest(function(arrays) {
  8203. var comparator = last(arrays),
  8204. mapped = arrayMap(arrays, castArrayLikeObject);
  8205. comparator = typeof comparator == 'function' ? comparator : undefined;
  8206. if (comparator) {
  8207. mapped.pop();
  8208. }
  8209. return (mapped.length && mapped[0] === arrays[0])
  8210. ? baseIntersection(mapped, undefined, comparator)
  8211. : [];
  8212. });
  8213. /**
  8214. * Converts all elements in `array` into a string separated by `separator`.
  8215. *
  8216. * @static
  8217. * @memberOf _
  8218. * @since 4.0.0
  8219. * @category Array
  8220. * @param {Array} array The array to convert.
  8221. * @param {string} [separator=','] The element separator.
  8222. * @returns {string} Returns the joined string.
  8223. * @example
  8224. *
  8225. * _.join(['a', 'b', 'c'], '~');
  8226. * // => 'a~b~c'
  8227. */
  8228. function join(array, separator) {
  8229. return array == null ? '' : nativeJoin.call(array, separator);
  8230. }
  8231. /**
  8232. * Gets the last element of `array`.
  8233. *
  8234. * @static
  8235. * @memberOf _
  8236. * @since 0.1.0
  8237. * @category Array
  8238. * @param {Array} array The array to query.
  8239. * @returns {*} Returns the last element of `array`.
  8240. * @example
  8241. *
  8242. * _.last([1, 2, 3]);
  8243. * // => 3
  8244. */
  8245. function last(array) {
  8246. var length = array == null ? 0 : array.length;
  8247. return length ? array[length - 1] : undefined;
  8248. }
  8249. /**
  8250. * This method is like `_.indexOf` except that it iterates over elements of
  8251. * `array` from right to left.
  8252. *
  8253. * @static
  8254. * @memberOf _
  8255. * @since 0.1.0
  8256. * @category Array
  8257. * @param {Array} array The array to inspect.
  8258. * @param {*} value The value to search for.
  8259. * @param {number} [fromIndex=array.length-1] The index to search from.
  8260. * @returns {number} Returns the index of the matched value, else `-1`.
  8261. * @example
  8262. *
  8263. * _.lastIndexOf([1, 2, 1, 2], 2);
  8264. * // => 3
  8265. *
  8266. * // Search from the `fromIndex`.
  8267. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8268. * // => 1
  8269. */
  8270. function lastIndexOf(array, value, fromIndex) {
  8271. var length = array == null ? 0 : array.length;
  8272. if (!length) {
  8273. return -1;
  8274. }
  8275. var index = length;
  8276. if (fromIndex !== undefined) {
  8277. index = toInteger(fromIndex);
  8278. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8279. }
  8280. return value === value
  8281. ? strictLastIndexOf(array, value, index)
  8282. : baseFindIndex(array, baseIsNaN, index, true);
  8283. }
  8284. /**
  8285. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8286. * element from the end is returned.
  8287. *
  8288. * @static
  8289. * @memberOf _
  8290. * @since 4.11.0
  8291. * @category Array
  8292. * @param {Array} array The array to query.
  8293. * @param {number} [n=0] The index of the element to return.
  8294. * @returns {*} Returns the nth element of `array`.
  8295. * @example
  8296. *
  8297. * var array = ['a', 'b', 'c', 'd'];
  8298. *
  8299. * _.nth(array, 1);
  8300. * // => 'b'
  8301. *
  8302. * _.nth(array, -2);
  8303. * // => 'c';
  8304. */
  8305. function nth(array, n) {
  8306. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8307. }
  8308. /**
  8309. * Removes all given values from `array` using
  8310. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8311. * for equality comparisons.
  8312. *
  8313. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8314. * to remove elements from an array by predicate.
  8315. *
  8316. * @static
  8317. * @memberOf _
  8318. * @since 2.0.0
  8319. * @category Array
  8320. * @param {Array} array The array to modify.
  8321. * @param {...*} [values] The values to remove.
  8322. * @returns {Array} Returns `array`.
  8323. * @example
  8324. *
  8325. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8326. *
  8327. * _.pull(array, 'a', 'c');
  8328. * console.log(array);
  8329. * // => ['b', 'b']
  8330. */
  8331. var pull = baseRest(pullAll);
  8332. /**
  8333. * This method is like `_.pull` except that it accepts an array of values to remove.
  8334. *
  8335. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8336. *
  8337. * @static
  8338. * @memberOf _
  8339. * @since 4.0.0
  8340. * @category Array
  8341. * @param {Array} array The array to modify.
  8342. * @param {Array} values The values to remove.
  8343. * @returns {Array} Returns `array`.
  8344. * @example
  8345. *
  8346. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8347. *
  8348. * _.pullAll(array, ['a', 'c']);
  8349. * console.log(array);
  8350. * // => ['b', 'b']
  8351. */
  8352. function pullAll(array, values) {
  8353. return (array && array.length && values && values.length)
  8354. ? basePullAll(array, values)
  8355. : array;
  8356. }
  8357. /**
  8358. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8359. * invoked for each element of `array` and `values` to generate the criterion
  8360. * by which they're compared. The iteratee is invoked with one argument: (value).
  8361. *
  8362. * **Note:** Unlike `_.differenceBy`, 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. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8371. * @returns {Array} Returns `array`.
  8372. * @example
  8373. *
  8374. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8375. *
  8376. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8377. * console.log(array);
  8378. * // => [{ 'x': 2 }]
  8379. */
  8380. function pullAllBy(array, values, iteratee) {
  8381. return (array && array.length && values && values.length)
  8382. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8383. : array;
  8384. }
  8385. /**
  8386. * This method is like `_.pullAll` except that it accepts `comparator` which
  8387. * is invoked to compare elements of `array` to `values`. The comparator is
  8388. * invoked with two arguments: (arrVal, othVal).
  8389. *
  8390. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8391. *
  8392. * @static
  8393. * @memberOf _
  8394. * @since 4.6.0
  8395. * @category Array
  8396. * @param {Array} array The array to modify.
  8397. * @param {Array} values The values to remove.
  8398. * @param {Function} [comparator] The comparator invoked per element.
  8399. * @returns {Array} Returns `array`.
  8400. * @example
  8401. *
  8402. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8403. *
  8404. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8405. * console.log(array);
  8406. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8407. */
  8408. function pullAllWith(array, values, comparator) {
  8409. return (array && array.length && values && values.length)
  8410. ? basePullAll(array, values, undefined, comparator)
  8411. : array;
  8412. }
  8413. /**
  8414. * Removes elements from `array` corresponding to `indexes` and returns an
  8415. * array of removed elements.
  8416. *
  8417. * **Note:** Unlike `_.at`, this method mutates `array`.
  8418. *
  8419. * @static
  8420. * @memberOf _
  8421. * @since 3.0.0
  8422. * @category Array
  8423. * @param {Array} array The array to modify.
  8424. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8425. * @returns {Array} Returns the new array of removed elements.
  8426. * @example
  8427. *
  8428. * var array = ['a', 'b', 'c', 'd'];
  8429. * var pulled = _.pullAt(array, [1, 3]);
  8430. *
  8431. * console.log(array);
  8432. * // => ['a', 'c']
  8433. *
  8434. * console.log(pulled);
  8435. * // => ['b', 'd']
  8436. */
  8437. var pullAt = flatRest(function(array, indexes) {
  8438. var length = array == null ? 0 : array.length,
  8439. result = baseAt(array, indexes);
  8440. basePullAt(array, arrayMap(indexes, function(index) {
  8441. return isIndex(index, length) ? +index : index;
  8442. }).sort(compareAscending));
  8443. return result;
  8444. });
  8445. /**
  8446. * Removes all elements from `array` that `predicate` returns truthy for
  8447. * and returns an array of the removed elements. The predicate is invoked
  8448. * with three arguments: (value, index, array).
  8449. *
  8450. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8451. * to pull elements from an array by value.
  8452. *
  8453. * @static
  8454. * @memberOf _
  8455. * @since 2.0.0
  8456. * @category Array
  8457. * @param {Array} array The array to modify.
  8458. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8459. * @returns {Array} Returns the new array of removed elements.
  8460. * @example
  8461. *
  8462. * var array = [1, 2, 3, 4];
  8463. * var evens = _.remove(array, function(n) {
  8464. * return n % 2 == 0;
  8465. * });
  8466. *
  8467. * console.log(array);
  8468. * // => [1, 3]
  8469. *
  8470. * console.log(evens);
  8471. * // => [2, 4]
  8472. */
  8473. function remove(array, predicate) {
  8474. var result = [];
  8475. if (!(array && array.length)) {
  8476. return result;
  8477. }
  8478. var index = -1,
  8479. indexes = [],
  8480. length = array.length;
  8481. predicate = getIteratee(predicate, 3);
  8482. while (++index < length) {
  8483. var value = array[index];
  8484. if (predicate(value, index, array)) {
  8485. result.push(value);
  8486. indexes.push(index);
  8487. }
  8488. }
  8489. basePullAt(array, indexes);
  8490. return result;
  8491. }
  8492. /**
  8493. * Reverses `array` so that the first element becomes the last, the second
  8494. * element becomes the second to last, and so on.
  8495. *
  8496. * **Note:** This method mutates `array` and is based on
  8497. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8498. *
  8499. * @static
  8500. * @memberOf _
  8501. * @since 4.0.0
  8502. * @category Array
  8503. * @param {Array} array The array to modify.
  8504. * @returns {Array} Returns `array`.
  8505. * @example
  8506. *
  8507. * var array = [1, 2, 3];
  8508. *
  8509. * _.reverse(array);
  8510. * // => [3, 2, 1]
  8511. *
  8512. * console.log(array);
  8513. * // => [3, 2, 1]
  8514. */
  8515. function reverse(array) {
  8516. return array == null ? array : nativeReverse.call(array);
  8517. }
  8518. /**
  8519. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8520. *
  8521. * **Note:** This method is used instead of
  8522. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8523. * returned.
  8524. *
  8525. * @static
  8526. * @memberOf _
  8527. * @since 3.0.0
  8528. * @category Array
  8529. * @param {Array} array The array to slice.
  8530. * @param {number} [start=0] The start position.
  8531. * @param {number} [end=array.length] The end position.
  8532. * @returns {Array} Returns the slice of `array`.
  8533. */
  8534. function slice(array, start, end) {
  8535. var length = array == null ? 0 : array.length;
  8536. if (!length) {
  8537. return [];
  8538. }
  8539. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8540. start = 0;
  8541. end = length;
  8542. }
  8543. else {
  8544. start = start == null ? 0 : toInteger(start);
  8545. end = end === undefined ? length : toInteger(end);
  8546. }
  8547. return baseSlice(array, start, end);
  8548. }
  8549. /**
  8550. * Uses a binary search to determine the lowest index at which `value`
  8551. * should be inserted into `array` in order to maintain its sort order.
  8552. *
  8553. * @static
  8554. * @memberOf _
  8555. * @since 0.1.0
  8556. * @category Array
  8557. * @param {Array} array The sorted array to inspect.
  8558. * @param {*} value The value to evaluate.
  8559. * @returns {number} Returns the index at which `value` should be inserted
  8560. * into `array`.
  8561. * @example
  8562. *
  8563. * _.sortedIndex([30, 50], 40);
  8564. * // => 1
  8565. */
  8566. function sortedIndex(array, value) {
  8567. return baseSortedIndex(array, value);
  8568. }
  8569. /**
  8570. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8571. * which is invoked for `value` and each element of `array` to compute their
  8572. * sort ranking. The iteratee is invoked with one argument: (value).
  8573. *
  8574. * @static
  8575. * @memberOf _
  8576. * @since 4.0.0
  8577. * @category Array
  8578. * @param {Array} array The sorted array to inspect.
  8579. * @param {*} value The value to evaluate.
  8580. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8581. * @returns {number} Returns the index at which `value` should be inserted
  8582. * into `array`.
  8583. * @example
  8584. *
  8585. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8586. *
  8587. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8588. * // => 0
  8589. *
  8590. * // The `_.property` iteratee shorthand.
  8591. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8592. * // => 0
  8593. */
  8594. function sortedIndexBy(array, value, iteratee) {
  8595. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8596. }
  8597. /**
  8598. * This method is like `_.indexOf` except that it performs a binary
  8599. * search on a sorted `array`.
  8600. *
  8601. * @static
  8602. * @memberOf _
  8603. * @since 4.0.0
  8604. * @category Array
  8605. * @param {Array} array The array to inspect.
  8606. * @param {*} value The value to search for.
  8607. * @returns {number} Returns the index of the matched value, else `-1`.
  8608. * @example
  8609. *
  8610. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8611. * // => 1
  8612. */
  8613. function sortedIndexOf(array, value) {
  8614. var length = array == null ? 0 : array.length;
  8615. if (length) {
  8616. var index = baseSortedIndex(array, value);
  8617. if (index < length && eq(array[index], value)) {
  8618. return index;
  8619. }
  8620. }
  8621. return -1;
  8622. }
  8623. /**
  8624. * This method is like `_.sortedIndex` except that it returns the highest
  8625. * index at which `value` should be inserted into `array` in order to
  8626. * maintain its sort order.
  8627. *
  8628. * @static
  8629. * @memberOf _
  8630. * @since 3.0.0
  8631. * @category Array
  8632. * @param {Array} array The sorted array to inspect.
  8633. * @param {*} value The value to evaluate.
  8634. * @returns {number} Returns the index at which `value` should be inserted
  8635. * into `array`.
  8636. * @example
  8637. *
  8638. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8639. * // => 4
  8640. */
  8641. function sortedLastIndex(array, value) {
  8642. return baseSortedIndex(array, value, true);
  8643. }
  8644. /**
  8645. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8646. * which is invoked for `value` and each element of `array` to compute their
  8647. * sort ranking. The iteratee is invoked with one argument: (value).
  8648. *
  8649. * @static
  8650. * @memberOf _
  8651. * @since 4.0.0
  8652. * @category Array
  8653. * @param {Array} array The sorted array to inspect.
  8654. * @param {*} value The value to evaluate.
  8655. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8656. * @returns {number} Returns the index at which `value` should be inserted
  8657. * into `array`.
  8658. * @example
  8659. *
  8660. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8661. *
  8662. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8663. * // => 1
  8664. *
  8665. * // The `_.property` iteratee shorthand.
  8666. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8667. * // => 1
  8668. */
  8669. function sortedLastIndexBy(array, value, iteratee) {
  8670. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8671. }
  8672. /**
  8673. * This method is like `_.lastIndexOf` except that it performs a binary
  8674. * search on a sorted `array`.
  8675. *
  8676. * @static
  8677. * @memberOf _
  8678. * @since 4.0.0
  8679. * @category Array
  8680. * @param {Array} array The array to inspect.
  8681. * @param {*} value The value to search for.
  8682. * @returns {number} Returns the index of the matched value, else `-1`.
  8683. * @example
  8684. *
  8685. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8686. * // => 3
  8687. */
  8688. function sortedLastIndexOf(array, value) {
  8689. var length = array == null ? 0 : array.length;
  8690. if (length) {
  8691. var index = baseSortedIndex(array, value, true) - 1;
  8692. if (eq(array[index], value)) {
  8693. return index;
  8694. }
  8695. }
  8696. return -1;
  8697. }
  8698. /**
  8699. * This method is like `_.uniq` except that it's designed and optimized
  8700. * for sorted arrays.
  8701. *
  8702. * @static
  8703. * @memberOf _
  8704. * @since 4.0.0
  8705. * @category Array
  8706. * @param {Array} array The array to inspect.
  8707. * @returns {Array} Returns the new duplicate free array.
  8708. * @example
  8709. *
  8710. * _.sortedUniq([1, 1, 2]);
  8711. * // => [1, 2]
  8712. */
  8713. function sortedUniq(array) {
  8714. return (array && array.length)
  8715. ? baseSortedUniq(array)
  8716. : [];
  8717. }
  8718. /**
  8719. * This method is like `_.uniqBy` except that it's designed and optimized
  8720. * for sorted arrays.
  8721. *
  8722. * @static
  8723. * @memberOf _
  8724. * @since 4.0.0
  8725. * @category Array
  8726. * @param {Array} array The array to inspect.
  8727. * @param {Function} [iteratee] The iteratee invoked per element.
  8728. * @returns {Array} Returns the new duplicate free array.
  8729. * @example
  8730. *
  8731. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8732. * // => [1.1, 2.3]
  8733. */
  8734. function sortedUniqBy(array, iteratee) {
  8735. return (array && array.length)
  8736. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8737. : [];
  8738. }
  8739. /**
  8740. * Gets all but the first element of `array`.
  8741. *
  8742. * @static
  8743. * @memberOf _
  8744. * @since 4.0.0
  8745. * @category Array
  8746. * @param {Array} array The array to query.
  8747. * @returns {Array} Returns the slice of `array`.
  8748. * @example
  8749. *
  8750. * _.tail([1, 2, 3]);
  8751. * // => [2, 3]
  8752. */
  8753. function tail(array) {
  8754. var length = array == null ? 0 : array.length;
  8755. return length ? baseSlice(array, 1, length) : [];
  8756. }
  8757. /**
  8758. * Creates a slice of `array` with `n` elements taken from the beginning.
  8759. *
  8760. * @static
  8761. * @memberOf _
  8762. * @since 0.1.0
  8763. * @category Array
  8764. * @param {Array} array The array to query.
  8765. * @param {number} [n=1] The number of elements to take.
  8766. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8767. * @returns {Array} Returns the slice of `array`.
  8768. * @example
  8769. *
  8770. * _.take([1, 2, 3]);
  8771. * // => [1]
  8772. *
  8773. * _.take([1, 2, 3], 2);
  8774. * // => [1, 2]
  8775. *
  8776. * _.take([1, 2, 3], 5);
  8777. * // => [1, 2, 3]
  8778. *
  8779. * _.take([1, 2, 3], 0);
  8780. * // => []
  8781. */
  8782. function take(array, n, guard) {
  8783. if (!(array && array.length)) {
  8784. return [];
  8785. }
  8786. n = (guard || n === undefined) ? 1 : toInteger(n);
  8787. return baseSlice(array, 0, n < 0 ? 0 : n);
  8788. }
  8789. /**
  8790. * Creates a slice of `array` with `n` elements taken from the end.
  8791. *
  8792. * @static
  8793. * @memberOf _
  8794. * @since 3.0.0
  8795. * @category Array
  8796. * @param {Array} array The array to query.
  8797. * @param {number} [n=1] The number of elements to take.
  8798. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8799. * @returns {Array} Returns the slice of `array`.
  8800. * @example
  8801. *
  8802. * _.takeRight([1, 2, 3]);
  8803. * // => [3]
  8804. *
  8805. * _.takeRight([1, 2, 3], 2);
  8806. * // => [2, 3]
  8807. *
  8808. * _.takeRight([1, 2, 3], 5);
  8809. * // => [1, 2, 3]
  8810. *
  8811. * _.takeRight([1, 2, 3], 0);
  8812. * // => []
  8813. */
  8814. function takeRight(array, n, guard) {
  8815. var length = array == null ? 0 : array.length;
  8816. if (!length) {
  8817. return [];
  8818. }
  8819. n = (guard || n === undefined) ? 1 : toInteger(n);
  8820. n = length - n;
  8821. return baseSlice(array, n < 0 ? 0 : n, length);
  8822. }
  8823. /**
  8824. * Creates a slice of `array` with elements taken from the end. Elements are
  8825. * taken until `predicate` returns falsey. The predicate is invoked with
  8826. * three arguments: (value, index, array).
  8827. *
  8828. * @static
  8829. * @memberOf _
  8830. * @since 3.0.0
  8831. * @category Array
  8832. * @param {Array} array The array to query.
  8833. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8834. * @returns {Array} Returns the slice of `array`.
  8835. * @example
  8836. *
  8837. * var users = [
  8838. * { 'user': 'barney', 'active': true },
  8839. * { 'user': 'fred', 'active': false },
  8840. * { 'user': 'pebbles', 'active': false }
  8841. * ];
  8842. *
  8843. * _.takeRightWhile(users, function(o) { return !o.active; });
  8844. * // => objects for ['fred', 'pebbles']
  8845. *
  8846. * // The `_.matches` iteratee shorthand.
  8847. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8848. * // => objects for ['pebbles']
  8849. *
  8850. * // The `_.matchesProperty` iteratee shorthand.
  8851. * _.takeRightWhile(users, ['active', false]);
  8852. * // => objects for ['fred', 'pebbles']
  8853. *
  8854. * // The `_.property` iteratee shorthand.
  8855. * _.takeRightWhile(users, 'active');
  8856. * // => []
  8857. */
  8858. function takeRightWhile(array, predicate) {
  8859. return (array && array.length)
  8860. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8861. : [];
  8862. }
  8863. /**
  8864. * Creates a slice of `array` with elements taken from the beginning. Elements
  8865. * are taken until `predicate` returns falsey. The predicate is invoked with
  8866. * three arguments: (value, index, array).
  8867. *
  8868. * @static
  8869. * @memberOf _
  8870. * @since 3.0.0
  8871. * @category Array
  8872. * @param {Array} array The array to query.
  8873. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8874. * @returns {Array} Returns the slice of `array`.
  8875. * @example
  8876. *
  8877. * var users = [
  8878. * { 'user': 'barney', 'active': false },
  8879. * { 'user': 'fred', 'active': false },
  8880. * { 'user': 'pebbles', 'active': true }
  8881. * ];
  8882. *
  8883. * _.takeWhile(users, function(o) { return !o.active; });
  8884. * // => objects for ['barney', 'fred']
  8885. *
  8886. * // The `_.matches` iteratee shorthand.
  8887. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8888. * // => objects for ['barney']
  8889. *
  8890. * // The `_.matchesProperty` iteratee shorthand.
  8891. * _.takeWhile(users, ['active', false]);
  8892. * // => objects for ['barney', 'fred']
  8893. *
  8894. * // The `_.property` iteratee shorthand.
  8895. * _.takeWhile(users, 'active');
  8896. * // => []
  8897. */
  8898. function takeWhile(array, predicate) {
  8899. return (array && array.length)
  8900. ? baseWhile(array, getIteratee(predicate, 3))
  8901. : [];
  8902. }
  8903. /**
  8904. * Creates an array of unique values, in order, from all given arrays using
  8905. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8906. * for equality comparisons.
  8907. *
  8908. * @static
  8909. * @memberOf _
  8910. * @since 0.1.0
  8911. * @category Array
  8912. * @param {...Array} [arrays] The arrays to inspect.
  8913. * @returns {Array} Returns the new array of combined values.
  8914. * @example
  8915. *
  8916. * _.union([2], [1, 2]);
  8917. * // => [2, 1]
  8918. */
  8919. var union = baseRest(function(arrays) {
  8920. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8921. });
  8922. /**
  8923. * This method is like `_.union` except that it accepts `iteratee` which is
  8924. * invoked for each element of each `arrays` to generate the criterion by
  8925. * which uniqueness is computed. Result values are chosen from the first
  8926. * array in which the value occurs. The iteratee is invoked with one argument:
  8927. * (value).
  8928. *
  8929. * @static
  8930. * @memberOf _
  8931. * @since 4.0.0
  8932. * @category Array
  8933. * @param {...Array} [arrays] The arrays to inspect.
  8934. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8935. * @returns {Array} Returns the new array of combined values.
  8936. * @example
  8937. *
  8938. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8939. * // => [2.1, 1.2]
  8940. *
  8941. * // The `_.property` iteratee shorthand.
  8942. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8943. * // => [{ 'x': 1 }, { 'x': 2 }]
  8944. */
  8945. var unionBy = baseRest(function(arrays) {
  8946. var iteratee = last(arrays);
  8947. if (isArrayLikeObject(iteratee)) {
  8948. iteratee = undefined;
  8949. }
  8950. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8951. });
  8952. /**
  8953. * This method is like `_.union` except that it accepts `comparator` which
  8954. * is invoked to compare elements of `arrays`. Result values are chosen from
  8955. * the first array in which the value occurs. The comparator is invoked
  8956. * with two arguments: (arrVal, othVal).
  8957. *
  8958. * @static
  8959. * @memberOf _
  8960. * @since 4.0.0
  8961. * @category Array
  8962. * @param {...Array} [arrays] The arrays to inspect.
  8963. * @param {Function} [comparator] The comparator invoked per element.
  8964. * @returns {Array} Returns the new array of combined values.
  8965. * @example
  8966. *
  8967. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8968. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8969. *
  8970. * _.unionWith(objects, others, _.isEqual);
  8971. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8972. */
  8973. var unionWith = baseRest(function(arrays) {
  8974. var comparator = last(arrays);
  8975. comparator = typeof comparator == 'function' ? comparator : undefined;
  8976. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8977. });
  8978. /**
  8979. * Creates a duplicate-free version of an array, using
  8980. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8981. * for equality comparisons, in which only the first occurrence of each element
  8982. * is kept. The order of result values is determined by the order they occur
  8983. * in the array.
  8984. *
  8985. * @static
  8986. * @memberOf _
  8987. * @since 0.1.0
  8988. * @category Array
  8989. * @param {Array} array The array to inspect.
  8990. * @returns {Array} Returns the new duplicate free array.
  8991. * @example
  8992. *
  8993. * _.uniq([2, 1, 2]);
  8994. * // => [2, 1]
  8995. */
  8996. function uniq(array) {
  8997. return (array && array.length) ? baseUniq(array) : [];
  8998. }
  8999. /**
  9000. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9001. * invoked for each element in `array` to generate the criterion by which
  9002. * uniqueness is computed. The order of result values is determined by the
  9003. * order they occur in the array. The iteratee is invoked with one argument:
  9004. * (value).
  9005. *
  9006. * @static
  9007. * @memberOf _
  9008. * @since 4.0.0
  9009. * @category Array
  9010. * @param {Array} array The array to inspect.
  9011. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9012. * @returns {Array} Returns the new duplicate free array.
  9013. * @example
  9014. *
  9015. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9016. * // => [2.1, 1.2]
  9017. *
  9018. * // The `_.property` iteratee shorthand.
  9019. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9020. * // => [{ 'x': 1 }, { 'x': 2 }]
  9021. */
  9022. function uniqBy(array, iteratee) {
  9023. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9024. }
  9025. /**
  9026. * This method is like `_.uniq` except that it accepts `comparator` which
  9027. * is invoked to compare elements of `array`. The order of result values is
  9028. * determined by the order they occur in the array.The comparator is invoked
  9029. * with two arguments: (arrVal, othVal).
  9030. *
  9031. * @static
  9032. * @memberOf _
  9033. * @since 4.0.0
  9034. * @category Array
  9035. * @param {Array} array The array to inspect.
  9036. * @param {Function} [comparator] The comparator invoked per element.
  9037. * @returns {Array} Returns the new duplicate free array.
  9038. * @example
  9039. *
  9040. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9041. *
  9042. * _.uniqWith(objects, _.isEqual);
  9043. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9044. */
  9045. function uniqWith(array, comparator) {
  9046. comparator = typeof comparator == 'function' ? comparator : undefined;
  9047. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9048. }
  9049. /**
  9050. * This method is like `_.zip` except that it accepts an array of grouped
  9051. * elements and creates an array regrouping the elements to their pre-zip
  9052. * configuration.
  9053. *
  9054. * @static
  9055. * @memberOf _
  9056. * @since 1.2.0
  9057. * @category Array
  9058. * @param {Array} array The array of grouped elements to process.
  9059. * @returns {Array} Returns the new array of regrouped elements.
  9060. * @example
  9061. *
  9062. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9063. * // => [['a', 1, true], ['b', 2, false]]
  9064. *
  9065. * _.unzip(zipped);
  9066. * // => [['a', 'b'], [1, 2], [true, false]]
  9067. */
  9068. function unzip(array) {
  9069. if (!(array && array.length)) {
  9070. return [];
  9071. }
  9072. var length = 0;
  9073. array = arrayFilter(array, function(group) {
  9074. if (isArrayLikeObject(group)) {
  9075. length = nativeMax(group.length, length);
  9076. return true;
  9077. }
  9078. });
  9079. return baseTimes(length, function(index) {
  9080. return arrayMap(array, baseProperty(index));
  9081. });
  9082. }
  9083. /**
  9084. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9085. * how regrouped values should be combined. The iteratee is invoked with the
  9086. * elements of each group: (...group).
  9087. *
  9088. * @static
  9089. * @memberOf _
  9090. * @since 3.8.0
  9091. * @category Array
  9092. * @param {Array} array The array of grouped elements to process.
  9093. * @param {Function} [iteratee=_.identity] The function to combine
  9094. * regrouped values.
  9095. * @returns {Array} Returns the new array of regrouped elements.
  9096. * @example
  9097. *
  9098. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9099. * // => [[1, 10, 100], [2, 20, 200]]
  9100. *
  9101. * _.unzipWith(zipped, _.add);
  9102. * // => [3, 30, 300]
  9103. */
  9104. function unzipWith(array, iteratee) {
  9105. if (!(array && array.length)) {
  9106. return [];
  9107. }
  9108. var result = unzip(array);
  9109. if (iteratee == null) {
  9110. return result;
  9111. }
  9112. return arrayMap(result, function(group) {
  9113. return apply(iteratee, undefined, group);
  9114. });
  9115. }
  9116. /**
  9117. * Creates an array excluding all given values using
  9118. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9119. * for equality comparisons.
  9120. *
  9121. * **Note:** Unlike `_.pull`, this method returns a new array.
  9122. *
  9123. * @static
  9124. * @memberOf _
  9125. * @since 0.1.0
  9126. * @category Array
  9127. * @param {Array} array The array to inspect.
  9128. * @param {...*} [values] The values to exclude.
  9129. * @returns {Array} Returns the new array of filtered values.
  9130. * @see _.difference, _.xor
  9131. * @example
  9132. *
  9133. * _.without([2, 1, 2, 3], 1, 2);
  9134. * // => [3]
  9135. */
  9136. var without = baseRest(function(array, values) {
  9137. return isArrayLikeObject(array)
  9138. ? baseDifference(array, values)
  9139. : [];
  9140. });
  9141. /**
  9142. * Creates an array of unique values that is the
  9143. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9144. * of the given arrays. The order of result values is determined by the order
  9145. * they occur in the arrays.
  9146. *
  9147. * @static
  9148. * @memberOf _
  9149. * @since 2.4.0
  9150. * @category Array
  9151. * @param {...Array} [arrays] The arrays to inspect.
  9152. * @returns {Array} Returns the new array of filtered values.
  9153. * @see _.difference, _.without
  9154. * @example
  9155. *
  9156. * _.xor([2, 1], [2, 3]);
  9157. * // => [1, 3]
  9158. */
  9159. var xor = baseRest(function(arrays) {
  9160. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9161. });
  9162. /**
  9163. * This method is like `_.xor` except that it accepts `iteratee` which is
  9164. * invoked for each element of each `arrays` to generate the criterion by
  9165. * which by which they're compared. The order of result values is determined
  9166. * by the order they occur in the arrays. The iteratee is invoked with one
  9167. * argument: (value).
  9168. *
  9169. * @static
  9170. * @memberOf _
  9171. * @since 4.0.0
  9172. * @category Array
  9173. * @param {...Array} [arrays] The arrays to inspect.
  9174. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9175. * @returns {Array} Returns the new array of filtered values.
  9176. * @example
  9177. *
  9178. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9179. * // => [1.2, 3.4]
  9180. *
  9181. * // The `_.property` iteratee shorthand.
  9182. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9183. * // => [{ 'x': 2 }]
  9184. */
  9185. var xorBy = baseRest(function(arrays) {
  9186. var iteratee = last(arrays);
  9187. if (isArrayLikeObject(iteratee)) {
  9188. iteratee = undefined;
  9189. }
  9190. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9191. });
  9192. /**
  9193. * This method is like `_.xor` except that it accepts `comparator` which is
  9194. * invoked to compare elements of `arrays`. The order of result values is
  9195. * determined by the order they occur in the arrays. The comparator is invoked
  9196. * with two arguments: (arrVal, othVal).
  9197. *
  9198. * @static
  9199. * @memberOf _
  9200. * @since 4.0.0
  9201. * @category Array
  9202. * @param {...Array} [arrays] The arrays to inspect.
  9203. * @param {Function} [comparator] The comparator invoked per element.
  9204. * @returns {Array} Returns the new array of filtered values.
  9205. * @example
  9206. *
  9207. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9208. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9209. *
  9210. * _.xorWith(objects, others, _.isEqual);
  9211. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9212. */
  9213. var xorWith = baseRest(function(arrays) {
  9214. var comparator = last(arrays);
  9215. comparator = typeof comparator == 'function' ? comparator : undefined;
  9216. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9217. });
  9218. /**
  9219. * Creates an array of grouped elements, the first of which contains the
  9220. * first elements of the given arrays, the second of which contains the
  9221. * second elements of the given arrays, and so on.
  9222. *
  9223. * @static
  9224. * @memberOf _
  9225. * @since 0.1.0
  9226. * @category Array
  9227. * @param {...Array} [arrays] The arrays to process.
  9228. * @returns {Array} Returns the new array of grouped elements.
  9229. * @example
  9230. *
  9231. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9232. * // => [['a', 1, true], ['b', 2, false]]
  9233. */
  9234. var zip = baseRest(unzip);
  9235. /**
  9236. * This method is like `_.fromPairs` except that it accepts two arrays,
  9237. * one of property identifiers and one of corresponding values.
  9238. *
  9239. * @static
  9240. * @memberOf _
  9241. * @since 0.4.0
  9242. * @category Array
  9243. * @param {Array} [props=[]] The property identifiers.
  9244. * @param {Array} [values=[]] The property values.
  9245. * @returns {Object} Returns the new object.
  9246. * @example
  9247. *
  9248. * _.zipObject(['a', 'b'], [1, 2]);
  9249. * // => { 'a': 1, 'b': 2 }
  9250. */
  9251. function zipObject(props, values) {
  9252. return baseZipObject(props || [], values || [], assignValue);
  9253. }
  9254. /**
  9255. * This method is like `_.zipObject` except that it supports property paths.
  9256. *
  9257. * @static
  9258. * @memberOf _
  9259. * @since 4.1.0
  9260. * @category Array
  9261. * @param {Array} [props=[]] The property identifiers.
  9262. * @param {Array} [values=[]] The property values.
  9263. * @returns {Object} Returns the new object.
  9264. * @example
  9265. *
  9266. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9267. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9268. */
  9269. function zipObjectDeep(props, values) {
  9270. return baseZipObject(props || [], values || [], baseSet);
  9271. }
  9272. /**
  9273. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9274. * how grouped values should be combined. The iteratee is invoked with the
  9275. * elements of each group: (...group).
  9276. *
  9277. * @static
  9278. * @memberOf _
  9279. * @since 3.8.0
  9280. * @category Array
  9281. * @param {...Array} [arrays] The arrays to process.
  9282. * @param {Function} [iteratee=_.identity] The function to combine
  9283. * grouped values.
  9284. * @returns {Array} Returns the new array of grouped elements.
  9285. * @example
  9286. *
  9287. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9288. * return a + b + c;
  9289. * });
  9290. * // => [111, 222]
  9291. */
  9292. var zipWith = baseRest(function(arrays) {
  9293. var length = arrays.length,
  9294. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9295. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9296. return unzipWith(arrays, iteratee);
  9297. });
  9298. /*------------------------------------------------------------------------*/
  9299. /**
  9300. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9301. * chain sequences enabled. The result of such sequences must be unwrapped
  9302. * with `_#value`.
  9303. *
  9304. * @static
  9305. * @memberOf _
  9306. * @since 1.3.0
  9307. * @category Seq
  9308. * @param {*} value The value to wrap.
  9309. * @returns {Object} Returns the new `lodash` wrapper instance.
  9310. * @example
  9311. *
  9312. * var users = [
  9313. * { 'user': 'barney', 'age': 36 },
  9314. * { 'user': 'fred', 'age': 40 },
  9315. * { 'user': 'pebbles', 'age': 1 }
  9316. * ];
  9317. *
  9318. * var youngest = _
  9319. * .chain(users)
  9320. * .sortBy('age')
  9321. * .map(function(o) {
  9322. * return o.user + ' is ' + o.age;
  9323. * })
  9324. * .head()
  9325. * .value();
  9326. * // => 'pebbles is 1'
  9327. */
  9328. function chain(value) {
  9329. var result = lodash(value);
  9330. result.__chain__ = true;
  9331. return result;
  9332. }
  9333. /**
  9334. * This method invokes `interceptor` and returns `value`. The interceptor
  9335. * is invoked with one argument; (value). The purpose of this method is to
  9336. * "tap into" a method chain sequence in order to modify intermediate results.
  9337. *
  9338. * @static
  9339. * @memberOf _
  9340. * @since 0.1.0
  9341. * @category Seq
  9342. * @param {*} value The value to provide to `interceptor`.
  9343. * @param {Function} interceptor The function to invoke.
  9344. * @returns {*} Returns `value`.
  9345. * @example
  9346. *
  9347. * _([1, 2, 3])
  9348. * .tap(function(array) {
  9349. * // Mutate input array.
  9350. * array.pop();
  9351. * })
  9352. * .reverse()
  9353. * .value();
  9354. * // => [2, 1]
  9355. */
  9356. function tap(value, interceptor) {
  9357. interceptor(value);
  9358. return value;
  9359. }
  9360. /**
  9361. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9362. * The purpose of this method is to "pass thru" values replacing intermediate
  9363. * results in a method chain sequence.
  9364. *
  9365. * @static
  9366. * @memberOf _
  9367. * @since 3.0.0
  9368. * @category Seq
  9369. * @param {*} value The value to provide to `interceptor`.
  9370. * @param {Function} interceptor The function to invoke.
  9371. * @returns {*} Returns the result of `interceptor`.
  9372. * @example
  9373. *
  9374. * _(' abc ')
  9375. * .chain()
  9376. * .trim()
  9377. * .thru(function(value) {
  9378. * return [value];
  9379. * })
  9380. * .value();
  9381. * // => ['abc']
  9382. */
  9383. function thru(value, interceptor) {
  9384. return interceptor(value);
  9385. }
  9386. /**
  9387. * This method is the wrapper version of `_.at`.
  9388. *
  9389. * @name at
  9390. * @memberOf _
  9391. * @since 1.0.0
  9392. * @category Seq
  9393. * @param {...(string|string[])} [paths] The property paths to pick.
  9394. * @returns {Object} Returns the new `lodash` wrapper instance.
  9395. * @example
  9396. *
  9397. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9398. *
  9399. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9400. * // => [3, 4]
  9401. */
  9402. var wrapperAt = flatRest(function(paths) {
  9403. var length = paths.length,
  9404. start = length ? paths[0] : 0,
  9405. value = this.__wrapped__,
  9406. interceptor = function(object) { return baseAt(object, paths); };
  9407. if (length > 1 || this.__actions__.length ||
  9408. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9409. return this.thru(interceptor);
  9410. }
  9411. value = value.slice(start, +start + (length ? 1 : 0));
  9412. value.__actions__.push({
  9413. 'func': thru,
  9414. 'args': [interceptor],
  9415. 'thisArg': undefined
  9416. });
  9417. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9418. if (length && !array.length) {
  9419. array.push(undefined);
  9420. }
  9421. return array;
  9422. });
  9423. });
  9424. /**
  9425. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9426. *
  9427. * @name chain
  9428. * @memberOf _
  9429. * @since 0.1.0
  9430. * @category Seq
  9431. * @returns {Object} Returns the new `lodash` wrapper instance.
  9432. * @example
  9433. *
  9434. * var users = [
  9435. * { 'user': 'barney', 'age': 36 },
  9436. * { 'user': 'fred', 'age': 40 }
  9437. * ];
  9438. *
  9439. * // A sequence without explicit chaining.
  9440. * _(users).head();
  9441. * // => { 'user': 'barney', 'age': 36 }
  9442. *
  9443. * // A sequence with explicit chaining.
  9444. * _(users)
  9445. * .chain()
  9446. * .head()
  9447. * .pick('user')
  9448. * .value();
  9449. * // => { 'user': 'barney' }
  9450. */
  9451. function wrapperChain() {
  9452. return chain(this);
  9453. }
  9454. /**
  9455. * Executes the chain sequence and returns the wrapped result.
  9456. *
  9457. * @name commit
  9458. * @memberOf _
  9459. * @since 3.2.0
  9460. * @category Seq
  9461. * @returns {Object} Returns the new `lodash` wrapper instance.
  9462. * @example
  9463. *
  9464. * var array = [1, 2];
  9465. * var wrapped = _(array).push(3);
  9466. *
  9467. * console.log(array);
  9468. * // => [1, 2]
  9469. *
  9470. * wrapped = wrapped.commit();
  9471. * console.log(array);
  9472. * // => [1, 2, 3]
  9473. *
  9474. * wrapped.last();
  9475. * // => 3
  9476. *
  9477. * console.log(array);
  9478. * // => [1, 2, 3]
  9479. */
  9480. function wrapperCommit() {
  9481. return new LodashWrapper(this.value(), this.__chain__);
  9482. }
  9483. /**
  9484. * Gets the next value on a wrapped object following the
  9485. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9486. *
  9487. * @name next
  9488. * @memberOf _
  9489. * @since 4.0.0
  9490. * @category Seq
  9491. * @returns {Object} Returns the next iterator value.
  9492. * @example
  9493. *
  9494. * var wrapped = _([1, 2]);
  9495. *
  9496. * wrapped.next();
  9497. * // => { 'done': false, 'value': 1 }
  9498. *
  9499. * wrapped.next();
  9500. * // => { 'done': false, 'value': 2 }
  9501. *
  9502. * wrapped.next();
  9503. * // => { 'done': true, 'value': undefined }
  9504. */
  9505. function wrapperNext() {
  9506. if (this.__values__ === undefined) {
  9507. this.__values__ = toArray(this.value());
  9508. }
  9509. var done = this.__index__ >= this.__values__.length,
  9510. value = done ? undefined : this.__values__[this.__index__++];
  9511. return { 'done': done, 'value': value };
  9512. }
  9513. /**
  9514. * Enables the wrapper to be iterable.
  9515. *
  9516. * @name Symbol.iterator
  9517. * @memberOf _
  9518. * @since 4.0.0
  9519. * @category Seq
  9520. * @returns {Object} Returns the wrapper object.
  9521. * @example
  9522. *
  9523. * var wrapped = _([1, 2]);
  9524. *
  9525. * wrapped[Symbol.iterator]() === wrapped;
  9526. * // => true
  9527. *
  9528. * Array.from(wrapped);
  9529. * // => [1, 2]
  9530. */
  9531. function wrapperToIterator() {
  9532. return this;
  9533. }
  9534. /**
  9535. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9536. *
  9537. * @name plant
  9538. * @memberOf _
  9539. * @since 3.2.0
  9540. * @category Seq
  9541. * @param {*} value The value to plant.
  9542. * @returns {Object} Returns the new `lodash` wrapper instance.
  9543. * @example
  9544. *
  9545. * function square(n) {
  9546. * return n * n;
  9547. * }
  9548. *
  9549. * var wrapped = _([1, 2]).map(square);
  9550. * var other = wrapped.plant([3, 4]);
  9551. *
  9552. * other.value();
  9553. * // => [9, 16]
  9554. *
  9555. * wrapped.value();
  9556. * // => [1, 4]
  9557. */
  9558. function wrapperPlant(value) {
  9559. var result,
  9560. parent = this;
  9561. while (parent instanceof baseLodash) {
  9562. var clone = wrapperClone(parent);
  9563. clone.__index__ = 0;
  9564. clone.__values__ = undefined;
  9565. if (result) {
  9566. previous.__wrapped__ = clone;
  9567. } else {
  9568. result = clone;
  9569. }
  9570. var previous = clone;
  9571. parent = parent.__wrapped__;
  9572. }
  9573. previous.__wrapped__ = value;
  9574. return result;
  9575. }
  9576. /**
  9577. * This method is the wrapper version of `_.reverse`.
  9578. *
  9579. * **Note:** This method mutates the wrapped array.
  9580. *
  9581. * @name reverse
  9582. * @memberOf _
  9583. * @since 0.1.0
  9584. * @category Seq
  9585. * @returns {Object} Returns the new `lodash` wrapper instance.
  9586. * @example
  9587. *
  9588. * var array = [1, 2, 3];
  9589. *
  9590. * _(array).reverse().value()
  9591. * // => [3, 2, 1]
  9592. *
  9593. * console.log(array);
  9594. * // => [3, 2, 1]
  9595. */
  9596. function wrapperReverse() {
  9597. var value = this.__wrapped__;
  9598. if (value instanceof LazyWrapper) {
  9599. var wrapped = value;
  9600. if (this.__actions__.length) {
  9601. wrapped = new LazyWrapper(this);
  9602. }
  9603. wrapped = wrapped.reverse();
  9604. wrapped.__actions__.push({
  9605. 'func': thru,
  9606. 'args': [reverse],
  9607. 'thisArg': undefined
  9608. });
  9609. return new LodashWrapper(wrapped, this.__chain__);
  9610. }
  9611. return this.thru(reverse);
  9612. }
  9613. /**
  9614. * Executes the chain sequence to resolve the unwrapped value.
  9615. *
  9616. * @name value
  9617. * @memberOf _
  9618. * @since 0.1.0
  9619. * @alias toJSON, valueOf
  9620. * @category Seq
  9621. * @returns {*} Returns the resolved unwrapped value.
  9622. * @example
  9623. *
  9624. * _([1, 2, 3]).value();
  9625. * // => [1, 2, 3]
  9626. */
  9627. function wrapperValue() {
  9628. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9629. }
  9630. /*------------------------------------------------------------------------*/
  9631. /**
  9632. * Creates an object composed of keys generated from the results of running
  9633. * each element of `collection` thru `iteratee`. The corresponding value of
  9634. * each key is the number of times the key was returned by `iteratee`. The
  9635. * iteratee is invoked with one argument: (value).
  9636. *
  9637. * @static
  9638. * @memberOf _
  9639. * @since 0.5.0
  9640. * @category Collection
  9641. * @param {Array|Object} collection The collection to iterate over.
  9642. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9643. * @returns {Object} Returns the composed aggregate object.
  9644. * @example
  9645. *
  9646. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9647. * // => { '4': 1, '6': 2 }
  9648. *
  9649. * // The `_.property` iteratee shorthand.
  9650. * _.countBy(['one', 'two', 'three'], 'length');
  9651. * // => { '3': 2, '5': 1 }
  9652. */
  9653. var countBy = createAggregator(function(result, value, key) {
  9654. if (hasOwnProperty.call(result, key)) {
  9655. ++result[key];
  9656. } else {
  9657. baseAssignValue(result, key, 1);
  9658. }
  9659. });
  9660. /**
  9661. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9662. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9663. * invoked with three arguments: (value, index|key, collection).
  9664. *
  9665. * **Note:** This method returns `true` for
  9666. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9667. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9668. * elements of empty collections.
  9669. *
  9670. * @static
  9671. * @memberOf _
  9672. * @since 0.1.0
  9673. * @category Collection
  9674. * @param {Array|Object} collection The collection to iterate over.
  9675. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9676. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9677. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9678. * else `false`.
  9679. * @example
  9680. *
  9681. * _.every([true, 1, null, 'yes'], Boolean);
  9682. * // => false
  9683. *
  9684. * var users = [
  9685. * { 'user': 'barney', 'age': 36, 'active': false },
  9686. * { 'user': 'fred', 'age': 40, 'active': false }
  9687. * ];
  9688. *
  9689. * // The `_.matches` iteratee shorthand.
  9690. * _.every(users, { 'user': 'barney', 'active': false });
  9691. * // => false
  9692. *
  9693. * // The `_.matchesProperty` iteratee shorthand.
  9694. * _.every(users, ['active', false]);
  9695. * // => true
  9696. *
  9697. * // The `_.property` iteratee shorthand.
  9698. * _.every(users, 'active');
  9699. * // => false
  9700. */
  9701. function every(collection, predicate, guard) {
  9702. var func = isArray(collection) ? arrayEvery : baseEvery;
  9703. if (guard && isIterateeCall(collection, predicate, guard)) {
  9704. predicate = undefined;
  9705. }
  9706. return func(collection, getIteratee(predicate, 3));
  9707. }
  9708. /**
  9709. * Iterates over elements of `collection`, returning an array of all elements
  9710. * `predicate` returns truthy for. The predicate is invoked with three
  9711. * arguments: (value, index|key, collection).
  9712. *
  9713. * **Note:** Unlike `_.remove`, this method returns a new array.
  9714. *
  9715. * @static
  9716. * @memberOf _
  9717. * @since 0.1.0
  9718. * @category Collection
  9719. * @param {Array|Object} collection The collection to iterate over.
  9720. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9721. * @returns {Array} Returns the new filtered array.
  9722. * @see _.reject
  9723. * @example
  9724. *
  9725. * var users = [
  9726. * { 'user': 'barney', 'age': 36, 'active': true },
  9727. * { 'user': 'fred', 'age': 40, 'active': false }
  9728. * ];
  9729. *
  9730. * _.filter(users, function(o) { return !o.active; });
  9731. * // => objects for ['fred']
  9732. *
  9733. * // The `_.matches` iteratee shorthand.
  9734. * _.filter(users, { 'age': 36, 'active': true });
  9735. * // => objects for ['barney']
  9736. *
  9737. * // The `_.matchesProperty` iteratee shorthand.
  9738. * _.filter(users, ['active', false]);
  9739. * // => objects for ['fred']
  9740. *
  9741. * // The `_.property` iteratee shorthand.
  9742. * _.filter(users, 'active');
  9743. * // => objects for ['barney']
  9744. *
  9745. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9746. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9747. * // => objects for ['fred', 'barney']
  9748. */
  9749. function filter(collection, predicate) {
  9750. var func = isArray(collection) ? arrayFilter : baseFilter;
  9751. return func(collection, getIteratee(predicate, 3));
  9752. }
  9753. /**
  9754. * Iterates over elements of `collection`, returning the first element
  9755. * `predicate` returns truthy for. The predicate is invoked with three
  9756. * arguments: (value, index|key, collection).
  9757. *
  9758. * @static
  9759. * @memberOf _
  9760. * @since 0.1.0
  9761. * @category Collection
  9762. * @param {Array|Object} collection The collection to inspect.
  9763. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9764. * @param {number} [fromIndex=0] The index to search from.
  9765. * @returns {*} Returns the matched element, else `undefined`.
  9766. * @example
  9767. *
  9768. * var users = [
  9769. * { 'user': 'barney', 'age': 36, 'active': true },
  9770. * { 'user': 'fred', 'age': 40, 'active': false },
  9771. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9772. * ];
  9773. *
  9774. * _.find(users, function(o) { return o.age < 40; });
  9775. * // => object for 'barney'
  9776. *
  9777. * // The `_.matches` iteratee shorthand.
  9778. * _.find(users, { 'age': 1, 'active': true });
  9779. * // => object for 'pebbles'
  9780. *
  9781. * // The `_.matchesProperty` iteratee shorthand.
  9782. * _.find(users, ['active', false]);
  9783. * // => object for 'fred'
  9784. *
  9785. * // The `_.property` iteratee shorthand.
  9786. * _.find(users, 'active');
  9787. * // => object for 'barney'
  9788. */
  9789. var find = createFind(findIndex);
  9790. /**
  9791. * This method is like `_.find` except that it iterates over elements of
  9792. * `collection` from right to left.
  9793. *
  9794. * @static
  9795. * @memberOf _
  9796. * @since 2.0.0
  9797. * @category Collection
  9798. * @param {Array|Object} collection The collection to inspect.
  9799. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9800. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9801. * @returns {*} Returns the matched element, else `undefined`.
  9802. * @example
  9803. *
  9804. * _.findLast([1, 2, 3, 4], function(n) {
  9805. * return n % 2 == 1;
  9806. * });
  9807. * // => 3
  9808. */
  9809. var findLast = createFind(findLastIndex);
  9810. /**
  9811. * Creates a flattened array of values by running each element in `collection`
  9812. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9813. * with three arguments: (value, index|key, collection).
  9814. *
  9815. * @static
  9816. * @memberOf _
  9817. * @since 4.0.0
  9818. * @category Collection
  9819. * @param {Array|Object} collection The collection to iterate over.
  9820. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9821. * @returns {Array} Returns the new flattened array.
  9822. * @example
  9823. *
  9824. * function duplicate(n) {
  9825. * return [n, n];
  9826. * }
  9827. *
  9828. * _.flatMap([1, 2], duplicate);
  9829. * // => [1, 1, 2, 2]
  9830. */
  9831. function flatMap(collection, iteratee) {
  9832. return baseFlatten(map(collection, iteratee), 1);
  9833. }
  9834. /**
  9835. * This method is like `_.flatMap` except that it recursively flattens the
  9836. * mapped results.
  9837. *
  9838. * @static
  9839. * @memberOf _
  9840. * @since 4.7.0
  9841. * @category Collection
  9842. * @param {Array|Object} collection The collection to iterate over.
  9843. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9844. * @returns {Array} Returns the new flattened array.
  9845. * @example
  9846. *
  9847. * function duplicate(n) {
  9848. * return [[[n, n]]];
  9849. * }
  9850. *
  9851. * _.flatMapDeep([1, 2], duplicate);
  9852. * // => [1, 1, 2, 2]
  9853. */
  9854. function flatMapDeep(collection, iteratee) {
  9855. return baseFlatten(map(collection, iteratee), INFINITY);
  9856. }
  9857. /**
  9858. * This method is like `_.flatMap` except that it recursively flattens the
  9859. * mapped results up to `depth` times.
  9860. *
  9861. * @static
  9862. * @memberOf _
  9863. * @since 4.7.0
  9864. * @category Collection
  9865. * @param {Array|Object} collection The collection to iterate over.
  9866. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9867. * @param {number} [depth=1] The maximum recursion depth.
  9868. * @returns {Array} Returns the new flattened array.
  9869. * @example
  9870. *
  9871. * function duplicate(n) {
  9872. * return [[[n, n]]];
  9873. * }
  9874. *
  9875. * _.flatMapDepth([1, 2], duplicate, 2);
  9876. * // => [[1, 1], [2, 2]]
  9877. */
  9878. function flatMapDepth(collection, iteratee, depth) {
  9879. depth = depth === undefined ? 1 : toInteger(depth);
  9880. return baseFlatten(map(collection, iteratee), depth);
  9881. }
  9882. /**
  9883. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9884. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9885. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9886. *
  9887. * **Note:** As with other "Collections" methods, objects with a "length"
  9888. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9889. * or `_.forOwn` for object iteration.
  9890. *
  9891. * @static
  9892. * @memberOf _
  9893. * @since 0.1.0
  9894. * @alias each
  9895. * @category Collection
  9896. * @param {Array|Object} collection The collection to iterate over.
  9897. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9898. * @returns {Array|Object} Returns `collection`.
  9899. * @see _.forEachRight
  9900. * @example
  9901. *
  9902. * _.forEach([1, 2], function(value) {
  9903. * console.log(value);
  9904. * });
  9905. * // => Logs `1` then `2`.
  9906. *
  9907. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9908. * console.log(key);
  9909. * });
  9910. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9911. */
  9912. function forEach(collection, iteratee) {
  9913. var func = isArray(collection) ? arrayEach : baseEach;
  9914. return func(collection, getIteratee(iteratee, 3));
  9915. }
  9916. /**
  9917. * This method is like `_.forEach` except that it iterates over elements of
  9918. * `collection` from right to left.
  9919. *
  9920. * @static
  9921. * @memberOf _
  9922. * @since 2.0.0
  9923. * @alias eachRight
  9924. * @category Collection
  9925. * @param {Array|Object} collection The collection to iterate over.
  9926. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9927. * @returns {Array|Object} Returns `collection`.
  9928. * @see _.forEach
  9929. * @example
  9930. *
  9931. * _.forEachRight([1, 2], function(value) {
  9932. * console.log(value);
  9933. * });
  9934. * // => Logs `2` then `1`.
  9935. */
  9936. function forEachRight(collection, iteratee) {
  9937. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9938. return func(collection, getIteratee(iteratee, 3));
  9939. }
  9940. /**
  9941. * Creates an object composed of keys generated from the results of running
  9942. * each element of `collection` thru `iteratee`. The order of grouped values
  9943. * is determined by the order they occur in `collection`. The corresponding
  9944. * value of each key is an array of elements responsible for generating the
  9945. * key. The iteratee is invoked with one argument: (value).
  9946. *
  9947. * @static
  9948. * @memberOf _
  9949. * @since 0.1.0
  9950. * @category Collection
  9951. * @param {Array|Object} collection The collection to iterate over.
  9952. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9953. * @returns {Object} Returns the composed aggregate object.
  9954. * @example
  9955. *
  9956. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9957. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9958. *
  9959. * // The `_.property` iteratee shorthand.
  9960. * _.groupBy(['one', 'two', 'three'], 'length');
  9961. * // => { '3': ['one', 'two'], '5': ['three'] }
  9962. */
  9963. var groupBy = createAggregator(function(result, value, key) {
  9964. if (hasOwnProperty.call(result, key)) {
  9965. result[key].push(value);
  9966. } else {
  9967. baseAssignValue(result, key, [value]);
  9968. }
  9969. });
  9970. /**
  9971. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9972. * checked for a substring of `value`, otherwise
  9973. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9974. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9975. * the offset from the end of `collection`.
  9976. *
  9977. * @static
  9978. * @memberOf _
  9979. * @since 0.1.0
  9980. * @category Collection
  9981. * @param {Array|Object|string} collection The collection to inspect.
  9982. * @param {*} value The value to search for.
  9983. * @param {number} [fromIndex=0] The index to search from.
  9984. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9985. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9986. * @example
  9987. *
  9988. * _.includes([1, 2, 3], 1);
  9989. * // => true
  9990. *
  9991. * _.includes([1, 2, 3], 1, 2);
  9992. * // => false
  9993. *
  9994. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9995. * // => true
  9996. *
  9997. * _.includes('abcd', 'bc');
  9998. * // => true
  9999. */
  10000. function includes(collection, value, fromIndex, guard) {
  10001. collection = isArrayLike(collection) ? collection : values(collection);
  10002. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10003. var length = collection.length;
  10004. if (fromIndex < 0) {
  10005. fromIndex = nativeMax(length + fromIndex, 0);
  10006. }
  10007. return isString(collection)
  10008. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10009. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10010. }
  10011. /**
  10012. * Invokes the method at `path` of each element in `collection`, returning
  10013. * an array of the results of each invoked method. Any additional arguments
  10014. * are provided to each invoked method. If `path` is a function, it's invoked
  10015. * for, and `this` bound to, each element in `collection`.
  10016. *
  10017. * @static
  10018. * @memberOf _
  10019. * @since 4.0.0
  10020. * @category Collection
  10021. * @param {Array|Object} collection The collection to iterate over.
  10022. * @param {Array|Function|string} path The path of the method to invoke or
  10023. * the function invoked per iteration.
  10024. * @param {...*} [args] The arguments to invoke each method with.
  10025. * @returns {Array} Returns the array of results.
  10026. * @example
  10027. *
  10028. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10029. * // => [[1, 5, 7], [1, 2, 3]]
  10030. *
  10031. * _.invokeMap([123, 456], String.prototype.split, '');
  10032. * // => [['1', '2', '3'], ['4', '5', '6']]
  10033. */
  10034. var invokeMap = baseRest(function(collection, path, args) {
  10035. var index = -1,
  10036. isFunc = typeof path == 'function',
  10037. result = isArrayLike(collection) ? Array(collection.length) : [];
  10038. baseEach(collection, function(value) {
  10039. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10040. });
  10041. return result;
  10042. });
  10043. /**
  10044. * Creates an object composed of keys generated from the results of running
  10045. * each element of `collection` thru `iteratee`. The corresponding value of
  10046. * each key is the last element responsible for generating the key. The
  10047. * iteratee is invoked with one argument: (value).
  10048. *
  10049. * @static
  10050. * @memberOf _
  10051. * @since 4.0.0
  10052. * @category Collection
  10053. * @param {Array|Object} collection The collection to iterate over.
  10054. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10055. * @returns {Object} Returns the composed aggregate object.
  10056. * @example
  10057. *
  10058. * var array = [
  10059. * { 'dir': 'left', 'code': 97 },
  10060. * { 'dir': 'right', 'code': 100 }
  10061. * ];
  10062. *
  10063. * _.keyBy(array, function(o) {
  10064. * return String.fromCharCode(o.code);
  10065. * });
  10066. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10067. *
  10068. * _.keyBy(array, 'dir');
  10069. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10070. */
  10071. var keyBy = createAggregator(function(result, value, key) {
  10072. baseAssignValue(result, key, value);
  10073. });
  10074. /**
  10075. * Creates an array of values by running each element in `collection` thru
  10076. * `iteratee`. The iteratee is invoked with three arguments:
  10077. * (value, index|key, collection).
  10078. *
  10079. * Many lodash methods are guarded to work as iteratees for methods like
  10080. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10081. *
  10082. * The guarded methods are:
  10083. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10084. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10085. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10086. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10087. *
  10088. * @static
  10089. * @memberOf _
  10090. * @since 0.1.0
  10091. * @category Collection
  10092. * @param {Array|Object} collection The collection to iterate over.
  10093. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10094. * @returns {Array} Returns the new mapped array.
  10095. * @example
  10096. *
  10097. * function square(n) {
  10098. * return n * n;
  10099. * }
  10100. *
  10101. * _.map([4, 8], square);
  10102. * // => [16, 64]
  10103. *
  10104. * _.map({ 'a': 4, 'b': 8 }, square);
  10105. * // => [16, 64] (iteration order is not guaranteed)
  10106. *
  10107. * var users = [
  10108. * { 'user': 'barney' },
  10109. * { 'user': 'fred' }
  10110. * ];
  10111. *
  10112. * // The `_.property` iteratee shorthand.
  10113. * _.map(users, 'user');
  10114. * // => ['barney', 'fred']
  10115. */
  10116. function map(collection, iteratee) {
  10117. var func = isArray(collection) ? arrayMap : baseMap;
  10118. return func(collection, getIteratee(iteratee, 3));
  10119. }
  10120. /**
  10121. * This method is like `_.sortBy` except that it allows specifying the sort
  10122. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10123. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10124. * descending or "asc" for ascending sort order of corresponding values.
  10125. *
  10126. * @static
  10127. * @memberOf _
  10128. * @since 4.0.0
  10129. * @category Collection
  10130. * @param {Array|Object} collection The collection to iterate over.
  10131. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10132. * The iteratees to sort by.
  10133. * @param {string[]} [orders] The sort orders of `iteratees`.
  10134. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10135. * @returns {Array} Returns the new sorted array.
  10136. * @example
  10137. *
  10138. * var users = [
  10139. * { 'user': 'fred', 'age': 48 },
  10140. * { 'user': 'barney', 'age': 34 },
  10141. * { 'user': 'fred', 'age': 40 },
  10142. * { 'user': 'barney', 'age': 36 }
  10143. * ];
  10144. *
  10145. * // Sort by `user` in ascending order and by `age` in descending order.
  10146. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10147. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10148. */
  10149. function orderBy(collection, iteratees, orders, guard) {
  10150. if (collection == null) {
  10151. return [];
  10152. }
  10153. if (!isArray(iteratees)) {
  10154. iteratees = iteratees == null ? [] : [iteratees];
  10155. }
  10156. orders = guard ? undefined : orders;
  10157. if (!isArray(orders)) {
  10158. orders = orders == null ? [] : [orders];
  10159. }
  10160. return baseOrderBy(collection, iteratees, orders);
  10161. }
  10162. /**
  10163. * Creates an array of elements split into two groups, the first of which
  10164. * contains elements `predicate` returns truthy for, the second of which
  10165. * contains elements `predicate` returns falsey for. The predicate is
  10166. * invoked with one argument: (value).
  10167. *
  10168. * @static
  10169. * @memberOf _
  10170. * @since 3.0.0
  10171. * @category Collection
  10172. * @param {Array|Object} collection The collection to iterate over.
  10173. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10174. * @returns {Array} Returns the array of grouped elements.
  10175. * @example
  10176. *
  10177. * var users = [
  10178. * { 'user': 'barney', 'age': 36, 'active': false },
  10179. * { 'user': 'fred', 'age': 40, 'active': true },
  10180. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10181. * ];
  10182. *
  10183. * _.partition(users, function(o) { return o.active; });
  10184. * // => objects for [['fred'], ['barney', 'pebbles']]
  10185. *
  10186. * // The `_.matches` iteratee shorthand.
  10187. * _.partition(users, { 'age': 1, 'active': false });
  10188. * // => objects for [['pebbles'], ['barney', 'fred']]
  10189. *
  10190. * // The `_.matchesProperty` iteratee shorthand.
  10191. * _.partition(users, ['active', false]);
  10192. * // => objects for [['barney', 'pebbles'], ['fred']]
  10193. *
  10194. * // The `_.property` iteratee shorthand.
  10195. * _.partition(users, 'active');
  10196. * // => objects for [['fred'], ['barney', 'pebbles']]
  10197. */
  10198. var partition = createAggregator(function(result, value, key) {
  10199. result[key ? 0 : 1].push(value);
  10200. }, function() { return [[], []]; });
  10201. /**
  10202. * Reduces `collection` to a value which is the accumulated result of running
  10203. * each element in `collection` thru `iteratee`, where each successive
  10204. * invocation is supplied the return value of the previous. If `accumulator`
  10205. * is not given, the first element of `collection` is used as the initial
  10206. * value. The iteratee is invoked with four arguments:
  10207. * (accumulator, value, index|key, collection).
  10208. *
  10209. * Many lodash methods are guarded to work as iteratees for methods like
  10210. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10211. *
  10212. * The guarded methods are:
  10213. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10214. * and `sortBy`
  10215. *
  10216. * @static
  10217. * @memberOf _
  10218. * @since 0.1.0
  10219. * @category Collection
  10220. * @param {Array|Object} collection The collection to iterate over.
  10221. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10222. * @param {*} [accumulator] The initial value.
  10223. * @returns {*} Returns the accumulated value.
  10224. * @see _.reduceRight
  10225. * @example
  10226. *
  10227. * _.reduce([1, 2], function(sum, n) {
  10228. * return sum + n;
  10229. * }, 0);
  10230. * // => 3
  10231. *
  10232. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10233. * (result[value] || (result[value] = [])).push(key);
  10234. * return result;
  10235. * }, {});
  10236. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10237. */
  10238. function reduce(collection, iteratee, accumulator) {
  10239. var func = isArray(collection) ? arrayReduce : baseReduce,
  10240. initAccum = arguments.length < 3;
  10241. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10242. }
  10243. /**
  10244. * This method is like `_.reduce` except that it iterates over elements of
  10245. * `collection` from right to left.
  10246. *
  10247. * @static
  10248. * @memberOf _
  10249. * @since 0.1.0
  10250. * @category Collection
  10251. * @param {Array|Object} collection The collection to iterate over.
  10252. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10253. * @param {*} [accumulator] The initial value.
  10254. * @returns {*} Returns the accumulated value.
  10255. * @see _.reduce
  10256. * @example
  10257. *
  10258. * var array = [[0, 1], [2, 3], [4, 5]];
  10259. *
  10260. * _.reduceRight(array, function(flattened, other) {
  10261. * return flattened.concat(other);
  10262. * }, []);
  10263. * // => [4, 5, 2, 3, 0, 1]
  10264. */
  10265. function reduceRight(collection, iteratee, accumulator) {
  10266. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10267. initAccum = arguments.length < 3;
  10268. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10269. }
  10270. /**
  10271. * The opposite of `_.filter`; this method returns the elements of `collection`
  10272. * that `predicate` does **not** return truthy for.
  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} [predicate=_.identity] The function invoked per iteration.
  10280. * @returns {Array} Returns the new filtered array.
  10281. * @see _.filter
  10282. * @example
  10283. *
  10284. * var users = [
  10285. * { 'user': 'barney', 'age': 36, 'active': false },
  10286. * { 'user': 'fred', 'age': 40, 'active': true }
  10287. * ];
  10288. *
  10289. * _.reject(users, function(o) { return !o.active; });
  10290. * // => objects for ['fred']
  10291. *
  10292. * // The `_.matches` iteratee shorthand.
  10293. * _.reject(users, { 'age': 40, 'active': true });
  10294. * // => objects for ['barney']
  10295. *
  10296. * // The `_.matchesProperty` iteratee shorthand.
  10297. * _.reject(users, ['active', false]);
  10298. * // => objects for ['fred']
  10299. *
  10300. * // The `_.property` iteratee shorthand.
  10301. * _.reject(users, 'active');
  10302. * // => objects for ['barney']
  10303. */
  10304. function reject(collection, predicate) {
  10305. var func = isArray(collection) ? arrayFilter : baseFilter;
  10306. return func(collection, negate(getIteratee(predicate, 3)));
  10307. }
  10308. /**
  10309. * Gets a random element from `collection`.
  10310. *
  10311. * @static
  10312. * @memberOf _
  10313. * @since 2.0.0
  10314. * @category Collection
  10315. * @param {Array|Object} collection The collection to sample.
  10316. * @returns {*} Returns the random element.
  10317. * @example
  10318. *
  10319. * _.sample([1, 2, 3, 4]);
  10320. * // => 2
  10321. */
  10322. function sample(collection) {
  10323. var func = isArray(collection) ? arraySample : baseSample;
  10324. return func(collection);
  10325. }
  10326. /**
  10327. * Gets `n` random elements at unique keys from `collection` up to the
  10328. * size of `collection`.
  10329. *
  10330. * @static
  10331. * @memberOf _
  10332. * @since 4.0.0
  10333. * @category Collection
  10334. * @param {Array|Object} collection The collection to sample.
  10335. * @param {number} [n=1] The number of elements to sample.
  10336. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10337. * @returns {Array} Returns the random elements.
  10338. * @example
  10339. *
  10340. * _.sampleSize([1, 2, 3], 2);
  10341. * // => [3, 1]
  10342. *
  10343. * _.sampleSize([1, 2, 3], 4);
  10344. * // => [2, 3, 1]
  10345. */
  10346. function sampleSize(collection, n, guard) {
  10347. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10348. n = 1;
  10349. } else {
  10350. n = toInteger(n);
  10351. }
  10352. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10353. return func(collection, n);
  10354. }
  10355. /**
  10356. * Creates an array of shuffled values, using a version of the
  10357. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10358. *
  10359. * @static
  10360. * @memberOf _
  10361. * @since 0.1.0
  10362. * @category Collection
  10363. * @param {Array|Object} collection The collection to shuffle.
  10364. * @returns {Array} Returns the new shuffled array.
  10365. * @example
  10366. *
  10367. * _.shuffle([1, 2, 3, 4]);
  10368. * // => [4, 1, 3, 2]
  10369. */
  10370. function shuffle(collection) {
  10371. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10372. return func(collection);
  10373. }
  10374. /**
  10375. * Gets the size of `collection` by returning its length for array-like
  10376. * values or the number of own enumerable string keyed properties for objects.
  10377. *
  10378. * @static
  10379. * @memberOf _
  10380. * @since 0.1.0
  10381. * @category Collection
  10382. * @param {Array|Object|string} collection The collection to inspect.
  10383. * @returns {number} Returns the collection size.
  10384. * @example
  10385. *
  10386. * _.size([1, 2, 3]);
  10387. * // => 3
  10388. *
  10389. * _.size({ 'a': 1, 'b': 2 });
  10390. * // => 2
  10391. *
  10392. * _.size('pebbles');
  10393. * // => 7
  10394. */
  10395. function size(collection) {
  10396. if (collection == null) {
  10397. return 0;
  10398. }
  10399. if (isArrayLike(collection)) {
  10400. return isString(collection) ? stringSize(collection) : collection.length;
  10401. }
  10402. var tag = getTag(collection);
  10403. if (tag == mapTag || tag == setTag) {
  10404. return collection.size;
  10405. }
  10406. return baseKeys(collection).length;
  10407. }
  10408. /**
  10409. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10410. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10411. * invoked with three arguments: (value, index|key, collection).
  10412. *
  10413. * @static
  10414. * @memberOf _
  10415. * @since 0.1.0
  10416. * @category Collection
  10417. * @param {Array|Object} collection The collection to iterate over.
  10418. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10419. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10420. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10421. * else `false`.
  10422. * @example
  10423. *
  10424. * _.some([null, 0, 'yes', false], Boolean);
  10425. * // => true
  10426. *
  10427. * var users = [
  10428. * { 'user': 'barney', 'active': true },
  10429. * { 'user': 'fred', 'active': false }
  10430. * ];
  10431. *
  10432. * // The `_.matches` iteratee shorthand.
  10433. * _.some(users, { 'user': 'barney', 'active': false });
  10434. * // => false
  10435. *
  10436. * // The `_.matchesProperty` iteratee shorthand.
  10437. * _.some(users, ['active', false]);
  10438. * // => true
  10439. *
  10440. * // The `_.property` iteratee shorthand.
  10441. * _.some(users, 'active');
  10442. * // => true
  10443. */
  10444. function some(collection, predicate, guard) {
  10445. var func = isArray(collection) ? arraySome : baseSome;
  10446. if (guard && isIterateeCall(collection, predicate, guard)) {
  10447. predicate = undefined;
  10448. }
  10449. return func(collection, getIteratee(predicate, 3));
  10450. }
  10451. /**
  10452. * Creates an array of elements, sorted in ascending order by the results of
  10453. * running each element in a collection thru each iteratee. This method
  10454. * performs a stable sort, that is, it preserves the original sort order of
  10455. * equal elements. The iteratees are invoked with one argument: (value).
  10456. *
  10457. * @static
  10458. * @memberOf _
  10459. * @since 0.1.0
  10460. * @category Collection
  10461. * @param {Array|Object} collection The collection to iterate over.
  10462. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10463. * The iteratees to sort by.
  10464. * @returns {Array} Returns the new sorted array.
  10465. * @example
  10466. *
  10467. * var users = [
  10468. * { 'user': 'fred', 'age': 48 },
  10469. * { 'user': 'barney', 'age': 36 },
  10470. * { 'user': 'fred', 'age': 30 },
  10471. * { 'user': 'barney', 'age': 34 }
  10472. * ];
  10473. *
  10474. * _.sortBy(users, [function(o) { return o.user; }]);
  10475. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10476. *
  10477. * _.sortBy(users, ['user', 'age']);
  10478. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10479. */
  10480. var sortBy = baseRest(function(collection, iteratees) {
  10481. if (collection == null) {
  10482. return [];
  10483. }
  10484. var length = iteratees.length;
  10485. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10486. iteratees = [];
  10487. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10488. iteratees = [iteratees[0]];
  10489. }
  10490. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10491. });
  10492. /*------------------------------------------------------------------------*/
  10493. /**
  10494. * Gets the timestamp of the number of milliseconds that have elapsed since
  10495. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10496. *
  10497. * @static
  10498. * @memberOf _
  10499. * @since 2.4.0
  10500. * @category Date
  10501. * @returns {number} Returns the timestamp.
  10502. * @example
  10503. *
  10504. * _.defer(function(stamp) {
  10505. * console.log(_.now() - stamp);
  10506. * }, _.now());
  10507. * // => Logs the number of milliseconds it took for the deferred invocation.
  10508. */
  10509. var now = ctxNow || function() {
  10510. return root.Date.now();
  10511. };
  10512. /*------------------------------------------------------------------------*/
  10513. /**
  10514. * The opposite of `_.before`; this method creates a function that invokes
  10515. * `func` once it's called `n` or more times.
  10516. *
  10517. * @static
  10518. * @memberOf _
  10519. * @since 0.1.0
  10520. * @category Function
  10521. * @param {number} n The number of calls before `func` is invoked.
  10522. * @param {Function} func The function to restrict.
  10523. * @returns {Function} Returns the new restricted function.
  10524. * @example
  10525. *
  10526. * var saves = ['profile', 'settings'];
  10527. *
  10528. * var done = _.after(saves.length, function() {
  10529. * console.log('done saving!');
  10530. * });
  10531. *
  10532. * _.forEach(saves, function(type) {
  10533. * asyncSave({ 'type': type, 'complete': done });
  10534. * });
  10535. * // => Logs 'done saving!' after the two async saves have completed.
  10536. */
  10537. function after(n, func) {
  10538. if (typeof func != 'function') {
  10539. throw new TypeError(FUNC_ERROR_TEXT);
  10540. }
  10541. n = toInteger(n);
  10542. return function() {
  10543. if (--n < 1) {
  10544. return func.apply(this, arguments);
  10545. }
  10546. };
  10547. }
  10548. /**
  10549. * Creates a function that invokes `func`, with up to `n` arguments,
  10550. * ignoring any additional arguments.
  10551. *
  10552. * @static
  10553. * @memberOf _
  10554. * @since 3.0.0
  10555. * @category Function
  10556. * @param {Function} func The function to cap arguments for.
  10557. * @param {number} [n=func.length] The arity cap.
  10558. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10559. * @returns {Function} Returns the new capped function.
  10560. * @example
  10561. *
  10562. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10563. * // => [6, 8, 10]
  10564. */
  10565. function ary(func, n, guard) {
  10566. n = guard ? undefined : n;
  10567. n = (func && n == null) ? func.length : n;
  10568. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10569. }
  10570. /**
  10571. * Creates a function that invokes `func`, with the `this` binding and arguments
  10572. * of the created function, while it's called less than `n` times. Subsequent
  10573. * calls to the created function return the result of the last `func` invocation.
  10574. *
  10575. * @static
  10576. * @memberOf _
  10577. * @since 3.0.0
  10578. * @category Function
  10579. * @param {number} n The number of calls at which `func` is no longer invoked.
  10580. * @param {Function} func The function to restrict.
  10581. * @returns {Function} Returns the new restricted function.
  10582. * @example
  10583. *
  10584. * jQuery(element).on('click', _.before(5, addContactToList));
  10585. * // => Allows adding up to 4 contacts to the list.
  10586. */
  10587. function before(n, func) {
  10588. var result;
  10589. if (typeof func != 'function') {
  10590. throw new TypeError(FUNC_ERROR_TEXT);
  10591. }
  10592. n = toInteger(n);
  10593. return function() {
  10594. if (--n > 0) {
  10595. result = func.apply(this, arguments);
  10596. }
  10597. if (n <= 1) {
  10598. func = undefined;
  10599. }
  10600. return result;
  10601. };
  10602. }
  10603. /**
  10604. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10605. * and `partials` prepended to the arguments it receives.
  10606. *
  10607. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10608. * may be used as a placeholder for partially applied arguments.
  10609. *
  10610. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10611. * property of bound functions.
  10612. *
  10613. * @static
  10614. * @memberOf _
  10615. * @since 0.1.0
  10616. * @category Function
  10617. * @param {Function} func The function to bind.
  10618. * @param {*} thisArg The `this` binding of `func`.
  10619. * @param {...*} [partials] The arguments to be partially applied.
  10620. * @returns {Function} Returns the new bound function.
  10621. * @example
  10622. *
  10623. * function greet(greeting, punctuation) {
  10624. * return greeting + ' ' + this.user + punctuation;
  10625. * }
  10626. *
  10627. * var object = { 'user': 'fred' };
  10628. *
  10629. * var bound = _.bind(greet, object, 'hi');
  10630. * bound('!');
  10631. * // => 'hi fred!'
  10632. *
  10633. * // Bound with placeholders.
  10634. * var bound = _.bind(greet, object, _, '!');
  10635. * bound('hi');
  10636. * // => 'hi fred!'
  10637. */
  10638. var bind = baseRest(function(func, thisArg, partials) {
  10639. var bitmask = WRAP_BIND_FLAG;
  10640. if (partials.length) {
  10641. var holders = replaceHolders(partials, getHolder(bind));
  10642. bitmask |= WRAP_PARTIAL_FLAG;
  10643. }
  10644. return createWrap(func, bitmask, thisArg, partials, holders);
  10645. });
  10646. /**
  10647. * Creates a function that invokes the method at `object[key]` with `partials`
  10648. * prepended to the arguments it receives.
  10649. *
  10650. * This method differs from `_.bind` by allowing bound functions to reference
  10651. * methods that may be redefined or don't yet exist. See
  10652. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10653. * for more details.
  10654. *
  10655. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10656. * builds, may be used as a placeholder for partially applied arguments.
  10657. *
  10658. * @static
  10659. * @memberOf _
  10660. * @since 0.10.0
  10661. * @category Function
  10662. * @param {Object} object The object to invoke the method on.
  10663. * @param {string} key The key of the method.
  10664. * @param {...*} [partials] The arguments to be partially applied.
  10665. * @returns {Function} Returns the new bound function.
  10666. * @example
  10667. *
  10668. * var object = {
  10669. * 'user': 'fred',
  10670. * 'greet': function(greeting, punctuation) {
  10671. * return greeting + ' ' + this.user + punctuation;
  10672. * }
  10673. * };
  10674. *
  10675. * var bound = _.bindKey(object, 'greet', 'hi');
  10676. * bound('!');
  10677. * // => 'hi fred!'
  10678. *
  10679. * object.greet = function(greeting, punctuation) {
  10680. * return greeting + 'ya ' + this.user + punctuation;
  10681. * };
  10682. *
  10683. * bound('!');
  10684. * // => 'hiya fred!'
  10685. *
  10686. * // Bound with placeholders.
  10687. * var bound = _.bindKey(object, 'greet', _, '!');
  10688. * bound('hi');
  10689. * // => 'hiya fred!'
  10690. */
  10691. var bindKey = baseRest(function(object, key, partials) {
  10692. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10693. if (partials.length) {
  10694. var holders = replaceHolders(partials, getHolder(bindKey));
  10695. bitmask |= WRAP_PARTIAL_FLAG;
  10696. }
  10697. return createWrap(key, bitmask, object, partials, holders);
  10698. });
  10699. /**
  10700. * Creates a function that accepts arguments of `func` and either invokes
  10701. * `func` returning its result, if at least `arity` number of arguments have
  10702. * been provided, or returns a function that accepts the remaining `func`
  10703. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10704. * is not sufficient.
  10705. *
  10706. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10707. * may be used as a placeholder for provided arguments.
  10708. *
  10709. * **Note:** This method doesn't set the "length" property of curried functions.
  10710. *
  10711. * @static
  10712. * @memberOf _
  10713. * @since 2.0.0
  10714. * @category Function
  10715. * @param {Function} func The function to curry.
  10716. * @param {number} [arity=func.length] The arity of `func`.
  10717. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10718. * @returns {Function} Returns the new curried function.
  10719. * @example
  10720. *
  10721. * var abc = function(a, b, c) {
  10722. * return [a, b, c];
  10723. * };
  10724. *
  10725. * var curried = _.curry(abc);
  10726. *
  10727. * curried(1)(2)(3);
  10728. * // => [1, 2, 3]
  10729. *
  10730. * curried(1, 2)(3);
  10731. * // => [1, 2, 3]
  10732. *
  10733. * curried(1, 2, 3);
  10734. * // => [1, 2, 3]
  10735. *
  10736. * // Curried with placeholders.
  10737. * curried(1)(_, 3)(2);
  10738. * // => [1, 2, 3]
  10739. */
  10740. function curry(func, arity, guard) {
  10741. arity = guard ? undefined : arity;
  10742. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10743. result.placeholder = curry.placeholder;
  10744. return result;
  10745. }
  10746. /**
  10747. * This method is like `_.curry` except that arguments are applied to `func`
  10748. * in the manner of `_.partialRight` instead of `_.partial`.
  10749. *
  10750. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10751. * builds, may be used as a placeholder for provided arguments.
  10752. *
  10753. * **Note:** This method doesn't set the "length" property of curried functions.
  10754. *
  10755. * @static
  10756. * @memberOf _
  10757. * @since 3.0.0
  10758. * @category Function
  10759. * @param {Function} func The function to curry.
  10760. * @param {number} [arity=func.length] The arity of `func`.
  10761. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10762. * @returns {Function} Returns the new curried function.
  10763. * @example
  10764. *
  10765. * var abc = function(a, b, c) {
  10766. * return [a, b, c];
  10767. * };
  10768. *
  10769. * var curried = _.curryRight(abc);
  10770. *
  10771. * curried(3)(2)(1);
  10772. * // => [1, 2, 3]
  10773. *
  10774. * curried(2, 3)(1);
  10775. * // => [1, 2, 3]
  10776. *
  10777. * curried(1, 2, 3);
  10778. * // => [1, 2, 3]
  10779. *
  10780. * // Curried with placeholders.
  10781. * curried(3)(1, _)(2);
  10782. * // => [1, 2, 3]
  10783. */
  10784. function curryRight(func, arity, guard) {
  10785. arity = guard ? undefined : arity;
  10786. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10787. result.placeholder = curryRight.placeholder;
  10788. return result;
  10789. }
  10790. /**
  10791. * Creates a debounced function that delays invoking `func` until after `wait`
  10792. * milliseconds have elapsed since the last time the debounced function was
  10793. * invoked. The debounced function comes with a `cancel` method to cancel
  10794. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10795. * Provide `options` to indicate whether `func` should be invoked on the
  10796. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10797. * with the last arguments provided to the debounced function. Subsequent
  10798. * calls to the debounced function return the result of the last `func`
  10799. * invocation.
  10800. *
  10801. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10802. * invoked on the trailing edge of the timeout only if the debounced function
  10803. * is invoked more than once during the `wait` timeout.
  10804. *
  10805. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10806. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10807. *
  10808. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10809. * for details over the differences between `_.debounce` and `_.throttle`.
  10810. *
  10811. * @static
  10812. * @memberOf _
  10813. * @since 0.1.0
  10814. * @category Function
  10815. * @param {Function} func The function to debounce.
  10816. * @param {number} [wait=0] The number of milliseconds to delay.
  10817. * @param {Object} [options={}] The options object.
  10818. * @param {boolean} [options.leading=false]
  10819. * Specify invoking on the leading edge of the timeout.
  10820. * @param {number} [options.maxWait]
  10821. * The maximum time `func` is allowed to be delayed before it's invoked.
  10822. * @param {boolean} [options.trailing=true]
  10823. * Specify invoking on the trailing edge of the timeout.
  10824. * @returns {Function} Returns the new debounced function.
  10825. * @example
  10826. *
  10827. * // Avoid costly calculations while the window size is in flux.
  10828. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10829. *
  10830. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10831. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10832. * 'leading': true,
  10833. * 'trailing': false
  10834. * }));
  10835. *
  10836. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10837. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10838. * var source = new EventSource('/stream');
  10839. * jQuery(source).on('message', debounced);
  10840. *
  10841. * // Cancel the trailing debounced invocation.
  10842. * jQuery(window).on('popstate', debounced.cancel);
  10843. */
  10844. function debounce(func, wait, options) {
  10845. var lastArgs,
  10846. lastThis,
  10847. maxWait,
  10848. result,
  10849. timerId,
  10850. lastCallTime,
  10851. lastInvokeTime = 0,
  10852. leading = false,
  10853. maxing = false,
  10854. trailing = true;
  10855. if (typeof func != 'function') {
  10856. throw new TypeError(FUNC_ERROR_TEXT);
  10857. }
  10858. wait = toNumber(wait) || 0;
  10859. if (isObject(options)) {
  10860. leading = !!options.leading;
  10861. maxing = 'maxWait' in options;
  10862. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10863. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10864. }
  10865. function invokeFunc(time) {
  10866. var args = lastArgs,
  10867. thisArg = lastThis;
  10868. lastArgs = lastThis = undefined;
  10869. lastInvokeTime = time;
  10870. result = func.apply(thisArg, args);
  10871. return result;
  10872. }
  10873. function leadingEdge(time) {
  10874. // Reset any `maxWait` timer.
  10875. lastInvokeTime = time;
  10876. // Start the timer for the trailing edge.
  10877. timerId = setTimeout(timerExpired, wait);
  10878. // Invoke the leading edge.
  10879. return leading ? invokeFunc(time) : result;
  10880. }
  10881. function remainingWait(time) {
  10882. var timeSinceLastCall = time - lastCallTime,
  10883. timeSinceLastInvoke = time - lastInvokeTime,
  10884. timeWaiting = wait - timeSinceLastCall;
  10885. return maxing
  10886. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10887. : timeWaiting;
  10888. }
  10889. function shouldInvoke(time) {
  10890. var timeSinceLastCall = time - lastCallTime,
  10891. timeSinceLastInvoke = time - lastInvokeTime;
  10892. // Either this is the first call, activity has stopped and we're at the
  10893. // trailing edge, the system time has gone backwards and we're treating
  10894. // it as the trailing edge, or we've hit the `maxWait` limit.
  10895. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10896. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10897. }
  10898. function timerExpired() {
  10899. var time = now();
  10900. if (shouldInvoke(time)) {
  10901. return trailingEdge(time);
  10902. }
  10903. // Restart the timer.
  10904. timerId = setTimeout(timerExpired, remainingWait(time));
  10905. }
  10906. function trailingEdge(time) {
  10907. timerId = undefined;
  10908. // Only invoke if we have `lastArgs` which means `func` has been
  10909. // debounced at least once.
  10910. if (trailing && lastArgs) {
  10911. return invokeFunc(time);
  10912. }
  10913. lastArgs = lastThis = undefined;
  10914. return result;
  10915. }
  10916. function cancel() {
  10917. if (timerId !== undefined) {
  10918. clearTimeout(timerId);
  10919. }
  10920. lastInvokeTime = 0;
  10921. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10922. }
  10923. function flush() {
  10924. return timerId === undefined ? result : trailingEdge(now());
  10925. }
  10926. function debounced() {
  10927. var time = now(),
  10928. isInvoking = shouldInvoke(time);
  10929. lastArgs = arguments;
  10930. lastThis = this;
  10931. lastCallTime = time;
  10932. if (isInvoking) {
  10933. if (timerId === undefined) {
  10934. return leadingEdge(lastCallTime);
  10935. }
  10936. if (maxing) {
  10937. // Handle invocations in a tight loop.
  10938. clearTimeout(timerId);
  10939. timerId = setTimeout(timerExpired, wait);
  10940. return invokeFunc(lastCallTime);
  10941. }
  10942. }
  10943. if (timerId === undefined) {
  10944. timerId = setTimeout(timerExpired, wait);
  10945. }
  10946. return result;
  10947. }
  10948. debounced.cancel = cancel;
  10949. debounced.flush = flush;
  10950. return debounced;
  10951. }
  10952. /**
  10953. * Defers invoking the `func` until the current call stack has cleared. Any
  10954. * additional arguments are provided to `func` when it's invoked.
  10955. *
  10956. * @static
  10957. * @memberOf _
  10958. * @since 0.1.0
  10959. * @category Function
  10960. * @param {Function} func The function to defer.
  10961. * @param {...*} [args] The arguments to invoke `func` with.
  10962. * @returns {number} Returns the timer id.
  10963. * @example
  10964. *
  10965. * _.defer(function(text) {
  10966. * console.log(text);
  10967. * }, 'deferred');
  10968. * // => Logs 'deferred' after one millisecond.
  10969. */
  10970. var defer = baseRest(function(func, args) {
  10971. return baseDelay(func, 1, args);
  10972. });
  10973. /**
  10974. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10975. * provided to `func` when it's invoked.
  10976. *
  10977. * @static
  10978. * @memberOf _
  10979. * @since 0.1.0
  10980. * @category Function
  10981. * @param {Function} func The function to delay.
  10982. * @param {number} wait The number of milliseconds to delay invocation.
  10983. * @param {...*} [args] The arguments to invoke `func` with.
  10984. * @returns {number} Returns the timer id.
  10985. * @example
  10986. *
  10987. * _.delay(function(text) {
  10988. * console.log(text);
  10989. * }, 1000, 'later');
  10990. * // => Logs 'later' after one second.
  10991. */
  10992. var delay = baseRest(function(func, wait, args) {
  10993. return baseDelay(func, toNumber(wait) || 0, args);
  10994. });
  10995. /**
  10996. * Creates a function that invokes `func` with arguments reversed.
  10997. *
  10998. * @static
  10999. * @memberOf _
  11000. * @since 4.0.0
  11001. * @category Function
  11002. * @param {Function} func The function to flip arguments for.
  11003. * @returns {Function} Returns the new flipped function.
  11004. * @example
  11005. *
  11006. * var flipped = _.flip(function() {
  11007. * return _.toArray(arguments);
  11008. * });
  11009. *
  11010. * flipped('a', 'b', 'c', 'd');
  11011. * // => ['d', 'c', 'b', 'a']
  11012. */
  11013. function flip(func) {
  11014. return createWrap(func, WRAP_FLIP_FLAG);
  11015. }
  11016. /**
  11017. * Creates a function that memoizes the result of `func`. If `resolver` is
  11018. * provided, it determines the cache key for storing the result based on the
  11019. * arguments provided to the memoized function. By default, the first argument
  11020. * provided to the memoized function is used as the map cache key. The `func`
  11021. * is invoked with the `this` binding of the memoized function.
  11022. *
  11023. * **Note:** The cache is exposed as the `cache` property on the memoized
  11024. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11025. * constructor with one whose instances implement the
  11026. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11027. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11028. *
  11029. * @static
  11030. * @memberOf _
  11031. * @since 0.1.0
  11032. * @category Function
  11033. * @param {Function} func The function to have its output memoized.
  11034. * @param {Function} [resolver] The function to resolve the cache key.
  11035. * @returns {Function} Returns the new memoized function.
  11036. * @example
  11037. *
  11038. * var object = { 'a': 1, 'b': 2 };
  11039. * var other = { 'c': 3, 'd': 4 };
  11040. *
  11041. * var values = _.memoize(_.values);
  11042. * values(object);
  11043. * // => [1, 2]
  11044. *
  11045. * values(other);
  11046. * // => [3, 4]
  11047. *
  11048. * object.a = 2;
  11049. * values(object);
  11050. * // => [1, 2]
  11051. *
  11052. * // Modify the result cache.
  11053. * values.cache.set(object, ['a', 'b']);
  11054. * values(object);
  11055. * // => ['a', 'b']
  11056. *
  11057. * // Replace `_.memoize.Cache`.
  11058. * _.memoize.Cache = WeakMap;
  11059. */
  11060. function memoize(func, resolver) {
  11061. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11062. throw new TypeError(FUNC_ERROR_TEXT);
  11063. }
  11064. var memoized = function() {
  11065. var args = arguments,
  11066. key = resolver ? resolver.apply(this, args) : args[0],
  11067. cache = memoized.cache;
  11068. if (cache.has(key)) {
  11069. return cache.get(key);
  11070. }
  11071. var result = func.apply(this, args);
  11072. memoized.cache = cache.set(key, result) || cache;
  11073. return result;
  11074. };
  11075. memoized.cache = new (memoize.Cache || MapCache);
  11076. return memoized;
  11077. }
  11078. // Expose `MapCache`.
  11079. memoize.Cache = MapCache;
  11080. /**
  11081. * Creates a function that negates the result of the predicate `func`. The
  11082. * `func` predicate is invoked with the `this` binding and arguments of the
  11083. * created function.
  11084. *
  11085. * @static
  11086. * @memberOf _
  11087. * @since 3.0.0
  11088. * @category Function
  11089. * @param {Function} predicate The predicate to negate.
  11090. * @returns {Function} Returns the new negated function.
  11091. * @example
  11092. *
  11093. * function isEven(n) {
  11094. * return n % 2 == 0;
  11095. * }
  11096. *
  11097. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11098. * // => [1, 3, 5]
  11099. */
  11100. function negate(predicate) {
  11101. if (typeof predicate != 'function') {
  11102. throw new TypeError(FUNC_ERROR_TEXT);
  11103. }
  11104. return function() {
  11105. var args = arguments;
  11106. switch (args.length) {
  11107. case 0: return !predicate.call(this);
  11108. case 1: return !predicate.call(this, args[0]);
  11109. case 2: return !predicate.call(this, args[0], args[1]);
  11110. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11111. }
  11112. return !predicate.apply(this, args);
  11113. };
  11114. }
  11115. /**
  11116. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11117. * to the function return the value of the first invocation. The `func` is
  11118. * invoked with the `this` binding and arguments of the created function.
  11119. *
  11120. * @static
  11121. * @memberOf _
  11122. * @since 0.1.0
  11123. * @category Function
  11124. * @param {Function} func The function to restrict.
  11125. * @returns {Function} Returns the new restricted function.
  11126. * @example
  11127. *
  11128. * var initialize = _.once(createApplication);
  11129. * initialize();
  11130. * initialize();
  11131. * // => `createApplication` is invoked once
  11132. */
  11133. function once(func) {
  11134. return before(2, func);
  11135. }
  11136. /**
  11137. * Creates a function that invokes `func` with its arguments transformed.
  11138. *
  11139. * @static
  11140. * @since 4.0.0
  11141. * @memberOf _
  11142. * @category Function
  11143. * @param {Function} func The function to wrap.
  11144. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11145. * The argument transforms.
  11146. * @returns {Function} Returns the new function.
  11147. * @example
  11148. *
  11149. * function doubled(n) {
  11150. * return n * 2;
  11151. * }
  11152. *
  11153. * function square(n) {
  11154. * return n * n;
  11155. * }
  11156. *
  11157. * var func = _.overArgs(function(x, y) {
  11158. * return [x, y];
  11159. * }, [square, doubled]);
  11160. *
  11161. * func(9, 3);
  11162. * // => [81, 6]
  11163. *
  11164. * func(10, 5);
  11165. * // => [100, 10]
  11166. */
  11167. var overArgs = castRest(function(func, transforms) {
  11168. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11169. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11170. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11171. var funcsLength = transforms.length;
  11172. return baseRest(function(args) {
  11173. var index = -1,
  11174. length = nativeMin(args.length, funcsLength);
  11175. while (++index < length) {
  11176. args[index] = transforms[index].call(this, args[index]);
  11177. }
  11178. return apply(func, this, args);
  11179. });
  11180. });
  11181. /**
  11182. * Creates a function that invokes `func` with `partials` prepended to the
  11183. * arguments it receives. This method is like `_.bind` except it does **not**
  11184. * alter the `this` binding.
  11185. *
  11186. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11187. * builds, may be used as a placeholder for partially applied arguments.
  11188. *
  11189. * **Note:** This method doesn't set the "length" property of partially
  11190. * applied functions.
  11191. *
  11192. * @static
  11193. * @memberOf _
  11194. * @since 0.2.0
  11195. * @category Function
  11196. * @param {Function} func The function to partially apply arguments to.
  11197. * @param {...*} [partials] The arguments to be partially applied.
  11198. * @returns {Function} Returns the new partially applied function.
  11199. * @example
  11200. *
  11201. * function greet(greeting, name) {
  11202. * return greeting + ' ' + name;
  11203. * }
  11204. *
  11205. * var sayHelloTo = _.partial(greet, 'hello');
  11206. * sayHelloTo('fred');
  11207. * // => 'hello fred'
  11208. *
  11209. * // Partially applied with placeholders.
  11210. * var greetFred = _.partial(greet, _, 'fred');
  11211. * greetFred('hi');
  11212. * // => 'hi fred'
  11213. */
  11214. var partial = baseRest(function(func, partials) {
  11215. var holders = replaceHolders(partials, getHolder(partial));
  11216. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11217. });
  11218. /**
  11219. * This method is like `_.partial` except that partially applied arguments
  11220. * are appended to the arguments it receives.
  11221. *
  11222. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11223. * builds, may be used as a placeholder for partially applied arguments.
  11224. *
  11225. * **Note:** This method doesn't set the "length" property of partially
  11226. * applied functions.
  11227. *
  11228. * @static
  11229. * @memberOf _
  11230. * @since 1.0.0
  11231. * @category Function
  11232. * @param {Function} func The function to partially apply arguments to.
  11233. * @param {...*} [partials] The arguments to be partially applied.
  11234. * @returns {Function} Returns the new partially applied function.
  11235. * @example
  11236. *
  11237. * function greet(greeting, name) {
  11238. * return greeting + ' ' + name;
  11239. * }
  11240. *
  11241. * var greetFred = _.partialRight(greet, 'fred');
  11242. * greetFred('hi');
  11243. * // => 'hi fred'
  11244. *
  11245. * // Partially applied with placeholders.
  11246. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11247. * sayHelloTo('fred');
  11248. * // => 'hello fred'
  11249. */
  11250. var partialRight = baseRest(function(func, partials) {
  11251. var holders = replaceHolders(partials, getHolder(partialRight));
  11252. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11253. });
  11254. /**
  11255. * Creates a function that invokes `func` with arguments arranged according
  11256. * to the specified `indexes` where the argument value at the first index is
  11257. * provided as the first argument, the argument value at the second index is
  11258. * provided as the second argument, and so on.
  11259. *
  11260. * @static
  11261. * @memberOf _
  11262. * @since 3.0.0
  11263. * @category Function
  11264. * @param {Function} func The function to rearrange arguments for.
  11265. * @param {...(number|number[])} indexes The arranged argument indexes.
  11266. * @returns {Function} Returns the new function.
  11267. * @example
  11268. *
  11269. * var rearged = _.rearg(function(a, b, c) {
  11270. * return [a, b, c];
  11271. * }, [2, 0, 1]);
  11272. *
  11273. * rearged('b', 'c', 'a')
  11274. * // => ['a', 'b', 'c']
  11275. */
  11276. var rearg = flatRest(function(func, indexes) {
  11277. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11278. });
  11279. /**
  11280. * Creates a function that invokes `func` with the `this` binding of the
  11281. * created function and arguments from `start` and beyond provided as
  11282. * an array.
  11283. *
  11284. * **Note:** This method is based on the
  11285. * [rest parameter](https://mdn.io/rest_parameters).
  11286. *
  11287. * @static
  11288. * @memberOf _
  11289. * @since 4.0.0
  11290. * @category Function
  11291. * @param {Function} func The function to apply a rest parameter to.
  11292. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11293. * @returns {Function} Returns the new function.
  11294. * @example
  11295. *
  11296. * var say = _.rest(function(what, names) {
  11297. * return what + ' ' + _.initial(names).join(', ') +
  11298. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11299. * });
  11300. *
  11301. * say('hello', 'fred', 'barney', 'pebbles');
  11302. * // => 'hello fred, barney, & pebbles'
  11303. */
  11304. function rest(func, start) {
  11305. if (typeof func != 'function') {
  11306. throw new TypeError(FUNC_ERROR_TEXT);
  11307. }
  11308. start = start === undefined ? start : toInteger(start);
  11309. return baseRest(func, start);
  11310. }
  11311. /**
  11312. * Creates a function that invokes `func` with the `this` binding of the
  11313. * create function and an array of arguments much like
  11314. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11315. *
  11316. * **Note:** This method is based on the
  11317. * [spread operator](https://mdn.io/spread_operator).
  11318. *
  11319. * @static
  11320. * @memberOf _
  11321. * @since 3.2.0
  11322. * @category Function
  11323. * @param {Function} func The function to spread arguments over.
  11324. * @param {number} [start=0] The start position of the spread.
  11325. * @returns {Function} Returns the new function.
  11326. * @example
  11327. *
  11328. * var say = _.spread(function(who, what) {
  11329. * return who + ' says ' + what;
  11330. * });
  11331. *
  11332. * say(['fred', 'hello']);
  11333. * // => 'fred says hello'
  11334. *
  11335. * var numbers = Promise.all([
  11336. * Promise.resolve(40),
  11337. * Promise.resolve(36)
  11338. * ]);
  11339. *
  11340. * numbers.then(_.spread(function(x, y) {
  11341. * return x + y;
  11342. * }));
  11343. * // => a Promise of 76
  11344. */
  11345. function spread(func, start) {
  11346. if (typeof func != 'function') {
  11347. throw new TypeError(FUNC_ERROR_TEXT);
  11348. }
  11349. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11350. return baseRest(function(args) {
  11351. var array = args[start],
  11352. otherArgs = castSlice(args, 0, start);
  11353. if (array) {
  11354. arrayPush(otherArgs, array);
  11355. }
  11356. return apply(func, this, otherArgs);
  11357. });
  11358. }
  11359. /**
  11360. * Creates a throttled function that only invokes `func` at most once per
  11361. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11362. * method to cancel delayed `func` invocations and a `flush` method to
  11363. * immediately invoke them. Provide `options` to indicate whether `func`
  11364. * should be invoked on the leading and/or trailing edge of the `wait`
  11365. * timeout. The `func` is invoked with the last arguments provided to the
  11366. * throttled function. Subsequent calls to the throttled function return the
  11367. * result of the last `func` invocation.
  11368. *
  11369. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11370. * invoked on the trailing edge of the timeout only if the throttled function
  11371. * is invoked more than once during the `wait` timeout.
  11372. *
  11373. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11374. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11375. *
  11376. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11377. * for details over the differences between `_.throttle` and `_.debounce`.
  11378. *
  11379. * @static
  11380. * @memberOf _
  11381. * @since 0.1.0
  11382. * @category Function
  11383. * @param {Function} func The function to throttle.
  11384. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11385. * @param {Object} [options={}] The options object.
  11386. * @param {boolean} [options.leading=true]
  11387. * Specify invoking on the leading edge of the timeout.
  11388. * @param {boolean} [options.trailing=true]
  11389. * Specify invoking on the trailing edge of the timeout.
  11390. * @returns {Function} Returns the new throttled function.
  11391. * @example
  11392. *
  11393. * // Avoid excessively updating the position while scrolling.
  11394. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11395. *
  11396. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11397. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11398. * jQuery(element).on('click', throttled);
  11399. *
  11400. * // Cancel the trailing throttled invocation.
  11401. * jQuery(window).on('popstate', throttled.cancel);
  11402. */
  11403. function throttle(func, wait, options) {
  11404. var leading = true,
  11405. trailing = true;
  11406. if (typeof func != 'function') {
  11407. throw new TypeError(FUNC_ERROR_TEXT);
  11408. }
  11409. if (isObject(options)) {
  11410. leading = 'leading' in options ? !!options.leading : leading;
  11411. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11412. }
  11413. return debounce(func, wait, {
  11414. 'leading': leading,
  11415. 'maxWait': wait,
  11416. 'trailing': trailing
  11417. });
  11418. }
  11419. /**
  11420. * Creates a function that accepts up to one argument, ignoring any
  11421. * additional arguments.
  11422. *
  11423. * @static
  11424. * @memberOf _
  11425. * @since 4.0.0
  11426. * @category Function
  11427. * @param {Function} func The function to cap arguments for.
  11428. * @returns {Function} Returns the new capped function.
  11429. * @example
  11430. *
  11431. * _.map(['6', '8', '10'], _.unary(parseInt));
  11432. * // => [6, 8, 10]
  11433. */
  11434. function unary(func) {
  11435. return ary(func, 1);
  11436. }
  11437. /**
  11438. * Creates a function that provides `value` to `wrapper` as its first
  11439. * argument. Any additional arguments provided to the function are appended
  11440. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11441. * binding of the created function.
  11442. *
  11443. * @static
  11444. * @memberOf _
  11445. * @since 0.1.0
  11446. * @category Function
  11447. * @param {*} value The value to wrap.
  11448. * @param {Function} [wrapper=identity] The wrapper function.
  11449. * @returns {Function} Returns the new function.
  11450. * @example
  11451. *
  11452. * var p = _.wrap(_.escape, function(func, text) {
  11453. * return '<p>' + func(text) + '</p>';
  11454. * });
  11455. *
  11456. * p('fred, barney, & pebbles');
  11457. * // => '<p>fred, barney, &amp; pebbles</p>'
  11458. */
  11459. function wrap(value, wrapper) {
  11460. return partial(castFunction(wrapper), value);
  11461. }
  11462. /*------------------------------------------------------------------------*/
  11463. /**
  11464. * Casts `value` as an array if it's not one.
  11465. *
  11466. * @static
  11467. * @memberOf _
  11468. * @since 4.4.0
  11469. * @category Lang
  11470. * @param {*} value The value to inspect.
  11471. * @returns {Array} Returns the cast array.
  11472. * @example
  11473. *
  11474. * _.castArray(1);
  11475. * // => [1]
  11476. *
  11477. * _.castArray({ 'a': 1 });
  11478. * // => [{ 'a': 1 }]
  11479. *
  11480. * _.castArray('abc');
  11481. * // => ['abc']
  11482. *
  11483. * _.castArray(null);
  11484. * // => [null]
  11485. *
  11486. * _.castArray(undefined);
  11487. * // => [undefined]
  11488. *
  11489. * _.castArray();
  11490. * // => []
  11491. *
  11492. * var array = [1, 2, 3];
  11493. * console.log(_.castArray(array) === array);
  11494. * // => true
  11495. */
  11496. function castArray() {
  11497. if (!arguments.length) {
  11498. return [];
  11499. }
  11500. var value = arguments[0];
  11501. return isArray(value) ? value : [value];
  11502. }
  11503. /**
  11504. * Creates a shallow clone of `value`.
  11505. *
  11506. * **Note:** This method is loosely based on the
  11507. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11508. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11509. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11510. * arrays. The own enumerable properties of `arguments` objects are cloned
  11511. * as plain objects. An empty object is returned for uncloneable values such
  11512. * as error objects, functions, DOM nodes, and WeakMaps.
  11513. *
  11514. * @static
  11515. * @memberOf _
  11516. * @since 0.1.0
  11517. * @category Lang
  11518. * @param {*} value The value to clone.
  11519. * @returns {*} Returns the cloned value.
  11520. * @see _.cloneDeep
  11521. * @example
  11522. *
  11523. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11524. *
  11525. * var shallow = _.clone(objects);
  11526. * console.log(shallow[0] === objects[0]);
  11527. * // => true
  11528. */
  11529. function clone(value) {
  11530. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11531. }
  11532. /**
  11533. * This method is like `_.clone` except that it accepts `customizer` which
  11534. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11535. * cloning is handled by the method instead. The `customizer` is invoked with
  11536. * up to four arguments; (value [, index|key, object, stack]).
  11537. *
  11538. * @static
  11539. * @memberOf _
  11540. * @since 4.0.0
  11541. * @category Lang
  11542. * @param {*} value The value to clone.
  11543. * @param {Function} [customizer] The function to customize cloning.
  11544. * @returns {*} Returns the cloned value.
  11545. * @see _.cloneDeepWith
  11546. * @example
  11547. *
  11548. * function customizer(value) {
  11549. * if (_.isElement(value)) {
  11550. * return value.cloneNode(false);
  11551. * }
  11552. * }
  11553. *
  11554. * var el = _.cloneWith(document.body, customizer);
  11555. *
  11556. * console.log(el === document.body);
  11557. * // => false
  11558. * console.log(el.nodeName);
  11559. * // => 'BODY'
  11560. * console.log(el.childNodes.length);
  11561. * // => 0
  11562. */
  11563. function cloneWith(value, customizer) {
  11564. customizer = typeof customizer == 'function' ? customizer : undefined;
  11565. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11566. }
  11567. /**
  11568. * This method is like `_.clone` except that it recursively clones `value`.
  11569. *
  11570. * @static
  11571. * @memberOf _
  11572. * @since 1.0.0
  11573. * @category Lang
  11574. * @param {*} value The value to recursively clone.
  11575. * @returns {*} Returns the deep cloned value.
  11576. * @see _.clone
  11577. * @example
  11578. *
  11579. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11580. *
  11581. * var deep = _.cloneDeep(objects);
  11582. * console.log(deep[0] === objects[0]);
  11583. * // => false
  11584. */
  11585. function cloneDeep(value) {
  11586. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11587. }
  11588. /**
  11589. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11590. *
  11591. * @static
  11592. * @memberOf _
  11593. * @since 4.0.0
  11594. * @category Lang
  11595. * @param {*} value The value to recursively clone.
  11596. * @param {Function} [customizer] The function to customize cloning.
  11597. * @returns {*} Returns the deep cloned value.
  11598. * @see _.cloneWith
  11599. * @example
  11600. *
  11601. * function customizer(value) {
  11602. * if (_.isElement(value)) {
  11603. * return value.cloneNode(true);
  11604. * }
  11605. * }
  11606. *
  11607. * var el = _.cloneDeepWith(document.body, customizer);
  11608. *
  11609. * console.log(el === document.body);
  11610. * // => false
  11611. * console.log(el.nodeName);
  11612. * // => 'BODY'
  11613. * console.log(el.childNodes.length);
  11614. * // => 20
  11615. */
  11616. function cloneDeepWith(value, customizer) {
  11617. customizer = typeof customizer == 'function' ? customizer : undefined;
  11618. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11619. }
  11620. /**
  11621. * Checks if `object` conforms to `source` by invoking the predicate
  11622. * properties of `source` with the corresponding property values of `object`.
  11623. *
  11624. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11625. * partially applied.
  11626. *
  11627. * @static
  11628. * @memberOf _
  11629. * @since 4.14.0
  11630. * @category Lang
  11631. * @param {Object} object The object to inspect.
  11632. * @param {Object} source The object of property predicates to conform to.
  11633. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11634. * @example
  11635. *
  11636. * var object = { 'a': 1, 'b': 2 };
  11637. *
  11638. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11639. * // => true
  11640. *
  11641. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11642. * // => false
  11643. */
  11644. function conformsTo(object, source) {
  11645. return source == null || baseConformsTo(object, source, keys(source));
  11646. }
  11647. /**
  11648. * Performs a
  11649. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11650. * comparison between two values to determine if they are equivalent.
  11651. *
  11652. * @static
  11653. * @memberOf _
  11654. * @since 4.0.0
  11655. * @category Lang
  11656. * @param {*} value The value to compare.
  11657. * @param {*} other The other value to compare.
  11658. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11659. * @example
  11660. *
  11661. * var object = { 'a': 1 };
  11662. * var other = { 'a': 1 };
  11663. *
  11664. * _.eq(object, object);
  11665. * // => true
  11666. *
  11667. * _.eq(object, other);
  11668. * // => false
  11669. *
  11670. * _.eq('a', 'a');
  11671. * // => true
  11672. *
  11673. * _.eq('a', Object('a'));
  11674. * // => false
  11675. *
  11676. * _.eq(NaN, NaN);
  11677. * // => true
  11678. */
  11679. function eq(value, other) {
  11680. return value === other || (value !== value && other !== other);
  11681. }
  11682. /**
  11683. * Checks if `value` is greater than `other`.
  11684. *
  11685. * @static
  11686. * @memberOf _
  11687. * @since 3.9.0
  11688. * @category Lang
  11689. * @param {*} value The value to compare.
  11690. * @param {*} other The other value to compare.
  11691. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11692. * else `false`.
  11693. * @see _.lt
  11694. * @example
  11695. *
  11696. * _.gt(3, 1);
  11697. * // => true
  11698. *
  11699. * _.gt(3, 3);
  11700. * // => false
  11701. *
  11702. * _.gt(1, 3);
  11703. * // => false
  11704. */
  11705. var gt = createRelationalOperation(baseGt);
  11706. /**
  11707. * Checks if `value` is greater than or equal to `other`.
  11708. *
  11709. * @static
  11710. * @memberOf _
  11711. * @since 3.9.0
  11712. * @category Lang
  11713. * @param {*} value The value to compare.
  11714. * @param {*} other The other value to compare.
  11715. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11716. * `other`, else `false`.
  11717. * @see _.lte
  11718. * @example
  11719. *
  11720. * _.gte(3, 1);
  11721. * // => true
  11722. *
  11723. * _.gte(3, 3);
  11724. * // => true
  11725. *
  11726. * _.gte(1, 3);
  11727. * // => false
  11728. */
  11729. var gte = createRelationalOperation(function(value, other) {
  11730. return value >= other;
  11731. });
  11732. /**
  11733. * Checks if `value` is likely an `arguments` object.
  11734. *
  11735. * @static
  11736. * @memberOf _
  11737. * @since 0.1.0
  11738. * @category Lang
  11739. * @param {*} value The value to check.
  11740. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11741. * else `false`.
  11742. * @example
  11743. *
  11744. * _.isArguments(function() { return arguments; }());
  11745. * // => true
  11746. *
  11747. * _.isArguments([1, 2, 3]);
  11748. * // => false
  11749. */
  11750. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11751. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11752. !propertyIsEnumerable.call(value, 'callee');
  11753. };
  11754. /**
  11755. * Checks if `value` is classified as an `Array` object.
  11756. *
  11757. * @static
  11758. * @memberOf _
  11759. * @since 0.1.0
  11760. * @category Lang
  11761. * @param {*} value The value to check.
  11762. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11763. * @example
  11764. *
  11765. * _.isArray([1, 2, 3]);
  11766. * // => true
  11767. *
  11768. * _.isArray(document.body.children);
  11769. * // => false
  11770. *
  11771. * _.isArray('abc');
  11772. * // => false
  11773. *
  11774. * _.isArray(_.noop);
  11775. * // => false
  11776. */
  11777. var isArray = Array.isArray;
  11778. /**
  11779. * Checks if `value` is classified as an `ArrayBuffer` object.
  11780. *
  11781. * @static
  11782. * @memberOf _
  11783. * @since 4.3.0
  11784. * @category Lang
  11785. * @param {*} value The value to check.
  11786. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11787. * @example
  11788. *
  11789. * _.isArrayBuffer(new ArrayBuffer(2));
  11790. * // => true
  11791. *
  11792. * _.isArrayBuffer(new Array(2));
  11793. * // => false
  11794. */
  11795. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11796. /**
  11797. * Checks if `value` is array-like. A value is considered array-like if it's
  11798. * not a function and has a `value.length` that's an integer greater than or
  11799. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11800. *
  11801. * @static
  11802. * @memberOf _
  11803. * @since 4.0.0
  11804. * @category Lang
  11805. * @param {*} value The value to check.
  11806. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11807. * @example
  11808. *
  11809. * _.isArrayLike([1, 2, 3]);
  11810. * // => true
  11811. *
  11812. * _.isArrayLike(document.body.children);
  11813. * // => true
  11814. *
  11815. * _.isArrayLike('abc');
  11816. * // => true
  11817. *
  11818. * _.isArrayLike(_.noop);
  11819. * // => false
  11820. */
  11821. function isArrayLike(value) {
  11822. return value != null && isLength(value.length) && !isFunction(value);
  11823. }
  11824. /**
  11825. * This method is like `_.isArrayLike` except that it also checks if `value`
  11826. * is an object.
  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 an array-like object,
  11834. * else `false`.
  11835. * @example
  11836. *
  11837. * _.isArrayLikeObject([1, 2, 3]);
  11838. * // => true
  11839. *
  11840. * _.isArrayLikeObject(document.body.children);
  11841. * // => true
  11842. *
  11843. * _.isArrayLikeObject('abc');
  11844. * // => false
  11845. *
  11846. * _.isArrayLikeObject(_.noop);
  11847. * // => false
  11848. */
  11849. function isArrayLikeObject(value) {
  11850. return isObjectLike(value) && isArrayLike(value);
  11851. }
  11852. /**
  11853. * Checks if `value` is classified as a boolean primitive or object.
  11854. *
  11855. * @static
  11856. * @memberOf _
  11857. * @since 0.1.0
  11858. * @category Lang
  11859. * @param {*} value The value to check.
  11860. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11861. * @example
  11862. *
  11863. * _.isBoolean(false);
  11864. * // => true
  11865. *
  11866. * _.isBoolean(null);
  11867. * // => false
  11868. */
  11869. function isBoolean(value) {
  11870. return value === true || value === false ||
  11871. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11872. }
  11873. /**
  11874. * Checks if `value` is a buffer.
  11875. *
  11876. * @static
  11877. * @memberOf _
  11878. * @since 4.3.0
  11879. * @category Lang
  11880. * @param {*} value The value to check.
  11881. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11882. * @example
  11883. *
  11884. * _.isBuffer(new Buffer(2));
  11885. * // => true
  11886. *
  11887. * _.isBuffer(new Uint8Array(2));
  11888. * // => false
  11889. */
  11890. var isBuffer = nativeIsBuffer || stubFalse;
  11891. /**
  11892. * Checks if `value` is classified as a `Date` object.
  11893. *
  11894. * @static
  11895. * @memberOf _
  11896. * @since 0.1.0
  11897. * @category Lang
  11898. * @param {*} value The value to check.
  11899. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11900. * @example
  11901. *
  11902. * _.isDate(new Date);
  11903. * // => true
  11904. *
  11905. * _.isDate('Mon April 23 2012');
  11906. * // => false
  11907. */
  11908. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11909. /**
  11910. * Checks if `value` is likely a DOM element.
  11911. *
  11912. * @static
  11913. * @memberOf _
  11914. * @since 0.1.0
  11915. * @category Lang
  11916. * @param {*} value The value to check.
  11917. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11918. * @example
  11919. *
  11920. * _.isElement(document.body);
  11921. * // => true
  11922. *
  11923. * _.isElement('<body>');
  11924. * // => false
  11925. */
  11926. function isElement(value) {
  11927. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11928. }
  11929. /**
  11930. * Checks if `value` is an empty object, collection, map, or set.
  11931. *
  11932. * Objects are considered empty if they have no own enumerable string keyed
  11933. * properties.
  11934. *
  11935. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11936. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11937. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  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 empty, else `false`.
  11945. * @example
  11946. *
  11947. * _.isEmpty(null);
  11948. * // => true
  11949. *
  11950. * _.isEmpty(true);
  11951. * // => true
  11952. *
  11953. * _.isEmpty(1);
  11954. * // => true
  11955. *
  11956. * _.isEmpty([1, 2, 3]);
  11957. * // => false
  11958. *
  11959. * _.isEmpty({ 'a': 1 });
  11960. * // => false
  11961. */
  11962. function isEmpty(value) {
  11963. if (value == null) {
  11964. return true;
  11965. }
  11966. if (isArrayLike(value) &&
  11967. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11968. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11969. return !value.length;
  11970. }
  11971. var tag = getTag(value);
  11972. if (tag == mapTag || tag == setTag) {
  11973. return !value.size;
  11974. }
  11975. if (isPrototype(value)) {
  11976. return !baseKeys(value).length;
  11977. }
  11978. for (var key in value) {
  11979. if (hasOwnProperty.call(value, key)) {
  11980. return false;
  11981. }
  11982. }
  11983. return true;
  11984. }
  11985. /**
  11986. * Performs a deep comparison between two values to determine if they are
  11987. * equivalent.
  11988. *
  11989. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11990. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11991. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11992. * by their own, not inherited, enumerable properties. Functions and DOM
  11993. * nodes are compared by strict equality, i.e. `===`.
  11994. *
  11995. * @static
  11996. * @memberOf _
  11997. * @since 0.1.0
  11998. * @category Lang
  11999. * @param {*} value The value to compare.
  12000. * @param {*} other The other value to compare.
  12001. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12002. * @example
  12003. *
  12004. * var object = { 'a': 1 };
  12005. * var other = { 'a': 1 };
  12006. *
  12007. * _.isEqual(object, other);
  12008. * // => true
  12009. *
  12010. * object === other;
  12011. * // => false
  12012. */
  12013. function isEqual(value, other) {
  12014. return baseIsEqual(value, other);
  12015. }
  12016. /**
  12017. * This method is like `_.isEqual` except that it accepts `customizer` which
  12018. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12019. * are handled by the method instead. The `customizer` is invoked with up to
  12020. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12021. *
  12022. * @static
  12023. * @memberOf _
  12024. * @since 4.0.0
  12025. * @category Lang
  12026. * @param {*} value The value to compare.
  12027. * @param {*} other The other value to compare.
  12028. * @param {Function} [customizer] The function to customize comparisons.
  12029. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12030. * @example
  12031. *
  12032. * function isGreeting(value) {
  12033. * return /^h(?:i|ello)$/.test(value);
  12034. * }
  12035. *
  12036. * function customizer(objValue, othValue) {
  12037. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12038. * return true;
  12039. * }
  12040. * }
  12041. *
  12042. * var array = ['hello', 'goodbye'];
  12043. * var other = ['hi', 'goodbye'];
  12044. *
  12045. * _.isEqualWith(array, other, customizer);
  12046. * // => true
  12047. */
  12048. function isEqualWith(value, other, customizer) {
  12049. customizer = typeof customizer == 'function' ? customizer : undefined;
  12050. var result = customizer ? customizer(value, other) : undefined;
  12051. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12052. }
  12053. /**
  12054. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12055. * `SyntaxError`, `TypeError`, or `URIError` object.
  12056. *
  12057. * @static
  12058. * @memberOf _
  12059. * @since 3.0.0
  12060. * @category Lang
  12061. * @param {*} value The value to check.
  12062. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12063. * @example
  12064. *
  12065. * _.isError(new Error);
  12066. * // => true
  12067. *
  12068. * _.isError(Error);
  12069. * // => false
  12070. */
  12071. function isError(value) {
  12072. if (!isObjectLike(value)) {
  12073. return false;
  12074. }
  12075. var tag = baseGetTag(value);
  12076. return tag == errorTag || tag == domExcTag ||
  12077. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12078. }
  12079. /**
  12080. * Checks if `value` is a finite primitive number.
  12081. *
  12082. * **Note:** This method is based on
  12083. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12084. *
  12085. * @static
  12086. * @memberOf _
  12087. * @since 0.1.0
  12088. * @category Lang
  12089. * @param {*} value The value to check.
  12090. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12091. * @example
  12092. *
  12093. * _.isFinite(3);
  12094. * // => true
  12095. *
  12096. * _.isFinite(Number.MIN_VALUE);
  12097. * // => true
  12098. *
  12099. * _.isFinite(Infinity);
  12100. * // => false
  12101. *
  12102. * _.isFinite('3');
  12103. * // => false
  12104. */
  12105. function isFinite(value) {
  12106. return typeof value == 'number' && nativeIsFinite(value);
  12107. }
  12108. /**
  12109. * Checks if `value` is classified as a `Function` object.
  12110. *
  12111. * @static
  12112. * @memberOf _
  12113. * @since 0.1.0
  12114. * @category Lang
  12115. * @param {*} value The value to check.
  12116. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12117. * @example
  12118. *
  12119. * _.isFunction(_);
  12120. * // => true
  12121. *
  12122. * _.isFunction(/abc/);
  12123. * // => false
  12124. */
  12125. function isFunction(value) {
  12126. if (!isObject(value)) {
  12127. return false;
  12128. }
  12129. // The use of `Object#toString` avoids issues with the `typeof` operator
  12130. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12131. var tag = baseGetTag(value);
  12132. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12133. }
  12134. /**
  12135. * Checks if `value` is an integer.
  12136. *
  12137. * **Note:** This method is based on
  12138. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12139. *
  12140. * @static
  12141. * @memberOf _
  12142. * @since 4.0.0
  12143. * @category Lang
  12144. * @param {*} value The value to check.
  12145. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12146. * @example
  12147. *
  12148. * _.isInteger(3);
  12149. * // => true
  12150. *
  12151. * _.isInteger(Number.MIN_VALUE);
  12152. * // => false
  12153. *
  12154. * _.isInteger(Infinity);
  12155. * // => false
  12156. *
  12157. * _.isInteger('3');
  12158. * // => false
  12159. */
  12160. function isInteger(value) {
  12161. return typeof value == 'number' && value == toInteger(value);
  12162. }
  12163. /**
  12164. * Checks if `value` is a valid array-like length.
  12165. *
  12166. * **Note:** This method is loosely based on
  12167. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12168. *
  12169. * @static
  12170. * @memberOf _
  12171. * @since 4.0.0
  12172. * @category Lang
  12173. * @param {*} value The value to check.
  12174. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12175. * @example
  12176. *
  12177. * _.isLength(3);
  12178. * // => true
  12179. *
  12180. * _.isLength(Number.MIN_VALUE);
  12181. * // => false
  12182. *
  12183. * _.isLength(Infinity);
  12184. * // => false
  12185. *
  12186. * _.isLength('3');
  12187. * // => false
  12188. */
  12189. function isLength(value) {
  12190. return typeof value == 'number' &&
  12191. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12192. }
  12193. /**
  12194. * Checks if `value` is the
  12195. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12196. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12197. *
  12198. * @static
  12199. * @memberOf _
  12200. * @since 0.1.0
  12201. * @category Lang
  12202. * @param {*} value The value to check.
  12203. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12204. * @example
  12205. *
  12206. * _.isObject({});
  12207. * // => true
  12208. *
  12209. * _.isObject([1, 2, 3]);
  12210. * // => true
  12211. *
  12212. * _.isObject(_.noop);
  12213. * // => true
  12214. *
  12215. * _.isObject(null);
  12216. * // => false
  12217. */
  12218. function isObject(value) {
  12219. var type = typeof value;
  12220. return value != null && (type == 'object' || type == 'function');
  12221. }
  12222. /**
  12223. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12224. * and has a `typeof` result of "object".
  12225. *
  12226. * @static
  12227. * @memberOf _
  12228. * @since 4.0.0
  12229. * @category Lang
  12230. * @param {*} value The value to check.
  12231. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12232. * @example
  12233. *
  12234. * _.isObjectLike({});
  12235. * // => true
  12236. *
  12237. * _.isObjectLike([1, 2, 3]);
  12238. * // => true
  12239. *
  12240. * _.isObjectLike(_.noop);
  12241. * // => false
  12242. *
  12243. * _.isObjectLike(null);
  12244. * // => false
  12245. */
  12246. function isObjectLike(value) {
  12247. return value != null && typeof value == 'object';
  12248. }
  12249. /**
  12250. * Checks if `value` is classified as a `Map` object.
  12251. *
  12252. * @static
  12253. * @memberOf _
  12254. * @since 4.3.0
  12255. * @category Lang
  12256. * @param {*} value The value to check.
  12257. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12258. * @example
  12259. *
  12260. * _.isMap(new Map);
  12261. * // => true
  12262. *
  12263. * _.isMap(new WeakMap);
  12264. * // => false
  12265. */
  12266. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12267. /**
  12268. * Performs a partial deep comparison between `object` and `source` to
  12269. * determine if `object` contains equivalent property values.
  12270. *
  12271. * **Note:** This method is equivalent to `_.matches` when `source` is
  12272. * partially applied.
  12273. *
  12274. * Partial comparisons will match empty array and empty object `source`
  12275. * values against any array or object value, respectively. See `_.isEqual`
  12276. * for a list of supported value comparisons.
  12277. *
  12278. * @static
  12279. * @memberOf _
  12280. * @since 3.0.0
  12281. * @category Lang
  12282. * @param {Object} object The object to inspect.
  12283. * @param {Object} source The object of property values to match.
  12284. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12285. * @example
  12286. *
  12287. * var object = { 'a': 1, 'b': 2 };
  12288. *
  12289. * _.isMatch(object, { 'b': 2 });
  12290. * // => true
  12291. *
  12292. * _.isMatch(object, { 'b': 1 });
  12293. * // => false
  12294. */
  12295. function isMatch(object, source) {
  12296. return object === source || baseIsMatch(object, source, getMatchData(source));
  12297. }
  12298. /**
  12299. * This method is like `_.isMatch` except that it accepts `customizer` which
  12300. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12301. * are handled by the method instead. The `customizer` is invoked with five
  12302. * arguments: (objValue, srcValue, index|key, object, source).
  12303. *
  12304. * @static
  12305. * @memberOf _
  12306. * @since 4.0.0
  12307. * @category Lang
  12308. * @param {Object} object The object to inspect.
  12309. * @param {Object} source The object of property values to match.
  12310. * @param {Function} [customizer] The function to customize comparisons.
  12311. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12312. * @example
  12313. *
  12314. * function isGreeting(value) {
  12315. * return /^h(?:i|ello)$/.test(value);
  12316. * }
  12317. *
  12318. * function customizer(objValue, srcValue) {
  12319. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12320. * return true;
  12321. * }
  12322. * }
  12323. *
  12324. * var object = { 'greeting': 'hello' };
  12325. * var source = { 'greeting': 'hi' };
  12326. *
  12327. * _.isMatchWith(object, source, customizer);
  12328. * // => true
  12329. */
  12330. function isMatchWith(object, source, customizer) {
  12331. customizer = typeof customizer == 'function' ? customizer : undefined;
  12332. return baseIsMatch(object, source, getMatchData(source), customizer);
  12333. }
  12334. /**
  12335. * Checks if `value` is `NaN`.
  12336. *
  12337. * **Note:** This method is based on
  12338. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12339. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12340. * `undefined` and other non-number values.
  12341. *
  12342. * @static
  12343. * @memberOf _
  12344. * @since 0.1.0
  12345. * @category Lang
  12346. * @param {*} value The value to check.
  12347. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12348. * @example
  12349. *
  12350. * _.isNaN(NaN);
  12351. * // => true
  12352. *
  12353. * _.isNaN(new Number(NaN));
  12354. * // => true
  12355. *
  12356. * isNaN(undefined);
  12357. * // => true
  12358. *
  12359. * _.isNaN(undefined);
  12360. * // => false
  12361. */
  12362. function isNaN(value) {
  12363. // An `NaN` primitive is the only value that is not equal to itself.
  12364. // Perform the `toStringTag` check first to avoid errors with some
  12365. // ActiveX objects in IE.
  12366. return isNumber(value) && value != +value;
  12367. }
  12368. /**
  12369. * Checks if `value` is a pristine native function.
  12370. *
  12371. * **Note:** This method can't reliably detect native functions in the presence
  12372. * of the core-js package because core-js circumvents this kind of detection.
  12373. * Despite multiple requests, the core-js maintainer has made it clear: any
  12374. * attempt to fix the detection will be obstructed. As a result, we're left
  12375. * with little choice but to throw an error. Unfortunately, this also affects
  12376. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12377. * which rely on core-js.
  12378. *
  12379. * @static
  12380. * @memberOf _
  12381. * @since 3.0.0
  12382. * @category Lang
  12383. * @param {*} value The value to check.
  12384. * @returns {boolean} Returns `true` if `value` is a native function,
  12385. * else `false`.
  12386. * @example
  12387. *
  12388. * _.isNative(Array.prototype.push);
  12389. * // => true
  12390. *
  12391. * _.isNative(_);
  12392. * // => false
  12393. */
  12394. function isNative(value) {
  12395. if (isMaskable(value)) {
  12396. throw new Error(CORE_ERROR_TEXT);
  12397. }
  12398. return baseIsNative(value);
  12399. }
  12400. /**
  12401. * Checks if `value` is `null`.
  12402. *
  12403. * @static
  12404. * @memberOf _
  12405. * @since 0.1.0
  12406. * @category Lang
  12407. * @param {*} value The value to check.
  12408. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12409. * @example
  12410. *
  12411. * _.isNull(null);
  12412. * // => true
  12413. *
  12414. * _.isNull(void 0);
  12415. * // => false
  12416. */
  12417. function isNull(value) {
  12418. return value === null;
  12419. }
  12420. /**
  12421. * Checks if `value` is `null` or `undefined`.
  12422. *
  12423. * @static
  12424. * @memberOf _
  12425. * @since 4.0.0
  12426. * @category Lang
  12427. * @param {*} value The value to check.
  12428. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12429. * @example
  12430. *
  12431. * _.isNil(null);
  12432. * // => true
  12433. *
  12434. * _.isNil(void 0);
  12435. * // => true
  12436. *
  12437. * _.isNil(NaN);
  12438. * // => false
  12439. */
  12440. function isNil(value) {
  12441. return value == null;
  12442. }
  12443. /**
  12444. * Checks if `value` is classified as a `Number` primitive or object.
  12445. *
  12446. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12447. * classified as numbers, use the `_.isFinite` method.
  12448. *
  12449. * @static
  12450. * @memberOf _
  12451. * @since 0.1.0
  12452. * @category Lang
  12453. * @param {*} value The value to check.
  12454. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12455. * @example
  12456. *
  12457. * _.isNumber(3);
  12458. * // => true
  12459. *
  12460. * _.isNumber(Number.MIN_VALUE);
  12461. * // => true
  12462. *
  12463. * _.isNumber(Infinity);
  12464. * // => true
  12465. *
  12466. * _.isNumber('3');
  12467. * // => false
  12468. */
  12469. function isNumber(value) {
  12470. return typeof value == 'number' ||
  12471. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12472. }
  12473. /**
  12474. * Checks if `value` is a plain object, that is, an object created by the
  12475. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12476. *
  12477. * @static
  12478. * @memberOf _
  12479. * @since 0.8.0
  12480. * @category Lang
  12481. * @param {*} value The value to check.
  12482. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12483. * @example
  12484. *
  12485. * function Foo() {
  12486. * this.a = 1;
  12487. * }
  12488. *
  12489. * _.isPlainObject(new Foo);
  12490. * // => false
  12491. *
  12492. * _.isPlainObject([1, 2, 3]);
  12493. * // => false
  12494. *
  12495. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12496. * // => true
  12497. *
  12498. * _.isPlainObject(Object.create(null));
  12499. * // => true
  12500. */
  12501. function isPlainObject(value) {
  12502. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12503. return false;
  12504. }
  12505. var proto = getPrototype(value);
  12506. if (proto === null) {
  12507. return true;
  12508. }
  12509. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12510. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12511. funcToString.call(Ctor) == objectCtorString;
  12512. }
  12513. /**
  12514. * Checks if `value` is classified as a `RegExp` object.
  12515. *
  12516. * @static
  12517. * @memberOf _
  12518. * @since 0.1.0
  12519. * @category Lang
  12520. * @param {*} value The value to check.
  12521. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12522. * @example
  12523. *
  12524. * _.isRegExp(/abc/);
  12525. * // => true
  12526. *
  12527. * _.isRegExp('/abc/');
  12528. * // => false
  12529. */
  12530. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12531. /**
  12532. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12533. * double precision number which isn't the result of a rounded unsafe integer.
  12534. *
  12535. * **Note:** This method is based on
  12536. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12537. *
  12538. * @static
  12539. * @memberOf _
  12540. * @since 4.0.0
  12541. * @category Lang
  12542. * @param {*} value The value to check.
  12543. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12544. * @example
  12545. *
  12546. * _.isSafeInteger(3);
  12547. * // => true
  12548. *
  12549. * _.isSafeInteger(Number.MIN_VALUE);
  12550. * // => false
  12551. *
  12552. * _.isSafeInteger(Infinity);
  12553. * // => false
  12554. *
  12555. * _.isSafeInteger('3');
  12556. * // => false
  12557. */
  12558. function isSafeInteger(value) {
  12559. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12560. }
  12561. /**
  12562. * Checks if `value` is classified as a `Set` object.
  12563. *
  12564. * @static
  12565. * @memberOf _
  12566. * @since 4.3.0
  12567. * @category Lang
  12568. * @param {*} value The value to check.
  12569. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12570. * @example
  12571. *
  12572. * _.isSet(new Set);
  12573. * // => true
  12574. *
  12575. * _.isSet(new WeakSet);
  12576. * // => false
  12577. */
  12578. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12579. /**
  12580. * Checks if `value` is classified as a `String` primitive or object.
  12581. *
  12582. * @static
  12583. * @since 0.1.0
  12584. * @memberOf _
  12585. * @category Lang
  12586. * @param {*} value The value to check.
  12587. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12588. * @example
  12589. *
  12590. * _.isString('abc');
  12591. * // => true
  12592. *
  12593. * _.isString(1);
  12594. * // => false
  12595. */
  12596. function isString(value) {
  12597. return typeof value == 'string' ||
  12598. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12599. }
  12600. /**
  12601. * Checks if `value` is classified as a `Symbol` primitive or object.
  12602. *
  12603. * @static
  12604. * @memberOf _
  12605. * @since 4.0.0
  12606. * @category Lang
  12607. * @param {*} value The value to check.
  12608. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12609. * @example
  12610. *
  12611. * _.isSymbol(Symbol.iterator);
  12612. * // => true
  12613. *
  12614. * _.isSymbol('abc');
  12615. * // => false
  12616. */
  12617. function isSymbol(value) {
  12618. return typeof value == 'symbol' ||
  12619. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12620. }
  12621. /**
  12622. * Checks if `value` is classified as a typed array.
  12623. *
  12624. * @static
  12625. * @memberOf _
  12626. * @since 3.0.0
  12627. * @category Lang
  12628. * @param {*} value The value to check.
  12629. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12630. * @example
  12631. *
  12632. * _.isTypedArray(new Uint8Array);
  12633. * // => true
  12634. *
  12635. * _.isTypedArray([]);
  12636. * // => false
  12637. */
  12638. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12639. /**
  12640. * Checks if `value` is `undefined`.
  12641. *
  12642. * @static
  12643. * @since 0.1.0
  12644. * @memberOf _
  12645. * @category Lang
  12646. * @param {*} value The value to check.
  12647. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12648. * @example
  12649. *
  12650. * _.isUndefined(void 0);
  12651. * // => true
  12652. *
  12653. * _.isUndefined(null);
  12654. * // => false
  12655. */
  12656. function isUndefined(value) {
  12657. return value === undefined;
  12658. }
  12659. /**
  12660. * Checks if `value` is classified as a `WeakMap` object.
  12661. *
  12662. * @static
  12663. * @memberOf _
  12664. * @since 4.3.0
  12665. * @category Lang
  12666. * @param {*} value The value to check.
  12667. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12668. * @example
  12669. *
  12670. * _.isWeakMap(new WeakMap);
  12671. * // => true
  12672. *
  12673. * _.isWeakMap(new Map);
  12674. * // => false
  12675. */
  12676. function isWeakMap(value) {
  12677. return isObjectLike(value) && getTag(value) == weakMapTag;
  12678. }
  12679. /**
  12680. * Checks if `value` is classified as a `WeakSet` object.
  12681. *
  12682. * @static
  12683. * @memberOf _
  12684. * @since 4.3.0
  12685. * @category Lang
  12686. * @param {*} value The value to check.
  12687. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12688. * @example
  12689. *
  12690. * _.isWeakSet(new WeakSet);
  12691. * // => true
  12692. *
  12693. * _.isWeakSet(new Set);
  12694. * // => false
  12695. */
  12696. function isWeakSet(value) {
  12697. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12698. }
  12699. /**
  12700. * Checks if `value` is less than `other`.
  12701. *
  12702. * @static
  12703. * @memberOf _
  12704. * @since 3.9.0
  12705. * @category Lang
  12706. * @param {*} value The value to compare.
  12707. * @param {*} other The other value to compare.
  12708. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12709. * else `false`.
  12710. * @see _.gt
  12711. * @example
  12712. *
  12713. * _.lt(1, 3);
  12714. * // => true
  12715. *
  12716. * _.lt(3, 3);
  12717. * // => false
  12718. *
  12719. * _.lt(3, 1);
  12720. * // => false
  12721. */
  12722. var lt = createRelationalOperation(baseLt);
  12723. /**
  12724. * Checks if `value` is less than or equal to `other`.
  12725. *
  12726. * @static
  12727. * @memberOf _
  12728. * @since 3.9.0
  12729. * @category Lang
  12730. * @param {*} value The value to compare.
  12731. * @param {*} other The other value to compare.
  12732. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12733. * `other`, else `false`.
  12734. * @see _.gte
  12735. * @example
  12736. *
  12737. * _.lte(1, 3);
  12738. * // => true
  12739. *
  12740. * _.lte(3, 3);
  12741. * // => true
  12742. *
  12743. * _.lte(3, 1);
  12744. * // => false
  12745. */
  12746. var lte = createRelationalOperation(function(value, other) {
  12747. return value <= other;
  12748. });
  12749. /**
  12750. * Converts `value` to an array.
  12751. *
  12752. * @static
  12753. * @since 0.1.0
  12754. * @memberOf _
  12755. * @category Lang
  12756. * @param {*} value The value to convert.
  12757. * @returns {Array} Returns the converted array.
  12758. * @example
  12759. *
  12760. * _.toArray({ 'a': 1, 'b': 2 });
  12761. * // => [1, 2]
  12762. *
  12763. * _.toArray('abc');
  12764. * // => ['a', 'b', 'c']
  12765. *
  12766. * _.toArray(1);
  12767. * // => []
  12768. *
  12769. * _.toArray(null);
  12770. * // => []
  12771. */
  12772. function toArray(value) {
  12773. if (!value) {
  12774. return [];
  12775. }
  12776. if (isArrayLike(value)) {
  12777. return isString(value) ? stringToArray(value) : copyArray(value);
  12778. }
  12779. if (symIterator && value[symIterator]) {
  12780. return iteratorToArray(value[symIterator]());
  12781. }
  12782. var tag = getTag(value),
  12783. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12784. return func(value);
  12785. }
  12786. /**
  12787. * Converts `value` to a finite number.
  12788. *
  12789. * @static
  12790. * @memberOf _
  12791. * @since 4.12.0
  12792. * @category Lang
  12793. * @param {*} value The value to convert.
  12794. * @returns {number} Returns the converted number.
  12795. * @example
  12796. *
  12797. * _.toFinite(3.2);
  12798. * // => 3.2
  12799. *
  12800. * _.toFinite(Number.MIN_VALUE);
  12801. * // => 5e-324
  12802. *
  12803. * _.toFinite(Infinity);
  12804. * // => 1.7976931348623157e+308
  12805. *
  12806. * _.toFinite('3.2');
  12807. * // => 3.2
  12808. */
  12809. function toFinite(value) {
  12810. if (!value) {
  12811. return value === 0 ? value : 0;
  12812. }
  12813. value = toNumber(value);
  12814. if (value === INFINITY || value === -INFINITY) {
  12815. var sign = (value < 0 ? -1 : 1);
  12816. return sign * MAX_INTEGER;
  12817. }
  12818. return value === value ? value : 0;
  12819. }
  12820. /**
  12821. * Converts `value` to an integer.
  12822. *
  12823. * **Note:** This method is loosely based on
  12824. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12825. *
  12826. * @static
  12827. * @memberOf _
  12828. * @since 4.0.0
  12829. * @category Lang
  12830. * @param {*} value The value to convert.
  12831. * @returns {number} Returns the converted integer.
  12832. * @example
  12833. *
  12834. * _.toInteger(3.2);
  12835. * // => 3
  12836. *
  12837. * _.toInteger(Number.MIN_VALUE);
  12838. * // => 0
  12839. *
  12840. * _.toInteger(Infinity);
  12841. * // => 1.7976931348623157e+308
  12842. *
  12843. * _.toInteger('3.2');
  12844. * // => 3
  12845. */
  12846. function toInteger(value) {
  12847. var result = toFinite(value),
  12848. remainder = result % 1;
  12849. return result === result ? (remainder ? result - remainder : result) : 0;
  12850. }
  12851. /**
  12852. * Converts `value` to an integer suitable for use as the length of an
  12853. * array-like object.
  12854. *
  12855. * **Note:** This method is based on
  12856. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12857. *
  12858. * @static
  12859. * @memberOf _
  12860. * @since 4.0.0
  12861. * @category Lang
  12862. * @param {*} value The value to convert.
  12863. * @returns {number} Returns the converted integer.
  12864. * @example
  12865. *
  12866. * _.toLength(3.2);
  12867. * // => 3
  12868. *
  12869. * _.toLength(Number.MIN_VALUE);
  12870. * // => 0
  12871. *
  12872. * _.toLength(Infinity);
  12873. * // => 4294967295
  12874. *
  12875. * _.toLength('3.2');
  12876. * // => 3
  12877. */
  12878. function toLength(value) {
  12879. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12880. }
  12881. /**
  12882. * Converts `value` to a number.
  12883. *
  12884. * @static
  12885. * @memberOf _
  12886. * @since 4.0.0
  12887. * @category Lang
  12888. * @param {*} value The value to process.
  12889. * @returns {number} Returns the number.
  12890. * @example
  12891. *
  12892. * _.toNumber(3.2);
  12893. * // => 3.2
  12894. *
  12895. * _.toNumber(Number.MIN_VALUE);
  12896. * // => 5e-324
  12897. *
  12898. * _.toNumber(Infinity);
  12899. * // => Infinity
  12900. *
  12901. * _.toNumber('3.2');
  12902. * // => 3.2
  12903. */
  12904. function toNumber(value) {
  12905. if (typeof value == 'number') {
  12906. return value;
  12907. }
  12908. if (isSymbol(value)) {
  12909. return NAN;
  12910. }
  12911. if (isObject(value)) {
  12912. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12913. value = isObject(other) ? (other + '') : other;
  12914. }
  12915. if (typeof value != 'string') {
  12916. return value === 0 ? value : +value;
  12917. }
  12918. value = baseTrim(value);
  12919. var isBinary = reIsBinary.test(value);
  12920. return (isBinary || reIsOctal.test(value))
  12921. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12922. : (reIsBadHex.test(value) ? NAN : +value);
  12923. }
  12924. /**
  12925. * Converts `value` to a plain object flattening inherited enumerable string
  12926. * keyed properties of `value` to own properties of the plain object.
  12927. *
  12928. * @static
  12929. * @memberOf _
  12930. * @since 3.0.0
  12931. * @category Lang
  12932. * @param {*} value The value to convert.
  12933. * @returns {Object} Returns the converted plain object.
  12934. * @example
  12935. *
  12936. * function Foo() {
  12937. * this.b = 2;
  12938. * }
  12939. *
  12940. * Foo.prototype.c = 3;
  12941. *
  12942. * _.assign({ 'a': 1 }, new Foo);
  12943. * // => { 'a': 1, 'b': 2 }
  12944. *
  12945. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12946. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12947. */
  12948. function toPlainObject(value) {
  12949. return copyObject(value, keysIn(value));
  12950. }
  12951. /**
  12952. * Converts `value` to a safe integer. A safe integer can be compared and
  12953. * represented correctly.
  12954. *
  12955. * @static
  12956. * @memberOf _
  12957. * @since 4.0.0
  12958. * @category Lang
  12959. * @param {*} value The value to convert.
  12960. * @returns {number} Returns the converted integer.
  12961. * @example
  12962. *
  12963. * _.toSafeInteger(3.2);
  12964. * // => 3
  12965. *
  12966. * _.toSafeInteger(Number.MIN_VALUE);
  12967. * // => 0
  12968. *
  12969. * _.toSafeInteger(Infinity);
  12970. * // => 9007199254740991
  12971. *
  12972. * _.toSafeInteger('3.2');
  12973. * // => 3
  12974. */
  12975. function toSafeInteger(value) {
  12976. return value
  12977. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12978. : (value === 0 ? value : 0);
  12979. }
  12980. /**
  12981. * Converts `value` to a string. An empty string is returned for `null`
  12982. * and `undefined` values. The sign of `-0` is preserved.
  12983. *
  12984. * @static
  12985. * @memberOf _
  12986. * @since 4.0.0
  12987. * @category Lang
  12988. * @param {*} value The value to convert.
  12989. * @returns {string} Returns the converted string.
  12990. * @example
  12991. *
  12992. * _.toString(null);
  12993. * // => ''
  12994. *
  12995. * _.toString(-0);
  12996. * // => '-0'
  12997. *
  12998. * _.toString([1, 2, 3]);
  12999. * // => '1,2,3'
  13000. */
  13001. function toString(value) {
  13002. return value == null ? '' : baseToString(value);
  13003. }
  13004. /*------------------------------------------------------------------------*/
  13005. /**
  13006. * Assigns own enumerable string keyed properties of source objects to the
  13007. * destination object. Source objects are applied from left to right.
  13008. * Subsequent sources overwrite property assignments of previous sources.
  13009. *
  13010. * **Note:** This method mutates `object` and is loosely based on
  13011. * [`Object.assign`](https://mdn.io/Object/assign).
  13012. *
  13013. * @static
  13014. * @memberOf _
  13015. * @since 0.10.0
  13016. * @category Object
  13017. * @param {Object} object The destination object.
  13018. * @param {...Object} [sources] The source objects.
  13019. * @returns {Object} Returns `object`.
  13020. * @see _.assignIn
  13021. * @example
  13022. *
  13023. * function Foo() {
  13024. * this.a = 1;
  13025. * }
  13026. *
  13027. * function Bar() {
  13028. * this.c = 3;
  13029. * }
  13030. *
  13031. * Foo.prototype.b = 2;
  13032. * Bar.prototype.d = 4;
  13033. *
  13034. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13035. * // => { 'a': 1, 'c': 3 }
  13036. */
  13037. var assign = createAssigner(function(object, source) {
  13038. if (isPrototype(source) || isArrayLike(source)) {
  13039. copyObject(source, keys(source), object);
  13040. return;
  13041. }
  13042. for (var key in source) {
  13043. if (hasOwnProperty.call(source, key)) {
  13044. assignValue(object, key, source[key]);
  13045. }
  13046. }
  13047. });
  13048. /**
  13049. * This method is like `_.assign` except that it iterates over own and
  13050. * inherited source properties.
  13051. *
  13052. * **Note:** This method mutates `object`.
  13053. *
  13054. * @static
  13055. * @memberOf _
  13056. * @since 4.0.0
  13057. * @alias extend
  13058. * @category Object
  13059. * @param {Object} object The destination object.
  13060. * @param {...Object} [sources] The source objects.
  13061. * @returns {Object} Returns `object`.
  13062. * @see _.assign
  13063. * @example
  13064. *
  13065. * function Foo() {
  13066. * this.a = 1;
  13067. * }
  13068. *
  13069. * function Bar() {
  13070. * this.c = 3;
  13071. * }
  13072. *
  13073. * Foo.prototype.b = 2;
  13074. * Bar.prototype.d = 4;
  13075. *
  13076. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13077. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13078. */
  13079. var assignIn = createAssigner(function(object, source) {
  13080. copyObject(source, keysIn(source), object);
  13081. });
  13082. /**
  13083. * This method is like `_.assignIn` except that it accepts `customizer`
  13084. * which is invoked to produce the assigned values. If `customizer` returns
  13085. * `undefined`, assignment is handled by the method instead. The `customizer`
  13086. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13087. *
  13088. * **Note:** This method mutates `object`.
  13089. *
  13090. * @static
  13091. * @memberOf _
  13092. * @since 4.0.0
  13093. * @alias extendWith
  13094. * @category Object
  13095. * @param {Object} object The destination object.
  13096. * @param {...Object} sources The source objects.
  13097. * @param {Function} [customizer] The function to customize assigned values.
  13098. * @returns {Object} Returns `object`.
  13099. * @see _.assignWith
  13100. * @example
  13101. *
  13102. * function customizer(objValue, srcValue) {
  13103. * return _.isUndefined(objValue) ? srcValue : objValue;
  13104. * }
  13105. *
  13106. * var defaults = _.partialRight(_.assignInWith, customizer);
  13107. *
  13108. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13109. * // => { 'a': 1, 'b': 2 }
  13110. */
  13111. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13112. copyObject(source, keysIn(source), object, customizer);
  13113. });
  13114. /**
  13115. * This method is like `_.assign` except that it accepts `customizer`
  13116. * which is invoked to produce the assigned values. If `customizer` returns
  13117. * `undefined`, assignment is handled by the method instead. The `customizer`
  13118. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13119. *
  13120. * **Note:** This method mutates `object`.
  13121. *
  13122. * @static
  13123. * @memberOf _
  13124. * @since 4.0.0
  13125. * @category Object
  13126. * @param {Object} object The destination object.
  13127. * @param {...Object} sources The source objects.
  13128. * @param {Function} [customizer] The function to customize assigned values.
  13129. * @returns {Object} Returns `object`.
  13130. * @see _.assignInWith
  13131. * @example
  13132. *
  13133. * function customizer(objValue, srcValue) {
  13134. * return _.isUndefined(objValue) ? srcValue : objValue;
  13135. * }
  13136. *
  13137. * var defaults = _.partialRight(_.assignWith, customizer);
  13138. *
  13139. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13140. * // => { 'a': 1, 'b': 2 }
  13141. */
  13142. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13143. copyObject(source, keys(source), object, customizer);
  13144. });
  13145. /**
  13146. * Creates an array of values corresponding to `paths` of `object`.
  13147. *
  13148. * @static
  13149. * @memberOf _
  13150. * @since 1.0.0
  13151. * @category Object
  13152. * @param {Object} object The object to iterate over.
  13153. * @param {...(string|string[])} [paths] The property paths to pick.
  13154. * @returns {Array} Returns the picked values.
  13155. * @example
  13156. *
  13157. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13158. *
  13159. * _.at(object, ['a[0].b.c', 'a[1]']);
  13160. * // => [3, 4]
  13161. */
  13162. var at = flatRest(baseAt);
  13163. /**
  13164. * Creates an object that inherits from the `prototype` object. If a
  13165. * `properties` object is given, its own enumerable string keyed properties
  13166. * are assigned to the created object.
  13167. *
  13168. * @static
  13169. * @memberOf _
  13170. * @since 2.3.0
  13171. * @category Object
  13172. * @param {Object} prototype The object to inherit from.
  13173. * @param {Object} [properties] The properties to assign to the object.
  13174. * @returns {Object} Returns the new object.
  13175. * @example
  13176. *
  13177. * function Shape() {
  13178. * this.x = 0;
  13179. * this.y = 0;
  13180. * }
  13181. *
  13182. * function Circle() {
  13183. * Shape.call(this);
  13184. * }
  13185. *
  13186. * Circle.prototype = _.create(Shape.prototype, {
  13187. * 'constructor': Circle
  13188. * });
  13189. *
  13190. * var circle = new Circle;
  13191. * circle instanceof Circle;
  13192. * // => true
  13193. *
  13194. * circle instanceof Shape;
  13195. * // => true
  13196. */
  13197. function create(prototype, properties) {
  13198. var result = baseCreate(prototype);
  13199. return properties == null ? result : baseAssign(result, properties);
  13200. }
  13201. /**
  13202. * Assigns own and inherited enumerable string keyed properties of source
  13203. * objects to the destination object for all destination properties that
  13204. * resolve to `undefined`. Source objects are applied from left to right.
  13205. * Once a property is set, additional values of the same property are ignored.
  13206. *
  13207. * **Note:** This method mutates `object`.
  13208. *
  13209. * @static
  13210. * @since 0.1.0
  13211. * @memberOf _
  13212. * @category Object
  13213. * @param {Object} object The destination object.
  13214. * @param {...Object} [sources] The source objects.
  13215. * @returns {Object} Returns `object`.
  13216. * @see _.defaultsDeep
  13217. * @example
  13218. *
  13219. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13220. * // => { 'a': 1, 'b': 2 }
  13221. */
  13222. var defaults = baseRest(function(object, sources) {
  13223. object = Object(object);
  13224. var index = -1;
  13225. var length = sources.length;
  13226. var guard = length > 2 ? sources[2] : undefined;
  13227. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13228. length = 1;
  13229. }
  13230. while (++index < length) {
  13231. var source = sources[index];
  13232. var props = keysIn(source);
  13233. var propsIndex = -1;
  13234. var propsLength = props.length;
  13235. while (++propsIndex < propsLength) {
  13236. var key = props[propsIndex];
  13237. var value = object[key];
  13238. if (value === undefined ||
  13239. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13240. object[key] = source[key];
  13241. }
  13242. }
  13243. }
  13244. return object;
  13245. });
  13246. /**
  13247. * This method is like `_.defaults` except that it recursively assigns
  13248. * default properties.
  13249. *
  13250. * **Note:** This method mutates `object`.
  13251. *
  13252. * @static
  13253. * @memberOf _
  13254. * @since 3.10.0
  13255. * @category Object
  13256. * @param {Object} object The destination object.
  13257. * @param {...Object} [sources] The source objects.
  13258. * @returns {Object} Returns `object`.
  13259. * @see _.defaults
  13260. * @example
  13261. *
  13262. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13263. * // => { 'a': { 'b': 2, 'c': 3 } }
  13264. */
  13265. var defaultsDeep = baseRest(function(args) {
  13266. args.push(undefined, customDefaultsMerge);
  13267. return apply(mergeWith, undefined, args);
  13268. });
  13269. /**
  13270. * This method is like `_.find` except that it returns the key of the first
  13271. * element `predicate` returns truthy for instead of the element itself.
  13272. *
  13273. * @static
  13274. * @memberOf _
  13275. * @since 1.1.0
  13276. * @category Object
  13277. * @param {Object} object The object to inspect.
  13278. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13279. * @returns {string|undefined} Returns the key of the matched element,
  13280. * else `undefined`.
  13281. * @example
  13282. *
  13283. * var users = {
  13284. * 'barney': { 'age': 36, 'active': true },
  13285. * 'fred': { 'age': 40, 'active': false },
  13286. * 'pebbles': { 'age': 1, 'active': true }
  13287. * };
  13288. *
  13289. * _.findKey(users, function(o) { return o.age < 40; });
  13290. * // => 'barney' (iteration order is not guaranteed)
  13291. *
  13292. * // The `_.matches` iteratee shorthand.
  13293. * _.findKey(users, { 'age': 1, 'active': true });
  13294. * // => 'pebbles'
  13295. *
  13296. * // The `_.matchesProperty` iteratee shorthand.
  13297. * _.findKey(users, ['active', false]);
  13298. * // => 'fred'
  13299. *
  13300. * // The `_.property` iteratee shorthand.
  13301. * _.findKey(users, 'active');
  13302. * // => 'barney'
  13303. */
  13304. function findKey(object, predicate) {
  13305. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13306. }
  13307. /**
  13308. * This method is like `_.findKey` except that it iterates over elements of
  13309. * a collection in the opposite order.
  13310. *
  13311. * @static
  13312. * @memberOf _
  13313. * @since 2.0.0
  13314. * @category Object
  13315. * @param {Object} object The object to inspect.
  13316. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13317. * @returns {string|undefined} Returns the key of the matched element,
  13318. * else `undefined`.
  13319. * @example
  13320. *
  13321. * var users = {
  13322. * 'barney': { 'age': 36, 'active': true },
  13323. * 'fred': { 'age': 40, 'active': false },
  13324. * 'pebbles': { 'age': 1, 'active': true }
  13325. * };
  13326. *
  13327. * _.findLastKey(users, function(o) { return o.age < 40; });
  13328. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13329. *
  13330. * // The `_.matches` iteratee shorthand.
  13331. * _.findLastKey(users, { 'age': 36, 'active': true });
  13332. * // => 'barney'
  13333. *
  13334. * // The `_.matchesProperty` iteratee shorthand.
  13335. * _.findLastKey(users, ['active', false]);
  13336. * // => 'fred'
  13337. *
  13338. * // The `_.property` iteratee shorthand.
  13339. * _.findLastKey(users, 'active');
  13340. * // => 'pebbles'
  13341. */
  13342. function findLastKey(object, predicate) {
  13343. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13344. }
  13345. /**
  13346. * Iterates over own and inherited enumerable string keyed properties of an
  13347. * object and invokes `iteratee` for each property. The iteratee is invoked
  13348. * with three arguments: (value, key, object). Iteratee functions may exit
  13349. * iteration early by explicitly returning `false`.
  13350. *
  13351. * @static
  13352. * @memberOf _
  13353. * @since 0.3.0
  13354. * @category Object
  13355. * @param {Object} object The object to iterate over.
  13356. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13357. * @returns {Object} Returns `object`.
  13358. * @see _.forInRight
  13359. * @example
  13360. *
  13361. * function Foo() {
  13362. * this.a = 1;
  13363. * this.b = 2;
  13364. * }
  13365. *
  13366. * Foo.prototype.c = 3;
  13367. *
  13368. * _.forIn(new Foo, function(value, key) {
  13369. * console.log(key);
  13370. * });
  13371. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13372. */
  13373. function forIn(object, iteratee) {
  13374. return object == null
  13375. ? object
  13376. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13377. }
  13378. /**
  13379. * This method is like `_.forIn` except that it iterates over properties of
  13380. * `object` in the opposite order.
  13381. *
  13382. * @static
  13383. * @memberOf _
  13384. * @since 2.0.0
  13385. * @category Object
  13386. * @param {Object} object The object to iterate over.
  13387. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13388. * @returns {Object} Returns `object`.
  13389. * @see _.forIn
  13390. * @example
  13391. *
  13392. * function Foo() {
  13393. * this.a = 1;
  13394. * this.b = 2;
  13395. * }
  13396. *
  13397. * Foo.prototype.c = 3;
  13398. *
  13399. * _.forInRight(new Foo, function(value, key) {
  13400. * console.log(key);
  13401. * });
  13402. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13403. */
  13404. function forInRight(object, iteratee) {
  13405. return object == null
  13406. ? object
  13407. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13408. }
  13409. /**
  13410. * Iterates over own enumerable string keyed properties of an object and
  13411. * invokes `iteratee` for each property. The iteratee is invoked with three
  13412. * arguments: (value, key, object). Iteratee functions may exit iteration
  13413. * early by explicitly returning `false`.
  13414. *
  13415. * @static
  13416. * @memberOf _
  13417. * @since 0.3.0
  13418. * @category Object
  13419. * @param {Object} object The object to iterate over.
  13420. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13421. * @returns {Object} Returns `object`.
  13422. * @see _.forOwnRight
  13423. * @example
  13424. *
  13425. * function Foo() {
  13426. * this.a = 1;
  13427. * this.b = 2;
  13428. * }
  13429. *
  13430. * Foo.prototype.c = 3;
  13431. *
  13432. * _.forOwn(new Foo, function(value, key) {
  13433. * console.log(key);
  13434. * });
  13435. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13436. */
  13437. function forOwn(object, iteratee) {
  13438. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13439. }
  13440. /**
  13441. * This method is like `_.forOwn` except that it iterates over properties of
  13442. * `object` in the opposite order.
  13443. *
  13444. * @static
  13445. * @memberOf _
  13446. * @since 2.0.0
  13447. * @category Object
  13448. * @param {Object} object The object to iterate over.
  13449. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13450. * @returns {Object} Returns `object`.
  13451. * @see _.forOwn
  13452. * @example
  13453. *
  13454. * function Foo() {
  13455. * this.a = 1;
  13456. * this.b = 2;
  13457. * }
  13458. *
  13459. * Foo.prototype.c = 3;
  13460. *
  13461. * _.forOwnRight(new Foo, function(value, key) {
  13462. * console.log(key);
  13463. * });
  13464. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13465. */
  13466. function forOwnRight(object, iteratee) {
  13467. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13468. }
  13469. /**
  13470. * Creates an array of function property names from own enumerable properties
  13471. * of `object`.
  13472. *
  13473. * @static
  13474. * @since 0.1.0
  13475. * @memberOf _
  13476. * @category Object
  13477. * @param {Object} object The object to inspect.
  13478. * @returns {Array} Returns the function names.
  13479. * @see _.functionsIn
  13480. * @example
  13481. *
  13482. * function Foo() {
  13483. * this.a = _.constant('a');
  13484. * this.b = _.constant('b');
  13485. * }
  13486. *
  13487. * Foo.prototype.c = _.constant('c');
  13488. *
  13489. * _.functions(new Foo);
  13490. * // => ['a', 'b']
  13491. */
  13492. function functions(object) {
  13493. return object == null ? [] : baseFunctions(object, keys(object));
  13494. }
  13495. /**
  13496. * Creates an array of function property names from own and inherited
  13497. * enumerable properties of `object`.
  13498. *
  13499. * @static
  13500. * @memberOf _
  13501. * @since 4.0.0
  13502. * @category Object
  13503. * @param {Object} object The object to inspect.
  13504. * @returns {Array} Returns the function names.
  13505. * @see _.functions
  13506. * @example
  13507. *
  13508. * function Foo() {
  13509. * this.a = _.constant('a');
  13510. * this.b = _.constant('b');
  13511. * }
  13512. *
  13513. * Foo.prototype.c = _.constant('c');
  13514. *
  13515. * _.functionsIn(new Foo);
  13516. * // => ['a', 'b', 'c']
  13517. */
  13518. function functionsIn(object) {
  13519. return object == null ? [] : baseFunctions(object, keysIn(object));
  13520. }
  13521. /**
  13522. * Gets the value at `path` of `object`. If the resolved value is
  13523. * `undefined`, the `defaultValue` is returned in its place.
  13524. *
  13525. * @static
  13526. * @memberOf _
  13527. * @since 3.7.0
  13528. * @category Object
  13529. * @param {Object} object The object to query.
  13530. * @param {Array|string} path The path of the property to get.
  13531. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13532. * @returns {*} Returns the resolved value.
  13533. * @example
  13534. *
  13535. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13536. *
  13537. * _.get(object, 'a[0].b.c');
  13538. * // => 3
  13539. *
  13540. * _.get(object, ['a', '0', 'b', 'c']);
  13541. * // => 3
  13542. *
  13543. * _.get(object, 'a.b.c', 'default');
  13544. * // => 'default'
  13545. */
  13546. function get(object, path, defaultValue) {
  13547. var result = object == null ? undefined : baseGet(object, path);
  13548. return result === undefined ? defaultValue : result;
  13549. }
  13550. /**
  13551. * Checks if `path` is a direct property of `object`.
  13552. *
  13553. * @static
  13554. * @since 0.1.0
  13555. * @memberOf _
  13556. * @category Object
  13557. * @param {Object} object The object to query.
  13558. * @param {Array|string} path The path to check.
  13559. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13560. * @example
  13561. *
  13562. * var object = { 'a': { 'b': 2 } };
  13563. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13564. *
  13565. * _.has(object, 'a');
  13566. * // => true
  13567. *
  13568. * _.has(object, 'a.b');
  13569. * // => true
  13570. *
  13571. * _.has(object, ['a', 'b']);
  13572. * // => true
  13573. *
  13574. * _.has(other, 'a');
  13575. * // => false
  13576. */
  13577. function has(object, path) {
  13578. return object != null && hasPath(object, path, baseHas);
  13579. }
  13580. /**
  13581. * Checks if `path` is a direct or inherited property of `object`.
  13582. *
  13583. * @static
  13584. * @memberOf _
  13585. * @since 4.0.0
  13586. * @category Object
  13587. * @param {Object} object The object to query.
  13588. * @param {Array|string} path The path to check.
  13589. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13590. * @example
  13591. *
  13592. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13593. *
  13594. * _.hasIn(object, 'a');
  13595. * // => true
  13596. *
  13597. * _.hasIn(object, 'a.b');
  13598. * // => true
  13599. *
  13600. * _.hasIn(object, ['a', 'b']);
  13601. * // => true
  13602. *
  13603. * _.hasIn(object, 'b');
  13604. * // => false
  13605. */
  13606. function hasIn(object, path) {
  13607. return object != null && hasPath(object, path, baseHasIn);
  13608. }
  13609. /**
  13610. * Creates an object composed of the inverted keys and values of `object`.
  13611. * If `object` contains duplicate values, subsequent values overwrite
  13612. * property assignments of previous values.
  13613. *
  13614. * @static
  13615. * @memberOf _
  13616. * @since 0.7.0
  13617. * @category Object
  13618. * @param {Object} object The object to invert.
  13619. * @returns {Object} Returns the new inverted object.
  13620. * @example
  13621. *
  13622. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13623. *
  13624. * _.invert(object);
  13625. * // => { '1': 'c', '2': 'b' }
  13626. */
  13627. var invert = createInverter(function(result, value, key) {
  13628. if (value != null &&
  13629. typeof value.toString != 'function') {
  13630. value = nativeObjectToString.call(value);
  13631. }
  13632. result[value] = key;
  13633. }, constant(identity));
  13634. /**
  13635. * This method is like `_.invert` except that the inverted object is generated
  13636. * from the results of running each element of `object` thru `iteratee`. The
  13637. * corresponding inverted value of each inverted key is an array of keys
  13638. * responsible for generating the inverted value. The iteratee is invoked
  13639. * with one argument: (value).
  13640. *
  13641. * @static
  13642. * @memberOf _
  13643. * @since 4.1.0
  13644. * @category Object
  13645. * @param {Object} object The object to invert.
  13646. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13647. * @returns {Object} Returns the new inverted object.
  13648. * @example
  13649. *
  13650. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13651. *
  13652. * _.invertBy(object);
  13653. * // => { '1': ['a', 'c'], '2': ['b'] }
  13654. *
  13655. * _.invertBy(object, function(value) {
  13656. * return 'group' + value;
  13657. * });
  13658. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13659. */
  13660. var invertBy = createInverter(function(result, value, key) {
  13661. if (value != null &&
  13662. typeof value.toString != 'function') {
  13663. value = nativeObjectToString.call(value);
  13664. }
  13665. if (hasOwnProperty.call(result, value)) {
  13666. result[value].push(key);
  13667. } else {
  13668. result[value] = [key];
  13669. }
  13670. }, getIteratee);
  13671. /**
  13672. * Invokes the method at `path` of `object`.
  13673. *
  13674. * @static
  13675. * @memberOf _
  13676. * @since 4.0.0
  13677. * @category Object
  13678. * @param {Object} object The object to query.
  13679. * @param {Array|string} path The path of the method to invoke.
  13680. * @param {...*} [args] The arguments to invoke the method with.
  13681. * @returns {*} Returns the result of the invoked method.
  13682. * @example
  13683. *
  13684. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13685. *
  13686. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13687. * // => [2, 3]
  13688. */
  13689. var invoke = baseRest(baseInvoke);
  13690. /**
  13691. * Creates an array of the own enumerable property names of `object`.
  13692. *
  13693. * **Note:** Non-object values are coerced to objects. See the
  13694. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13695. * for more details.
  13696. *
  13697. * @static
  13698. * @since 0.1.0
  13699. * @memberOf _
  13700. * @category Object
  13701. * @param {Object} object The object to query.
  13702. * @returns {Array} Returns the array of property names.
  13703. * @example
  13704. *
  13705. * function Foo() {
  13706. * this.a = 1;
  13707. * this.b = 2;
  13708. * }
  13709. *
  13710. * Foo.prototype.c = 3;
  13711. *
  13712. * _.keys(new Foo);
  13713. * // => ['a', 'b'] (iteration order is not guaranteed)
  13714. *
  13715. * _.keys('hi');
  13716. * // => ['0', '1']
  13717. */
  13718. function keys(object) {
  13719. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13720. }
  13721. /**
  13722. * Creates an array of the own and inherited enumerable property names of `object`.
  13723. *
  13724. * **Note:** Non-object values are coerced to objects.
  13725. *
  13726. * @static
  13727. * @memberOf _
  13728. * @since 3.0.0
  13729. * @category Object
  13730. * @param {Object} object The object to query.
  13731. * @returns {Array} Returns the array of property names.
  13732. * @example
  13733. *
  13734. * function Foo() {
  13735. * this.a = 1;
  13736. * this.b = 2;
  13737. * }
  13738. *
  13739. * Foo.prototype.c = 3;
  13740. *
  13741. * _.keysIn(new Foo);
  13742. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13743. */
  13744. function keysIn(object) {
  13745. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13746. }
  13747. /**
  13748. * The opposite of `_.mapValues`; this method creates an object with the
  13749. * same values as `object` and keys generated by running each own enumerable
  13750. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13751. * with three arguments: (value, key, object).
  13752. *
  13753. * @static
  13754. * @memberOf _
  13755. * @since 3.8.0
  13756. * @category Object
  13757. * @param {Object} object The object to iterate over.
  13758. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13759. * @returns {Object} Returns the new mapped object.
  13760. * @see _.mapValues
  13761. * @example
  13762. *
  13763. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13764. * return key + value;
  13765. * });
  13766. * // => { 'a1': 1, 'b2': 2 }
  13767. */
  13768. function mapKeys(object, iteratee) {
  13769. var result = {};
  13770. iteratee = getIteratee(iteratee, 3);
  13771. baseForOwn(object, function(value, key, object) {
  13772. baseAssignValue(result, iteratee(value, key, object), value);
  13773. });
  13774. return result;
  13775. }
  13776. /**
  13777. * Creates an object with the same keys as `object` and values generated
  13778. * by running each own enumerable string keyed property of `object` thru
  13779. * `iteratee`. The iteratee is invoked with three arguments:
  13780. * (value, key, object).
  13781. *
  13782. * @static
  13783. * @memberOf _
  13784. * @since 2.4.0
  13785. * @category Object
  13786. * @param {Object} object The object to iterate over.
  13787. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13788. * @returns {Object} Returns the new mapped object.
  13789. * @see _.mapKeys
  13790. * @example
  13791. *
  13792. * var users = {
  13793. * 'fred': { 'user': 'fred', 'age': 40 },
  13794. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13795. * };
  13796. *
  13797. * _.mapValues(users, function(o) { return o.age; });
  13798. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13799. *
  13800. * // The `_.property` iteratee shorthand.
  13801. * _.mapValues(users, 'age');
  13802. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13803. */
  13804. function mapValues(object, iteratee) {
  13805. var result = {};
  13806. iteratee = getIteratee(iteratee, 3);
  13807. baseForOwn(object, function(value, key, object) {
  13808. baseAssignValue(result, key, iteratee(value, key, object));
  13809. });
  13810. return result;
  13811. }
  13812. /**
  13813. * This method is like `_.assign` except that it recursively merges own and
  13814. * inherited enumerable string keyed properties of source objects into the
  13815. * destination object. Source properties that resolve to `undefined` are
  13816. * skipped if a destination value exists. Array and plain object properties
  13817. * are merged recursively. Other objects and value types are overridden by
  13818. * assignment. Source objects are applied from left to right. Subsequent
  13819. * sources overwrite property assignments of previous sources.
  13820. *
  13821. * **Note:** This method mutates `object`.
  13822. *
  13823. * @static
  13824. * @memberOf _
  13825. * @since 0.5.0
  13826. * @category Object
  13827. * @param {Object} object The destination object.
  13828. * @param {...Object} [sources] The source objects.
  13829. * @returns {Object} Returns `object`.
  13830. * @example
  13831. *
  13832. * var object = {
  13833. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13834. * };
  13835. *
  13836. * var other = {
  13837. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13838. * };
  13839. *
  13840. * _.merge(object, other);
  13841. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13842. */
  13843. var merge = createAssigner(function(object, source, srcIndex) {
  13844. baseMerge(object, source, srcIndex);
  13845. });
  13846. /**
  13847. * This method is like `_.merge` except that it accepts `customizer` which
  13848. * is invoked to produce the merged values of the destination and source
  13849. * properties. If `customizer` returns `undefined`, merging is handled by the
  13850. * method instead. The `customizer` is invoked with six arguments:
  13851. * (objValue, srcValue, key, object, source, stack).
  13852. *
  13853. * **Note:** This method mutates `object`.
  13854. *
  13855. * @static
  13856. * @memberOf _
  13857. * @since 4.0.0
  13858. * @category Object
  13859. * @param {Object} object The destination object.
  13860. * @param {...Object} sources The source objects.
  13861. * @param {Function} customizer The function to customize assigned values.
  13862. * @returns {Object} Returns `object`.
  13863. * @example
  13864. *
  13865. * function customizer(objValue, srcValue) {
  13866. * if (_.isArray(objValue)) {
  13867. * return objValue.concat(srcValue);
  13868. * }
  13869. * }
  13870. *
  13871. * var object = { 'a': [1], 'b': [2] };
  13872. * var other = { 'a': [3], 'b': [4] };
  13873. *
  13874. * _.mergeWith(object, other, customizer);
  13875. * // => { 'a': [1, 3], 'b': [2, 4] }
  13876. */
  13877. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13878. baseMerge(object, source, srcIndex, customizer);
  13879. });
  13880. /**
  13881. * The opposite of `_.pick`; this method creates an object composed of the
  13882. * own and inherited enumerable property paths of `object` that are not omitted.
  13883. *
  13884. * **Note:** This method is considerably slower than `_.pick`.
  13885. *
  13886. * @static
  13887. * @since 0.1.0
  13888. * @memberOf _
  13889. * @category Object
  13890. * @param {Object} object The source object.
  13891. * @param {...(string|string[])} [paths] The property paths to omit.
  13892. * @returns {Object} Returns the new object.
  13893. * @example
  13894. *
  13895. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13896. *
  13897. * _.omit(object, ['a', 'c']);
  13898. * // => { 'b': '2' }
  13899. */
  13900. var omit = flatRest(function(object, paths) {
  13901. var result = {};
  13902. if (object == null) {
  13903. return result;
  13904. }
  13905. var isDeep = false;
  13906. paths = arrayMap(paths, function(path) {
  13907. path = castPath(path, object);
  13908. isDeep || (isDeep = path.length > 1);
  13909. return path;
  13910. });
  13911. copyObject(object, getAllKeysIn(object), result);
  13912. if (isDeep) {
  13913. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13914. }
  13915. var length = paths.length;
  13916. while (length--) {
  13917. baseUnset(result, paths[length]);
  13918. }
  13919. return result;
  13920. });
  13921. /**
  13922. * The opposite of `_.pickBy`; this method creates an object composed of
  13923. * the own and inherited enumerable string keyed properties of `object` that
  13924. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13925. * arguments: (value, key).
  13926. *
  13927. * @static
  13928. * @memberOf _
  13929. * @since 4.0.0
  13930. * @category Object
  13931. * @param {Object} object The source object.
  13932. * @param {Function} [predicate=_.identity] The function invoked per property.
  13933. * @returns {Object} Returns the new object.
  13934. * @example
  13935. *
  13936. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13937. *
  13938. * _.omitBy(object, _.isNumber);
  13939. * // => { 'b': '2' }
  13940. */
  13941. function omitBy(object, predicate) {
  13942. return pickBy(object, negate(getIteratee(predicate)));
  13943. }
  13944. /**
  13945. * Creates an object composed of the picked `object` properties.
  13946. *
  13947. * @static
  13948. * @since 0.1.0
  13949. * @memberOf _
  13950. * @category Object
  13951. * @param {Object} object The source object.
  13952. * @param {...(string|string[])} [paths] The property paths to pick.
  13953. * @returns {Object} Returns the new object.
  13954. * @example
  13955. *
  13956. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13957. *
  13958. * _.pick(object, ['a', 'c']);
  13959. * // => { 'a': 1, 'c': 3 }
  13960. */
  13961. var pick = flatRest(function(object, paths) {
  13962. return object == null ? {} : basePick(object, paths);
  13963. });
  13964. /**
  13965. * Creates an object composed of the `object` properties `predicate` returns
  13966. * truthy for. The predicate is invoked with two arguments: (value, key).
  13967. *
  13968. * @static
  13969. * @memberOf _
  13970. * @since 4.0.0
  13971. * @category Object
  13972. * @param {Object} object The source object.
  13973. * @param {Function} [predicate=_.identity] The function invoked per property.
  13974. * @returns {Object} Returns the new object.
  13975. * @example
  13976. *
  13977. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13978. *
  13979. * _.pickBy(object, _.isNumber);
  13980. * // => { 'a': 1, 'c': 3 }
  13981. */
  13982. function pickBy(object, predicate) {
  13983. if (object == null) {
  13984. return {};
  13985. }
  13986. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13987. return [prop];
  13988. });
  13989. predicate = getIteratee(predicate);
  13990. return basePickBy(object, props, function(value, path) {
  13991. return predicate(value, path[0]);
  13992. });
  13993. }
  13994. /**
  13995. * This method is like `_.get` except that if the resolved value is a
  13996. * function it's invoked with the `this` binding of its parent object and
  13997. * its result is returned.
  13998. *
  13999. * @static
  14000. * @since 0.1.0
  14001. * @memberOf _
  14002. * @category Object
  14003. * @param {Object} object The object to query.
  14004. * @param {Array|string} path The path of the property to resolve.
  14005. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14006. * @returns {*} Returns the resolved value.
  14007. * @example
  14008. *
  14009. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14010. *
  14011. * _.result(object, 'a[0].b.c1');
  14012. * // => 3
  14013. *
  14014. * _.result(object, 'a[0].b.c2');
  14015. * // => 4
  14016. *
  14017. * _.result(object, 'a[0].b.c3', 'default');
  14018. * // => 'default'
  14019. *
  14020. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14021. * // => 'default'
  14022. */
  14023. function result(object, path, defaultValue) {
  14024. path = castPath(path, object);
  14025. var index = -1,
  14026. length = path.length;
  14027. // Ensure the loop is entered when path is empty.
  14028. if (!length) {
  14029. length = 1;
  14030. object = undefined;
  14031. }
  14032. while (++index < length) {
  14033. var value = object == null ? undefined : object[toKey(path[index])];
  14034. if (value === undefined) {
  14035. index = length;
  14036. value = defaultValue;
  14037. }
  14038. object = isFunction(value) ? value.call(object) : value;
  14039. }
  14040. return object;
  14041. }
  14042. /**
  14043. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14044. * it's created. Arrays are created for missing index properties while objects
  14045. * are created for all other missing properties. Use `_.setWith` to customize
  14046. * `path` creation.
  14047. *
  14048. * **Note:** This method mutates `object`.
  14049. *
  14050. * @static
  14051. * @memberOf _
  14052. * @since 3.7.0
  14053. * @category Object
  14054. * @param {Object} object The object to modify.
  14055. * @param {Array|string} path The path of the property to set.
  14056. * @param {*} value The value to set.
  14057. * @returns {Object} Returns `object`.
  14058. * @example
  14059. *
  14060. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14061. *
  14062. * _.set(object, 'a[0].b.c', 4);
  14063. * console.log(object.a[0].b.c);
  14064. * // => 4
  14065. *
  14066. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14067. * console.log(object.x[0].y.z);
  14068. * // => 5
  14069. */
  14070. function set(object, path, value) {
  14071. return object == null ? object : baseSet(object, path, value);
  14072. }
  14073. /**
  14074. * This method is like `_.set` except that it accepts `customizer` which is
  14075. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14076. * path creation is handled by the method instead. The `customizer` is invoked
  14077. * with three arguments: (nsValue, key, nsObject).
  14078. *
  14079. * **Note:** This method mutates `object`.
  14080. *
  14081. * @static
  14082. * @memberOf _
  14083. * @since 4.0.0
  14084. * @category Object
  14085. * @param {Object} object The object to modify.
  14086. * @param {Array|string} path The path of the property to set.
  14087. * @param {*} value The value to set.
  14088. * @param {Function} [customizer] The function to customize assigned values.
  14089. * @returns {Object} Returns `object`.
  14090. * @example
  14091. *
  14092. * var object = {};
  14093. *
  14094. * _.setWith(object, '[0][1]', 'a', Object);
  14095. * // => { '0': { '1': 'a' } }
  14096. */
  14097. function setWith(object, path, value, customizer) {
  14098. customizer = typeof customizer == 'function' ? customizer : undefined;
  14099. return object == null ? object : baseSet(object, path, value, customizer);
  14100. }
  14101. /**
  14102. * Creates an array of own enumerable string keyed-value pairs for `object`
  14103. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14104. * entries are returned.
  14105. *
  14106. * @static
  14107. * @memberOf _
  14108. * @since 4.0.0
  14109. * @alias entries
  14110. * @category Object
  14111. * @param {Object} object The object to query.
  14112. * @returns {Array} Returns the key-value pairs.
  14113. * @example
  14114. *
  14115. * function Foo() {
  14116. * this.a = 1;
  14117. * this.b = 2;
  14118. * }
  14119. *
  14120. * Foo.prototype.c = 3;
  14121. *
  14122. * _.toPairs(new Foo);
  14123. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14124. */
  14125. var toPairs = createToPairs(keys);
  14126. /**
  14127. * Creates an array of own and inherited enumerable string keyed-value pairs
  14128. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14129. * or set, its entries are returned.
  14130. *
  14131. * @static
  14132. * @memberOf _
  14133. * @since 4.0.0
  14134. * @alias entriesIn
  14135. * @category Object
  14136. * @param {Object} object The object to query.
  14137. * @returns {Array} Returns the key-value pairs.
  14138. * @example
  14139. *
  14140. * function Foo() {
  14141. * this.a = 1;
  14142. * this.b = 2;
  14143. * }
  14144. *
  14145. * Foo.prototype.c = 3;
  14146. *
  14147. * _.toPairsIn(new Foo);
  14148. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14149. */
  14150. var toPairsIn = createToPairs(keysIn);
  14151. /**
  14152. * An alternative to `_.reduce`; this method transforms `object` to a new
  14153. * `accumulator` object which is the result of running each of its own
  14154. * enumerable string keyed properties thru `iteratee`, with each invocation
  14155. * potentially mutating the `accumulator` object. If `accumulator` is not
  14156. * provided, a new object with the same `[[Prototype]]` will be used. The
  14157. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14158. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14159. *
  14160. * @static
  14161. * @memberOf _
  14162. * @since 1.3.0
  14163. * @category Object
  14164. * @param {Object} object The object to iterate over.
  14165. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14166. * @param {*} [accumulator] The custom accumulator value.
  14167. * @returns {*} Returns the accumulated value.
  14168. * @example
  14169. *
  14170. * _.transform([2, 3, 4], function(result, n) {
  14171. * result.push(n *= n);
  14172. * return n % 2 == 0;
  14173. * }, []);
  14174. * // => [4, 9]
  14175. *
  14176. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14177. * (result[value] || (result[value] = [])).push(key);
  14178. * }, {});
  14179. * // => { '1': ['a', 'c'], '2': ['b'] }
  14180. */
  14181. function transform(object, iteratee, accumulator) {
  14182. var isArr = isArray(object),
  14183. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14184. iteratee = getIteratee(iteratee, 4);
  14185. if (accumulator == null) {
  14186. var Ctor = object && object.constructor;
  14187. if (isArrLike) {
  14188. accumulator = isArr ? new Ctor : [];
  14189. }
  14190. else if (isObject(object)) {
  14191. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14192. }
  14193. else {
  14194. accumulator = {};
  14195. }
  14196. }
  14197. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14198. return iteratee(accumulator, value, index, object);
  14199. });
  14200. return accumulator;
  14201. }
  14202. /**
  14203. * Removes the property at `path` of `object`.
  14204. *
  14205. * **Note:** This method mutates `object`.
  14206. *
  14207. * @static
  14208. * @memberOf _
  14209. * @since 4.0.0
  14210. * @category Object
  14211. * @param {Object} object The object to modify.
  14212. * @param {Array|string} path The path of the property to unset.
  14213. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14214. * @example
  14215. *
  14216. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14217. * _.unset(object, 'a[0].b.c');
  14218. * // => true
  14219. *
  14220. * console.log(object);
  14221. * // => { 'a': [{ 'b': {} }] };
  14222. *
  14223. * _.unset(object, ['a', '0', 'b', 'c']);
  14224. * // => true
  14225. *
  14226. * console.log(object);
  14227. * // => { 'a': [{ 'b': {} }] };
  14228. */
  14229. function unset(object, path) {
  14230. return object == null ? true : baseUnset(object, path);
  14231. }
  14232. /**
  14233. * This method is like `_.set` except that accepts `updater` to produce the
  14234. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14235. * is invoked with one argument: (value).
  14236. *
  14237. * **Note:** This method mutates `object`.
  14238. *
  14239. * @static
  14240. * @memberOf _
  14241. * @since 4.6.0
  14242. * @category Object
  14243. * @param {Object} object The object to modify.
  14244. * @param {Array|string} path The path of the property to set.
  14245. * @param {Function} updater The function to produce the updated value.
  14246. * @returns {Object} Returns `object`.
  14247. * @example
  14248. *
  14249. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14250. *
  14251. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14252. * console.log(object.a[0].b.c);
  14253. * // => 9
  14254. *
  14255. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14256. * console.log(object.x[0].y.z);
  14257. * // => 0
  14258. */
  14259. function update(object, path, updater) {
  14260. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14261. }
  14262. /**
  14263. * This method is like `_.update` except that it accepts `customizer` which is
  14264. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14265. * path creation is handled by the method instead. The `customizer` is invoked
  14266. * with three arguments: (nsValue, key, nsObject).
  14267. *
  14268. * **Note:** This method mutates `object`.
  14269. *
  14270. * @static
  14271. * @memberOf _
  14272. * @since 4.6.0
  14273. * @category Object
  14274. * @param {Object} object The object to modify.
  14275. * @param {Array|string} path The path of the property to set.
  14276. * @param {Function} updater The function to produce the updated value.
  14277. * @param {Function} [customizer] The function to customize assigned values.
  14278. * @returns {Object} Returns `object`.
  14279. * @example
  14280. *
  14281. * var object = {};
  14282. *
  14283. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14284. * // => { '0': { '1': 'a' } }
  14285. */
  14286. function updateWith(object, path, updater, customizer) {
  14287. customizer = typeof customizer == 'function' ? customizer : undefined;
  14288. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14289. }
  14290. /**
  14291. * Creates an array of the own enumerable string keyed property values of `object`.
  14292. *
  14293. * **Note:** Non-object values are coerced to objects.
  14294. *
  14295. * @static
  14296. * @since 0.1.0
  14297. * @memberOf _
  14298. * @category Object
  14299. * @param {Object} object The object to query.
  14300. * @returns {Array} Returns the array of property values.
  14301. * @example
  14302. *
  14303. * function Foo() {
  14304. * this.a = 1;
  14305. * this.b = 2;
  14306. * }
  14307. *
  14308. * Foo.prototype.c = 3;
  14309. *
  14310. * _.values(new Foo);
  14311. * // => [1, 2] (iteration order is not guaranteed)
  14312. *
  14313. * _.values('hi');
  14314. * // => ['h', 'i']
  14315. */
  14316. function values(object) {
  14317. return object == null ? [] : baseValues(object, keys(object));
  14318. }
  14319. /**
  14320. * Creates an array of the own and inherited enumerable string keyed property
  14321. * values of `object`.
  14322. *
  14323. * **Note:** Non-object values are coerced to objects.
  14324. *
  14325. * @static
  14326. * @memberOf _
  14327. * @since 3.0.0
  14328. * @category Object
  14329. * @param {Object} object The object to query.
  14330. * @returns {Array} Returns the array of property values.
  14331. * @example
  14332. *
  14333. * function Foo() {
  14334. * this.a = 1;
  14335. * this.b = 2;
  14336. * }
  14337. *
  14338. * Foo.prototype.c = 3;
  14339. *
  14340. * _.valuesIn(new Foo);
  14341. * // => [1, 2, 3] (iteration order is not guaranteed)
  14342. */
  14343. function valuesIn(object) {
  14344. return object == null ? [] : baseValues(object, keysIn(object));
  14345. }
  14346. /*------------------------------------------------------------------------*/
  14347. /**
  14348. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14349. *
  14350. * @static
  14351. * @memberOf _
  14352. * @since 4.0.0
  14353. * @category Number
  14354. * @param {number} number The number to clamp.
  14355. * @param {number} [lower] The lower bound.
  14356. * @param {number} upper The upper bound.
  14357. * @returns {number} Returns the clamped number.
  14358. * @example
  14359. *
  14360. * _.clamp(-10, -5, 5);
  14361. * // => -5
  14362. *
  14363. * _.clamp(10, -5, 5);
  14364. * // => 5
  14365. */
  14366. function clamp(number, lower, upper) {
  14367. if (upper === undefined) {
  14368. upper = lower;
  14369. lower = undefined;
  14370. }
  14371. if (upper !== undefined) {
  14372. upper = toNumber(upper);
  14373. upper = upper === upper ? upper : 0;
  14374. }
  14375. if (lower !== undefined) {
  14376. lower = toNumber(lower);
  14377. lower = lower === lower ? lower : 0;
  14378. }
  14379. return baseClamp(toNumber(number), lower, upper);
  14380. }
  14381. /**
  14382. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14383. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14384. * If `start` is greater than `end` the params are swapped to support
  14385. * negative ranges.
  14386. *
  14387. * @static
  14388. * @memberOf _
  14389. * @since 3.3.0
  14390. * @category Number
  14391. * @param {number} number The number to check.
  14392. * @param {number} [start=0] The start of the range.
  14393. * @param {number} end The end of the range.
  14394. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14395. * @see _.range, _.rangeRight
  14396. * @example
  14397. *
  14398. * _.inRange(3, 2, 4);
  14399. * // => true
  14400. *
  14401. * _.inRange(4, 8);
  14402. * // => true
  14403. *
  14404. * _.inRange(4, 2);
  14405. * // => false
  14406. *
  14407. * _.inRange(2, 2);
  14408. * // => false
  14409. *
  14410. * _.inRange(1.2, 2);
  14411. * // => true
  14412. *
  14413. * _.inRange(5.2, 4);
  14414. * // => false
  14415. *
  14416. * _.inRange(-3, -2, -6);
  14417. * // => true
  14418. */
  14419. function inRange(number, start, end) {
  14420. start = toFinite(start);
  14421. if (end === undefined) {
  14422. end = start;
  14423. start = 0;
  14424. } else {
  14425. end = toFinite(end);
  14426. }
  14427. number = toNumber(number);
  14428. return baseInRange(number, start, end);
  14429. }
  14430. /**
  14431. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14432. * If only one argument is provided a number between `0` and the given number
  14433. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14434. * floats, a floating-point number is returned instead of an integer.
  14435. *
  14436. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14437. * floating-point values which can produce unexpected results.
  14438. *
  14439. * @static
  14440. * @memberOf _
  14441. * @since 0.7.0
  14442. * @category Number
  14443. * @param {number} [lower=0] The lower bound.
  14444. * @param {number} [upper=1] The upper bound.
  14445. * @param {boolean} [floating] Specify returning a floating-point number.
  14446. * @returns {number} Returns the random number.
  14447. * @example
  14448. *
  14449. * _.random(0, 5);
  14450. * // => an integer between 0 and 5
  14451. *
  14452. * _.random(5);
  14453. * // => also an integer between 0 and 5
  14454. *
  14455. * _.random(5, true);
  14456. * // => a floating-point number between 0 and 5
  14457. *
  14458. * _.random(1.2, 5.2);
  14459. * // => a floating-point number between 1.2 and 5.2
  14460. */
  14461. function random(lower, upper, floating) {
  14462. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14463. upper = floating = undefined;
  14464. }
  14465. if (floating === undefined) {
  14466. if (typeof upper == 'boolean') {
  14467. floating = upper;
  14468. upper = undefined;
  14469. }
  14470. else if (typeof lower == 'boolean') {
  14471. floating = lower;
  14472. lower = undefined;
  14473. }
  14474. }
  14475. if (lower === undefined && upper === undefined) {
  14476. lower = 0;
  14477. upper = 1;
  14478. }
  14479. else {
  14480. lower = toFinite(lower);
  14481. if (upper === undefined) {
  14482. upper = lower;
  14483. lower = 0;
  14484. } else {
  14485. upper = toFinite(upper);
  14486. }
  14487. }
  14488. if (lower > upper) {
  14489. var temp = lower;
  14490. lower = upper;
  14491. upper = temp;
  14492. }
  14493. if (floating || lower % 1 || upper % 1) {
  14494. var rand = nativeRandom();
  14495. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14496. }
  14497. return baseRandom(lower, upper);
  14498. }
  14499. /*------------------------------------------------------------------------*/
  14500. /**
  14501. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14502. *
  14503. * @static
  14504. * @memberOf _
  14505. * @since 3.0.0
  14506. * @category String
  14507. * @param {string} [string=''] The string to convert.
  14508. * @returns {string} Returns the camel cased string.
  14509. * @example
  14510. *
  14511. * _.camelCase('Foo Bar');
  14512. * // => 'fooBar'
  14513. *
  14514. * _.camelCase('--foo-bar--');
  14515. * // => 'fooBar'
  14516. *
  14517. * _.camelCase('__FOO_BAR__');
  14518. * // => 'fooBar'
  14519. */
  14520. var camelCase = createCompounder(function(result, word, index) {
  14521. word = word.toLowerCase();
  14522. return result + (index ? capitalize(word) : word);
  14523. });
  14524. /**
  14525. * Converts the first character of `string` to upper case and the remaining
  14526. * to lower case.
  14527. *
  14528. * @static
  14529. * @memberOf _
  14530. * @since 3.0.0
  14531. * @category String
  14532. * @param {string} [string=''] The string to capitalize.
  14533. * @returns {string} Returns the capitalized string.
  14534. * @example
  14535. *
  14536. * _.capitalize('FRED');
  14537. * // => 'Fred'
  14538. */
  14539. function capitalize(string) {
  14540. return upperFirst(toString(string).toLowerCase());
  14541. }
  14542. /**
  14543. * Deburrs `string` by converting
  14544. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14545. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14546. * letters to basic Latin letters and removing
  14547. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14548. *
  14549. * @static
  14550. * @memberOf _
  14551. * @since 3.0.0
  14552. * @category String
  14553. * @param {string} [string=''] The string to deburr.
  14554. * @returns {string} Returns the deburred string.
  14555. * @example
  14556. *
  14557. * _.deburr('déjà vu');
  14558. * // => 'deja vu'
  14559. */
  14560. function deburr(string) {
  14561. string = toString(string);
  14562. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14563. }
  14564. /**
  14565. * Checks if `string` ends with the given target string.
  14566. *
  14567. * @static
  14568. * @memberOf _
  14569. * @since 3.0.0
  14570. * @category String
  14571. * @param {string} [string=''] The string to inspect.
  14572. * @param {string} [target] The string to search for.
  14573. * @param {number} [position=string.length] The position to search up to.
  14574. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14575. * else `false`.
  14576. * @example
  14577. *
  14578. * _.endsWith('abc', 'c');
  14579. * // => true
  14580. *
  14581. * _.endsWith('abc', 'b');
  14582. * // => false
  14583. *
  14584. * _.endsWith('abc', 'b', 2);
  14585. * // => true
  14586. */
  14587. function endsWith(string, target, position) {
  14588. string = toString(string);
  14589. target = baseToString(target);
  14590. var length = string.length;
  14591. position = position === undefined
  14592. ? length
  14593. : baseClamp(toInteger(position), 0, length);
  14594. var end = position;
  14595. position -= target.length;
  14596. return position >= 0 && string.slice(position, end) == target;
  14597. }
  14598. /**
  14599. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14600. * corresponding HTML entities.
  14601. *
  14602. * **Note:** No other characters are escaped. To escape additional
  14603. * characters use a third-party library like [_he_](https://mths.be/he).
  14604. *
  14605. * Though the ">" character is escaped for symmetry, characters like
  14606. * ">" and "/" don't need escaping in HTML and have no special meaning
  14607. * unless they're part of a tag or unquoted attribute value. See
  14608. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14609. * (under "semi-related fun fact") for more details.
  14610. *
  14611. * When working with HTML you should always
  14612. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14613. * XSS vectors.
  14614. *
  14615. * @static
  14616. * @since 0.1.0
  14617. * @memberOf _
  14618. * @category String
  14619. * @param {string} [string=''] The string to escape.
  14620. * @returns {string} Returns the escaped string.
  14621. * @example
  14622. *
  14623. * _.escape('fred, barney, & pebbles');
  14624. * // => 'fred, barney, &amp; pebbles'
  14625. */
  14626. function escape(string) {
  14627. string = toString(string);
  14628. return (string && reHasUnescapedHtml.test(string))
  14629. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14630. : string;
  14631. }
  14632. /**
  14633. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14634. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14635. *
  14636. * @static
  14637. * @memberOf _
  14638. * @since 3.0.0
  14639. * @category String
  14640. * @param {string} [string=''] The string to escape.
  14641. * @returns {string} Returns the escaped string.
  14642. * @example
  14643. *
  14644. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14645. * // => '\[lodash\]\(https://lodash\.com/\)'
  14646. */
  14647. function escapeRegExp(string) {
  14648. string = toString(string);
  14649. return (string && reHasRegExpChar.test(string))
  14650. ? string.replace(reRegExpChar, '\\$&')
  14651. : string;
  14652. }
  14653. /**
  14654. * Converts `string` to
  14655. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14656. *
  14657. * @static
  14658. * @memberOf _
  14659. * @since 3.0.0
  14660. * @category String
  14661. * @param {string} [string=''] The string to convert.
  14662. * @returns {string} Returns the kebab cased string.
  14663. * @example
  14664. *
  14665. * _.kebabCase('Foo Bar');
  14666. * // => 'foo-bar'
  14667. *
  14668. * _.kebabCase('fooBar');
  14669. * // => 'foo-bar'
  14670. *
  14671. * _.kebabCase('__FOO_BAR__');
  14672. * // => 'foo-bar'
  14673. */
  14674. var kebabCase = createCompounder(function(result, word, index) {
  14675. return result + (index ? '-' : '') + word.toLowerCase();
  14676. });
  14677. /**
  14678. * Converts `string`, as space separated words, to lower case.
  14679. *
  14680. * @static
  14681. * @memberOf _
  14682. * @since 4.0.0
  14683. * @category String
  14684. * @param {string} [string=''] The string to convert.
  14685. * @returns {string} Returns the lower cased string.
  14686. * @example
  14687. *
  14688. * _.lowerCase('--Foo-Bar--');
  14689. * // => 'foo bar'
  14690. *
  14691. * _.lowerCase('fooBar');
  14692. * // => 'foo bar'
  14693. *
  14694. * _.lowerCase('__FOO_BAR__');
  14695. * // => 'foo bar'
  14696. */
  14697. var lowerCase = createCompounder(function(result, word, index) {
  14698. return result + (index ? ' ' : '') + word.toLowerCase();
  14699. });
  14700. /**
  14701. * Converts the first character of `string` to lower case.
  14702. *
  14703. * @static
  14704. * @memberOf _
  14705. * @since 4.0.0
  14706. * @category String
  14707. * @param {string} [string=''] The string to convert.
  14708. * @returns {string} Returns the converted string.
  14709. * @example
  14710. *
  14711. * _.lowerFirst('Fred');
  14712. * // => 'fred'
  14713. *
  14714. * _.lowerFirst('FRED');
  14715. * // => 'fRED'
  14716. */
  14717. var lowerFirst = createCaseFirst('toLowerCase');
  14718. /**
  14719. * Pads `string` on the left and right sides if it's shorter than `length`.
  14720. * Padding characters are truncated if they can't be evenly divided by `length`.
  14721. *
  14722. * @static
  14723. * @memberOf _
  14724. * @since 3.0.0
  14725. * @category String
  14726. * @param {string} [string=''] The string to pad.
  14727. * @param {number} [length=0] The padding length.
  14728. * @param {string} [chars=' '] The string used as padding.
  14729. * @returns {string} Returns the padded string.
  14730. * @example
  14731. *
  14732. * _.pad('abc', 8);
  14733. * // => ' abc '
  14734. *
  14735. * _.pad('abc', 8, '_-');
  14736. * // => '_-abc_-_'
  14737. *
  14738. * _.pad('abc', 3);
  14739. * // => 'abc'
  14740. */
  14741. function pad(string, length, chars) {
  14742. string = toString(string);
  14743. length = toInteger(length);
  14744. var strLength = length ? stringSize(string) : 0;
  14745. if (!length || strLength >= length) {
  14746. return string;
  14747. }
  14748. var mid = (length - strLength) / 2;
  14749. return (
  14750. createPadding(nativeFloor(mid), chars) +
  14751. string +
  14752. createPadding(nativeCeil(mid), chars)
  14753. );
  14754. }
  14755. /**
  14756. * Pads `string` on the right side if it's shorter than `length`. Padding
  14757. * characters are truncated if they exceed `length`.
  14758. *
  14759. * @static
  14760. * @memberOf _
  14761. * @since 4.0.0
  14762. * @category String
  14763. * @param {string} [string=''] The string to pad.
  14764. * @param {number} [length=0] The padding length.
  14765. * @param {string} [chars=' '] The string used as padding.
  14766. * @returns {string} Returns the padded string.
  14767. * @example
  14768. *
  14769. * _.padEnd('abc', 6);
  14770. * // => 'abc '
  14771. *
  14772. * _.padEnd('abc', 6, '_-');
  14773. * // => 'abc_-_'
  14774. *
  14775. * _.padEnd('abc', 3);
  14776. * // => 'abc'
  14777. */
  14778. function padEnd(string, length, chars) {
  14779. string = toString(string);
  14780. length = toInteger(length);
  14781. var strLength = length ? stringSize(string) : 0;
  14782. return (length && strLength < length)
  14783. ? (string + createPadding(length - strLength, chars))
  14784. : string;
  14785. }
  14786. /**
  14787. * Pads `string` on the left side if it's shorter than `length`. Padding
  14788. * characters are truncated if they exceed `length`.
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 4.0.0
  14793. * @category String
  14794. * @param {string} [string=''] The string to pad.
  14795. * @param {number} [length=0] The padding length.
  14796. * @param {string} [chars=' '] The string used as padding.
  14797. * @returns {string} Returns the padded string.
  14798. * @example
  14799. *
  14800. * _.padStart('abc', 6);
  14801. * // => ' abc'
  14802. *
  14803. * _.padStart('abc', 6, '_-');
  14804. * // => '_-_abc'
  14805. *
  14806. * _.padStart('abc', 3);
  14807. * // => 'abc'
  14808. */
  14809. function padStart(string, length, chars) {
  14810. string = toString(string);
  14811. length = toInteger(length);
  14812. var strLength = length ? stringSize(string) : 0;
  14813. return (length && strLength < length)
  14814. ? (createPadding(length - strLength, chars) + string)
  14815. : string;
  14816. }
  14817. /**
  14818. * Converts `string` to an integer of the specified radix. If `radix` is
  14819. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14820. * hexadecimal, in which case a `radix` of `16` is used.
  14821. *
  14822. * **Note:** This method aligns with the
  14823. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14824. *
  14825. * @static
  14826. * @memberOf _
  14827. * @since 1.1.0
  14828. * @category String
  14829. * @param {string} string The string to convert.
  14830. * @param {number} [radix=10] The radix to interpret `value` by.
  14831. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14832. * @returns {number} Returns the converted integer.
  14833. * @example
  14834. *
  14835. * _.parseInt('08');
  14836. * // => 8
  14837. *
  14838. * _.map(['6', '08', '10'], _.parseInt);
  14839. * // => [6, 8, 10]
  14840. */
  14841. function parseInt(string, radix, guard) {
  14842. if (guard || radix == null) {
  14843. radix = 0;
  14844. } else if (radix) {
  14845. radix = +radix;
  14846. }
  14847. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14848. }
  14849. /**
  14850. * Repeats the given string `n` times.
  14851. *
  14852. * @static
  14853. * @memberOf _
  14854. * @since 3.0.0
  14855. * @category String
  14856. * @param {string} [string=''] The string to repeat.
  14857. * @param {number} [n=1] The number of times to repeat the string.
  14858. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14859. * @returns {string} Returns the repeated string.
  14860. * @example
  14861. *
  14862. * _.repeat('*', 3);
  14863. * // => '***'
  14864. *
  14865. * _.repeat('abc', 2);
  14866. * // => 'abcabc'
  14867. *
  14868. * _.repeat('abc', 0);
  14869. * // => ''
  14870. */
  14871. function repeat(string, n, guard) {
  14872. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14873. n = 1;
  14874. } else {
  14875. n = toInteger(n);
  14876. }
  14877. return baseRepeat(toString(string), n);
  14878. }
  14879. /**
  14880. * Replaces matches for `pattern` in `string` with `replacement`.
  14881. *
  14882. * **Note:** This method is based on
  14883. * [`String#replace`](https://mdn.io/String/replace).
  14884. *
  14885. * @static
  14886. * @memberOf _
  14887. * @since 4.0.0
  14888. * @category String
  14889. * @param {string} [string=''] The string to modify.
  14890. * @param {RegExp|string} pattern The pattern to replace.
  14891. * @param {Function|string} replacement The match replacement.
  14892. * @returns {string} Returns the modified string.
  14893. * @example
  14894. *
  14895. * _.replace('Hi Fred', 'Fred', 'Barney');
  14896. * // => 'Hi Barney'
  14897. */
  14898. function replace() {
  14899. var args = arguments,
  14900. string = toString(args[0]);
  14901. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14902. }
  14903. /**
  14904. * Converts `string` to
  14905. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14906. *
  14907. * @static
  14908. * @memberOf _
  14909. * @since 3.0.0
  14910. * @category String
  14911. * @param {string} [string=''] The string to convert.
  14912. * @returns {string} Returns the snake cased string.
  14913. * @example
  14914. *
  14915. * _.snakeCase('Foo Bar');
  14916. * // => 'foo_bar'
  14917. *
  14918. * _.snakeCase('fooBar');
  14919. * // => 'foo_bar'
  14920. *
  14921. * _.snakeCase('--FOO-BAR--');
  14922. * // => 'foo_bar'
  14923. */
  14924. var snakeCase = createCompounder(function(result, word, index) {
  14925. return result + (index ? '_' : '') + word.toLowerCase();
  14926. });
  14927. /**
  14928. * Splits `string` by `separator`.
  14929. *
  14930. * **Note:** This method is based on
  14931. * [`String#split`](https://mdn.io/String/split).
  14932. *
  14933. * @static
  14934. * @memberOf _
  14935. * @since 4.0.0
  14936. * @category String
  14937. * @param {string} [string=''] The string to split.
  14938. * @param {RegExp|string} separator The separator pattern to split by.
  14939. * @param {number} [limit] The length to truncate results to.
  14940. * @returns {Array} Returns the string segments.
  14941. * @example
  14942. *
  14943. * _.split('a-b-c', '-', 2);
  14944. * // => ['a', 'b']
  14945. */
  14946. function split(string, separator, limit) {
  14947. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14948. separator = limit = undefined;
  14949. }
  14950. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14951. if (!limit) {
  14952. return [];
  14953. }
  14954. string = toString(string);
  14955. if (string && (
  14956. typeof separator == 'string' ||
  14957. (separator != null && !isRegExp(separator))
  14958. )) {
  14959. separator = baseToString(separator);
  14960. if (!separator && hasUnicode(string)) {
  14961. return castSlice(stringToArray(string), 0, limit);
  14962. }
  14963. }
  14964. return string.split(separator, limit);
  14965. }
  14966. /**
  14967. * Converts `string` to
  14968. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14969. *
  14970. * @static
  14971. * @memberOf _
  14972. * @since 3.1.0
  14973. * @category String
  14974. * @param {string} [string=''] The string to convert.
  14975. * @returns {string} Returns the start cased string.
  14976. * @example
  14977. *
  14978. * _.startCase('--foo-bar--');
  14979. * // => 'Foo Bar'
  14980. *
  14981. * _.startCase('fooBar');
  14982. * // => 'Foo Bar'
  14983. *
  14984. * _.startCase('__FOO_BAR__');
  14985. * // => 'FOO BAR'
  14986. */
  14987. var startCase = createCompounder(function(result, word, index) {
  14988. return result + (index ? ' ' : '') + upperFirst(word);
  14989. });
  14990. /**
  14991. * Checks if `string` starts with the given target string.
  14992. *
  14993. * @static
  14994. * @memberOf _
  14995. * @since 3.0.0
  14996. * @category String
  14997. * @param {string} [string=''] The string to inspect.
  14998. * @param {string} [target] The string to search for.
  14999. * @param {number} [position=0] The position to search from.
  15000. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15001. * else `false`.
  15002. * @example
  15003. *
  15004. * _.startsWith('abc', 'a');
  15005. * // => true
  15006. *
  15007. * _.startsWith('abc', 'b');
  15008. * // => false
  15009. *
  15010. * _.startsWith('abc', 'b', 1);
  15011. * // => true
  15012. */
  15013. function startsWith(string, target, position) {
  15014. string = toString(string);
  15015. position = position == null
  15016. ? 0
  15017. : baseClamp(toInteger(position), 0, string.length);
  15018. target = baseToString(target);
  15019. return string.slice(position, position + target.length) == target;
  15020. }
  15021. /**
  15022. * Creates a compiled template function that can interpolate data properties
  15023. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15024. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15025. * properties may be accessed as free variables in the template. If a setting
  15026. * object is given, it takes precedence over `_.templateSettings` values.
  15027. *
  15028. * **Note:** In the development build `_.template` utilizes
  15029. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15030. * for easier debugging.
  15031. *
  15032. * For more information on precompiling templates see
  15033. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15034. *
  15035. * For more information on Chrome extension sandboxes see
  15036. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15037. *
  15038. * @static
  15039. * @since 0.1.0
  15040. * @memberOf _
  15041. * @category String
  15042. * @param {string} [string=''] The template string.
  15043. * @param {Object} [options={}] The options object.
  15044. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15045. * The HTML "escape" delimiter.
  15046. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15047. * The "evaluate" delimiter.
  15048. * @param {Object} [options.imports=_.templateSettings.imports]
  15049. * An object to import into the template as free variables.
  15050. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15051. * The "interpolate" delimiter.
  15052. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15053. * The sourceURL of the compiled template.
  15054. * @param {string} [options.variable='obj']
  15055. * The data object variable name.
  15056. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15057. * @returns {Function} Returns the compiled template function.
  15058. * @example
  15059. *
  15060. * // Use the "interpolate" delimiter to create a compiled template.
  15061. * var compiled = _.template('hello <%= user %>!');
  15062. * compiled({ 'user': 'fred' });
  15063. * // => 'hello fred!'
  15064. *
  15065. * // Use the HTML "escape" delimiter to escape data property values.
  15066. * var compiled = _.template('<b><%- value %></b>');
  15067. * compiled({ 'value': '<script>' });
  15068. * // => '<b>&lt;script&gt;</b>'
  15069. *
  15070. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15071. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15072. * compiled({ 'users': ['fred', 'barney'] });
  15073. * // => '<li>fred</li><li>barney</li>'
  15074. *
  15075. * // Use the internal `print` function in "evaluate" delimiters.
  15076. * var compiled = _.template('<% print("hello " + user); %>!');
  15077. * compiled({ 'user': 'barney' });
  15078. * // => 'hello barney!'
  15079. *
  15080. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15081. * // Disable support by replacing the "interpolate" delimiter.
  15082. * var compiled = _.template('hello ${ user }!');
  15083. * compiled({ 'user': 'pebbles' });
  15084. * // => 'hello pebbles!'
  15085. *
  15086. * // Use backslashes to treat delimiters as plain text.
  15087. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15088. * compiled({ 'value': 'ignored' });
  15089. * // => '<%- value %>'
  15090. *
  15091. * // Use the `imports` option to import `jQuery` as `jq`.
  15092. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15093. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15094. * compiled({ 'users': ['fred', 'barney'] });
  15095. * // => '<li>fred</li><li>barney</li>'
  15096. *
  15097. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15098. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15099. * compiled(data);
  15100. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15101. *
  15102. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15103. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15104. * compiled.source;
  15105. * // => function(data) {
  15106. * // var __t, __p = '';
  15107. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15108. * // return __p;
  15109. * // }
  15110. *
  15111. * // Use custom template delimiters.
  15112. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15113. * var compiled = _.template('hello {{ user }}!');
  15114. * compiled({ 'user': 'mustache' });
  15115. * // => 'hello mustache!'
  15116. *
  15117. * // Use the `source` property to inline compiled templates for meaningful
  15118. * // line numbers in error messages and stack traces.
  15119. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15120. * var JST = {\
  15121. * "main": ' + _.template(mainText).source + '\
  15122. * };\
  15123. * ');
  15124. */
  15125. function template(string, options, guard) {
  15126. // Based on John Resig's `tmpl` implementation
  15127. // (http://ejohn.org/blog/javascript-micro-templating/)
  15128. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15129. var settings = lodash.templateSettings;
  15130. if (guard && isIterateeCall(string, options, guard)) {
  15131. options = undefined;
  15132. }
  15133. string = toString(string);
  15134. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15135. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15136. importsKeys = keys(imports),
  15137. importsValues = baseValues(imports, importsKeys);
  15138. var isEscaping,
  15139. isEvaluating,
  15140. index = 0,
  15141. interpolate = options.interpolate || reNoMatch,
  15142. source = "__p += '";
  15143. // Compile the regexp to match each delimiter.
  15144. var reDelimiters = RegExp(
  15145. (options.escape || reNoMatch).source + '|' +
  15146. interpolate.source + '|' +
  15147. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15148. (options.evaluate || reNoMatch).source + '|$'
  15149. , 'g');
  15150. // Use a sourceURL for easier debugging.
  15151. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15152. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15153. // and escape the comment, thus injecting code that gets evaled.
  15154. var sourceURL = '//# sourceURL=' +
  15155. (hasOwnProperty.call(options, 'sourceURL')
  15156. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15157. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15158. ) + '\n';
  15159. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15160. interpolateValue || (interpolateValue = esTemplateValue);
  15161. // Escape characters that can't be included in string literals.
  15162. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15163. // Replace delimiters with snippets.
  15164. if (escapeValue) {
  15165. isEscaping = true;
  15166. source += "' +\n__e(" + escapeValue + ") +\n'";
  15167. }
  15168. if (evaluateValue) {
  15169. isEvaluating = true;
  15170. source += "';\n" + evaluateValue + ";\n__p += '";
  15171. }
  15172. if (interpolateValue) {
  15173. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15174. }
  15175. index = offset + match.length;
  15176. // The JS engine embedded in Adobe products needs `match` returned in
  15177. // order to produce the correct `offset` value.
  15178. return match;
  15179. });
  15180. source += "';\n";
  15181. // If `variable` is not specified wrap a with-statement around the generated
  15182. // code to add the data object to the top of the scope chain.
  15183. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15184. if (!variable) {
  15185. source = 'with (obj) {\n' + source + '\n}\n';
  15186. }
  15187. // Throw an error if a forbidden character was found in `variable`, to prevent
  15188. // potential command injection attacks.
  15189. else if (reForbiddenIdentifierChars.test(variable)) {
  15190. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15191. }
  15192. // Cleanup code by stripping empty strings.
  15193. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15194. .replace(reEmptyStringMiddle, '$1')
  15195. .replace(reEmptyStringTrailing, '$1;');
  15196. // Frame code as the function body.
  15197. source = 'function(' + (variable || 'obj') + ') {\n' +
  15198. (variable
  15199. ? ''
  15200. : 'obj || (obj = {});\n'
  15201. ) +
  15202. "var __t, __p = ''" +
  15203. (isEscaping
  15204. ? ', __e = _.escape'
  15205. : ''
  15206. ) +
  15207. (isEvaluating
  15208. ? ', __j = Array.prototype.join;\n' +
  15209. "function print() { __p += __j.call(arguments, '') }\n"
  15210. : ';\n'
  15211. ) +
  15212. source +
  15213. 'return __p\n}';
  15214. var result = attempt(function() {
  15215. return Function(importsKeys, sourceURL + 'return ' + source)
  15216. .apply(undefined, importsValues);
  15217. });
  15218. // Provide the compiled function's source by its `toString` method or
  15219. // the `source` property as a convenience for inlining compiled templates.
  15220. result.source = source;
  15221. if (isError(result)) {
  15222. throw result;
  15223. }
  15224. return result;
  15225. }
  15226. /**
  15227. * Converts `string`, as a whole, to lower case just like
  15228. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15229. *
  15230. * @static
  15231. * @memberOf _
  15232. * @since 4.0.0
  15233. * @category String
  15234. * @param {string} [string=''] The string to convert.
  15235. * @returns {string} Returns the lower cased string.
  15236. * @example
  15237. *
  15238. * _.toLower('--Foo-Bar--');
  15239. * // => '--foo-bar--'
  15240. *
  15241. * _.toLower('fooBar');
  15242. * // => 'foobar'
  15243. *
  15244. * _.toLower('__FOO_BAR__');
  15245. * // => '__foo_bar__'
  15246. */
  15247. function toLower(value) {
  15248. return toString(value).toLowerCase();
  15249. }
  15250. /**
  15251. * Converts `string`, as a whole, to upper case just like
  15252. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15253. *
  15254. * @static
  15255. * @memberOf _
  15256. * @since 4.0.0
  15257. * @category String
  15258. * @param {string} [string=''] The string to convert.
  15259. * @returns {string} Returns the upper cased string.
  15260. * @example
  15261. *
  15262. * _.toUpper('--foo-bar--');
  15263. * // => '--FOO-BAR--'
  15264. *
  15265. * _.toUpper('fooBar');
  15266. * // => 'FOOBAR'
  15267. *
  15268. * _.toUpper('__foo_bar__');
  15269. * // => '__FOO_BAR__'
  15270. */
  15271. function toUpper(value) {
  15272. return toString(value).toUpperCase();
  15273. }
  15274. /**
  15275. * Removes leading and trailing whitespace or specified characters from `string`.
  15276. *
  15277. * @static
  15278. * @memberOf _
  15279. * @since 3.0.0
  15280. * @category String
  15281. * @param {string} [string=''] The string to trim.
  15282. * @param {string} [chars=whitespace] The characters to trim.
  15283. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15284. * @returns {string} Returns the trimmed string.
  15285. * @example
  15286. *
  15287. * _.trim(' abc ');
  15288. * // => 'abc'
  15289. *
  15290. * _.trim('-_-abc-_-', '_-');
  15291. * // => 'abc'
  15292. *
  15293. * _.map([' foo ', ' bar '], _.trim);
  15294. * // => ['foo', 'bar']
  15295. */
  15296. function trim(string, chars, guard) {
  15297. string = toString(string);
  15298. if (string && (guard || chars === undefined)) {
  15299. return baseTrim(string);
  15300. }
  15301. if (!string || !(chars = baseToString(chars))) {
  15302. return string;
  15303. }
  15304. var strSymbols = stringToArray(string),
  15305. chrSymbols = stringToArray(chars),
  15306. start = charsStartIndex(strSymbols, chrSymbols),
  15307. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15308. return castSlice(strSymbols, start, end).join('');
  15309. }
  15310. /**
  15311. * Removes trailing whitespace or specified characters from `string`.
  15312. *
  15313. * @static
  15314. * @memberOf _
  15315. * @since 4.0.0
  15316. * @category String
  15317. * @param {string} [string=''] The string to trim.
  15318. * @param {string} [chars=whitespace] The characters to trim.
  15319. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15320. * @returns {string} Returns the trimmed string.
  15321. * @example
  15322. *
  15323. * _.trimEnd(' abc ');
  15324. * // => ' abc'
  15325. *
  15326. * _.trimEnd('-_-abc-_-', '_-');
  15327. * // => '-_-abc'
  15328. */
  15329. function trimEnd(string, chars, guard) {
  15330. string = toString(string);
  15331. if (string && (guard || chars === undefined)) {
  15332. return string.slice(0, trimmedEndIndex(string) + 1);
  15333. }
  15334. if (!string || !(chars = baseToString(chars))) {
  15335. return string;
  15336. }
  15337. var strSymbols = stringToArray(string),
  15338. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15339. return castSlice(strSymbols, 0, end).join('');
  15340. }
  15341. /**
  15342. * Removes leading whitespace or specified characters from `string`.
  15343. *
  15344. * @static
  15345. * @memberOf _
  15346. * @since 4.0.0
  15347. * @category String
  15348. * @param {string} [string=''] The string to trim.
  15349. * @param {string} [chars=whitespace] The characters to trim.
  15350. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15351. * @returns {string} Returns the trimmed string.
  15352. * @example
  15353. *
  15354. * _.trimStart(' abc ');
  15355. * // => 'abc '
  15356. *
  15357. * _.trimStart('-_-abc-_-', '_-');
  15358. * // => 'abc-_-'
  15359. */
  15360. function trimStart(string, chars, guard) {
  15361. string = toString(string);
  15362. if (string && (guard || chars === undefined)) {
  15363. return string.replace(reTrimStart, '');
  15364. }
  15365. if (!string || !(chars = baseToString(chars))) {
  15366. return string;
  15367. }
  15368. var strSymbols = stringToArray(string),
  15369. start = charsStartIndex(strSymbols, stringToArray(chars));
  15370. return castSlice(strSymbols, start).join('');
  15371. }
  15372. /**
  15373. * Truncates `string` if it's longer than the given maximum string length.
  15374. * The last characters of the truncated string are replaced with the omission
  15375. * string which defaults to "...".
  15376. *
  15377. * @static
  15378. * @memberOf _
  15379. * @since 4.0.0
  15380. * @category String
  15381. * @param {string} [string=''] The string to truncate.
  15382. * @param {Object} [options={}] The options object.
  15383. * @param {number} [options.length=30] The maximum string length.
  15384. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15385. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15386. * @returns {string} Returns the truncated string.
  15387. * @example
  15388. *
  15389. * _.truncate('hi-diddly-ho there, neighborino');
  15390. * // => 'hi-diddly-ho there, neighbo...'
  15391. *
  15392. * _.truncate('hi-diddly-ho there, neighborino', {
  15393. * 'length': 24,
  15394. * 'separator': ' '
  15395. * });
  15396. * // => 'hi-diddly-ho there,...'
  15397. *
  15398. * _.truncate('hi-diddly-ho there, neighborino', {
  15399. * 'length': 24,
  15400. * 'separator': /,? +/
  15401. * });
  15402. * // => 'hi-diddly-ho there...'
  15403. *
  15404. * _.truncate('hi-diddly-ho there, neighborino', {
  15405. * 'omission': ' [...]'
  15406. * });
  15407. * // => 'hi-diddly-ho there, neig [...]'
  15408. */
  15409. function truncate(string, options) {
  15410. var length = DEFAULT_TRUNC_LENGTH,
  15411. omission = DEFAULT_TRUNC_OMISSION;
  15412. if (isObject(options)) {
  15413. var separator = 'separator' in options ? options.separator : separator;
  15414. length = 'length' in options ? toInteger(options.length) : length;
  15415. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15416. }
  15417. string = toString(string);
  15418. var strLength = string.length;
  15419. if (hasUnicode(string)) {
  15420. var strSymbols = stringToArray(string);
  15421. strLength = strSymbols.length;
  15422. }
  15423. if (length >= strLength) {
  15424. return string;
  15425. }
  15426. var end = length - stringSize(omission);
  15427. if (end < 1) {
  15428. return omission;
  15429. }
  15430. var result = strSymbols
  15431. ? castSlice(strSymbols, 0, end).join('')
  15432. : string.slice(0, end);
  15433. if (separator === undefined) {
  15434. return result + omission;
  15435. }
  15436. if (strSymbols) {
  15437. end += (result.length - end);
  15438. }
  15439. if (isRegExp(separator)) {
  15440. if (string.slice(end).search(separator)) {
  15441. var match,
  15442. substring = result;
  15443. if (!separator.global) {
  15444. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15445. }
  15446. separator.lastIndex = 0;
  15447. while ((match = separator.exec(substring))) {
  15448. var newEnd = match.index;
  15449. }
  15450. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15451. }
  15452. } else if (string.indexOf(baseToString(separator), end) != end) {
  15453. var index = result.lastIndexOf(separator);
  15454. if (index > -1) {
  15455. result = result.slice(0, index);
  15456. }
  15457. }
  15458. return result + omission;
  15459. }
  15460. /**
  15461. * The inverse of `_.escape`; this method converts the HTML entities
  15462. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15463. * their corresponding characters.
  15464. *
  15465. * **Note:** No other HTML entities are unescaped. To unescape additional
  15466. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15467. *
  15468. * @static
  15469. * @memberOf _
  15470. * @since 0.6.0
  15471. * @category String
  15472. * @param {string} [string=''] The string to unescape.
  15473. * @returns {string} Returns the unescaped string.
  15474. * @example
  15475. *
  15476. * _.unescape('fred, barney, &amp; pebbles');
  15477. * // => 'fred, barney, & pebbles'
  15478. */
  15479. function unescape(string) {
  15480. string = toString(string);
  15481. return (string && reHasEscapedHtml.test(string))
  15482. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15483. : string;
  15484. }
  15485. /**
  15486. * Converts `string`, as space separated words, to upper case.
  15487. *
  15488. * @static
  15489. * @memberOf _
  15490. * @since 4.0.0
  15491. * @category String
  15492. * @param {string} [string=''] The string to convert.
  15493. * @returns {string} Returns the upper cased string.
  15494. * @example
  15495. *
  15496. * _.upperCase('--foo-bar');
  15497. * // => 'FOO BAR'
  15498. *
  15499. * _.upperCase('fooBar');
  15500. * // => 'FOO BAR'
  15501. *
  15502. * _.upperCase('__foo_bar__');
  15503. * // => 'FOO BAR'
  15504. */
  15505. var upperCase = createCompounder(function(result, word, index) {
  15506. return result + (index ? ' ' : '') + word.toUpperCase();
  15507. });
  15508. /**
  15509. * Converts the first character of `string` to upper case.
  15510. *
  15511. * @static
  15512. * @memberOf _
  15513. * @since 4.0.0
  15514. * @category String
  15515. * @param {string} [string=''] The string to convert.
  15516. * @returns {string} Returns the converted string.
  15517. * @example
  15518. *
  15519. * _.upperFirst('fred');
  15520. * // => 'Fred'
  15521. *
  15522. * _.upperFirst('FRED');
  15523. * // => 'FRED'
  15524. */
  15525. var upperFirst = createCaseFirst('toUpperCase');
  15526. /**
  15527. * Splits `string` into an array of its words.
  15528. *
  15529. * @static
  15530. * @memberOf _
  15531. * @since 3.0.0
  15532. * @category String
  15533. * @param {string} [string=''] The string to inspect.
  15534. * @param {RegExp|string} [pattern] The pattern to match words.
  15535. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15536. * @returns {Array} Returns the words of `string`.
  15537. * @example
  15538. *
  15539. * _.words('fred, barney, & pebbles');
  15540. * // => ['fred', 'barney', 'pebbles']
  15541. *
  15542. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15543. * // => ['fred', 'barney', '&', 'pebbles']
  15544. */
  15545. function words(string, pattern, guard) {
  15546. string = toString(string);
  15547. pattern = guard ? undefined : pattern;
  15548. if (pattern === undefined) {
  15549. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15550. }
  15551. return string.match(pattern) || [];
  15552. }
  15553. /*------------------------------------------------------------------------*/
  15554. /**
  15555. * Attempts to invoke `func`, returning either the result or the caught error
  15556. * object. Any additional arguments are provided to `func` when it's invoked.
  15557. *
  15558. * @static
  15559. * @memberOf _
  15560. * @since 3.0.0
  15561. * @category Util
  15562. * @param {Function} func The function to attempt.
  15563. * @param {...*} [args] The arguments to invoke `func` with.
  15564. * @returns {*} Returns the `func` result or error object.
  15565. * @example
  15566. *
  15567. * // Avoid throwing errors for invalid selectors.
  15568. * var elements = _.attempt(function(selector) {
  15569. * return document.querySelectorAll(selector);
  15570. * }, '>_>');
  15571. *
  15572. * if (_.isError(elements)) {
  15573. * elements = [];
  15574. * }
  15575. */
  15576. var attempt = baseRest(function(func, args) {
  15577. try {
  15578. return apply(func, undefined, args);
  15579. } catch (e) {
  15580. return isError(e) ? e : new Error(e);
  15581. }
  15582. });
  15583. /**
  15584. * Binds methods of an object to the object itself, overwriting the existing
  15585. * method.
  15586. *
  15587. * **Note:** This method doesn't set the "length" property of bound functions.
  15588. *
  15589. * @static
  15590. * @since 0.1.0
  15591. * @memberOf _
  15592. * @category Util
  15593. * @param {Object} object The object to bind and assign the bound methods to.
  15594. * @param {...(string|string[])} methodNames The object method names to bind.
  15595. * @returns {Object} Returns `object`.
  15596. * @example
  15597. *
  15598. * var view = {
  15599. * 'label': 'docs',
  15600. * 'click': function() {
  15601. * console.log('clicked ' + this.label);
  15602. * }
  15603. * };
  15604. *
  15605. * _.bindAll(view, ['click']);
  15606. * jQuery(element).on('click', view.click);
  15607. * // => Logs 'clicked docs' when clicked.
  15608. */
  15609. var bindAll = flatRest(function(object, methodNames) {
  15610. arrayEach(methodNames, function(key) {
  15611. key = toKey(key);
  15612. baseAssignValue(object, key, bind(object[key], object));
  15613. });
  15614. return object;
  15615. });
  15616. /**
  15617. * Creates a function that iterates over `pairs` and invokes the corresponding
  15618. * function of the first predicate to return truthy. The predicate-function
  15619. * pairs are invoked with the `this` binding and arguments of the created
  15620. * function.
  15621. *
  15622. * @static
  15623. * @memberOf _
  15624. * @since 4.0.0
  15625. * @category Util
  15626. * @param {Array} pairs The predicate-function pairs.
  15627. * @returns {Function} Returns the new composite function.
  15628. * @example
  15629. *
  15630. * var func = _.cond([
  15631. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15632. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15633. * [_.stubTrue, _.constant('no match')]
  15634. * ]);
  15635. *
  15636. * func({ 'a': 1, 'b': 2 });
  15637. * // => 'matches A'
  15638. *
  15639. * func({ 'a': 0, 'b': 1 });
  15640. * // => 'matches B'
  15641. *
  15642. * func({ 'a': '1', 'b': '2' });
  15643. * // => 'no match'
  15644. */
  15645. function cond(pairs) {
  15646. var length = pairs == null ? 0 : pairs.length,
  15647. toIteratee = getIteratee();
  15648. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15649. if (typeof pair[1] != 'function') {
  15650. throw new TypeError(FUNC_ERROR_TEXT);
  15651. }
  15652. return [toIteratee(pair[0]), pair[1]];
  15653. });
  15654. return baseRest(function(args) {
  15655. var index = -1;
  15656. while (++index < length) {
  15657. var pair = pairs[index];
  15658. if (apply(pair[0], this, args)) {
  15659. return apply(pair[1], this, args);
  15660. }
  15661. }
  15662. });
  15663. }
  15664. /**
  15665. * Creates a function that invokes the predicate properties of `source` with
  15666. * the corresponding property values of a given object, returning `true` if
  15667. * all predicates return truthy, else `false`.
  15668. *
  15669. * **Note:** The created function is equivalent to `_.conformsTo` with
  15670. * `source` partially applied.
  15671. *
  15672. * @static
  15673. * @memberOf _
  15674. * @since 4.0.0
  15675. * @category Util
  15676. * @param {Object} source The object of property predicates to conform to.
  15677. * @returns {Function} Returns the new spec function.
  15678. * @example
  15679. *
  15680. * var objects = [
  15681. * { 'a': 2, 'b': 1 },
  15682. * { 'a': 1, 'b': 2 }
  15683. * ];
  15684. *
  15685. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15686. * // => [{ 'a': 1, 'b': 2 }]
  15687. */
  15688. function conforms(source) {
  15689. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15690. }
  15691. /**
  15692. * Creates a function that returns `value`.
  15693. *
  15694. * @static
  15695. * @memberOf _
  15696. * @since 2.4.0
  15697. * @category Util
  15698. * @param {*} value The value to return from the new function.
  15699. * @returns {Function} Returns the new constant function.
  15700. * @example
  15701. *
  15702. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15703. *
  15704. * console.log(objects);
  15705. * // => [{ 'a': 1 }, { 'a': 1 }]
  15706. *
  15707. * console.log(objects[0] === objects[1]);
  15708. * // => true
  15709. */
  15710. function constant(value) {
  15711. return function() {
  15712. return value;
  15713. };
  15714. }
  15715. /**
  15716. * Checks `value` to determine whether a default value should be returned in
  15717. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15718. * or `undefined`.
  15719. *
  15720. * @static
  15721. * @memberOf _
  15722. * @since 4.14.0
  15723. * @category Util
  15724. * @param {*} value The value to check.
  15725. * @param {*} defaultValue The default value.
  15726. * @returns {*} Returns the resolved value.
  15727. * @example
  15728. *
  15729. * _.defaultTo(1, 10);
  15730. * // => 1
  15731. *
  15732. * _.defaultTo(undefined, 10);
  15733. * // => 10
  15734. */
  15735. function defaultTo(value, defaultValue) {
  15736. return (value == null || value !== value) ? defaultValue : value;
  15737. }
  15738. /**
  15739. * Creates a function that returns the result of invoking the given functions
  15740. * with the `this` binding of the created function, where each successive
  15741. * invocation is supplied the return value of the previous.
  15742. *
  15743. * @static
  15744. * @memberOf _
  15745. * @since 3.0.0
  15746. * @category Util
  15747. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15748. * @returns {Function} Returns the new composite function.
  15749. * @see _.flowRight
  15750. * @example
  15751. *
  15752. * function square(n) {
  15753. * return n * n;
  15754. * }
  15755. *
  15756. * var addSquare = _.flow([_.add, square]);
  15757. * addSquare(1, 2);
  15758. * // => 9
  15759. */
  15760. var flow = createFlow();
  15761. /**
  15762. * This method is like `_.flow` except that it creates a function that
  15763. * invokes the given functions from right to left.
  15764. *
  15765. * @static
  15766. * @since 3.0.0
  15767. * @memberOf _
  15768. * @category Util
  15769. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15770. * @returns {Function} Returns the new composite function.
  15771. * @see _.flow
  15772. * @example
  15773. *
  15774. * function square(n) {
  15775. * return n * n;
  15776. * }
  15777. *
  15778. * var addSquare = _.flowRight([square, _.add]);
  15779. * addSquare(1, 2);
  15780. * // => 9
  15781. */
  15782. var flowRight = createFlow(true);
  15783. /**
  15784. * This method returns the first argument it receives.
  15785. *
  15786. * @static
  15787. * @since 0.1.0
  15788. * @memberOf _
  15789. * @category Util
  15790. * @param {*} value Any value.
  15791. * @returns {*} Returns `value`.
  15792. * @example
  15793. *
  15794. * var object = { 'a': 1 };
  15795. *
  15796. * console.log(_.identity(object) === object);
  15797. * // => true
  15798. */
  15799. function identity(value) {
  15800. return value;
  15801. }
  15802. /**
  15803. * Creates a function that invokes `func` with the arguments of the created
  15804. * function. If `func` is a property name, the created function returns the
  15805. * property value for a given element. If `func` is an array or object, the
  15806. * created function returns `true` for elements that contain the equivalent
  15807. * source properties, otherwise it returns `false`.
  15808. *
  15809. * @static
  15810. * @since 4.0.0
  15811. * @memberOf _
  15812. * @category Util
  15813. * @param {*} [func=_.identity] The value to convert to a callback.
  15814. * @returns {Function} Returns the callback.
  15815. * @example
  15816. *
  15817. * var users = [
  15818. * { 'user': 'barney', 'age': 36, 'active': true },
  15819. * { 'user': 'fred', 'age': 40, 'active': false }
  15820. * ];
  15821. *
  15822. * // The `_.matches` iteratee shorthand.
  15823. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15824. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15825. *
  15826. * // The `_.matchesProperty` iteratee shorthand.
  15827. * _.filter(users, _.iteratee(['user', 'fred']));
  15828. * // => [{ 'user': 'fred', 'age': 40 }]
  15829. *
  15830. * // The `_.property` iteratee shorthand.
  15831. * _.map(users, _.iteratee('user'));
  15832. * // => ['barney', 'fred']
  15833. *
  15834. * // Create custom iteratee shorthands.
  15835. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15836. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15837. * return func.test(string);
  15838. * };
  15839. * });
  15840. *
  15841. * _.filter(['abc', 'def'], /ef/);
  15842. * // => ['def']
  15843. */
  15844. function iteratee(func) {
  15845. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15846. }
  15847. /**
  15848. * Creates a function that performs a partial deep comparison between a given
  15849. * object and `source`, returning `true` if the given object has equivalent
  15850. * property values, else `false`.
  15851. *
  15852. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15853. * partially applied.
  15854. *
  15855. * Partial comparisons will match empty array and empty object `source`
  15856. * values against any array or object value, respectively. See `_.isEqual`
  15857. * for a list of supported value comparisons.
  15858. *
  15859. * **Note:** Multiple values can be checked by combining several matchers
  15860. * using `_.overSome`
  15861. *
  15862. * @static
  15863. * @memberOf _
  15864. * @since 3.0.0
  15865. * @category Util
  15866. * @param {Object} source The object of property values to match.
  15867. * @returns {Function} Returns the new spec function.
  15868. * @example
  15869. *
  15870. * var objects = [
  15871. * { 'a': 1, 'b': 2, 'c': 3 },
  15872. * { 'a': 4, 'b': 5, 'c': 6 }
  15873. * ];
  15874. *
  15875. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15876. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15877. *
  15878. * // Checking for several possible values
  15879. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15880. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15881. */
  15882. function matches(source) {
  15883. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15884. }
  15885. /**
  15886. * Creates a function that performs a partial deep comparison between the
  15887. * value at `path` of a given object to `srcValue`, returning `true` if the
  15888. * object value is equivalent, else `false`.
  15889. *
  15890. * **Note:** Partial comparisons will match empty array and empty object
  15891. * `srcValue` values against any array or object value, respectively. See
  15892. * `_.isEqual` for a list of supported value comparisons.
  15893. *
  15894. * **Note:** Multiple values can be checked by combining several matchers
  15895. * using `_.overSome`
  15896. *
  15897. * @static
  15898. * @memberOf _
  15899. * @since 3.2.0
  15900. * @category Util
  15901. * @param {Array|string} path The path of the property to get.
  15902. * @param {*} srcValue The value to match.
  15903. * @returns {Function} Returns the new spec function.
  15904. * @example
  15905. *
  15906. * var objects = [
  15907. * { 'a': 1, 'b': 2, 'c': 3 },
  15908. * { 'a': 4, 'b': 5, 'c': 6 }
  15909. * ];
  15910. *
  15911. * _.find(objects, _.matchesProperty('a', 4));
  15912. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15913. *
  15914. * // Checking for several possible values
  15915. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15916. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15917. */
  15918. function matchesProperty(path, srcValue) {
  15919. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15920. }
  15921. /**
  15922. * Creates a function that invokes the method at `path` of a given object.
  15923. * Any additional arguments are provided to the invoked method.
  15924. *
  15925. * @static
  15926. * @memberOf _
  15927. * @since 3.7.0
  15928. * @category Util
  15929. * @param {Array|string} path The path of the method to invoke.
  15930. * @param {...*} [args] The arguments to invoke the method with.
  15931. * @returns {Function} Returns the new invoker function.
  15932. * @example
  15933. *
  15934. * var objects = [
  15935. * { 'a': { 'b': _.constant(2) } },
  15936. * { 'a': { 'b': _.constant(1) } }
  15937. * ];
  15938. *
  15939. * _.map(objects, _.method('a.b'));
  15940. * // => [2, 1]
  15941. *
  15942. * _.map(objects, _.method(['a', 'b']));
  15943. * // => [2, 1]
  15944. */
  15945. var method = baseRest(function(path, args) {
  15946. return function(object) {
  15947. return baseInvoke(object, path, args);
  15948. };
  15949. });
  15950. /**
  15951. * The opposite of `_.method`; this method creates a function that invokes
  15952. * the method at a given path of `object`. Any additional arguments are
  15953. * provided to the invoked method.
  15954. *
  15955. * @static
  15956. * @memberOf _
  15957. * @since 3.7.0
  15958. * @category Util
  15959. * @param {Object} object The object to query.
  15960. * @param {...*} [args] The arguments to invoke the method with.
  15961. * @returns {Function} Returns the new invoker function.
  15962. * @example
  15963. *
  15964. * var array = _.times(3, _.constant),
  15965. * object = { 'a': array, 'b': array, 'c': array };
  15966. *
  15967. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15968. * // => [2, 0]
  15969. *
  15970. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15971. * // => [2, 0]
  15972. */
  15973. var methodOf = baseRest(function(object, args) {
  15974. return function(path) {
  15975. return baseInvoke(object, path, args);
  15976. };
  15977. });
  15978. /**
  15979. * Adds all own enumerable string keyed function properties of a source
  15980. * object to the destination object. If `object` is a function, then methods
  15981. * are added to its prototype as well.
  15982. *
  15983. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15984. * avoid conflicts caused by modifying the original.
  15985. *
  15986. * @static
  15987. * @since 0.1.0
  15988. * @memberOf _
  15989. * @category Util
  15990. * @param {Function|Object} [object=lodash] The destination object.
  15991. * @param {Object} source The object of functions to add.
  15992. * @param {Object} [options={}] The options object.
  15993. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15994. * @returns {Function|Object} Returns `object`.
  15995. * @example
  15996. *
  15997. * function vowels(string) {
  15998. * return _.filter(string, function(v) {
  15999. * return /[aeiou]/i.test(v);
  16000. * });
  16001. * }
  16002. *
  16003. * _.mixin({ 'vowels': vowels });
  16004. * _.vowels('fred');
  16005. * // => ['e']
  16006. *
  16007. * _('fred').vowels().value();
  16008. * // => ['e']
  16009. *
  16010. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16011. * _('fred').vowels();
  16012. * // => ['e']
  16013. */
  16014. function mixin(object, source, options) {
  16015. var props = keys(source),
  16016. methodNames = baseFunctions(source, props);
  16017. if (options == null &&
  16018. !(isObject(source) && (methodNames.length || !props.length))) {
  16019. options = source;
  16020. source = object;
  16021. object = this;
  16022. methodNames = baseFunctions(source, keys(source));
  16023. }
  16024. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16025. isFunc = isFunction(object);
  16026. arrayEach(methodNames, function(methodName) {
  16027. var func = source[methodName];
  16028. object[methodName] = func;
  16029. if (isFunc) {
  16030. object.prototype[methodName] = function() {
  16031. var chainAll = this.__chain__;
  16032. if (chain || chainAll) {
  16033. var result = object(this.__wrapped__),
  16034. actions = result.__actions__ = copyArray(this.__actions__);
  16035. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16036. result.__chain__ = chainAll;
  16037. return result;
  16038. }
  16039. return func.apply(object, arrayPush([this.value()], arguments));
  16040. };
  16041. }
  16042. });
  16043. return object;
  16044. }
  16045. /**
  16046. * Reverts the `_` variable to its previous value and returns a reference to
  16047. * the `lodash` function.
  16048. *
  16049. * @static
  16050. * @since 0.1.0
  16051. * @memberOf _
  16052. * @category Util
  16053. * @returns {Function} Returns the `lodash` function.
  16054. * @example
  16055. *
  16056. * var lodash = _.noConflict();
  16057. */
  16058. function noConflict() {
  16059. if (root._ === this) {
  16060. root._ = oldDash;
  16061. }
  16062. return this;
  16063. }
  16064. /**
  16065. * This method returns `undefined`.
  16066. *
  16067. * @static
  16068. * @memberOf _
  16069. * @since 2.3.0
  16070. * @category Util
  16071. * @example
  16072. *
  16073. * _.times(2, _.noop);
  16074. * // => [undefined, undefined]
  16075. */
  16076. function noop() {
  16077. // No operation performed.
  16078. }
  16079. /**
  16080. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16081. * the nth argument from the end is returned.
  16082. *
  16083. * @static
  16084. * @memberOf _
  16085. * @since 4.0.0
  16086. * @category Util
  16087. * @param {number} [n=0] The index of the argument to return.
  16088. * @returns {Function} Returns the new pass-thru function.
  16089. * @example
  16090. *
  16091. * var func = _.nthArg(1);
  16092. * func('a', 'b', 'c', 'd');
  16093. * // => 'b'
  16094. *
  16095. * var func = _.nthArg(-2);
  16096. * func('a', 'b', 'c', 'd');
  16097. * // => 'c'
  16098. */
  16099. function nthArg(n) {
  16100. n = toInteger(n);
  16101. return baseRest(function(args) {
  16102. return baseNth(args, n);
  16103. });
  16104. }
  16105. /**
  16106. * Creates a function that invokes `iteratees` with the arguments it receives
  16107. * and returns their results.
  16108. *
  16109. * @static
  16110. * @memberOf _
  16111. * @since 4.0.0
  16112. * @category Util
  16113. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16114. * The iteratees to invoke.
  16115. * @returns {Function} Returns the new function.
  16116. * @example
  16117. *
  16118. * var func = _.over([Math.max, Math.min]);
  16119. *
  16120. * func(1, 2, 3, 4);
  16121. * // => [4, 1]
  16122. */
  16123. var over = createOver(arrayMap);
  16124. /**
  16125. * Creates a function that checks if **all** of the `predicates` return
  16126. * truthy when invoked with the arguments it receives.
  16127. *
  16128. * Following shorthands are possible for providing predicates.
  16129. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16130. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16131. *
  16132. * @static
  16133. * @memberOf _
  16134. * @since 4.0.0
  16135. * @category Util
  16136. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16137. * The predicates to check.
  16138. * @returns {Function} Returns the new function.
  16139. * @example
  16140. *
  16141. * var func = _.overEvery([Boolean, isFinite]);
  16142. *
  16143. * func('1');
  16144. * // => true
  16145. *
  16146. * func(null);
  16147. * // => false
  16148. *
  16149. * func(NaN);
  16150. * // => false
  16151. */
  16152. var overEvery = createOver(arrayEvery);
  16153. /**
  16154. * Creates a function that checks if **any** of the `predicates` return
  16155. * truthy when invoked with the arguments it receives.
  16156. *
  16157. * Following shorthands are possible for providing predicates.
  16158. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16159. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16160. *
  16161. * @static
  16162. * @memberOf _
  16163. * @since 4.0.0
  16164. * @category Util
  16165. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16166. * The predicates to check.
  16167. * @returns {Function} Returns the new function.
  16168. * @example
  16169. *
  16170. * var func = _.overSome([Boolean, isFinite]);
  16171. *
  16172. * func('1');
  16173. * // => true
  16174. *
  16175. * func(null);
  16176. * // => true
  16177. *
  16178. * func(NaN);
  16179. * // => false
  16180. *
  16181. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16182. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16183. */
  16184. var overSome = createOver(arraySome);
  16185. /**
  16186. * Creates a function that returns the value at `path` of a given object.
  16187. *
  16188. * @static
  16189. * @memberOf _
  16190. * @since 2.4.0
  16191. * @category Util
  16192. * @param {Array|string} path The path of the property to get.
  16193. * @returns {Function} Returns the new accessor function.
  16194. * @example
  16195. *
  16196. * var objects = [
  16197. * { 'a': { 'b': 2 } },
  16198. * { 'a': { 'b': 1 } }
  16199. * ];
  16200. *
  16201. * _.map(objects, _.property('a.b'));
  16202. * // => [2, 1]
  16203. *
  16204. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16205. * // => [1, 2]
  16206. */
  16207. function property(path) {
  16208. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16209. }
  16210. /**
  16211. * The opposite of `_.property`; this method creates a function that returns
  16212. * the value at a given path of `object`.
  16213. *
  16214. * @static
  16215. * @memberOf _
  16216. * @since 3.0.0
  16217. * @category Util
  16218. * @param {Object} object The object to query.
  16219. * @returns {Function} Returns the new accessor function.
  16220. * @example
  16221. *
  16222. * var array = [0, 1, 2],
  16223. * object = { 'a': array, 'b': array, 'c': array };
  16224. *
  16225. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16226. * // => [2, 0]
  16227. *
  16228. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16229. * // => [2, 0]
  16230. */
  16231. function propertyOf(object) {
  16232. return function(path) {
  16233. return object == null ? undefined : baseGet(object, path);
  16234. };
  16235. }
  16236. /**
  16237. * Creates an array of numbers (positive and/or negative) progressing from
  16238. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16239. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16240. * it's set to `start` with `start` then set to `0`.
  16241. *
  16242. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16243. * floating-point values which can produce unexpected results.
  16244. *
  16245. * @static
  16246. * @since 0.1.0
  16247. * @memberOf _
  16248. * @category Util
  16249. * @param {number} [start=0] The start of the range.
  16250. * @param {number} end The end of the range.
  16251. * @param {number} [step=1] The value to increment or decrement by.
  16252. * @returns {Array} Returns the range of numbers.
  16253. * @see _.inRange, _.rangeRight
  16254. * @example
  16255. *
  16256. * _.range(4);
  16257. * // => [0, 1, 2, 3]
  16258. *
  16259. * _.range(-4);
  16260. * // => [0, -1, -2, -3]
  16261. *
  16262. * _.range(1, 5);
  16263. * // => [1, 2, 3, 4]
  16264. *
  16265. * _.range(0, 20, 5);
  16266. * // => [0, 5, 10, 15]
  16267. *
  16268. * _.range(0, -4, -1);
  16269. * // => [0, -1, -2, -3]
  16270. *
  16271. * _.range(1, 4, 0);
  16272. * // => [1, 1, 1]
  16273. *
  16274. * _.range(0);
  16275. * // => []
  16276. */
  16277. var range = createRange();
  16278. /**
  16279. * This method is like `_.range` except that it populates values in
  16280. * descending order.
  16281. *
  16282. * @static
  16283. * @memberOf _
  16284. * @since 4.0.0
  16285. * @category Util
  16286. * @param {number} [start=0] The start of the range.
  16287. * @param {number} end The end of the range.
  16288. * @param {number} [step=1] The value to increment or decrement by.
  16289. * @returns {Array} Returns the range of numbers.
  16290. * @see _.inRange, _.range
  16291. * @example
  16292. *
  16293. * _.rangeRight(4);
  16294. * // => [3, 2, 1, 0]
  16295. *
  16296. * _.rangeRight(-4);
  16297. * // => [-3, -2, -1, 0]
  16298. *
  16299. * _.rangeRight(1, 5);
  16300. * // => [4, 3, 2, 1]
  16301. *
  16302. * _.rangeRight(0, 20, 5);
  16303. * // => [15, 10, 5, 0]
  16304. *
  16305. * _.rangeRight(0, -4, -1);
  16306. * // => [-3, -2, -1, 0]
  16307. *
  16308. * _.rangeRight(1, 4, 0);
  16309. * // => [1, 1, 1]
  16310. *
  16311. * _.rangeRight(0);
  16312. * // => []
  16313. */
  16314. var rangeRight = createRange(true);
  16315. /**
  16316. * This method returns a new empty array.
  16317. *
  16318. * @static
  16319. * @memberOf _
  16320. * @since 4.13.0
  16321. * @category Util
  16322. * @returns {Array} Returns the new empty array.
  16323. * @example
  16324. *
  16325. * var arrays = _.times(2, _.stubArray);
  16326. *
  16327. * console.log(arrays);
  16328. * // => [[], []]
  16329. *
  16330. * console.log(arrays[0] === arrays[1]);
  16331. * // => false
  16332. */
  16333. function stubArray() {
  16334. return [];
  16335. }
  16336. /**
  16337. * This method returns `false`.
  16338. *
  16339. * @static
  16340. * @memberOf _
  16341. * @since 4.13.0
  16342. * @category Util
  16343. * @returns {boolean} Returns `false`.
  16344. * @example
  16345. *
  16346. * _.times(2, _.stubFalse);
  16347. * // => [false, false]
  16348. */
  16349. function stubFalse() {
  16350. return false;
  16351. }
  16352. /**
  16353. * This method returns a new empty object.
  16354. *
  16355. * @static
  16356. * @memberOf _
  16357. * @since 4.13.0
  16358. * @category Util
  16359. * @returns {Object} Returns the new empty object.
  16360. * @example
  16361. *
  16362. * var objects = _.times(2, _.stubObject);
  16363. *
  16364. * console.log(objects);
  16365. * // => [{}, {}]
  16366. *
  16367. * console.log(objects[0] === objects[1]);
  16368. * // => false
  16369. */
  16370. function stubObject() {
  16371. return {};
  16372. }
  16373. /**
  16374. * This method returns an empty string.
  16375. *
  16376. * @static
  16377. * @memberOf _
  16378. * @since 4.13.0
  16379. * @category Util
  16380. * @returns {string} Returns the empty string.
  16381. * @example
  16382. *
  16383. * _.times(2, _.stubString);
  16384. * // => ['', '']
  16385. */
  16386. function stubString() {
  16387. return '';
  16388. }
  16389. /**
  16390. * This method returns `true`.
  16391. *
  16392. * @static
  16393. * @memberOf _
  16394. * @since 4.13.0
  16395. * @category Util
  16396. * @returns {boolean} Returns `true`.
  16397. * @example
  16398. *
  16399. * _.times(2, _.stubTrue);
  16400. * // => [true, true]
  16401. */
  16402. function stubTrue() {
  16403. return true;
  16404. }
  16405. /**
  16406. * Invokes the iteratee `n` times, returning an array of the results of
  16407. * each invocation. The iteratee is invoked with one argument; (index).
  16408. *
  16409. * @static
  16410. * @since 0.1.0
  16411. * @memberOf _
  16412. * @category Util
  16413. * @param {number} n The number of times to invoke `iteratee`.
  16414. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16415. * @returns {Array} Returns the array of results.
  16416. * @example
  16417. *
  16418. * _.times(3, String);
  16419. * // => ['0', '1', '2']
  16420. *
  16421. * _.times(4, _.constant(0));
  16422. * // => [0, 0, 0, 0]
  16423. */
  16424. function times(n, iteratee) {
  16425. n = toInteger(n);
  16426. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16427. return [];
  16428. }
  16429. var index = MAX_ARRAY_LENGTH,
  16430. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16431. iteratee = getIteratee(iteratee);
  16432. n -= MAX_ARRAY_LENGTH;
  16433. var result = baseTimes(length, iteratee);
  16434. while (++index < n) {
  16435. iteratee(index);
  16436. }
  16437. return result;
  16438. }
  16439. /**
  16440. * Converts `value` to a property path array.
  16441. *
  16442. * @static
  16443. * @memberOf _
  16444. * @since 4.0.0
  16445. * @category Util
  16446. * @param {*} value The value to convert.
  16447. * @returns {Array} Returns the new property path array.
  16448. * @example
  16449. *
  16450. * _.toPath('a.b.c');
  16451. * // => ['a', 'b', 'c']
  16452. *
  16453. * _.toPath('a[0].b.c');
  16454. * // => ['a', '0', 'b', 'c']
  16455. */
  16456. function toPath(value) {
  16457. if (isArray(value)) {
  16458. return arrayMap(value, toKey);
  16459. }
  16460. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16461. }
  16462. /**
  16463. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16464. *
  16465. * @static
  16466. * @since 0.1.0
  16467. * @memberOf _
  16468. * @category Util
  16469. * @param {string} [prefix=''] The value to prefix the ID with.
  16470. * @returns {string} Returns the unique ID.
  16471. * @example
  16472. *
  16473. * _.uniqueId('contact_');
  16474. * // => 'contact_104'
  16475. *
  16476. * _.uniqueId();
  16477. * // => '105'
  16478. */
  16479. function uniqueId(prefix) {
  16480. var id = ++idCounter;
  16481. return toString(prefix) + id;
  16482. }
  16483. /*------------------------------------------------------------------------*/
  16484. /**
  16485. * Adds two numbers.
  16486. *
  16487. * @static
  16488. * @memberOf _
  16489. * @since 3.4.0
  16490. * @category Math
  16491. * @param {number} augend The first number in an addition.
  16492. * @param {number} addend The second number in an addition.
  16493. * @returns {number} Returns the total.
  16494. * @example
  16495. *
  16496. * _.add(6, 4);
  16497. * // => 10
  16498. */
  16499. var add = createMathOperation(function(augend, addend) {
  16500. return augend + addend;
  16501. }, 0);
  16502. /**
  16503. * Computes `number` rounded up to `precision`.
  16504. *
  16505. * @static
  16506. * @memberOf _
  16507. * @since 3.10.0
  16508. * @category Math
  16509. * @param {number} number The number to round up.
  16510. * @param {number} [precision=0] The precision to round up to.
  16511. * @returns {number} Returns the rounded up number.
  16512. * @example
  16513. *
  16514. * _.ceil(4.006);
  16515. * // => 5
  16516. *
  16517. * _.ceil(6.004, 2);
  16518. * // => 6.01
  16519. *
  16520. * _.ceil(6040, -2);
  16521. * // => 6100
  16522. */
  16523. var ceil = createRound('ceil');
  16524. /**
  16525. * Divide two numbers.
  16526. *
  16527. * @static
  16528. * @memberOf _
  16529. * @since 4.7.0
  16530. * @category Math
  16531. * @param {number} dividend The first number in a division.
  16532. * @param {number} divisor The second number in a division.
  16533. * @returns {number} Returns the quotient.
  16534. * @example
  16535. *
  16536. * _.divide(6, 4);
  16537. * // => 1.5
  16538. */
  16539. var divide = createMathOperation(function(dividend, divisor) {
  16540. return dividend / divisor;
  16541. }, 1);
  16542. /**
  16543. * Computes `number` rounded down to `precision`.
  16544. *
  16545. * @static
  16546. * @memberOf _
  16547. * @since 3.10.0
  16548. * @category Math
  16549. * @param {number} number The number to round down.
  16550. * @param {number} [precision=0] The precision to round down to.
  16551. * @returns {number} Returns the rounded down number.
  16552. * @example
  16553. *
  16554. * _.floor(4.006);
  16555. * // => 4
  16556. *
  16557. * _.floor(0.046, 2);
  16558. * // => 0.04
  16559. *
  16560. * _.floor(4060, -2);
  16561. * // => 4000
  16562. */
  16563. var floor = createRound('floor');
  16564. /**
  16565. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16566. * `undefined` is returned.
  16567. *
  16568. * @static
  16569. * @since 0.1.0
  16570. * @memberOf _
  16571. * @category Math
  16572. * @param {Array} array The array to iterate over.
  16573. * @returns {*} Returns the maximum value.
  16574. * @example
  16575. *
  16576. * _.max([4, 2, 8, 6]);
  16577. * // => 8
  16578. *
  16579. * _.max([]);
  16580. * // => undefined
  16581. */
  16582. function max(array) {
  16583. return (array && array.length)
  16584. ? baseExtremum(array, identity, baseGt)
  16585. : undefined;
  16586. }
  16587. /**
  16588. * This method is like `_.max` except that it accepts `iteratee` which is
  16589. * invoked for each element in `array` to generate the criterion by which
  16590. * the value is ranked. The iteratee is invoked with one argument: (value).
  16591. *
  16592. * @static
  16593. * @memberOf _
  16594. * @since 4.0.0
  16595. * @category Math
  16596. * @param {Array} array The array to iterate over.
  16597. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16598. * @returns {*} Returns the maximum value.
  16599. * @example
  16600. *
  16601. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16602. *
  16603. * _.maxBy(objects, function(o) { return o.n; });
  16604. * // => { 'n': 2 }
  16605. *
  16606. * // The `_.property` iteratee shorthand.
  16607. * _.maxBy(objects, 'n');
  16608. * // => { 'n': 2 }
  16609. */
  16610. function maxBy(array, iteratee) {
  16611. return (array && array.length)
  16612. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16613. : undefined;
  16614. }
  16615. /**
  16616. * Computes the mean of the values in `array`.
  16617. *
  16618. * @static
  16619. * @memberOf _
  16620. * @since 4.0.0
  16621. * @category Math
  16622. * @param {Array} array The array to iterate over.
  16623. * @returns {number} Returns the mean.
  16624. * @example
  16625. *
  16626. * _.mean([4, 2, 8, 6]);
  16627. * // => 5
  16628. */
  16629. function mean(array) {
  16630. return baseMean(array, identity);
  16631. }
  16632. /**
  16633. * This method is like `_.mean` except that it accepts `iteratee` which is
  16634. * invoked for each element in `array` to generate the value to be averaged.
  16635. * The iteratee is invoked with one argument: (value).
  16636. *
  16637. * @static
  16638. * @memberOf _
  16639. * @since 4.7.0
  16640. * @category Math
  16641. * @param {Array} array The array to iterate over.
  16642. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16643. * @returns {number} Returns the mean.
  16644. * @example
  16645. *
  16646. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16647. *
  16648. * _.meanBy(objects, function(o) { return o.n; });
  16649. * // => 5
  16650. *
  16651. * // The `_.property` iteratee shorthand.
  16652. * _.meanBy(objects, 'n');
  16653. * // => 5
  16654. */
  16655. function meanBy(array, iteratee) {
  16656. return baseMean(array, getIteratee(iteratee, 2));
  16657. }
  16658. /**
  16659. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16660. * `undefined` is returned.
  16661. *
  16662. * @static
  16663. * @since 0.1.0
  16664. * @memberOf _
  16665. * @category Math
  16666. * @param {Array} array The array to iterate over.
  16667. * @returns {*} Returns the minimum value.
  16668. * @example
  16669. *
  16670. * _.min([4, 2, 8, 6]);
  16671. * // => 2
  16672. *
  16673. * _.min([]);
  16674. * // => undefined
  16675. */
  16676. function min(array) {
  16677. return (array && array.length)
  16678. ? baseExtremum(array, identity, baseLt)
  16679. : undefined;
  16680. }
  16681. /**
  16682. * This method is like `_.min` except that it accepts `iteratee` which is
  16683. * invoked for each element in `array` to generate the criterion by which
  16684. * the value is ranked. The iteratee is invoked with one argument: (value).
  16685. *
  16686. * @static
  16687. * @memberOf _
  16688. * @since 4.0.0
  16689. * @category Math
  16690. * @param {Array} array The array to iterate over.
  16691. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16692. * @returns {*} Returns the minimum value.
  16693. * @example
  16694. *
  16695. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16696. *
  16697. * _.minBy(objects, function(o) { return o.n; });
  16698. * // => { 'n': 1 }
  16699. *
  16700. * // The `_.property` iteratee shorthand.
  16701. * _.minBy(objects, 'n');
  16702. * // => { 'n': 1 }
  16703. */
  16704. function minBy(array, iteratee) {
  16705. return (array && array.length)
  16706. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16707. : undefined;
  16708. }
  16709. /**
  16710. * Multiply two numbers.
  16711. *
  16712. * @static
  16713. * @memberOf _
  16714. * @since 4.7.0
  16715. * @category Math
  16716. * @param {number} multiplier The first number in a multiplication.
  16717. * @param {number} multiplicand The second number in a multiplication.
  16718. * @returns {number} Returns the product.
  16719. * @example
  16720. *
  16721. * _.multiply(6, 4);
  16722. * // => 24
  16723. */
  16724. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16725. return multiplier * multiplicand;
  16726. }, 1);
  16727. /**
  16728. * Computes `number` rounded to `precision`.
  16729. *
  16730. * @static
  16731. * @memberOf _
  16732. * @since 3.10.0
  16733. * @category Math
  16734. * @param {number} number The number to round.
  16735. * @param {number} [precision=0] The precision to round to.
  16736. * @returns {number} Returns the rounded number.
  16737. * @example
  16738. *
  16739. * _.round(4.006);
  16740. * // => 4
  16741. *
  16742. * _.round(4.006, 2);
  16743. * // => 4.01
  16744. *
  16745. * _.round(4060, -2);
  16746. * // => 4100
  16747. */
  16748. var round = createRound('round');
  16749. /**
  16750. * Subtract two numbers.
  16751. *
  16752. * @static
  16753. * @memberOf _
  16754. * @since 4.0.0
  16755. * @category Math
  16756. * @param {number} minuend The first number in a subtraction.
  16757. * @param {number} subtrahend The second number in a subtraction.
  16758. * @returns {number} Returns the difference.
  16759. * @example
  16760. *
  16761. * _.subtract(6, 4);
  16762. * // => 2
  16763. */
  16764. var subtract = createMathOperation(function(minuend, subtrahend) {
  16765. return minuend - subtrahend;
  16766. }, 0);
  16767. /**
  16768. * Computes the sum of the values in `array`.
  16769. *
  16770. * @static
  16771. * @memberOf _
  16772. * @since 3.4.0
  16773. * @category Math
  16774. * @param {Array} array The array to iterate over.
  16775. * @returns {number} Returns the sum.
  16776. * @example
  16777. *
  16778. * _.sum([4, 2, 8, 6]);
  16779. * // => 20
  16780. */
  16781. function sum(array) {
  16782. return (array && array.length)
  16783. ? baseSum(array, identity)
  16784. : 0;
  16785. }
  16786. /**
  16787. * This method is like `_.sum` except that it accepts `iteratee` which is
  16788. * invoked for each element in `array` to generate the value to be summed.
  16789. * The iteratee is invoked with one argument: (value).
  16790. *
  16791. * @static
  16792. * @memberOf _
  16793. * @since 4.0.0
  16794. * @category Math
  16795. * @param {Array} array The array to iterate over.
  16796. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16797. * @returns {number} Returns the sum.
  16798. * @example
  16799. *
  16800. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16801. *
  16802. * _.sumBy(objects, function(o) { return o.n; });
  16803. * // => 20
  16804. *
  16805. * // The `_.property` iteratee shorthand.
  16806. * _.sumBy(objects, 'n');
  16807. * // => 20
  16808. */
  16809. function sumBy(array, iteratee) {
  16810. return (array && array.length)
  16811. ? baseSum(array, getIteratee(iteratee, 2))
  16812. : 0;
  16813. }
  16814. /*------------------------------------------------------------------------*/
  16815. // Add methods that return wrapped values in chain sequences.
  16816. lodash.after = after;
  16817. lodash.ary = ary;
  16818. lodash.assign = assign;
  16819. lodash.assignIn = assignIn;
  16820. lodash.assignInWith = assignInWith;
  16821. lodash.assignWith = assignWith;
  16822. lodash.at = at;
  16823. lodash.before = before;
  16824. lodash.bind = bind;
  16825. lodash.bindAll = bindAll;
  16826. lodash.bindKey = bindKey;
  16827. lodash.castArray = castArray;
  16828. lodash.chain = chain;
  16829. lodash.chunk = chunk;
  16830. lodash.compact = compact;
  16831. lodash.concat = concat;
  16832. lodash.cond = cond;
  16833. lodash.conforms = conforms;
  16834. lodash.constant = constant;
  16835. lodash.countBy = countBy;
  16836. lodash.create = create;
  16837. lodash.curry = curry;
  16838. lodash.curryRight = curryRight;
  16839. lodash.debounce = debounce;
  16840. lodash.defaults = defaults;
  16841. lodash.defaultsDeep = defaultsDeep;
  16842. lodash.defer = defer;
  16843. lodash.delay = delay;
  16844. lodash.difference = difference;
  16845. lodash.differenceBy = differenceBy;
  16846. lodash.differenceWith = differenceWith;
  16847. lodash.drop = drop;
  16848. lodash.dropRight = dropRight;
  16849. lodash.dropRightWhile = dropRightWhile;
  16850. lodash.dropWhile = dropWhile;
  16851. lodash.fill = fill;
  16852. lodash.filter = filter;
  16853. lodash.flatMap = flatMap;
  16854. lodash.flatMapDeep = flatMapDeep;
  16855. lodash.flatMapDepth = flatMapDepth;
  16856. lodash.flatten = flatten;
  16857. lodash.flattenDeep = flattenDeep;
  16858. lodash.flattenDepth = flattenDepth;
  16859. lodash.flip = flip;
  16860. lodash.flow = flow;
  16861. lodash.flowRight = flowRight;
  16862. lodash.fromPairs = fromPairs;
  16863. lodash.functions = functions;
  16864. lodash.functionsIn = functionsIn;
  16865. lodash.groupBy = groupBy;
  16866. lodash.initial = initial;
  16867. lodash.intersection = intersection;
  16868. lodash.intersectionBy = intersectionBy;
  16869. lodash.intersectionWith = intersectionWith;
  16870. lodash.invert = invert;
  16871. lodash.invertBy = invertBy;
  16872. lodash.invokeMap = invokeMap;
  16873. lodash.iteratee = iteratee;
  16874. lodash.keyBy = keyBy;
  16875. lodash.keys = keys;
  16876. lodash.keysIn = keysIn;
  16877. lodash.map = map;
  16878. lodash.mapKeys = mapKeys;
  16879. lodash.mapValues = mapValues;
  16880. lodash.matches = matches;
  16881. lodash.matchesProperty = matchesProperty;
  16882. lodash.memoize = memoize;
  16883. lodash.merge = merge;
  16884. lodash.mergeWith = mergeWith;
  16885. lodash.method = method;
  16886. lodash.methodOf = methodOf;
  16887. lodash.mixin = mixin;
  16888. lodash.negate = negate;
  16889. lodash.nthArg = nthArg;
  16890. lodash.omit = omit;
  16891. lodash.omitBy = omitBy;
  16892. lodash.once = once;
  16893. lodash.orderBy = orderBy;
  16894. lodash.over = over;
  16895. lodash.overArgs = overArgs;
  16896. lodash.overEvery = overEvery;
  16897. lodash.overSome = overSome;
  16898. lodash.partial = partial;
  16899. lodash.partialRight = partialRight;
  16900. lodash.partition = partition;
  16901. lodash.pick = pick;
  16902. lodash.pickBy = pickBy;
  16903. lodash.property = property;
  16904. lodash.propertyOf = propertyOf;
  16905. lodash.pull = pull;
  16906. lodash.pullAll = pullAll;
  16907. lodash.pullAllBy = pullAllBy;
  16908. lodash.pullAllWith = pullAllWith;
  16909. lodash.pullAt = pullAt;
  16910. lodash.range = range;
  16911. lodash.rangeRight = rangeRight;
  16912. lodash.rearg = rearg;
  16913. lodash.reject = reject;
  16914. lodash.remove = remove;
  16915. lodash.rest = rest;
  16916. lodash.reverse = reverse;
  16917. lodash.sampleSize = sampleSize;
  16918. lodash.set = set;
  16919. lodash.setWith = setWith;
  16920. lodash.shuffle = shuffle;
  16921. lodash.slice = slice;
  16922. lodash.sortBy = sortBy;
  16923. lodash.sortedUniq = sortedUniq;
  16924. lodash.sortedUniqBy = sortedUniqBy;
  16925. lodash.split = split;
  16926. lodash.spread = spread;
  16927. lodash.tail = tail;
  16928. lodash.take = take;
  16929. lodash.takeRight = takeRight;
  16930. lodash.takeRightWhile = takeRightWhile;
  16931. lodash.takeWhile = takeWhile;
  16932. lodash.tap = tap;
  16933. lodash.throttle = throttle;
  16934. lodash.thru = thru;
  16935. lodash.toArray = toArray;
  16936. lodash.toPairs = toPairs;
  16937. lodash.toPairsIn = toPairsIn;
  16938. lodash.toPath = toPath;
  16939. lodash.toPlainObject = toPlainObject;
  16940. lodash.transform = transform;
  16941. lodash.unary = unary;
  16942. lodash.union = union;
  16943. lodash.unionBy = unionBy;
  16944. lodash.unionWith = unionWith;
  16945. lodash.uniq = uniq;
  16946. lodash.uniqBy = uniqBy;
  16947. lodash.uniqWith = uniqWith;
  16948. lodash.unset = unset;
  16949. lodash.unzip = unzip;
  16950. lodash.unzipWith = unzipWith;
  16951. lodash.update = update;
  16952. lodash.updateWith = updateWith;
  16953. lodash.values = values;
  16954. lodash.valuesIn = valuesIn;
  16955. lodash.without = without;
  16956. lodash.words = words;
  16957. lodash.wrap = wrap;
  16958. lodash.xor = xor;
  16959. lodash.xorBy = xorBy;
  16960. lodash.xorWith = xorWith;
  16961. lodash.zip = zip;
  16962. lodash.zipObject = zipObject;
  16963. lodash.zipObjectDeep = zipObjectDeep;
  16964. lodash.zipWith = zipWith;
  16965. // Add aliases.
  16966. lodash.entries = toPairs;
  16967. lodash.entriesIn = toPairsIn;
  16968. lodash.extend = assignIn;
  16969. lodash.extendWith = assignInWith;
  16970. // Add methods to `lodash.prototype`.
  16971. mixin(lodash, lodash);
  16972. /*------------------------------------------------------------------------*/
  16973. // Add methods that return unwrapped values in chain sequences.
  16974. lodash.add = add;
  16975. lodash.attempt = attempt;
  16976. lodash.camelCase = camelCase;
  16977. lodash.capitalize = capitalize;
  16978. lodash.ceil = ceil;
  16979. lodash.clamp = clamp;
  16980. lodash.clone = clone;
  16981. lodash.cloneDeep = cloneDeep;
  16982. lodash.cloneDeepWith = cloneDeepWith;
  16983. lodash.cloneWith = cloneWith;
  16984. lodash.conformsTo = conformsTo;
  16985. lodash.deburr = deburr;
  16986. lodash.defaultTo = defaultTo;
  16987. lodash.divide = divide;
  16988. lodash.endsWith = endsWith;
  16989. lodash.eq = eq;
  16990. lodash.escape = escape;
  16991. lodash.escapeRegExp = escapeRegExp;
  16992. lodash.every = every;
  16993. lodash.find = find;
  16994. lodash.findIndex = findIndex;
  16995. lodash.findKey = findKey;
  16996. lodash.findLast = findLast;
  16997. lodash.findLastIndex = findLastIndex;
  16998. lodash.findLastKey = findLastKey;
  16999. lodash.floor = floor;
  17000. lodash.forEach = forEach;
  17001. lodash.forEachRight = forEachRight;
  17002. lodash.forIn = forIn;
  17003. lodash.forInRight = forInRight;
  17004. lodash.forOwn = forOwn;
  17005. lodash.forOwnRight = forOwnRight;
  17006. lodash.get = get;
  17007. lodash.gt = gt;
  17008. lodash.gte = gte;
  17009. lodash.has = has;
  17010. lodash.hasIn = hasIn;
  17011. lodash.head = head;
  17012. lodash.identity = identity;
  17013. lodash.includes = includes;
  17014. lodash.indexOf = indexOf;
  17015. lodash.inRange = inRange;
  17016. lodash.invoke = invoke;
  17017. lodash.isArguments = isArguments;
  17018. lodash.isArray = isArray;
  17019. lodash.isArrayBuffer = isArrayBuffer;
  17020. lodash.isArrayLike = isArrayLike;
  17021. lodash.isArrayLikeObject = isArrayLikeObject;
  17022. lodash.isBoolean = isBoolean;
  17023. lodash.isBuffer = isBuffer;
  17024. lodash.isDate = isDate;
  17025. lodash.isElement = isElement;
  17026. lodash.isEmpty = isEmpty;
  17027. lodash.isEqual = isEqual;
  17028. lodash.isEqualWith = isEqualWith;
  17029. lodash.isError = isError;
  17030. lodash.isFinite = isFinite;
  17031. lodash.isFunction = isFunction;
  17032. lodash.isInteger = isInteger;
  17033. lodash.isLength = isLength;
  17034. lodash.isMap = isMap;
  17035. lodash.isMatch = isMatch;
  17036. lodash.isMatchWith = isMatchWith;
  17037. lodash.isNaN = isNaN;
  17038. lodash.isNative = isNative;
  17039. lodash.isNil = isNil;
  17040. lodash.isNull = isNull;
  17041. lodash.isNumber = isNumber;
  17042. lodash.isObject = isObject;
  17043. lodash.isObjectLike = isObjectLike;
  17044. lodash.isPlainObject = isPlainObject;
  17045. lodash.isRegExp = isRegExp;
  17046. lodash.isSafeInteger = isSafeInteger;
  17047. lodash.isSet = isSet;
  17048. lodash.isString = isString;
  17049. lodash.isSymbol = isSymbol;
  17050. lodash.isTypedArray = isTypedArray;
  17051. lodash.isUndefined = isUndefined;
  17052. lodash.isWeakMap = isWeakMap;
  17053. lodash.isWeakSet = isWeakSet;
  17054. lodash.join = join;
  17055. lodash.kebabCase = kebabCase;
  17056. lodash.last = last;
  17057. lodash.lastIndexOf = lastIndexOf;
  17058. lodash.lowerCase = lowerCase;
  17059. lodash.lowerFirst = lowerFirst;
  17060. lodash.lt = lt;
  17061. lodash.lte = lte;
  17062. lodash.max = max;
  17063. lodash.maxBy = maxBy;
  17064. lodash.mean = mean;
  17065. lodash.meanBy = meanBy;
  17066. lodash.min = min;
  17067. lodash.minBy = minBy;
  17068. lodash.stubArray = stubArray;
  17069. lodash.stubFalse = stubFalse;
  17070. lodash.stubObject = stubObject;
  17071. lodash.stubString = stubString;
  17072. lodash.stubTrue = stubTrue;
  17073. lodash.multiply = multiply;
  17074. lodash.nth = nth;
  17075. lodash.noConflict = noConflict;
  17076. lodash.noop = noop;
  17077. lodash.now = now;
  17078. lodash.pad = pad;
  17079. lodash.padEnd = padEnd;
  17080. lodash.padStart = padStart;
  17081. lodash.parseInt = parseInt;
  17082. lodash.random = random;
  17083. lodash.reduce = reduce;
  17084. lodash.reduceRight = reduceRight;
  17085. lodash.repeat = repeat;
  17086. lodash.replace = replace;
  17087. lodash.result = result;
  17088. lodash.round = round;
  17089. lodash.runInContext = runInContext;
  17090. lodash.sample = sample;
  17091. lodash.size = size;
  17092. lodash.snakeCase = snakeCase;
  17093. lodash.some = some;
  17094. lodash.sortedIndex = sortedIndex;
  17095. lodash.sortedIndexBy = sortedIndexBy;
  17096. lodash.sortedIndexOf = sortedIndexOf;
  17097. lodash.sortedLastIndex = sortedLastIndex;
  17098. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17099. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17100. lodash.startCase = startCase;
  17101. lodash.startsWith = startsWith;
  17102. lodash.subtract = subtract;
  17103. lodash.sum = sum;
  17104. lodash.sumBy = sumBy;
  17105. lodash.template = template;
  17106. lodash.times = times;
  17107. lodash.toFinite = toFinite;
  17108. lodash.toInteger = toInteger;
  17109. lodash.toLength = toLength;
  17110. lodash.toLower = toLower;
  17111. lodash.toNumber = toNumber;
  17112. lodash.toSafeInteger = toSafeInteger;
  17113. lodash.toString = toString;
  17114. lodash.toUpper = toUpper;
  17115. lodash.trim = trim;
  17116. lodash.trimEnd = trimEnd;
  17117. lodash.trimStart = trimStart;
  17118. lodash.truncate = truncate;
  17119. lodash.unescape = unescape;
  17120. lodash.uniqueId = uniqueId;
  17121. lodash.upperCase = upperCase;
  17122. lodash.upperFirst = upperFirst;
  17123. // Add aliases.
  17124. lodash.each = forEach;
  17125. lodash.eachRight = forEachRight;
  17126. lodash.first = head;
  17127. mixin(lodash, (function() {
  17128. var source = {};
  17129. baseForOwn(lodash, function(func, methodName) {
  17130. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17131. source[methodName] = func;
  17132. }
  17133. });
  17134. return source;
  17135. }()), { 'chain': false });
  17136. /*------------------------------------------------------------------------*/
  17137. /**
  17138. * The semantic version number.
  17139. *
  17140. * @static
  17141. * @memberOf _
  17142. * @type {string}
  17143. */
  17144. lodash.VERSION = VERSION;
  17145. // Assign default placeholders.
  17146. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17147. lodash[methodName].placeholder = lodash;
  17148. });
  17149. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17150. arrayEach(['drop', 'take'], function(methodName, index) {
  17151. LazyWrapper.prototype[methodName] = function(n) {
  17152. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17153. var result = (this.__filtered__ && !index)
  17154. ? new LazyWrapper(this)
  17155. : this.clone();
  17156. if (result.__filtered__) {
  17157. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17158. } else {
  17159. result.__views__.push({
  17160. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17161. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17162. });
  17163. }
  17164. return result;
  17165. };
  17166. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17167. return this.reverse()[methodName](n).reverse();
  17168. };
  17169. });
  17170. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17171. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17172. var type = index + 1,
  17173. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17174. LazyWrapper.prototype[methodName] = function(iteratee) {
  17175. var result = this.clone();
  17176. result.__iteratees__.push({
  17177. 'iteratee': getIteratee(iteratee, 3),
  17178. 'type': type
  17179. });
  17180. result.__filtered__ = result.__filtered__ || isFilter;
  17181. return result;
  17182. };
  17183. });
  17184. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17185. arrayEach(['head', 'last'], function(methodName, index) {
  17186. var takeName = 'take' + (index ? 'Right' : '');
  17187. LazyWrapper.prototype[methodName] = function() {
  17188. return this[takeName](1).value()[0];
  17189. };
  17190. });
  17191. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17192. arrayEach(['initial', 'tail'], function(methodName, index) {
  17193. var dropName = 'drop' + (index ? '' : 'Right');
  17194. LazyWrapper.prototype[methodName] = function() {
  17195. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17196. };
  17197. });
  17198. LazyWrapper.prototype.compact = function() {
  17199. return this.filter(identity);
  17200. };
  17201. LazyWrapper.prototype.find = function(predicate) {
  17202. return this.filter(predicate).head();
  17203. };
  17204. LazyWrapper.prototype.findLast = function(predicate) {
  17205. return this.reverse().find(predicate);
  17206. };
  17207. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17208. if (typeof path == 'function') {
  17209. return new LazyWrapper(this);
  17210. }
  17211. return this.map(function(value) {
  17212. return baseInvoke(value, path, args);
  17213. });
  17214. });
  17215. LazyWrapper.prototype.reject = function(predicate) {
  17216. return this.filter(negate(getIteratee(predicate)));
  17217. };
  17218. LazyWrapper.prototype.slice = function(start, end) {
  17219. start = toInteger(start);
  17220. var result = this;
  17221. if (result.__filtered__ && (start > 0 || end < 0)) {
  17222. return new LazyWrapper(result);
  17223. }
  17224. if (start < 0) {
  17225. result = result.takeRight(-start);
  17226. } else if (start) {
  17227. result = result.drop(start);
  17228. }
  17229. if (end !== undefined) {
  17230. end = toInteger(end);
  17231. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17232. }
  17233. return result;
  17234. };
  17235. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17236. return this.reverse().takeWhile(predicate).reverse();
  17237. };
  17238. LazyWrapper.prototype.toArray = function() {
  17239. return this.take(MAX_ARRAY_LENGTH);
  17240. };
  17241. // Add `LazyWrapper` methods to `lodash.prototype`.
  17242. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17243. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17244. isTaker = /^(?:head|last)$/.test(methodName),
  17245. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17246. retUnwrapped = isTaker || /^find/.test(methodName);
  17247. if (!lodashFunc) {
  17248. return;
  17249. }
  17250. lodash.prototype[methodName] = function() {
  17251. var value = this.__wrapped__,
  17252. args = isTaker ? [1] : arguments,
  17253. isLazy = value instanceof LazyWrapper,
  17254. iteratee = args[0],
  17255. useLazy = isLazy || isArray(value);
  17256. var interceptor = function(value) {
  17257. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17258. return (isTaker && chainAll) ? result[0] : result;
  17259. };
  17260. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17261. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17262. isLazy = useLazy = false;
  17263. }
  17264. var chainAll = this.__chain__,
  17265. isHybrid = !!this.__actions__.length,
  17266. isUnwrapped = retUnwrapped && !chainAll,
  17267. onlyLazy = isLazy && !isHybrid;
  17268. if (!retUnwrapped && useLazy) {
  17269. value = onlyLazy ? value : new LazyWrapper(this);
  17270. var result = func.apply(value, args);
  17271. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17272. return new LodashWrapper(result, chainAll);
  17273. }
  17274. if (isUnwrapped && onlyLazy) {
  17275. return func.apply(this, args);
  17276. }
  17277. result = this.thru(interceptor);
  17278. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17279. };
  17280. });
  17281. // Add `Array` methods to `lodash.prototype`.
  17282. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17283. var func = arrayProto[methodName],
  17284. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17285. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17286. lodash.prototype[methodName] = function() {
  17287. var args = arguments;
  17288. if (retUnwrapped && !this.__chain__) {
  17289. var value = this.value();
  17290. return func.apply(isArray(value) ? value : [], args);
  17291. }
  17292. return this[chainName](function(value) {
  17293. return func.apply(isArray(value) ? value : [], args);
  17294. });
  17295. };
  17296. });
  17297. // Map minified method names to their real names.
  17298. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17299. var lodashFunc = lodash[methodName];
  17300. if (lodashFunc) {
  17301. var key = lodashFunc.name + '';
  17302. if (!hasOwnProperty.call(realNames, key)) {
  17303. realNames[key] = [];
  17304. }
  17305. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17306. }
  17307. });
  17308. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17309. 'name': 'wrapper',
  17310. 'func': undefined
  17311. }];
  17312. // Add methods to `LazyWrapper`.
  17313. LazyWrapper.prototype.clone = lazyClone;
  17314. LazyWrapper.prototype.reverse = lazyReverse;
  17315. LazyWrapper.prototype.value = lazyValue;
  17316. // Add chain sequence methods to the `lodash` wrapper.
  17317. lodash.prototype.at = wrapperAt;
  17318. lodash.prototype.chain = wrapperChain;
  17319. lodash.prototype.commit = wrapperCommit;
  17320. lodash.prototype.next = wrapperNext;
  17321. lodash.prototype.plant = wrapperPlant;
  17322. lodash.prototype.reverse = wrapperReverse;
  17323. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17324. // Add lazy aliases.
  17325. lodash.prototype.first = lodash.prototype.head;
  17326. if (symIterator) {
  17327. lodash.prototype[symIterator] = wrapperToIterator;
  17328. }
  17329. return lodash;
  17330. });
  17331. /*--------------------------------------------------------------------------*/
  17332. // Export lodash.
  17333. var _ = runInContext();
  17334. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17335. if (true) {
  17336. // Expose Lodash on the global object to prevent errors when Lodash is
  17337. // loaded by a script tag in the presence of an AMD loader.
  17338. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17339. // Use `_.noConflict` to remove Lodash from the global object.
  17340. root._ = _;
  17341. // Define as an anonymous module so, through path mapping, it can be
  17342. // referenced as the "underscore" module.
  17343. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17344. return _;
  17345. }).call(exports, __webpack_require__, exports, module),
  17346. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17347. }
  17348. // Check for `exports` after `define` in case a build optimizer adds it.
  17349. else {}
  17350. }.call(this));
  17351. /***/ }),
  17352. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17353. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17354. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17355. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17356. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17357. "use strict";
  17358. __webpack_require__.r(__webpack_exports__);
  17359. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17360. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17361. /* harmony export */ });
  17362. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17363. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17364. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17365. var options = {};
  17366. options.insert = "head";
  17367. options.singleton = false;
  17368. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17369. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17370. /***/ }),
  17371. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17372. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17373. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17374. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17375. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17376. "use strict";
  17377. __webpack_require__.r(__webpack_exports__);
  17378. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17379. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17380. /* harmony export */ });
  17381. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17382. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17383. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17384. var options = {};
  17385. options.insert = "head";
  17386. options.singleton = false;
  17387. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17388. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17389. /***/ }),
  17390. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17391. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17392. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17393. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17394. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17395. "use strict";
  17396. __webpack_require__.r(__webpack_exports__);
  17397. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17398. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17399. /* harmony export */ });
  17400. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17401. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17402. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17403. var options = {};
  17404. options.insert = "head";
  17405. options.singleton = false;
  17406. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17407. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17408. /***/ }),
  17409. /***/ "./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":
  17410. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17411. !*** ./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 ***!
  17412. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17413. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17414. "use strict";
  17415. __webpack_require__.r(__webpack_exports__);
  17416. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17417. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17418. /* harmony export */ });
  17419. /* 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");
  17420. /* 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__);
  17421. /* 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");
  17422. var options = {};
  17423. options.insert = "head";
  17424. options.singleton = false;
  17425. 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);
  17426. /* 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 || {});
  17427. /***/ }),
  17428. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17429. /*!******************************************************!*\
  17430. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17431. \******************************************************/
  17432. /***/ ((__unused_webpack_module, exports) => {
  17433. "use strict";
  17434. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17435. // runtime helper for setting properties on components
  17436. // in a tree-shakable way
  17437. exports["default"] = (sfc, props) => {
  17438. const target = sfc.__vccOpts || sfc;
  17439. for (const [key, val] of props) {
  17440. target[key] = val;
  17441. }
  17442. return target;
  17443. };
  17444. /***/ }),
  17445. /***/ "./resources/js/components/AppButtonLink.vue":
  17446. /*!***************************************************!*\
  17447. !*** ./resources/js/components/AppButtonLink.vue ***!
  17448. \***************************************************/
  17449. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17450. "use strict";
  17451. __webpack_require__.r(__webpack_exports__);
  17452. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17453. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17454. /* harmony export */ });
  17455. /* harmony import */ var _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");
  17456. /* 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");
  17457. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17458. ;
  17459. 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"]])
  17460. /* hot reload */
  17461. if (false) {}
  17462. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17463. /***/ }),
  17464. /***/ "./resources/js/components/AppMessage.vue":
  17465. /*!************************************************!*\
  17466. !*** ./resources/js/components/AppMessage.vue ***!
  17467. \************************************************/
  17468. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17469. "use strict";
  17470. __webpack_require__.r(__webpack_exports__);
  17471. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17472. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17473. /* harmony export */ });
  17474. /* 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");
  17475. /* 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");
  17476. /* 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");
  17477. ;
  17478. 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"]])
  17479. /* hot reload */
  17480. if (false) {}
  17481. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17482. /***/ }),
  17483. /***/ "./resources/js/components/AppPagination.vue":
  17484. /*!***************************************************!*\
  17485. !*** ./resources/js/components/AppPagination.vue ***!
  17486. \***************************************************/
  17487. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17488. "use strict";
  17489. __webpack_require__.r(__webpack_exports__);
  17490. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17491. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17492. /* harmony export */ });
  17493. /* 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");
  17494. /* 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");
  17495. /* 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");
  17496. ;
  17497. 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"]])
  17498. /* hot reload */
  17499. if (false) {}
  17500. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17501. /***/ }),
  17502. /***/ "./resources/js/components/AppSearch.vue":
  17503. /*!***********************************************!*\
  17504. !*** ./resources/js/components/AppSearch.vue ***!
  17505. \***********************************************/
  17506. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17507. "use strict";
  17508. __webpack_require__.r(__webpack_exports__);
  17509. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17510. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17511. /* harmony export */ });
  17512. /* 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");
  17513. /* 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");
  17514. /* 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");
  17515. ;
  17516. 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"]])
  17517. /* hot reload */
  17518. if (false) {}
  17519. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17520. /***/ }),
  17521. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17522. /*!**************************************************************!*\
  17523. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17524. \**************************************************************/
  17525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17526. "use strict";
  17527. __webpack_require__.r(__webpack_exports__);
  17528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17529. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17530. /* harmony export */ });
  17531. /* harmony import */ var _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");
  17532. /* 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");
  17533. const script = {}
  17534. ;
  17535. 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"]])
  17536. /* hot reload */
  17537. if (false) {}
  17538. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17539. /***/ }),
  17540. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17541. /*!***************************************************************!*\
  17542. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17543. \***************************************************************/
  17544. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17545. "use strict";
  17546. __webpack_require__.r(__webpack_exports__);
  17547. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17548. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17549. /* harmony export */ });
  17550. /* 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");
  17551. /* 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");
  17552. /* 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");
  17553. /* 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");
  17554. ;
  17555. 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"]])
  17556. /* hot reload */
  17557. if (false) {}
  17558. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17559. /***/ }),
  17560. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17561. /*!******************************************************************!*\
  17562. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17563. \******************************************************************/
  17564. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17565. "use strict";
  17566. __webpack_require__.r(__webpack_exports__);
  17567. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17568. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17569. /* harmony export */ });
  17570. /* 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");
  17571. /* 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");
  17572. /* 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");
  17573. /* 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");
  17574. ;
  17575. 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"]])
  17576. /* hot reload */
  17577. if (false) {}
  17578. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17579. /***/ }),
  17580. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17581. /*!**************************************************************!*\
  17582. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17583. \**************************************************************/
  17584. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17585. "use strict";
  17586. __webpack_require__.r(__webpack_exports__);
  17587. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17588. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17589. /* harmony export */ });
  17590. /* 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");
  17591. /* 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");
  17592. /* 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");
  17593. /* 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");
  17594. ;
  17595. 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"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17601. /*!************************************************************!*\
  17602. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17603. \************************************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17609. /* harmony export */ });
  17610. /* 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");
  17611. /* 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");
  17612. /* 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");
  17613. /* 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");
  17614. ;
  17615. 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"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/pages/Sales/Index.vue":
  17621. /*!********************************************!*\
  17622. !*** ./resources/js/pages/Sales/Index.vue ***!
  17623. \********************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* harmony import */ var _Index_vue_vue_type_template_id_7c234776__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=7c234776 */ "./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776");
  17631. /* 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/Sales/Index.vue?vue&type=script&setup=true&lang=js");
  17632. /* 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");
  17633. ;
  17634. 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_7c234776__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Sales/Index.vue"]])
  17635. /* hot reload */
  17636. if (false) {}
  17637. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17638. /***/ }),
  17639. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17640. /*!**************************************************************************************!*\
  17641. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17642. \**************************************************************************************/
  17643. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17644. "use strict";
  17645. __webpack_require__.r(__webpack_exports__);
  17646. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17647. /* 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"])
  17648. /* harmony export */ });
  17649. /* 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");
  17650. /***/ }),
  17651. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17652. /*!***********************************************************************************!*\
  17653. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17654. \***********************************************************************************/
  17655. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17656. "use strict";
  17657. __webpack_require__.r(__webpack_exports__);
  17658. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17659. /* 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"])
  17660. /* harmony export */ });
  17661. /* 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");
  17662. /***/ }),
  17663. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17664. /*!**************************************************************************************!*\
  17665. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17666. \**************************************************************************************/
  17667. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17668. "use strict";
  17669. __webpack_require__.r(__webpack_exports__);
  17670. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17671. /* 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"])
  17672. /* harmony export */ });
  17673. /* 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");
  17674. /***/ }),
  17675. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17676. /*!**********************************************************************************!*\
  17677. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17678. \**********************************************************************************/
  17679. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17680. "use strict";
  17681. __webpack_require__.r(__webpack_exports__);
  17682. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17683. /* 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"])
  17684. /* harmony export */ });
  17685. /* 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");
  17686. /***/ }),
  17687. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17688. /*!**************************************************************************************************!*\
  17689. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17690. \**************************************************************************************************/
  17691. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17692. "use strict";
  17693. __webpack_require__.r(__webpack_exports__);
  17694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17695. /* 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"])
  17696. /* harmony export */ });
  17697. /* 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");
  17698. /***/ }),
  17699. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17700. /*!*****************************************************************************************************!*\
  17701. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17702. \*****************************************************************************************************/
  17703. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17704. "use strict";
  17705. __webpack_require__.r(__webpack_exports__);
  17706. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17707. /* 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"])
  17708. /* harmony export */ });
  17709. /* 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");
  17710. /***/ }),
  17711. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17712. /*!*************************************************************************************************!*\
  17713. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17714. \*************************************************************************************************/
  17715. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17716. "use strict";
  17717. __webpack_require__.r(__webpack_exports__);
  17718. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17719. /* 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"])
  17720. /* harmony export */ });
  17721. /* 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");
  17722. /***/ }),
  17723. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17724. /*!***********************************************************************************************!*\
  17725. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17726. \***********************************************************************************************/
  17727. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17728. "use strict";
  17729. __webpack_require__.r(__webpack_exports__);
  17730. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17731. /* 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"])
  17732. /* harmony export */ });
  17733. /* 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");
  17734. /***/ }),
  17735. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js":
  17736. /*!*******************************************************************************!*\
  17737. !*** ./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js ***!
  17738. \*******************************************************************************/
  17739. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17740. "use strict";
  17741. __webpack_require__.r(__webpack_exports__);
  17742. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17743. /* 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"])
  17744. /* harmony export */ });
  17745. /* 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/Sales/Index.vue?vue&type=script&setup=true&lang=js");
  17746. /***/ }),
  17747. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17748. /*!*********************************************************************************!*\
  17749. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17750. \*********************************************************************************/
  17751. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17752. "use strict";
  17753. __webpack_require__.r(__webpack_exports__);
  17754. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17755. /* 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)
  17756. /* harmony export */ });
  17757. /* 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");
  17758. /***/ }),
  17759. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17760. /*!******************************************************************************!*\
  17761. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17762. \******************************************************************************/
  17763. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17764. "use strict";
  17765. __webpack_require__.r(__webpack_exports__);
  17766. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17767. /* 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)
  17768. /* harmony export */ });
  17769. /* 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");
  17770. /***/ }),
  17771. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17772. /*!*********************************************************************************!*\
  17773. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17774. \*********************************************************************************/
  17775. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17776. "use strict";
  17777. __webpack_require__.r(__webpack_exports__);
  17778. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17779. /* 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)
  17780. /* harmony export */ });
  17781. /* 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");
  17782. /***/ }),
  17783. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17784. /*!*****************************************************************************!*\
  17785. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17786. \*****************************************************************************/
  17787. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17788. "use strict";
  17789. __webpack_require__.r(__webpack_exports__);
  17790. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17791. /* 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)
  17792. /* harmony export */ });
  17793. /* 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");
  17794. /***/ }),
  17795. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17796. /*!********************************************************************************************!*\
  17797. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17798. \********************************************************************************************/
  17799. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17800. "use strict";
  17801. __webpack_require__.r(__webpack_exports__);
  17802. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17803. /* 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)
  17804. /* harmony export */ });
  17805. /* 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");
  17806. /***/ }),
  17807. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17808. /*!*********************************************************************************************************!*\
  17809. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17810. \*********************************************************************************************************/
  17811. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17812. "use strict";
  17813. __webpack_require__.r(__webpack_exports__);
  17814. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17815. /* 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)
  17816. /* harmony export */ });
  17817. /* 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");
  17818. /***/ }),
  17819. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17820. /*!************************************************************************************************************!*\
  17821. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17822. \************************************************************************************************************/
  17823. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17824. "use strict";
  17825. __webpack_require__.r(__webpack_exports__);
  17826. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17827. /* 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)
  17828. /* harmony export */ });
  17829. /* 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");
  17830. /***/ }),
  17831. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17832. /*!********************************************************************************************************!*\
  17833. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17834. \********************************************************************************************************/
  17835. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17836. "use strict";
  17837. __webpack_require__.r(__webpack_exports__);
  17838. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17839. /* 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)
  17840. /* harmony export */ });
  17841. /* 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");
  17842. /***/ }),
  17843. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17844. /*!******************************************************************************************************!*\
  17845. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17846. \******************************************************************************************************/
  17847. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17848. "use strict";
  17849. __webpack_require__.r(__webpack_exports__);
  17850. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17851. /* 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)
  17852. /* harmony export */ });
  17853. /* 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");
  17854. /***/ }),
  17855. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776":
  17856. /*!**************************************************************************!*\
  17857. !*** ./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776 ***!
  17858. \**************************************************************************/
  17859. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17860. "use strict";
  17861. __webpack_require__.r(__webpack_exports__);
  17862. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17863. /* 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_7c234776__WEBPACK_IMPORTED_MODULE_0__.render)
  17864. /* harmony export */ });
  17865. /* 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_7c234776__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=7c234776 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Sales/Index.vue?vue&type=template&id=7c234776");
  17866. /***/ }),
  17867. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17868. /*!************************************************************************************************************************!*\
  17869. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17870. \************************************************************************************************************************/
  17871. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17872. "use strict";
  17873. __webpack_require__.r(__webpack_exports__);
  17874. /* 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");
  17875. /***/ }),
  17876. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17877. /*!***************************************************************************************************************************!*\
  17878. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17879. \***************************************************************************************************************************/
  17880. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17881. "use strict";
  17882. __webpack_require__.r(__webpack_exports__);
  17883. /* 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");
  17884. /***/ }),
  17885. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17886. /*!***********************************************************************************************************************!*\
  17887. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17888. \***********************************************************************************************************************/
  17889. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17890. "use strict";
  17891. __webpack_require__.r(__webpack_exports__);
  17892. /* 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");
  17893. /***/ }),
  17894. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17895. /*!*********************************************************************************************************************!*\
  17896. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&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_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");
  17902. /***/ })
  17903. }]);